فهرست منبع

修改场景logo构建逻辑

tianboguang 2 سال پیش
والد
کامیت
963921202e
1فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 10 2
      src/main/java/com/fdkankan/contro/mq/service/impl/BuildSceneServiceImpl.java

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

@@ -435,16 +435,24 @@ public class BuildSceneServiceImpl implements IBuildSceneService {
 
         if(!ObjectUtils.isEmpty(company)){
             String userViewPath = String.format(UploadFilePath.USER_VIEW_PATH, num);
+            String localLogoPath = null;
             if (StrUtil.isNotEmpty(company.getTopLogo())) {
-                fYunFileService.copyFileInBucket(company.getTopLogo(),userViewPath + "loadingLogo-user.png");
+                localLogoPath = ConstantFilePath.AGENT_PATH + company.getTopLogo().substring(company.getTopLogo().lastIndexOf("//") + 1);
+                HttpUtil.downloadFile(company.getTopLogo(), localLogoPath);
+                fYunFileService.uploadFile(localLogoPath, userViewPath + "loadingLogo-user.png");
                 sceneJson.setLoadingLogo("user");
                 sceneJson.setLoadingLogoFile("loadingLogo-user.png");
             }
             if (StrUtil.isNotEmpty(company.getFloorLogo())) {
-                fYunFileService.copyFileInBucket(company.getFloorLogo(),userViewPath + "floorLogo-user.png");
+                localLogoPath = ConstantFilePath.AGENT_PATH + company.getFloorLogo().substring(company.getFloorLogo().lastIndexOf("//") + 1);
+                HttpUtil.downloadFile(company.getFloorLogo(), localLogoPath);
+                fYunFileService.uploadFile(localLogoPath, userViewPath + "floorLogo-user.png");
                 sceneJson.setFloorLogo("user");
                 sceneJson.setFloorLogoFile("floorLogo-user.png");
             }
+            if(!ObjectUtils.isEmpty(localLogoPath)){
+                FileUtils.deleteFile(localLogoPath);
+            }
         }
         String sceneJsonStr = JSON.toJSONString(sceneJson);
         //上传sceneJson文件