|
|
@@ -63,6 +63,14 @@ public class GuorenDuplicateInsuranceComponent {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+ public static String getTimelyEndDate(String rtnMsg, String regex) {
|
|
|
+ String endDate = getTimelyTheExpiryDate(rtnMsg, regex);
|
|
|
+ if (!endDate.isEmpty()) {
|
|
|
+ return endDate;
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取终保日期
|
|
|
*
|
|
|
@@ -84,6 +92,7 @@ public class GuorenDuplicateInsuranceComponent {
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat(string);
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Date parse = dateFormat.parse(startDate);
|
|
|
+
|
|
|
return simpleDateFormat.format(parse);
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
@@ -93,6 +102,43 @@ public class GuorenDuplicateInsuranceComponent {
|
|
|
return "";
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static String getTimelyTheExpiryDate(String message, String regex) {
|
|
|
+ Pattern pattern = Pattern.compile(regex);
|
|
|
+ String replace = message.replace("\r", ";").replace("\n", ";").replace(" ", "");
|
|
|
+ Matcher m = pattern.matcher(replace);
|
|
|
+
|
|
|
+ boolean b = m.find();
|
|
|
+ if (b) {
|
|
|
+ try {
|
|
|
+ String startDate = "";
|
|
|
+ String group = m.group(2);
|
|
|
+ String groupRegex = "终保日期(\\d{4}-\\d{2}-\\d{2})";
|
|
|
+ Pattern groupPattern = Pattern.compile(groupRegex);
|
|
|
+ Matcher groupMatcher = groupPattern.matcher(group);
|
|
|
+ if(groupMatcher.find()) {
|
|
|
+ startDate = groupMatcher.group(1);
|
|
|
+ }else{
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ String string = "yyyy-MM-dd";
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat(string);
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ Date parse = dateFormat.parse(startDate);
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(parse);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, 1); // 加一天
|
|
|
+ // 获取增加一天后的日期
|
|
|
+ Date newDate = calendar.getTime();
|
|
|
+ return simpleDateFormat.format(newDate);
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new SystemException(message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 重复投保
|
|
|
*
|