|
@@ -404,11 +404,6 @@ public class EmailParseService {
|
|
} else if (StrUtil.containsAny(fileName, ReportType.MONTHLY.getPatterns())) {
|
|
} else if (StrUtil.containsAny(fileName, ReportType.MONTHLY.getPatterns())) {
|
|
reportType = ReportType.MONTHLY;
|
|
reportType = ReportType.MONTHLY;
|
|
}
|
|
}
|
|
- if (reportType == null) {
|
|
|
|
- result.setStatus(ReportParseStatus.NOT_A_REPORT.getCode());
|
|
|
|
- result.setMsg(StrUtil.format(ReportParseStatus.NOT_A_REPORT.getMsg(), fileName));
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
// 解析器--如果开启python解析则直接调用python接口,否则根据文件后缀获取对应解析器
|
|
// 解析器--如果开启python解析则直接调用python接口,否则根据文件后缀获取对应解析器
|
|
ReportParserFileType fileType;
|
|
ReportParserFileType fileType;
|
|
if (Objects.equals(Boolean.TRUE, this.properties.getEnablePyParser())) {
|
|
if (Objects.equals(Boolean.TRUE, this.properties.getEnablePyParser())) {
|
|
@@ -422,6 +417,12 @@ public class EmailParseService {
|
|
result.setMsg(StrUtil.format(ReportParseStatus.NO_SUPPORT_TEMPLATE.getMsg(), fileName));
|
|
result.setMsg(StrUtil.format(ReportParseStatus.NO_SUPPORT_TEMPLATE.getMsg(), fileName));
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
+ // 不是定期报告的判断逻辑放在不支持的格式下面
|
|
|
|
+ if (reportType == null) {
|
|
|
|
+ result.setStatus(ReportParseStatus.NOT_A_REPORT.getCode());
|
|
|
|
+ result.setMsg(StrUtil.format(ReportParseStatus.NOT_A_REPORT.getMsg(), fileName));
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
// 解析报告
|
|
// 解析报告
|
|
ReportData reportData = null;
|
|
ReportData reportData = null;
|
|
StopWatch parserWatch = new StopWatch();
|
|
StopWatch parserWatch = new StopWatch();
|