|
@@ -377,14 +377,16 @@ public class EmailTemplateService {
|
|
|
isMatch = iskeywordMatch(fileName, containKeyword, notContainKeyword);
|
|
|
} else if (ApplicationRuleFileConst.EMAIL_EXCEL_CONTENT_FILE.equals(type)) {
|
|
|
if (StrUtil.isNotBlank(fileName) && ExcelUtil.isExcel(fileName)) {
|
|
|
- if (applicationRuleDO.getRow() == null || StrUtil.isBlank(applicationRuleDO.getColumn())) {
|
|
|
+ Integer rowIndex = applicationRuleDO.getRow();
|
|
|
+ if (rowIndex == null || StrUtil.isBlank(applicationRuleDO.getColumn())) {
|
|
|
return false;
|
|
|
}
|
|
|
Sheet sheet = ExcelUtil.getFirstSheet(filePath);
|
|
|
if (sheet == null) {
|
|
|
return false;
|
|
|
}
|
|
|
- Row row = sheet.getRow(applicationRuleDO.getRow());
|
|
|
+ rowIndex = rowIndex - 1;
|
|
|
+ Row row = sheet.getRow(rowIndex);
|
|
|
if (row == null) {
|
|
|
return false;
|
|
|
}
|
|
@@ -456,8 +458,12 @@ public class EmailTemplateService {
|
|
|
}
|
|
|
Pattern pattern = Pattern.compile(fieldRule);
|
|
|
Matcher matcher = pattern.matcher(text);
|
|
|
- while (matcher.find()) {
|
|
|
- return matcher.group(1);
|
|
|
+ try {
|
|
|
+ while (matcher.find()) {
|
|
|
+ return matcher.group(1);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ return null;
|
|
|
}
|
|
|
return null;
|
|
|
}
|