瀏覽代碼

生成floorplan.json工具

dsx 2 年之前
父節點
當前提交
5ac8923e2e
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      4dkankan-utils-model/src/main/java/com/fdkankan/model/utils/FloorPlanUserUtil.java

+ 5 - 2
4dkankan-utils-model/src/main/java/com/fdkankan/model/utils/FloorPlanUserUtil.java

@@ -20,8 +20,8 @@ import java.util.Map;
 public class FloorPlanUserUtil {
 
 	public static void main(String[] args) {
-		JSONObject floorPlanUserJson = FloorPlanUserUtil.createFloorPlanUserJson("C:\\Users\\dsx\\Desktop\\floorplan_cad.json");
-		FileUtil.writeUtf8String(floorPlanUserJson.toJSONString(), "C:\\Users\\dsx\\Desktop\\floorplan.json");
+		JSONObject floorPlanUserJson = FloorPlanUserUtil.createFloorPlanUserJson("D:\\test\\新建文件夹\\floorplan_cad.json");
+		FileUtil.writeUtf8String(floorPlanUserJson.toJSONString(), "D:\\test\\新建文件夹\\floorplan.json");
 
 	}
 
@@ -57,6 +57,9 @@ public class FloorPlanUserUtil {
 			JSONObject targetFloor = new JSONObject();
 			targetFloor.put("points", convertArrToMap(points));
 			targetFloor.put("walls", convertArrToMap(walls));
+			targetFloor.put("id", floor.getInteger("id"));
+			targetFloor.put("name",floor.getString("name"));
+			targetFloor.put("subgroup", floor.getInteger("subgroup"));
 			targetFloors.add(targetFloor);
 		}