LAPTOP-JI2IUVG1\26646 1 неделя назад
Родитель
Сommit
e1657b0f58
16 измененных файлов с 124 добавлено и 0 удалено
  1. 15 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/DrainagePartitionController.java
  2. 15 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/EngineeringFacilityController.java
  3. 15 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/PipeNetworkInfoController.java
  4. 15 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/WaterloggingPointController.java
  5. 3 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/DrainagePartition.java
  6. 3 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/EngineeringFacility.java
  7. 3 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/PipeNetworkInfo.java
  8. 3 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/WaterloggingPoint.java
  9. 5 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainagePartitionService.java
  10. 5 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/EngineeringFacilityService.java
  11. 5 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/PipeNetworkInfoService.java
  12. 5 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/WaterloggingPointService.java
  13. 8 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainagePartitionServiceImpl.java
  14. 8 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/EngineeringFacilityServiceImpl.java
  15. 8 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/PipeNetworkInfoServiceImpl.java
  16. 8 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/WaterloggingPointServiceImpl.java

+ 15 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/DrainagePartitionController.java

@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 排水分区基础数据管理
@@ -98,4 +99,18 @@ public class DrainagePartitionController {
         boolean deleted = service.removeBatchWithCheck(ids);
         return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
     }
+
+    @Anonymous
+    @PostMapping("/bindEquipment")
+    @ApiOperation(value = "绑定设备到排水分区")
+    public AjaxResult bindEquipment(@RequestBody Map<String, Object> params) {
+        String partitionId = (String) params.get("partitionId");
+        @SuppressWarnings("unchecked")
+        List<String> equipmentIds = (List<String>) params.get("equipmentIds");
+        if (partitionId == null || equipmentIds == null || equipmentIds.isEmpty()) {
+            return AjaxResult.error("参数不完整");
+        }
+        boolean success = service.bindEquipment(partitionId, equipmentIds);
+        return success ? AjaxResult.success() : AjaxResult.error("绑定失败");
+    }
 }

+ 15 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/EngineeringFacilityController.java

@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 工程设施基础数据管理
@@ -98,4 +99,18 @@ public class EngineeringFacilityController {
         boolean deleted = service.removeBatchEntity(ids);
         return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
     }
+
+    @Anonymous
+    @PostMapping("/bindEquipment")
+    @ApiOperation(value = "绑定设备到工程设施")
+    public AjaxResult bindEquipment(@RequestBody Map<String, Object> params) {
+        String partitionId = (String) params.get("partitionId");
+        @SuppressWarnings("unchecked")
+        List<String> equipmentIds = (List<String>) params.get("equipmentIds");
+        if (partitionId == null || equipmentIds == null || equipmentIds.isEmpty()) {
+            return AjaxResult.error("参数不完整");
+        }
+        boolean success = service.bindEquipment(partitionId, equipmentIds);
+        return success ? AjaxResult.success() : AjaxResult.error("绑定失败");
+    }
 }

+ 15 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/PipeNetworkInfoController.java

@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 排水管网基础数据管理
@@ -98,4 +99,18 @@ public class PipeNetworkInfoController {
         boolean deleted = service.removeBatchEntity(ids);
         return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
     }
+
+    @Anonymous
+    @PostMapping("/bindEquipment")
+    @ApiOperation(value = "绑定设备到排水管网")
+    public AjaxResult bindEquipment(@RequestBody Map<String, Object> params) {
+        String partitionId = (String) params.get("partitionId");
+        @SuppressWarnings("unchecked")
+        List<String> equipmentIds = (List<String>) params.get("equipmentIds");
+        if (partitionId == null || equipmentIds == null || equipmentIds.isEmpty()) {
+            return AjaxResult.error("参数不完整");
+        }
+        boolean success = service.bindEquipment(partitionId, equipmentIds);
+        return success ? AjaxResult.success() : AjaxResult.error("绑定失败");
+    }
 }

+ 15 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/WaterloggingPointController.java

@@ -16,6 +16,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 易积水点管理
@@ -97,4 +98,18 @@ public class WaterloggingPointController {
         boolean deleted = service.removeBatchWithCheck(ids);
         return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
     }
+
+    @Anonymous
+    @PostMapping("/bindEquipment")
+    @ApiOperation(value = "绑定设备到易积水点")
+    public AjaxResult bindEquipment(@RequestBody Map<String, Object> params) {
+        String partitionId = (String) params.get("partitionId");
+        @SuppressWarnings("unchecked")
+        List<String> equipmentIds = (List<String>) params.get("equipmentIds");
+        if (partitionId == null || equipmentIds == null || equipmentIds.isEmpty()) {
+            return AjaxResult.error("参数不完整");
+        }
+        boolean success = service.bindEquipment(partitionId, equipmentIds);
+        return success ? AjaxResult.success() : AjaxResult.error("绑定失败");
+    }
 }

+ 3 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/DrainagePartition.java

@@ -48,6 +48,9 @@ public class DrainagePartition {
     @ApiModelProperty("纬度")
     private BigDecimal latitude;
 
+    @ApiModelProperty("关联设备ID(多个用逗号分隔)")
+    private String equipmentId;
+
     @ApiModelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;

+ 3 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/EngineeringFacility.java

@@ -42,6 +42,9 @@ public class EngineeringFacility {
     @ApiModelProperty("坐标数据JSON")
     private String points;
 
+    @ApiModelProperty("关联设备ID(多个用逗号分隔)")
+    private String equipmentId;
+
     @ApiModelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;

+ 3 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/PipeNetworkInfo.java

@@ -42,6 +42,9 @@ public class PipeNetworkInfo {
     @ApiModelProperty("坐标数据JSON")
     private String points;
 
+    @ApiModelProperty("关联设备ID(多个用逗号分隔)")
+    private String equipmentId;
+
     @ApiModelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;

+ 3 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/WaterloggingPoint.java

@@ -49,6 +49,9 @@ public class WaterloggingPoint {
     @TableField("waterlogging_level")
     private Integer waterloggingLevel;
 
+    @ApiModelProperty("关联设备ID(多个用逗号分隔)")
+    private String equipmentId;
+
     @ApiModelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;

+ 5 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainagePartitionService.java

@@ -36,4 +36,9 @@ public interface DrainagePartitionService extends IService<DrainagePartition> {
      * 批量删除
      */
     boolean removeBatchWithCheck(List<String> ids);
+
+    /**
+     * 绑定设备到分区
+     */
+    boolean bindEquipment(String partitionId, List<String> equipmentIds);
 }

+ 5 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/EngineeringFacilityService.java

@@ -36,4 +36,9 @@ public interface EngineeringFacilityService extends IService<EngineeringFacility
      * 批量删除
      */
     boolean removeBatchEntity(List<String> ids);
+
+    /**
+     * 绑定设备到工程设施
+     */
+    boolean bindEquipment(String id, List<String> equipmentIds);
 }

+ 5 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/PipeNetworkInfoService.java

@@ -36,4 +36,9 @@ public interface PipeNetworkInfoService extends IService<PipeNetworkInfo> {
      * 批量删除
      */
     boolean removeBatchEntity(List<String> ids);
+
+    /**
+     * 绑定设备到管网
+     */
+    boolean bindEquipment(String id, List<String> equipmentIds);
 }

+ 5 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/WaterloggingPointService.java

@@ -35,4 +35,9 @@ public interface WaterloggingPointService extends IService<WaterloggingPoint> {
      * 批量删除
      */
     boolean removeBatchWithCheck(List<String> ids);
+
+    /**
+     * 绑定设备到易积水点
+     */
+    boolean bindEquipment(String id, List<String> equipmentIds);
 }

+ 8 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainagePartitionServiceImpl.java

@@ -101,4 +101,12 @@ public class DrainagePartitionServiceImpl extends ServiceImpl<DrainagePartitionM
         }
         return this.removeByIds(existIds);
     }
+
+    @Override
+    public boolean bindEquipment(String partitionId, List<String> equipmentIds) {
+        DrainagePartition partition = this.getById(partitionId);
+        if (partition == null) return false;
+        partition.setEquipmentId(String.join(",", equipmentIds));
+        return this.updateById(partition);
+    }
 }

+ 8 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/EngineeringFacilityServiceImpl.java

@@ -91,4 +91,12 @@ public class EngineeringFacilityServiceImpl extends ServiceImpl<EngineeringFacil
         }
         return this.removeByIds(existIds);
     }
+
+    @Override
+    public boolean bindEquipment(String id, List<String> equipmentIds) {
+        EngineeringFacility entity = this.getById(id);
+        if (entity == null) return false;
+        entity.setEquipmentId(String.join(",", equipmentIds));
+        return this.updateById(entity);
+    }
 }

+ 8 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/PipeNetworkInfoServiceImpl.java

@@ -91,4 +91,12 @@ public class PipeNetworkInfoServiceImpl extends ServiceImpl<PipeNetworkInfoMappe
         }
         return this.removeByIds(existIds);
     }
+
+    @Override
+    public boolean bindEquipment(String id, List<String> equipmentIds) {
+        PipeNetworkInfo entity = this.getById(id);
+        if (entity == null) return false;
+        entity.setEquipmentId(String.join(",", equipmentIds));
+        return this.updateById(entity);
+    }
 }

+ 8 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/WaterloggingPointServiceImpl.java

@@ -77,4 +77,12 @@ public class WaterloggingPointServiceImpl extends ServiceImpl<WaterloggingPointM
                 .collect(Collectors.toList());
         return this.removeByIds(existIds);
     }
+
+    @Override
+    public boolean bindEquipment(String id, List<String> equipmentIds) {
+        WaterloggingPoint entity = this.getById(id);
+        if (entity == null) return false;
+        entity.setEquipmentId(String.join(",", equipmentIds));
+        return this.updateById(entity);
+    }
 }