Browse Source

修改构建逻辑

tianboguang 2 năm trước cách đây
mục cha
commit
c4f58cdbd8

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

@@ -324,6 +324,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         String icon = null;
         if (!ObjectUtils.isEmpty(jsonObject.getString("icon"))) {
             fYunFileService.copyFileInBucket(ConstantFilePath.OSS_PREFIX + prefix + jsonObject.getString("icon"),imgViewPath + jsonObject.getString("icon"));
+            icon = fYunFileConfig.getHost() + imgViewPath + jsonObject.getString("icon");
         }
 
         JSONObject firmwareVersion = new JSONObject();
@@ -348,6 +349,9 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
         //重算的场景,先移除该场景对应的容量
         if (rebuild == 1) {
             scenePlusService.resetSpace(sceneNum);
+
+            //删除oss的houst_floor.json(国际版可能会卡住)
+            fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
         } else {
             //上传log-main.png
             fYunFileService.uploadFile(ConstantFilePath.LOGO_PATH + "logo-main.png", imgViewPath + "logo-main.png");
@@ -378,9 +382,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
             FileUtils.writeFile(localDataPath + "status.json", statusJson.toString());
             fYunFileService.uploadFile(localDataPath + "status.json", dataViewPath + "status.json");
         }
-
-        //删除oss的houst_floor.json(国际版可能会卡住)
-        fYunFileService.deleteFile(dataViewPath + "houst_floor.json");
         if (cameraDetail.getCompanyId() != null) {
             Company company = companyService.getById(cameraDetail.getCompanyId());
             if (company != null) {