|
@@ -112,6 +112,8 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
public static final String JQ_REGEX = "交强险.+?[^保险止期|^终保日期][是::\\s]?([0-9\\-:]+)";
|
|
public static final String JQ_REGEX = "交强险.+?[^保险止期|^终保日期][是::\\s]?([0-9\\-:]+)";
|
|
|
|
|
|
|
|
|
|
+ public static final String REGEX_ALONE = "[^保险止期|^终保日期][是::\\s]?([0-9\\-:]+)";
|
|
|
|
|
+
|
|
|
public static final String SY_REGEX = "商业险.+?[^保险止期|^终保日期][是::\\s]?([0-9\\-:]+)";
|
|
public static final String SY_REGEX = "商业险.+?[^保险止期|^终保日期][是::\\s]?([0-9\\-:]+)";
|
|
|
|
|
|
|
|
public static final String END_TIME = "23:59:59";
|
|
public static final String END_TIME = "23:59:59";
|
|
@@ -449,11 +451,13 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
|
- String a = "交易失败:当前日志所在服务器地址:[1]!交强险重复投保提示:车险平台返回信息 号牌号码“晋AB1S60”的保单发生重复投保,与其重复投保的其它公司的保单信息如下:投保确认码 02TKIC140023061886966474033736;保单号 06671070807142300000001181;起保日期 2023-07-16 19:00;终保日期 2024-07-16 19:00;号牌号码 晋AB1S60;号牌种类 02;车架号 LE4WG4AB9KL578588;发动机号 11440669;地区 山西。*产品名称:机动车交通事故强制险(2008款)";
|
|
|
|
|
- String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(a, JQ_REGEX);
|
|
|
|
|
- System.out.println(coverageEndDate);
|
|
|
|
|
|
|
+ public String processingTime(String errorMsg, String regex){
|
|
|
|
|
+ String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, regex);
|
|
|
|
|
|
|
|
|
|
+ if (coverageEndDate.isEmpty()) {
|
|
|
|
|
+ coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, REGEX_ALONE);
|
|
|
|
|
+ }
|
|
|
|
|
+ return coverageEndDate;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -466,7 +470,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
requestInfoList.add(errorMsg);
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 交强重复投保----------------");
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 交强重复投保----------------");
|
|
|
|
|
|
|
|
- String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, JQ_REGEX);
|
|
|
|
|
|
|
+ String coverageEndDate = processingTime(errorMsg, JQ_REGEX);
|
|
|
if (coverageEndDate.isEmpty()) {
|
|
if (coverageEndDate.isEmpty()) {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
@@ -502,11 +506,11 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
if (appSYFlag) {
|
|
if (appSYFlag) {
|
|
|
requestInfoList.add(errorMsg);
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 商业险重复投保----------------");
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 商业险重复投保----------------");
|
|
|
- String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, SY_REGEX);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ String coverageEndDate = processingTime(errorMsg, SY_REGEX);
|
|
|
if (coverageEndDate.isEmpty()) {
|
|
if (coverageEndDate.isEmpty()) {
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
LocalDateTime start;
|
|
LocalDateTime start;
|
|
|
if (coverageEndDate.contains(END_TIME)) {
|
|
if (coverageEndDate.contains(END_TIME)) {
|
|
|
start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN).plusSeconds(1);
|
|
start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN).plusSeconds(1);
|