|
@@ -74,16 +74,13 @@ public class FloorpanHandler {
|
|
String floorplanCadPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "floorplan_cad.json";
|
|
String floorplanCadPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "floorplan_cad.json";
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(plus.getId());
|
|
fYunFileService.downloadFile(dataViewPath + "floorplan_cad.json", floorplanCadPath);
|
|
fYunFileService.downloadFile(dataViewPath + "floorplan_cad.json", floorplanCadPath);
|
|
- if (!new File(floorplanCadPath).exists()) {
|
|
|
|
- throw new Exception("生成floorplan.json失败,cadPath:" + floorplanCadPath);
|
|
|
|
- }
|
|
|
|
- JSONObject json = FloorPlanUserUtil.createFloorPlanUserJson(floorplanCadPath);
|
|
|
|
- if(Objects.isNull(json)){
|
|
|
|
- throw new Exception("生成floorplan.json失败,cadPath:" + floorplanCadPath);
|
|
|
|
- }
|
|
|
|
String floorplanJsonPath = dataViewPath + "floorplan.json";
|
|
String floorplanJsonPath = dataViewPath + "floorplan.json";
|
|
- fYunFileService.uploadFile(json.toJSONString().getBytes(), floorplanJsonPath);
|
|
|
|
- JSONArray cadFloors = json.getJSONArray("floors");
|
|
|
|
|
|
+ JSONArray cadFloors = null;
|
|
|
|
+ if (new File(floorplanCadPath).exists()) {
|
|
|
|
+ JSONObject json = FloorPlanUserUtil.createFloorPlanUserJson(floorplanCadPath);
|
|
|
|
+ fYunFileService.uploadFile(json.toJSONString().getBytes(), floorplanJsonPath);
|
|
|
|
+ cadFloors = json.getJSONArray("floors");
|
|
|
|
+ }
|
|
|
|
|
|
//生成用户编辑
|
|
//生成用户编辑
|
|
String editFloorplanUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan_user.json";
|
|
String editFloorplanUserPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "floorplan_user.json";
|
|
@@ -126,11 +123,19 @@ public class FloorpanHandler {
|
|
// if(Objects.nonNull(floorJson.getInteger("id"))){
|
|
// if(Objects.nonNull(floorJson.getInteger("id"))){
|
|
// continue;
|
|
// continue;
|
|
// }
|
|
// }
|
|
- Object cadFloor = cadFloors.get(i);
|
|
|
|
- JSONObject cadFloorJson = (JSONObject) cadFloor;
|
|
|
|
- floorJson.put("id",cadFloorJson.getInteger("id"));
|
|
|
|
- floorJson.put("name",cadFloorJson.getString("name"));
|
|
|
|
- floorJson.put("subgroup",cadFloorJson.getInteger("subgroup"));
|
|
|
|
|
|
+ Integer id = 0;
|
|
|
|
+ Integer subgroup = 0;
|
|
|
|
+ String name = "1楼";
|
|
|
|
+ if(Objects.nonNull(cadFloors)){
|
|
|
|
+ Object cadFloor = cadFloors.get(i);
|
|
|
|
+ JSONObject cadFloorJson = (JSONObject) cadFloor;
|
|
|
|
+ id = cadFloorJson.getInteger("id");
|
|
|
|
+ subgroup = cadFloorJson.getInteger("subgroup");
|
|
|
|
+ name = cadFloorJson.getString("name");
|
|
|
|
+ }
|
|
|
|
+ floorJson.put("id",id);
|
|
|
|
+ floorJson.put("subgroup",subgroup);
|
|
|
|
+ floorJson.put("name",name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|