xusl 8 tháng trước cách đây
mục cha
commit
77c62b5c6d

+ 8 - 8
ipp-ap/src/views/idp/control/dqIntervene/index.vue

@@ -70,12 +70,12 @@
 
       <div>
         <el-dialog :visible.sync="bathInterveneVisible" :close-on-click-modal='false'
-                   :before-close="closeDialog" width="50%">
+                   :before-close="closeDialog" width="540px">
           <el-form :model="bathForm">
             <fieldset>
               <legend>一键设置干预值</legend>
-              <el-row style="gutter:30" class="row-bg el-row-two" justify="space-between">
-                <el-col :span="10" :offset="1">
+              <el-row  class="row-bg el-row-two" justify="space-between">
+                <el-col :span="12" :offset="1">
                   <el-form-item label="开始时间:" label-width="150px" style="min-width: 100px">
                     <el-time-select
                       v-model="bathForm.startTime"
@@ -89,7 +89,7 @@
                     </el-time-select>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10" :offset="1">
+                <el-col :span="12" :offset="1">
                   <el-form-item label="结束时间:" label-width="150px" style="min-width: 110px">
                     <el-time-select
                       v-model="bathForm.endTime"
@@ -104,13 +104,13 @@
                   </el-form-item>
                 </el-col>
               </el-row>
-              <el-row style="gutter:30" class="row-bg el-row-two" justify="space-between">
-                <el-col :span="10" :offset="1">
+              <el-row class="row-bg el-row-two" justify="space-between">
+                <el-col :span="12" :offset="1">
                   <el-form-item label="设定干预值:" label-width="150px" style="min-width: 110px">
-                    <el-input-number style="width: 100%" v-model="bathForm.dqValue" :min=0 placeholder="必填项"/>
+                    <el-input-number style="width: 220px" v-model="bathForm.dqValue" :min=0 placeholder="必填项"/>
                   </el-form-item>
                 </el-col>
-                <el-col :span="10" :offset="1">
+                <el-col :span="12" :offset="1">
                 </el-col>
               </el-row>
             </fieldset>

+ 34 - 23
ipp-idp/src/main/java/com/jiayue/ipp/idp/service/an/FTPService.java

@@ -118,34 +118,45 @@ public class FTPService {
 //                            });
                             List<String> strings = ftp.ls(url);
                             //遍历文件
+                            int i=0;
                             for (String fileName : strings) {
+                                if (i>20){
+                                    break;
+                                }
+                                i++;
 //                                if (!fTPFile.isDirectory()) {
 //                                    String fileName = fTPFile.getName();
-                                ParsingLog parsingLog = new ParsingLog();
-                                parsingLog.setFileName(fileName);
-                                parsingLog.setStationCode(ftpParsingUrl.getStationCode());
-                                parsingLog.setParsingTime(new Date());
-
-                                //下载文件到临时目录
-                                ftp.download(url, fileName, dirFile);
-                                File file = FileUtils.getFile(dirFile, fileName);
-
-                                //定义解析的类型,默认为错误(未知),成功后为文件类型,也会作为存储目录名
-                                String type = parsingFileService.parsingFile(file, ftpParsingUrl);
-                                parsingLog.setFileType(type);
-                                if (type.startsWith(ParsingConstant.FAIL)) {
-                                    // 解析失败
-                                    file.delete();
-                                    parsingLog.setParsingFileStatus("0");
-                                    parsingLog.setParsingDescribe("文件解析失败");
+                                try {
+
+                                    ParsingLog parsingLog = new ParsingLog();
+                                    parsingLog.setFileName(fileName);
+                                    parsingLog.setStationCode(ftpParsingUrl.getStationCode());
+                                    parsingLog.setParsingTime(new Date());
+
+                                    //下载文件到临时目录
+                                    ftp.download(url, fileName, dirFile);
+                                    File file = FileUtils.getFile(dirFile, fileName);
+
+                                    //定义解析的类型,默认为错误(未知),成功后为文件类型,也会作为存储目录名
+                                    String type = parsingFileService.parsingFile(file, ftpParsingUrl);
+                                    parsingLog.setFileType(type);
+                                    if (type.startsWith(ParsingConstant.FAIL)) {
+                                        // 解析失败
+                                        file.delete();
+                                        parsingLog.setParsingFileStatus("0");
+                                        parsingLog.setParsingDescribe("文件解析失败");
+                                    } else {
+                                        // 解析成功,删除ftp上的文件
+                                        ftp.delFile(url + "/" + fileName);
+                                        parsingLog.setParsingFileStatus("1");
+                                        parsingLog.setParsingDescribe("文件解析成功");
+                                    }
+                                    parsingLogService.save(parsingLog);
+
                                 }
-                                else{
-                                    // 解析成功,删除ftp上的文件
-                                    ftp.delFile(url + "/" + fileName);
-                                    parsingLog.setParsingFileStatus("1");
-                                    parsingLog.setParsingDescribe("文件解析成功");
+                                catch (Exception e){
+                                    log.error(ftpParsingUrl.getStationCode()+"文件解析失败"+fileName,e);
                                 }
-                                parsingLogService.save(parsingLog);
                             }
                         }
                     }