dengsixing пре 2 месеци
родитељ
комит
852f3dcbe0

+ 1 - 1
src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

@@ -198,7 +198,7 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
             this.downLoadSource(message, message.getPath());
 
             //校验文件是否完整
-            jmgaService.checkFileWhole(uuid, dataSource, fdageData);
+            jmgaService.checkFileWhole(message.getPath());
 
             List<String> linkPanTargetList = linkPanService.genLinkPanPre(num);
             if(CollUtil.isNotEmpty(linkPanTargetList)){

+ 2 - 5
src/main/java/com/fdkankan/contro/service/IJmgaService.java

@@ -1,16 +1,13 @@
 package com.fdkankan.contro.service;
 
-import com.alibaba.fastjson.JSONObject;
-
 import java.util.Map;
-import java.util.Set;
 
 public interface IJmgaService {
 
-    void checkFileWhole(String uuid, String dataSource, JSONObject fdageData);
+    boolean checkFileWhole(String dataSource);
 
     void sendStatus(Map<String, Object> param);
 
-    Set<String> checkLackFile(String dataSource);
+    void checkLackFile(String dataSource);
 
 }

+ 11 - 2
src/main/java/com/fdkankan/contro/service/impl/JmgaServiceImpl.java

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.fdkankan.common.constant.ErrorCode;
 import com.fdkankan.common.exception.BusinessException;
+import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.entity.OrigFileUpload;
 import com.fdkankan.contro.entity.OrigFileUploadBatch;
 import com.fdkankan.contro.service.IJmgaService;
@@ -98,10 +99,18 @@ public class JmgaServiceImpl implements IJmgaService {
     }
 
     @Override
-    public Set<String> checkLackFile(String dataSource) {
+    public void checkLackFile(String dataSource) {
 
         String dataFdagePath = dataSource.concat(File.separator).concat("data.fdage");
-        JSONObject fdageData = JSON.parseObject(FileUtil.readUtf8String(dataFdagePath));
+        if(!FileUtil.exist(dataFdagePath)){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_4001.code(), ErrorCode.FAILURE_CODE_4001.formatMessage("data.fdage"));
+        }
+        JSONObject fdageData = null;
+        try {
+            fdageData = JSON.parseObject(FileUtil.readUtf8String(dataFdagePath));
+        }catch (Exception e){
+            throw new BusinessException(ErrorCode.FAILURE_CODE_4001.code(), ErrorCode.FAILURE_CODE_4001.formatMessage("data.fdage"));
+        }
 
         int camType = fdageData.getJSONObject("cam").getIntValue("type");