Parcourir la source

添加fdage文件判断

tianboguang il y a 2 ans
Parent
commit
cd48fc84c6

+ 13 - 3
src/main/java/com/fdkankan/contro/service/impl/SceneFileBuildServiceImpl.java

@@ -521,12 +521,17 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
         String buildType = "V2";
         Long cameraType = 10L;
+
+        if(!fYunFileService.fileExist(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage")){
+            log.error("data.fdage文件不存在");
+            throw new BusinessException(CameraConstant.FAILURE_6009);
+        }
+
         JSONObject fdageJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage"));
         if(ObjectUtils.isEmpty(fdageJson)){
-            log.info("data.fdage文件不存在");
+            log.info("data.fdage文件为空!");
             throw new BusinessException(CameraConstant.FAILURE_6009);
         }
-
         //根据videoVersion判断是V2还是V3版本的算法和页面
         if (fdageJson.containsKey("videoVersion") && StrUtil.isNotEmpty(fdageJson.getString("videoVersion"))) {
             if (fdageJson.getIntValue("videoVersion") >= 4) {
@@ -609,9 +614,14 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         //云目录
         StringBuilder prefixBuffer = new StringBuilder(mac).append(File.separator).append(fileId).append(File.separator).append(folderName).append(File.separator);
 
+        if(!fYunFileService.fileExist(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage")){
+            log.error("data.fdage文件不存在");
+            throw new BusinessException(CameraConstant.FAILURE_6009);
+        }
+
         JSONObject fdageJson = JSONObject.parseObject(fYunFileService.getFileContent(ConstantFilePath.OSS_PREFIX + prefixBuffer + "data.fdage"));
         if(ObjectUtils.isEmpty(fdageJson)){
-            log.info("data.fdage文件不存在");
+            log.info("data.fdage文件为空");
             throw new BusinessException(CameraConstant.FAILURE_6009);
         }
         String buildType = "V3";