Sfoglia il codice sorgente

修改文件下载逻辑

tianboguang 2 anni fa
parent
commit
b74c2227e6

+ 6 - 2
src/main/java/com/fdkankan/contro/service/impl/BuildScenePreServiceImpl.java

@@ -3,6 +3,7 @@ package com.fdkankan.contro.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.fdkankan.common.util.FileUtils;
 import com.fdkankan.contro.service.IBuildScenePreService;
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
 import com.fdkankan.model.constants.ConstantFilePath;
 import com.fdkankan.model.utils.CreateObjUtil;
 import com.fdkankan.model.utils.SceneUtil;
@@ -44,6 +45,9 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
     @Autowired
     private RabbitMqProducer mqProducer;
 
+    @Autowired
+    private FYunFileServiceInterface fYunFileService;
+
     public static String hostName;
 
 
@@ -139,9 +143,9 @@ public class BuildScenePreServiceImpl implements IBuildScenePreService {
                 //删除压缩包
                 FileUtils.delFile(path + File.separator + "capture" + File.separator + imgsName);
             }else if(cameraType == 14) {
-                CreateObjUtil.ossUtilCp(ossPath,path + File.separator + "capture");
+                fYunFileService.downloadFile(ossPath,path + File.separator + "capture");
             } else{
-                CreateObjUtil.ossUtilCp(ossPath,path + File.separator + "capture");
+                fYunFileService.downloadFile(ossPath,path + File.separator + "capture");
             }
         }
     }

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

@@ -361,7 +361,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
                 }
                 String icon = null;
                 if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
-                    CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
+                    fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
                     icon = fYunFileConfig.getHost() + "images/images" + sceneNum + "/" + jsonObject.getString("icon");
                     if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
                         fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));
@@ -676,7 +676,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
 
         String icon = null;
         if(jsonObject.containsKey("icon") && StrUtil.isNotEmpty(jsonObject.getString("icon"))){
-            CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
+            fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath);
             icon = fYunFileConfig.getHost() + imageViewPath + jsonObject.getString("icon");
             if(FYunTypeEnum.AWS.code().equals(fYunFileService.getFyunType())){
                 fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"), filePath + jsonObject.getString("icon"));