Browse Source

添加超图模块

董珍珍 1 year ago
parent
commit
d3a18c4d9a

+ 58 - 0
data/1715908499613.json

@@ -0,0 +1,58 @@
+{
+  "displayFieldName": "",
+  "features": [
+    {
+      "attributes": {
+        "RWLX": "辅助选址",
+        "RWBSM": "e2db463b154844f3966d531dd2277ccc"
+      },
+      "geometry": {
+        "rings": [
+          [
+            [
+              108.84986257208,
+              39.332339200433296
+            ],
+            [
+              108.81214489818039,
+              39.33598585084715
+            ],
+            [
+              108.81528803767202,
+              39.31045530399862
+            ],
+            [
+              108.84200472335091,
+              39.31045530399862
+            ],
+            [
+              108.84986257208,
+              39.332339200433296
+            ]
+          ]
+        ]
+      }
+    }
+  ],
+  "fieldAliases": {
+    "RWLX": "RWLX",
+    "RWBSM": "RWBSM"
+  },
+  "fields": [
+    {
+      "alias": "RWBSM",
+      "name": "RWBSM",
+      "type": "esriFieldTypeString"
+    },
+    {
+      "alias": "RWLX",
+      "name": "RWLX",
+      "type": "esriFieldTypeString"
+    }
+  ],
+  "geometryType": "esriGeometryPolygon",
+  "spatialReference": {
+    "latestWkid": 4490,
+    "wkid": 4490
+  }
+}

BIN
onemap-modules/onemap-analyse/lib/com.supermap.analyst.spatialanalyst.jar


BIN
onemap-modules/onemap-analyse/lib/com.supermap.data.jar


+ 17 - 0
onemap-modules/onemap-analyse/pom.xml

@@ -136,6 +136,23 @@
             <version>1.13</version>
             <version>1.13</version>
             <systemPath>${project.basedir}/lib/jts-1.13.jar</systemPath>
             <systemPath>${project.basedir}/lib/jts-1.13.jar</systemPath>
         </dependency>
         </dependency>
+
+        <!--supermap-->
+        <dependency>
+            <groupId>com.supermap</groupId>
+            <artifactId>analyst.spatialanalyst</artifactId>
+            <version>11.0</version>
+            <scope>system</scope>
+            <systemPath>${basedir}/lib/com.supermap.analyst.spatialanalyst.jar</systemPath>
+        </dependency>
+
+        <dependency>
+            <groupId>com.supermap</groupId>
+            <artifactId>data</artifactId>
+            <version>11.0</version>
+            <scope>system</scope>
+            <systemPath>${basedir}/lib/com.supermap.data.jar</systemPath>
+        </dependency>
         <!--    简繁体转换    -->
         <!--    简繁体转换    -->
         <dependency>
         <dependency>
             <groupId>com.ibm.icu</groupId>
             <groupId>com.ibm.icu</groupId>

+ 4 - 7
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/controller/ChscController.java

@@ -2,22 +2,19 @@ package com.onemap.analyse.controller;
 
 
 import com.onemap.analyse.domain.FzssChscXmgxDTO;
 import com.onemap.analyse.domain.FzssChscXmgxDTO;
 import com.onemap.analyse.domain.FzxzChscDTO;
 import com.onemap.analyse.domain.FzxzChscDTO;
-import com.onemap.analyse.domain.HgxfxEntityDTO;
 import com.onemap.analyse.service.IChscService;
 import com.onemap.analyse.service.IChscService;
 import com.onemap.common.core.domain.R;
 import com.onemap.common.core.domain.R;
 import com.onemap.common.core.web.controller.BaseController;
 import com.onemap.common.core.web.controller.BaseController;
-import com.onemap.common.core.web.domain.RequestResult;
 import com.onemap.common.core.web.domain.WebResult;
 import com.onemap.common.core.web.domain.WebResult;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Map;
 
 
 @RestController
 @RestController
 @RequestMapping("/chsc")
 @RequestMapping("/chsc")

+ 2 - 2
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/domain/FzxzDTO.java

@@ -21,10 +21,10 @@ public class FzxzDTO {
     private String zdpd;
     private String zdpd;
     private Double xzmj;
     private Double xzmj;
     private String sjy;
     private String sjy;
-    private String xzfw;
+    private String xzfw; //fwlx=1:wkt格式,4326,区域面积;fwlx=2:shp文件地址
     private String xmmc;
     private String xmmc;
     private String jsdw;
     private String jsdw;
-    private Integer fwlx;
+    private Integer fwlx;//0:行政区划,1:绘制,2:Shp文件
 
 
     public String getCjyh() {
     public String getCjyh() {
         return cjyh;
         return cjyh;

+ 12 - 8
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/service/impl/FzssServiceImpl.java

@@ -58,6 +58,7 @@ public class FzssServiceImpl implements IFzssService {
     private FzxzJgyzMapper fzxzJgyzMapper;
     private FzxzJgyzMapper fzxzJgyzMapper;
     @Autowired
     @Autowired
     FzxzSchedule fzxzSchedule;
     FzxzSchedule fzxzSchedule;
+
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     @Override
     @Override
     public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
     public RequestResult AddHgxfx(HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
@@ -104,17 +105,20 @@ public class FzssServiceImpl implements IFzssService {
     @Override
     @Override
     public RequestResult AddFzxz(Map params) {
     public RequestResult AddFzxz(Map params) {
         try {
         try {
-            //辅助选址
+            //辅助选址,解解析参数
             FzxzDTO fzxzDTO = DozerUtils.map(params, FzxzDTO.class);
             FzxzDTO fzxzDTO = DozerUtils.map(params, FzxzDTO.class);
             fzxzDTO.setBsm(StringUtils.getUUID());
             fzxzDTO.setBsm(StringUtils.getUUID());
             fzxzDTO.setCjsj(new Date());
             fzxzDTO.setCjsj(new Date());
-            fzxzDTO.setYdxz_bsm(fzxzDTO.getYdxz_bsm().replaceAll("\\[","").replaceAll("\\]",""));
-            //将分析范围矢量数据插入到KJGH.T_FZSS_FXRW_GIS
-            RequestResult info = fzxzvector2Sde(fzxzDTO, null);
-            if (info != null) {
-                return info;
-            }
-            //选址因子
+            fzxzDTO.setYdxz_bsm(fzxzDTO.getYdxz_bsm().replaceAll("\\[", "").replaceAll("\\]", ""));
+//            //将分析范围矢量数据插入到KJGH.T_FZSS_FXRW_GIS
+//            RequestResult info = fzxzvector2Sde(fzxzDTO, null);
+//            if (info != null) {
+//                return info;
+//            }
+
+            // 拿到空间数据
+
+            // 选址因子
             ArrayList xzyx = (ArrayList) params.get("yxyz");
             ArrayList xzyx = (ArrayList) params.get("yxyz");
             for (int i = 0; i < xzyx.size(); i++) {
             for (int i = 0; i < xzyx.size(); i++) {
                 FzxzXzyzDTO dto = DozerUtils.map(xzyx.get(i), FzxzXzyzDTO.class);
                 FzxzXzyzDTO dto = DozerUtils.map(xzyx.get(i), FzxzXzyzDTO.class);

+ 7 - 0
onemap-modules/onemap-analyse/src/main/java/com/onemap/analyse/utils/Fxfw2SdeUtils.java

@@ -109,6 +109,9 @@ public class Fxfw2SdeUtils {
                 features.add(feature);
                 features.add(feature);
                 esriModel.setFeatures(features);
                 esriModel.setFeatures(features);
             }
             }
+
+
+
             vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
             vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
 
 
             //写入文件
             //写入文件
@@ -195,6 +198,10 @@ public class Fxfw2SdeUtils {
             feature.setGeometry(geometry);
             feature.setGeometry(geometry);
             features.add(feature);
             features.add(feature);
             esriModel.setFeatures(features);
             esriModel.setFeatures(features);
+
+            // 获取系统的根目录
+            temp = System.getProperty("user.dir")+"\\data";
+
             vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
             vectorFilePath = temp + "\\" + System.currentTimeMillis() + ".json";
             //写入文件
             //写入文件
             FileOutputStream fos = null;
             FileOutputStream fos = null;