소스 검색

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;