Forráskód Böngészése

1.修复modbus误删的bean注册
2.添加上传经纬度坐标信息
3.修复eolg文件原始文件未移动到备份目录bug

wangt 1 éve
szülő
commit
81a63956b5

+ 2 - 1
neim-biz/src/main/java/com/jiayue/biz/job/ModbusReciveJob.java

@@ -13,6 +13,7 @@ import com.jiayue.biz.util.CalculationUtil;
 import com.jiayue.common.utils.DateUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
 import org.springframework.stereotype.Service;
 import wei.yigulu.modbus.domain.FunctionCode;
 import wei.yigulu.modbus.domain.Obj4RequestRegister;
@@ -56,7 +57,7 @@ public class ModbusReciveJob {
 
     private HashMap<String, ModbusTcpMasterBuilder> masterMap = new HashMap<>();
 
-    //@Bean
+    @Bean
     public void timingTunnel() {
         List<TunnelInfo> tunnelInfoList = tunnelInfoService.list();
         for (TunnelInfo tunnelInfo : tunnelInfoList) {

+ 14 - 7
neim-biz/src/main/java/com/jiayue/biz/service/impl/AnalysisDataImpl.java

@@ -1035,16 +1035,18 @@ public class AnalysisDataImpl {
                                 String eqNo = stringStringHashMap.get("SiteNumber");
                                 //找出csv文件
                                 List<File> csvFile = Arrays.stream(files1).filter(f -> f.getName().contains(".csv") && f.getName().contains(fileName)).collect(Collectors.toList());
-
-                                if (csvFile.size() > 0 && wndFile.size() > 0) {
-                                    parseEol(csvFile.get(0), stringStringHashMap, eqNo, fileNameForELog);
+                                
+                                File orgFile = new File(fileNameForELog.getParent() + File.separator + "Email" + File.separator);
+                                File[] orgFiles = orgFile.listFiles();
+                                List<File> orgElogFile = Arrays.stream(orgFiles).filter(f -> f.getName().endsWith(".elog") && f.getName().contains(fileName)).collect(Collectors.toList());
+                                if (csvFile.size() > 0) {
+                                    parseEol(csvFile.get(0), stringStringHashMap, eqNo, fileNameForELog, orgElogFile);
                                 }
                             }
                         } catch (Exception e) {
                             log.error("解析eol文件:{} 异常:{}", fileNameForELog, e);
                         }
                     }
-
                 }
             }
         } catch (Exception e) {
@@ -1055,7 +1057,7 @@ public class AnalysisDataImpl {
 
 
     //解析eol文件
-    public void parseEol(File fileCsv, HashMap<String, String> stringStringHashMap, String eqNo, File fileNameForELog) {
+    public void parseEol(File fileCsv, HashMap<String, String> stringStringHashMap, String eqNo, File fileNameForELog, List<File> orgElogFile) {
 
         CsvReader reader = CsvUtil.getReader();
         CsvData data = reader.read(fileCsv);
@@ -1117,6 +1119,10 @@ public class AnalysisDataImpl {
                 try {
                     //移动原始文件
                     com.jiayue.biz.util.FileUtil.move(fileNameForELog.getPath(), eolFilePath + File.separator + eqNo);
+                    com.jiayue.biz.util.FileUtil.move(fileCsv.getAbsolutePath(), eolFilePath + File.separator + eqNo);
+                    if (orgElogFile.size() > 0) {
+                        com.jiayue.biz.util.FileUtil.move(orgElogFile.get(0).getAbsolutePath(), eolFilePath + File.separator + eqNo);
+                    }
                 } catch (Exception e) {
                     log.error("备份EOL原始文件错误:{}", e);
                 }
@@ -1137,8 +1143,9 @@ public class AnalysisDataImpl {
         CsvReader reader = CsvUtil.getReader();
         //从文件中读取CSV数据
         File file = FileUtil.file(fileParent + File.separator + fileName);
-        file.renameTo(new File(fileParent + File.separator + xls));
-        CsvData data = reader.read(file);
+        FileUtil.copy(file, new File(fileParent + File.separator + xls), true);
+
+        CsvData data = reader.read(FileUtil.file(fileParent + File.separator + xls));
         CsvRow row = data.getRow(1);
         String Longitude = "";
         String Latitude = "";

+ 15 - 27
neim-ui/src/views/dataQuery/project/index.vue

@@ -208,9 +208,8 @@
 <script>
 import {addProject, delProject, listProject, updateProject} from "@/api/biz/dataQuery/project";
 import {listAllDisabled} from "@/api/biz/dataQuery/windTowerStatusInfo";
-import {companyListInfo} from "@/api/biz/dataQuery/company";
 import {getPointMap} from "@/api/biz/dataQuery/largeScreenPage";
-import {uploadProjectProgressFile} from "@/api/biz/dataQuery/homePage";
+import {uploadProjectFile} from "@/api/biz/dataQuery/homePage";
 
 export default {
   name: "Project",
@@ -227,22 +226,13 @@ export default {
         callback()
       }
     }
-    const checkLatitude = (rule, value, callback) => {
-      if (!value) {
-        callback(new Error('不许为空'))
-      }
-      if (reg1.test(value) == false) {
-        callback(new Error('请输入正确纬度'));
-      } else {
-        callback()
-      }
-    }
     return {
       projectName: null,
       // 遮罩层
       loading: true,
       // 选中数组
       ids: [],
+      fileList: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -306,6 +296,11 @@ export default {
     this.getList();
   },
   methods: {
+    show() {
+      setTimeout(() => {
+        console.log(this.$refs)
+      }, 0)
+    },
     beforeUpload(file) {
       const isLt2M = file.size / 1024 / 1024 < 1024 // 这里做文件大小限制
       if (!isLt2M) {
@@ -314,22 +309,26 @@ export default {
           type: 'warning'
         })
       }
+
       return isLt2M
     },
     dataUpload(item) {
       this.fullscreenLoading = true
       const formData = new FormData()
       formData.append('file', item.file)
-      formData.append("projectNo", this.row.projectNo)
-      uploadProjectProgressFile(formData).then((response) => {
-        this.$refs.upload.clearFiles()
+      formData.append("id", this.form.projectNo)
+      uploadProjectFile(formData).then((response) => {
+
         this.fullscreenLoading = false
+        this.open = false
+        console.log(response)
         if (response && response.code === 200) {
-          this.getProjectEvolve()
+          this.getList()
           this.$message.success(response.msg)
         } else {
           this.$message.error(response.msg)
         }
+        this.$refs.upload.clearFiles()
       })
     },
     formatEquipment(data) {
@@ -350,7 +349,6 @@ export default {
           return b;
         }
       }
-
     },
     /*条件查询*/
     selectList() {
@@ -377,11 +375,6 @@ export default {
         this.relationEquipmentData = res.data
       })
     },
-    getcompanyInfo() {
-      companyListInfo().then(res => {
-        this.companyData = res.rows
-      })
-    },
     // 表单重置
     reset() {
       this.form = {
@@ -493,11 +486,6 @@ export default {
       });
     },
     /** 导出按钮操作 */
-    // handleExport() {
-    //   this.download('client/project/export', {
-    //     ...this.queryParams
-    //   }, `project_${new Date().getTime()}.xlsx`)
-    // },
     getPoint() {
       getPointMap().then(res => {
         sessionStorage.setItem("allPointInfo", JSON.stringify({info: res.data}))