Przeglądaj źródła

获取资源目录,固定

chenendian 6 miesięcy temu
rodzic
commit
da6d00f9a1

+ 11 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/controller/ProjectController.java

@@ -1,5 +1,6 @@
 package com.siwei.apply.controller;
 
+import com.alibaba.fastjson2.JSONArray;
 import com.siwei.apply.domain.Project;
 import com.siwei.apply.domain.res.ProjectCycleRes;
 import com.siwei.apply.domain.res.ProjectOverviewRes;
@@ -184,6 +185,16 @@ public class ProjectController extends BaseController {
         }
     }
 
+    @GetMapping("/cycleResource")
+    public R<JSONArray> getResourceDir() {
+        try {
+            JSONArray resourceStr = projectService.getResourceData();
+            return R.ok(resourceStr);
+        } catch (Exception e) {
+            return R.fail(502,e.getMessage());
+        }
+    }
+
 
 
 }

+ 8 - 0
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/ProjectService.java

@@ -1,5 +1,6 @@
 package com.siwei.apply.service;
 
+import com.alibaba.fastjson2.JSONArray;
 import com.siwei.apply.domain.Project;
 import com.siwei.apply.domain.res.ProjectCycleRes;
 import com.siwei.apply.domain.res.ProjectOverviewRes;
@@ -7,6 +8,7 @@ import com.siwei.apply.domain.vo.ProjectFilterVo;
 import com.siwei.apply.domain.vo.ProjectUpdateVo;
 import com.siwei.apply.domain.vo.ProjectVo;
 
+import java.io.IOException;
 import java.util.List;
 import java.util.Map;
 
@@ -69,5 +71,11 @@ public interface ProjectService {
 
     Map<String, Object> getListSearch(ProjectFilterVo projectFilterVo);
 
+
+    JSONArray getResourceData() throws IOException;
+
+
+
+
 }
 

+ 14 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/impl/ProjectImpl.java

@@ -17,12 +17,15 @@ import com.siwei.apply.service.NodeLandService;
 import com.siwei.apply.service.ProjectService;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.File;
 import java.io.IOException;
+import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.*;
@@ -373,9 +376,17 @@ public class ProjectImpl implements ProjectService {
             return currentProjectWorkflow;
         }
 
-
-
-
+    @Override
+    public JSONArray getResourceData() throws IOException {
+        java.net.URL fileURL = this.getClass().getResource("/one_code_index_v1.json");
+        //String fileName = "classpath:reportConfig.txt";
+        String fileName = fileURL.getPath();
+        String configStr = FileUtils.readFileToString(new File(fileName), StandardCharsets.UTF_8);
+        JSONArray  aa =  JSON.parseArray(configStr);
+        configStr = aa.toJSONString();
+        log.info("------------"+configStr);
+        return aa;
+    }
 
 }
 

+ 89 - 0
siwei-modules/siwei-apply/src/main/resources/one_code_index_v1.json

@@ -0,0 +1,89 @@
+[
+  {
+            "id": "5508c9a73997439fb8f2344ae98151ca",
+            "label": "用地业务数据",
+            "title": "用地业务数据",
+            "type": "S3M",
+            "url": "http://192.168.60.2:8090/iserver/services/3D-WenTi/rest/realspace",
+            "source": "",
+            "legend": "",
+            "favorite": null,
+            "disabled": false,
+            "checked": false,
+            "expand": false,
+            "children": [
+                {
+                    "id": "bbf078180cc34b83b639c2dd95842296",
+                    "label": "用地预审与选址意见书",
+                    "title": "用地预审与选址意见书",
+                    "type": "wms",
+                    "url": "http://192.168.60.220:8090/geoserver/siwei_workspace/wms?service=WMS&version=1.1.0&request=GetMap&layers=siwei_workspace%3Ac_one_code_geom001&bbox=115.84467869332723%2C28.91651771292333%2C115.84799503916403%2C28.919477034878152&width=768&height=685&srs=EPSG%3A4326&styles=&format=application/openlayers",
+                    "source": "",
+                    "legend": "",
+                    "favorite": null,
+                    "disabled": false,
+                    "checked": false,
+                    "expand": false,
+                    "contextmenu": false
+                },
+                {
+                    "id": "d345ec123da6457cbbd48c1e2e3de47b",
+                    "label": "规划条件与用地红线",
+                    "title": "规划条件与用地红线",
+                    "type": "wmts",
+                    "url": "http://192.168.60.52:28085/geoserver/gwc/service/wmts",
+                    "source": null,
+                    "legend": null,
+                    "favorite": null,
+                    "disabled": false,
+                    "checked": false,
+                    "expand": false,
+                    "contextmenu": false
+                },
+                {
+                    "id": "a484b75e2ac24016a62ccbef76c8b138",
+                    "label": "土地供应",
+                    "title": "土地供应",
+                    "type": "wms",
+                    "url": "http://192.168.60.2:8089/geoserver/sanya_workspace/wms",
+                    "source": null,
+                    "legend": null,
+                    "favorite": null,
+                    "disabled": false,
+                    "checked": false,
+                    "expand": false,
+                    "contextmenu": false
+                }
+            ]
+        },
+        {
+            "id": "5508c9a73997439fb8f2344ae98151ca",
+            "label": "规划数据",
+            "title": "规划数据",
+            "type": "S3M",
+            "url": "http://192.168.60.2:8090/iserver/services/3D-WenTi/rest/realspace",
+            "source": "",
+            "legend": "",
+            "favorite": null,
+            "disabled": false,
+            "checked": false,
+            "expand": false,
+            "children": [
+                {
+                  "id": "5508c9a73997439fb8f2344ae98151ca",
+                  "label": "规划数据",
+                  "title": "规划数据",
+                  "type": "S3M",
+                  "url": "http://192.168.60.2:8090/iserver/services/3D-WenTi/rest/realspace",
+                  "source": null,
+                  "legend": null,
+                  "favorite": null,
+                  "disabled": false,
+                  "checked": false,
+                  "expand": false,
+                  "contextmenu": false
+                }
+
+            ]
+        }
+    ]