添加日期替换功能到RecruitModeUtil类

This commit is contained in:
dxfeng 2024-12-31 09:22:56 +08:00
parent 786b6b8579
commit 2427d836fd
1 changed files with 11 additions and 0 deletions

View File

@ -144,6 +144,17 @@ public class RecruitModeUtil {
}
public static String getReplaceContent(String content, Map<String, List<Formfield>> fieldMapList, Map<String, Object> paramsData) {
// 替换年月日
if(StringUtils.isNotBlank(content)){
Calendar calendar = Calendar.getInstance();
// 获取年份月份和日期
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
content = content.replace("{yyyy}", String.valueOf(year))
.replace("{MM}", String.valueOf(month))
.replace("{dd}", String.valueOf(day));
}
Matcher matcher = EMAIL_PATTERN.matcher(content);
// 指定要匹配的字符串
StringBuffer sb = new StringBuffer();