|
@@ -104,17 +104,15 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger("alltrust");
|
|
private static final Logger log = LoggerFactory.getLogger("alltrust");
|
|
|
|
|
|
|
|
- private String REDIS_YONGCHENG_QUERY_CODE_JQ = "REDIS_YONGCHENG_QUERY_CODE_JQ:";
|
|
|
|
|
|
|
+ private final String REDIS_YONGCHENG_QUERY_CODE_JQ = "REDIS_YONGCHENG_QUERY_CODE_JQ:";
|
|
|
|
|
|
|
|
- private String REDIS_YONGCHENG_QUERY_CODE_SY = "REDIS_YONGCHENG_QUERY_CODE_SY:";
|
|
|
|
|
|
|
+ private final String REDIS_YONGCHENG_QUERY_CODE_SY = "REDIS_YONGCHENG_QUERY_CODE_SY:";
|
|
|
|
|
|
|
|
- private Integer REDIS_YONGCHENG_QUERY_CODE_EXPIRE = 7;
|
|
|
|
|
|
|
+ private final Integer REDIS_YONGCHENG_QUERY_CODE_EXPIRE = 7;
|
|
|
|
|
|
|
|
- public static final String JQ_REGEX = "交强险.+?保险止期是[::\\s]?([0-9\\-:]+)";
|
|
|
|
|
|
|
+ public static final String JQ_REGEX = "交强险.+?[保险止期|终保日期][是::\\s]?([0-9\\-:]+)";
|
|
|
|
|
|
|
|
- public static final String SY_REGEX = "商业险.+?保险止期是[::\\s]?([0-9\\-:]+)";
|
|
|
|
|
-
|
|
|
|
|
- public static final String DAN_JQ_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";
|
|
|
|
|
|
|
@@ -322,9 +320,9 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
|
|
|
|
|
//处理返回信息
|
|
//处理返回信息
|
|
|
//1、交强险重复投保处理
|
|
//1、交强险重复投保处理
|
|
|
- String jq = ciRepetitionInsure(rr, m, requestInfoList, cAppJqFlag, appSYFlag);
|
|
|
|
|
|
|
+ String jq = ciRepetitionInsure(rr, m, requestInfoList, cAppJqFlag);
|
|
|
//1、商业险重复投保处理
|
|
//1、商业险重复投保处理
|
|
|
- String sy = commerceRepetitionInsure(rr, m, requestInfoList, appSYFlag, cAppJqFlag);
|
|
|
|
|
|
|
+ String sy = commerceRepetitionInsure(rr, m, requestInfoList, appSYFlag);
|
|
|
|
|
|
|
|
if (jq.isEmpty() && sy.isEmpty()) {
|
|
if (jq.isEmpty() && sy.isEmpty()) {
|
|
|
throw new SystemException(errorMsg);
|
|
throw new SystemException(errorMsg);
|
|
@@ -450,26 +448,27 @@ 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 ciRepetitionInsure(RuoteResponse rr, Ruote m, List<String> requestInfoList, boolean cAppJqFlag,
|
|
|
|
|
- boolean flag) {
|
|
|
|
|
|
|
+ public String ciRepetitionInsure(RuoteResponse rr, Ruote m, List<String> requestInfoList, boolean cAppJqFlag) {
|
|
|
String errorMsg = rr.getHead().getErrorMessage();
|
|
String errorMsg = rr.getHead().getErrorMessage();
|
|
|
|
|
|
|
|
if (cAppJqFlag) {
|
|
if (cAppJqFlag) {
|
|
|
requestInfoList.add(errorMsg);
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 交强重复投保----------------");
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 交强重复投保----------------");
|
|
|
- String coverageEndDate;
|
|
|
|
|
-
|
|
|
|
|
- if (flag) {
|
|
|
|
|
- coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, JQ_REGEX);
|
|
|
|
|
- } else {
|
|
|
|
|
- coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, DAN_JQ_REGEX);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, JQ_REGEX);
|
|
|
if (coverageEndDate.isEmpty()) {
|
|
if (coverageEndDate.isEmpty()) {
|
|
|
- throw new SystemException(errorMsg);
|
|
|
|
|
|
|
+ return "";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//判断是否是及时起保
|
|
//判断是否是及时起保
|
|
@@ -497,23 +496,17 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
|
|
|
/**
|
|
/**
|
|
|
* 报价 商业 重复 投保业务处理
|
|
* 报价 商业 重复 投保业务处理
|
|
|
*/
|
|
*/
|
|
|
- public String commerceRepetitionInsure(RuoteResponse rr, Ruote m, List<String> requestInfoList, boolean appSYFlag
|
|
|
|
|
- , boolean flag) {
|
|
|
|
|
|
|
+ public String commerceRepetitionInsure(RuoteResponse rr, Ruote m, List<String> requestInfoList, boolean appSYFlag) {
|
|
|
String errorMsg = rr.getHead().getErrorMessage();
|
|
String errorMsg = rr.getHead().getErrorMessage();
|
|
|
|
|
|
|
|
if (appSYFlag) {
|
|
if (appSYFlag) {
|
|
|
requestInfoList.add(errorMsg);
|
|
requestInfoList.add(errorMsg);
|
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 商业险重复投保----------------");
|
|
log.info("永诚API方式 - xml请求 ------------报价 -> 商业险重复投保----------------");
|
|
|
- String coverageEndDate;
|
|
|
|
|
- if (flag) {
|
|
|
|
|
- coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, SY_REGEX);
|
|
|
|
|
- } else {
|
|
|
|
|
- coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, DAN_JQ_REGEX);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String coverageEndDate = GuorenDuplicateInsuranceComponent.getEndDate(errorMsg, SY_REGEX);
|
|
|
if (coverageEndDate.isEmpty()) {
|
|
if (coverageEndDate.isEmpty()) {
|
|
|
- throw new SystemException(errorMsg);
|
|
|
|
|
|
|
+ return "";
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
LocalDateTime start;
|
|
LocalDateTime start;
|
|
|
if (coverageEndDate.contains("23:59:59")) {
|
|
if (coverageEndDate.contains("23:59:59")) {
|
|
|
start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN).plusSeconds(1);
|
|
start = DateTimeUtil.parseLocalDateTime(coverageEndDate, DateTimeUtil.DATETIME_PATTERN).plusSeconds(1);
|