|
@@ -3,9 +3,7 @@ package com.fd.server.impl;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.fd.Dto.FdageDto;
|
|
|
-import com.fd.Dto.ResourcesJsonDto;
|
|
|
-import com.fd.Dto.VectorResourcesJsonDto;
|
|
|
+import com.fd.Dto.*;
|
|
|
import com.fd.constant.MsgCode;
|
|
|
import com.fd.server.JsonServer;
|
|
|
import com.fd.util.FileUtils;
|
|
@@ -215,10 +213,69 @@ public class JsonServerImpl implements JsonServer {
|
|
|
|
|
|
log.info("result: {}", original.toJSONString());
|
|
|
|
|
|
-// System.out.println(original.toJSONString());
|
|
|
+ try {
|
|
|
+ FileUtils.fileWriter(JSON.toJSONString(original), FDAGE_PATH);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return new ResponseResult(200, MsgCode.SUCCESS);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseResult updateModelFdage(ModelFdageDto param) {
|
|
|
+// String s = readJson("json/4dage");
|
|
|
+ String s = readJsonLinux(FDAGE_PATH);
|
|
|
+ // 转jsonObject
|
|
|
+ JSONObject original = JSON.parseObject(s);
|
|
|
+
|
|
|
+ // tilesets
|
|
|
+ JSONArray subTilesets = JSON.parseArray(original.getString("tilesets"));
|
|
|
+ subTilesets.add(param.getTilesets());
|
|
|
+
|
|
|
+ // view
|
|
|
+ JSONObject subViewJson = JSON.parseObject(original.getString("view"));
|
|
|
+
|
|
|
+ JSONObject surfacesJson = JSON.parseObject(subViewJson.getString("surfaces"));
|
|
|
+ surfacesJson.put(param.getViewSurfaces(),JSON.parse("[]"));
|
|
|
+
|
|
|
+ subViewJson.put("surfaces", surfacesJson);
|
|
|
+
|
|
|
+ // 修改值设置回原来的接送
|
|
|
+ original.put("tilesets", subTilesets);
|
|
|
+ original.put("view", subViewJson);
|
|
|
+
|
|
|
+ log.info("result: {}", original.toString());
|
|
|
+ System.out.println(original.toString());
|
|
|
+
|
|
|
+ try {
|
|
|
+ FileUtils.fileWriter(JSON.toJSONString(original), FDAGE_PATH);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return new ResponseResult(200, MsgCode.SUCCESS);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResponseResult updateBaseMapFdage(BaseMapFdageDto param) {
|
|
|
+// String s = readJson("json/4dage");
|
|
|
+ String s = readJsonLinux(FDAGE_PATH);
|
|
|
+ // 转jsonObject
|
|
|
+ JSONObject original = JSON.parseObject(s);
|
|
|
+
|
|
|
+ // 获取子对象
|
|
|
+ JSONObject subFreeLayers = JSON.parseObject(original.getString("freeLayers"));
|
|
|
+ subFreeLayers.put("tiandi-surface", param.getTiandiSurface());
|
|
|
+
|
|
|
+ JSONObject subBoundLayers = JSON.parseObject(original.getString("boundLayers"));
|
|
|
+ subBoundLayers.put("tiandi-map", param.getTiandiMap());
|
|
|
+
|
|
|
+ // 修改值设置回原来的接送
|
|
|
+ original.put("freeLayers", subFreeLayers);
|
|
|
+ original.put("boundLayers", subBoundLayers);
|
|
|
+
|
|
|
+ log.info("result: {}", original.toString());
|
|
|
|
|
|
try {
|
|
|
-// FileUtils.fileWriter(JSON.toJSONString(original),"/var/vts/store/map-config/4dage_test");
|
|
|
FileUtils.fileWriter(JSON.toJSONString(original), FDAGE_PATH);
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|