Browse Source

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

wangzaijun 6 months ago
parent
commit
90c2d2f2f1

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

@@ -409,6 +409,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;