瀏覽代碼

Merge branch 'hotfix-37454-20230704-dsx' into test

dsx 2 年之前
父節點
當前提交
74088a36fb

+ 17 - 0
src/main/java/com/fdkankan/scene/service/impl/SceneUpgradeToV4Service.java

@@ -14,6 +14,7 @@ import com.fdkankan.common.constant.ModelKind;
 import com.fdkankan.common.constant.RecStatus;
 import com.fdkankan.common.constant.SceneSource;
 import com.fdkankan.model.utils.CreateHouseJsonUtil;
+import com.fdkankan.model.utils.FloorPlanUserUtil;
 import com.fdkankan.scene.entity.FolderScene;
 import com.fdkankan.scene.entity.ScenePlus;
 import com.fdkankan.scene.service.IFolderSceneService;
@@ -488,6 +489,22 @@ public class SceneUpgradeToV4Service implements ISceneUpgradeToV4Service {
             String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH+"scene.json", num);
             fYunFileService.uploadFile(JSON.toJSONBytes(sceneJson), sceneJsonPath);
 
+            //生成默认的floorplan.json
+            String ossFloorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num).concat("floorplan_cad.json");
+            String floorPlanCardFilePath = scenePlusExt.getDataSource() + File.separator + "results/floorplan_cad.json";
+            fYunFileService.downloadFile(ossFloorplanCadPath, floorPlanCardFilePath);
+            if (!new File(floorPlanCardFilePath).exists()) {
+                log.warn("floorplan_cad.json 文件不存在,文件路径:{}", floorPlanCardFilePath);
+            }else{
+                JSONObject json = FloorPlanUserUtil.createFloorPlanUserJson(floorPlanCardFilePath);
+                if(Objects.isNull(json)){
+                    log.warn("生成floorplan.json失败,cadPath:{}", floorPlanCardFilePath);
+                }else{
+                    String floorplanJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan.json";
+                    fYunFileService.uploadFile(json.toJSONString().getBytes(), floorplanJsonPath);
+                }
+            }
+
             redisUtil.del(String.format(RedisKey.SCENE_JSON, num));
 
             //迁移耗时

+ 1 - 1
src/main/resources/bootstrap-prod-eur.yml

@@ -3,7 +3,7 @@ spring:
     name: 4dkankan-center-scene-v3
   cloud:
     nacos:
-      server-addr: 172.31.42.151:8848
+      server-addr: 172.31.47.163:8848
       namespace: 4dkankan-v4-prod-eur
       config:
         file-extension: yaml