1
0

2 Коммиты e589dfa6c5 ... e6299cebe2

Автор SHA1 Сообщение Дата
  Kazerin e6299cebe2 Merge remote-tracking branch 'origin/master' 4 дней назад
  Kazerin e5adc8965a -针对 管网基础设施信息表(pipe_network_base) 的经纬度字段修改进行适配,修复单点坐标变双点坐标可能导致的问题 4 дней назад

+ 5 - 0
pipe-network-service/zksy-admin/pom.xml

@@ -27,6 +27,11 @@
             <groupId>com.github.xiaoymin</groupId>
             <artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.minio</groupId>
+            <artifactId>minio</artifactId>
+            <version>7.1.0</version> <!-- 与 classpath 中的版本保持一致,或使用 8.5.x 也可 -->
+        </dependency>
         <!-- swagger3-->
 <!--
         <dependency>

+ 18 - 3
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/gasbasic/GisController.java

@@ -39,9 +39,15 @@ public class GisController {
         List<PipeNetworkBase> list = pipeNetworkService.list();
         List<Map<String, Object>> features = new ArrayList<>();
         for (PipeNetworkBase pipe : list) {
-            if (pipe.getLongitude() == null || pipe.getLatitude() == null) continue;
+            // 检查起终点是否完整
+            if (pipe.getStartLongitude() == null || pipe.getStartLatitude() == null ||
+                    pipe.getEndLongitude() == null || pipe.getEndLatitude() == null) {
+                continue; // 起终点不完整则跳过
+            }
+
             Map<String, Object> feature = new HashMap<>();
             feature.put("type", "Feature");
+
             Map<String, Object> props = new HashMap<>();
             props.put("networkId", pipe.getNetworkId());
             props.put("networkName", pipe.getNetworkName());
@@ -49,13 +55,22 @@ public class GisController {
             props.put("networkCode", pipe.getNetworkCode());
             props.put("status", pipe.getStatus());
             props.put("material", pipe.getMaterial());
+            props.put("startLongitude", pipe.getStartLongitude());
+            props.put("startLatitude", pipe.getStartLatitude());
+            props.put("endLongitude", pipe.getEndLongitude());
+            props.put("endLatitude", pipe.getEndLatitude());
             feature.put("properties", props);
+
             Map<String, Object> geometry = new HashMap<>();
-            geometry.put("type", "Point");
-            geometry.put("coordinates", new double[]{pipe.getLongitude().doubleValue(), pipe.getLatitude().doubleValue()});
+            geometry.put("type", "LineString");
+            geometry.put("coordinates", new double[][]{
+                    {pipe.getStartLongitude().doubleValue(), pipe.getStartLatitude().doubleValue()},
+                    {pipe.getEndLongitude().doubleValue(), pipe.getEndLatitude().doubleValue()}
+            });
             feature.put("geometry", geometry);
             features.add(feature);
         }
+
         Map<String, Object> geojson = new HashMap<>();
         geojson.put("type", "FeatureCollection");
         geojson.put("features", features);

+ 4 - 4
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/PipeNetworkBase.java

@@ -83,14 +83,14 @@ public class PipeNetworkBase {
     private String delFlag;
 
     @ApiModelProperty("管网起点WGS84经度")
-    private BigDecimal start_longitude;
+    private BigDecimal startLongitude;
 
     @ApiModelProperty("管网起点WGS84纬度")
-    private BigDecimal start_latitude;
+    private BigDecimal startLatitude;
 
     @ApiModelProperty("管网终点WGS84经度")
-    private BigDecimal end_longitude;
+    private BigDecimal endLongitude;
 
     @ApiModelProperty("管网终点WGS84纬度")
-    private BigDecimal end_latitude;
+    private BigDecimal endLatitude;
 }

+ 13 - 6
pipe-network-service/zksy-system/src/main/java/com/zksy/base/dto/PipeNetworkExportDTO.java

@@ -1,6 +1,7 @@
 package com.zksy.base.dto;
 
 import com.zksy.common.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -38,12 +39,6 @@ public class PipeNetworkExportDTO implements Serializable {
     @Excel(name = "位置描述")
     private String location;
 
-    @Excel(name = "经度")
-    private BigDecimal longitude;
-
-    @Excel(name = "纬度")
-    private BigDecimal latitude;
-
     @Excel(name = "长度(m)")
     private BigDecimal length;
 
@@ -61,4 +56,16 @@ public class PipeNetworkExportDTO implements Serializable {
 
     @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
     private LocalDateTime createTime;
+
+    @ApiModelProperty("管网起点WGS84经度")
+    private BigDecimal startLongitude;
+
+    @ApiModelProperty("管网起点WGS84纬度")
+    private BigDecimal startLatitude;
+
+    @ApiModelProperty("管网终点WGS84经度")
+    private BigDecimal endLongitude;
+
+    @ApiModelProperty("管网终点WGS84纬度")
+    private BigDecimal endLatitude;
 }

+ 4 - 2
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/PipeNetworkBaseServiceImpl.java

@@ -174,8 +174,10 @@ public class PipeNetworkBaseServiceImpl extends ServiceImpl<PipeNetworkBaseMappe
             dto.setManagementUnit(entity.getManagementUnit());
             dto.setMaterial(entity.getMaterial());
             dto.setLocation(entity.getLocation());
-            dto.setLongitude(entity.getLongitude());
-            dto.setLatitude(entity.getLatitude());
+            dto.setStartLongitude(entity.getStartLongitude());
+            dto.setStartLatitude(entity.getStartLatitude());
+            dto.setEndLongitude(entity.getEndLongitude());
+            dto.setEndLatitude(entity.getEndLatitude());
             dto.setLength(entity.getLength());
             dto.setDiameter(entity.getDiameter());
             dto.setStatusName(entity.getStatus());

+ 4 - 2
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/RiskAssessmentServiceImpl.java

@@ -62,8 +62,10 @@ public class RiskAssessmentServiceImpl extends ServiceImpl<RiskAssessmentMapper,
             PipeNetworkBase pipe = pipeMap.get(risk.getNetworkId());
             if (pipe != null) {
                 item.put("networkName", pipe.getNetworkName());
-                item.put("longitude", pipe.getLongitude());
-                item.put("latitude", pipe.getLatitude());
+                item.put("startLongitude", pipe.getStartLongitude());
+                item.put("startLatitude", pipe.getStartLatitude());
+                item.put("endLongitude", pipe.getEndLongitude());
+                item.put("endLatitude", pipe.getEndLatitude());
                 item.put("networkCode", pipe.getNetworkCode());
             }
             result.add(item);