Browse Source

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

wangzaijun 6 tháng trước cách đây
mục cha
commit
a2f1245f2d

+ 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;