From 9e1a049cdd6dfa6404a4929379704c867f5dbc06 Mon Sep 17 00:00:00 2001 From: lxw <810412026@qq.com> Date: 星期三, 14 九月 2022 16:08:24 +0800 Subject: [PATCH] 台站下添加文件将文件存入数据库 --- src/main/java/com/whyc/service/StationInfoService.java | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/whyc/service/StationInfoService.java b/src/main/java/com/whyc/service/StationInfoService.java index e3c50a2..7e8207d 100644 --- a/src/main/java/com/whyc/service/StationInfoService.java +++ b/src/main/java/com/whyc/service/StationInfoService.java @@ -77,6 +77,9 @@ int stationIdMax=mapper.selectMaxId(); int fileIdMax=infoMapper.selectMaxId(); if(file.exists()){ + if(!filePath.contains(".xml")){ + return new Response().set(1,false,"鍙扮珯涓嬫坊鍔犳枃浠跺け璐�,鏂囦欢涓嶆槸鎸囧畾鐨剎ml鏂囦欢"); + } if(file.isFile()){ //2.瑙f瀽鏂囦欢骞惰ˉ鍏ㄦ枃浠秈d FileInfo fileInfo=XmlFileOpreate.readXml(filePath); @@ -100,6 +103,9 @@ if(allFile!=null&&allFile.size()>0){ for (int i=0;i< allFile.size();i++){ File file=allFile.get(i); + if(!file.getName().contains(".xml")){ + + } //2.瑙f瀽鏂囦欢骞惰ˉ鍏ㄦ枃浠秈d FileInfo fileInfo=XmlFileOpreate.readXml(file.getPath()); fileInfo.setFileUrl(file.getPath()); -- Gitblit v1.9.1