浏览代码

fix:不支持的文件格式错误提示

wangzaijun 6 月之前
父节点
当前提交
a2f1245f2d
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

+ 5 - 0
service-daq/src/main/java/com/simuwang/daq/service/EmailParseService.java

@@ -408,6 +408,11 @@ public class EmailParseService {
             String fileSuffix = StrUtil.subAfter(fileName, ".", true);
             fileType = ReportParserFileType.getBySuffix(fileSuffix);
         }
+        if (fileType == null) {
+            result.setStatus(ReportParseStatus.NO_SUPPORT_TEMPLATE.getCode());
+            result.setMsg(StrUtil.format(ReportParseStatus.NO_SUPPORT_TEMPLATE.getMsg(), fileName));
+            return result;
+        }
         // 解析报告
         ReportParserParams params = null;
         ReportData reportData = null;