Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	pipe-network-service/zksy-framework/src/main/java/com/zksy/framework/config/ApplicationConfig.java
Kazerin 2 tygodni temu
rodzic
commit
22ba59f3d5
88 zmienionych plików z 5290 dodań i 35 usunięć
  1. 459 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/DrainageEquipmentController.java
  2. 101 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/DrainagePartitionController.java
  3. 174 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/DrainageWarningController.java
  4. 101 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/EngineeringFacilityController.java
  5. 101 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/PipeNetworkInfoController.java
  6. 100 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/drainage/WaterloggingPointController.java
  7. 1 1
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/gasbasic/GasEquipmentController.java
  8. 73 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/MaintenanceDataStatController.java
  9. 84 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/MaintenanceTaskController.java
  10. 28 8
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/ManholeDeviceController.java
  11. 70 0
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/TerminalFaultController.java
  12. 36 1
      pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/WorkOrderController.java
  13. 1 1
      pipe-network-service/zksy-framework/src/main/java/com/zksy/framework/config/ApplicationConfig.java
  14. 3 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/EquipmentBase.java
  15. 9 3
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/EquipmentStatus.java
  16. 89 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceDataStat.java
  17. 117 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceTask.java
  18. 83 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceTaskDetail.java
  19. 121 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/TerminalFault.java
  20. 5 2
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/vo/EquipmentFullVO.java
  21. 20 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceDataStatMapper.java
  22. 20 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceTaskDetailMapper.java
  23. 20 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceTaskMapper.java
  24. 20 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/TerminalFaultMapper.java
  25. 20 2
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/EquipmentBaseService.java
  26. 40 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceDataStatService.java
  27. 13 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceTaskDetailService.java
  28. 45 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceTaskService.java
  29. 37 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/TerminalFaultService.java
  30. 22 2
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/WorkOrderService.java
  31. 127 8
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/EquipmentBaseServiceImpl.java
  32. 19 5
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/EquipmentStatusServiceImpl.java
  33. 178 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceDataStatServiceImpl.java
  34. 24 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceTaskDetailServiceImpl.java
  35. 180 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceTaskServiceImpl.java
  36. 116 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/TerminalFaultServiceImpl.java
  37. 122 2
      pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/WorkOrderServiceImpl.java
  38. 58 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/DrainagePartition.java
  39. 131 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/DrainageWarning.java
  40. 52 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/EngineeringFacility.java
  41. 52 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/PipeNetworkInfo.java
  42. 21 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/WarningPublishRequest.java
  43. 48 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/WarningScopeUser.java
  44. 59 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/domain/WaterloggingPoint.java
  45. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/DrainagePartitionMapper.java
  46. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/DrainageWarningMapper.java
  47. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/EngineeringFacilityMapper.java
  48. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/PipeNetworkInfoMapper.java
  49. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/WarningScopeUserMapper.java
  50. 9 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/WaterloggingPointMapper.java
  51. 25 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageEquipmentPointRelService.java
  52. 23 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageEquipmentTestService.java
  53. 39 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainagePartitionService.java
  54. 124 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageWarningService.java
  55. 39 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/EngineeringFacilityService.java
  56. 39 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/PipeNetworkInfoService.java
  57. 38 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/WaterloggingPointService.java
  58. 139 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainageEquipmentPointRelServiceImpl.java
  59. 107 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainageEquipmentTestServiceImpl.java
  60. 104 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainagePartitionServiceImpl.java
  61. 321 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/DrainageWarningServiceImpl.java
  62. 94 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/EngineeringFacilityServiceImpl.java
  63. 94 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/PipeNetworkInfoServiceImpl.java
  64. 80 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/impl/WaterloggingPointServiceImpl.java
  65. 21 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/EquipmentCountByTypeInDTO.java
  66. 21 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/EquipmentExportInDTO.java
  67. 27 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceDataStatQueryInDTO.java
  68. 34 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceDataStatTrendInDTO.java
  69. 68 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskDispatchInDTO.java
  70. 39 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskPageInDTO.java
  71. 30 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskProcessInDTO.java
  72. 30 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/TerminalFaultHandleInDTO.java
  73. 49 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/TerminalFaultPageInDTO.java
  74. 45 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderAddInDTO.java
  75. 49 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderFinishedInDTO.java
  76. 39 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderProcessingInDTO.java
  77. 30 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/AbnormalTerminalTrendOutDTO.java
  78. 34 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/CaseRateTrendOutDTO.java
  79. 27 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/EquipmentCountByTypeOutDTO.java
  80. 37 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/EquipmentExportOutDTO.java
  81. 18 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceDataStatOutDTO.java
  82. 18 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceTaskDetailOutDTO.java
  83. 23 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceTaskOutDTO.java
  84. 18 0
      pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/TerminalFaultOutDTO.java
  85. 26 0
      pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceDataStatMapper.xml
  86. 24 0
      pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceTaskDetailMapper.xml
  87. 31 0
      pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceTaskMapper.xml
  88. 32 0
      pipe-network-service/zksy-system/src/main/resources/mapper/TerminalFaultMapper.xml

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

@@ -0,0 +1,459 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.base.domain.*;
+import com.zksy.base.domain.vo.EquipmentFullVO;
+import com.zksy.base.service.EquipmentBaseService;
+import com.zksy.base.service.EquipmentMaintainService;
+import com.zksy.base.service.EquipmentStatusService;
+import com.zksy.base.service.EquipmentTypeService;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.service.DrainageEquipmentPointRelService;
+import com.zksy.drainage.service.DrainageEquipmentTestService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 排水系统-监测设备管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/equipment")
+@Api(tags = "排水系统-监测设备管理")
+public class DrainageEquipmentController {
+
+    @Autowired
+    private EquipmentBaseService equipmentBaseService;
+
+    @Autowired
+    private EquipmentTypeService equipmentTypeService;
+
+    @Autowired
+    private EquipmentStatusService equipmentStatusService;
+
+    @Autowired
+    private EquipmentMaintainService equipmentMaintainService;
+
+    @Autowired
+    private DrainageEquipmentTestService equipmentTestService;
+
+    @Autowired
+    private DrainageEquipmentPointRelService equipmentPointRelService;
+
+    // ==================== 设备基础信息 ====================
+
+    @Anonymous
+    @GetMapping("/base/page")
+    @ApiOperation(value = "监测设备分页查询")
+    public Page<EquipmentFullVO> basePage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("设备编码") @RequestParam(required = false) String equipmentCode,
+            @ApiParam("设备名称") @RequestParam(required = false) String equipmentName,
+            @ApiParam("设备型号") @RequestParam(required = false) String equipmentModel,
+            @ApiParam("制造商") @RequestParam(required = false) String manufacturer,
+            @ApiParam("设备类型ID") @RequestParam(required = false) String equipmentTypeId) {
+        return equipmentBaseService.findFullByPage(pageNum, pageSize, equipmentCode, equipmentName, equipmentModel, manufacturer, equipmentTypeId);
+    }
+
+    @Anonymous
+    @GetMapping("/base/{id}")
+    @ApiOperation(value = "查询设备详情")
+    public AjaxResult baseGetById(@PathVariable String id) {
+        Map<String, Object> detail = equipmentBaseService.getEquipmentDetail(id);
+        return AjaxResult.success(detail);
+    }
+
+    @Anonymous
+    @GetMapping("/base/list")
+    @ApiOperation(value = "查询所有监测设备")
+    public AjaxResult baseList() {
+        return AjaxResult.success(equipmentBaseService.list());
+    }
+
+    @Anonymous
+    @PostMapping("/base")
+    @ApiOperation(value = "新增监测设备")
+    @Log(title = "新增监测设备", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult baseSave(@RequestBody EquipmentBase entity) {
+        boolean saved = equipmentBaseService.saveWithCheck(entity);
+        if (saved) {
+            return AjaxResult.success("新增成功", entity);
+        }
+        return AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping("/base")
+    @ApiOperation(value = "修改监测设备")
+    @Log(title = "修改监测设备", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult baseUpdate(@RequestBody EquipmentBase entity) {
+        boolean updated = equipmentBaseService.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/base/{id}")
+    @ApiOperation(value = "删除监测设备")
+    @Log(title = "删除监测设备", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult baseDelete(@PathVariable String id) {
+        boolean deleted = equipmentBaseService.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/base/batch")
+    @ApiOperation(value = "批量删除监测设备")
+    @Log(title = "批量删除监测设备", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult baseDeleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = equipmentBaseService.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+
+    // ==================== 设备类别 ====================
+
+    @Anonymous
+    @GetMapping("/type/page")
+    @ApiOperation(value = "设备类别分页查询")
+    public Page<EquipmentType> typePage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("类别ID") @RequestParam(required = false) String typeId,
+            @ApiParam("类别名称") @RequestParam(required = false) String typeName,
+            @ApiParam("父类别ID") @RequestParam(required = false) String parentTypeId) {
+        return equipmentTypeService.findByPage(pageNum, pageSize, typeId, typeName, parentTypeId);
+    }
+
+    @Anonymous
+    @GetMapping("/type/{id}")
+    @ApiOperation(value = "查询设备类别详情")
+    public AjaxResult typeGetById(@PathVariable String id) {
+        EquipmentType entity = equipmentTypeService.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该设备类别不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @GetMapping("/type/list")
+    @ApiOperation(value = "查询所有设备类别")
+    public AjaxResult typeList() {
+        return AjaxResult.success(equipmentTypeService.list());
+    }
+
+    @Anonymous
+    @PostMapping("/type")
+    @ApiOperation(value = "新增设备类别")
+    @Log(title = "新增设备类别", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult typeSave(@RequestBody EquipmentType entity) {
+        boolean saved = equipmentTypeService.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping("/type")
+    @ApiOperation(value = "修改设备类别")
+    @Log(title = "修改设备类别", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult typeUpdate(@RequestBody EquipmentType entity) {
+        boolean updated = equipmentTypeService.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/type/{id}")
+    @ApiOperation(value = "删除设备类别")
+    @Log(title = "删除设备类别", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult typeDelete(@PathVariable String id) {
+        boolean deleted = equipmentTypeService.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/type/batch")
+    @ApiOperation(value = "批量删除设备类别")
+    @Log(title = "批量删除设备类别", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult typeDeleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = equipmentTypeService.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+
+    // ==================== 设备状态 ====================
+
+    @Anonymous
+    @GetMapping("/status/page")
+    @ApiOperation(value = "设备状态分页查询")
+    public Page<EquipmentStatus> statusPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("状态ID") @RequestParam(required = false) String statusId,
+            @ApiParam("设备ID") @RequestParam(required = false) String equipmentId,
+            @ApiParam("当前状态") @RequestParam(required = false) Integer currentStatus,
+            @ApiParam("报警状态") @RequestParam(required = false) Integer alarmStatus,
+            @ApiParam("在线状态") @RequestParam(required = false) Integer onlineStatus,
+            @ApiParam("负责人ID") @RequestParam(required = false) Long userId) {
+        return equipmentStatusService.findByPage(pageNum, pageSize, statusId, equipmentId, currentStatus, alarmStatus, onlineStatus, userId);
+    }
+
+    @Anonymous
+    @GetMapping("/status/{id}")
+    @ApiOperation(value = "查询设备状态详情")
+    public AjaxResult statusGetById(@PathVariable String id) {
+        EquipmentStatus entity = equipmentStatusService.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该设备状态记录不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @PostMapping("/status")
+    @ApiOperation(value = "新增设备状态")
+    @Log(title = "新增设备状态", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult statusSave(@RequestBody EquipmentStatus entity) {
+        boolean saved = equipmentStatusService.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping("/status")
+    @ApiOperation(value = "修改设备状态")
+    @Log(title = "修改设备状态", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult statusUpdate(@RequestBody EquipmentStatus entity) {
+        boolean updated = equipmentStatusService.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/status/{id}")
+    @ApiOperation(value = "删除设备状态")
+    @Log(title = "删除设备状态", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult statusDelete(@PathVariable String id) {
+        boolean deleted = equipmentStatusService.removeById(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    // ==================== 设备维护记录 ====================
+
+    @Anonymous
+    @GetMapping("/maintain/page")
+    @ApiOperation(value = "设备维护记录分页查询")
+    public Page<EquipmentMaintain> maintainPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("维护记录ID") @RequestParam(required = false) String maintainId,
+            @ApiParam("设备ID") @RequestParam(required = false) String equipmentId,
+            @ApiParam("维护类型") @RequestParam(required = false) String maintainType,
+            @ApiParam("维护人") @RequestParam(required = false) String maintainPerson) {
+        return equipmentMaintainService.findByPage(pageNum, pageSize, maintainId, equipmentId, maintainType, maintainPerson);
+    }
+
+    @Anonymous
+    @GetMapping("/maintain/{id}")
+    @ApiOperation(value = "查询设备维护记录详情")
+    public AjaxResult maintainGetById(@PathVariable String id) {
+        EquipmentMaintain entity = equipmentMaintainService.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该维护记录不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @PostMapping("/maintain")
+    @ApiOperation(value = "新增设备维护记录")
+    @Log(title = "新增设备维护记录", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult maintainSave(@RequestBody EquipmentMaintain entity) {
+        boolean saved = equipmentMaintainService.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping("/maintain")
+    @ApiOperation(value = "修改设备维护记录")
+    @Log(title = "修改设备维护记录", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult maintainUpdate(@RequestBody EquipmentMaintain entity) {
+        boolean updated = equipmentMaintainService.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/maintain/{id}")
+    @ApiOperation(value = "删除设备维护记录")
+    @Log(title = "删除设备维护记录", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult maintainDelete(@PathVariable String id) {
+        boolean deleted = equipmentMaintainService.removeById(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/maintain/batch")
+    @ApiOperation(value = "批量删除设备维护记录")
+    @Log(title = "批量删除设备维护记录", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult maintainDeleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = equipmentMaintainService.removeByIds(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+
+    // ==================== 设备测试记录 ====================
+
+    @Anonymous
+    @GetMapping("/test/page")
+    @ApiOperation(value = "设备测试记录分页查询")
+    public Page<EquipmentTest> testPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("设备ID") @RequestParam(required = false) String equipmentId,
+            @ApiParam("测试类型") @RequestParam(required = false) String testType,
+            @ApiParam("测试结果") @RequestParam(required = false) String testResult) {
+        return equipmentTestService.findByPage(pageNum, pageSize, equipmentId, testType, testResult);
+    }
+
+    @Anonymous
+    @GetMapping("/test/{id}")
+    @ApiOperation(value = "查询设备测试记录详情")
+    public AjaxResult testGetById(@PathVariable String id) {
+        EquipmentTest entity = equipmentTestService.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该测试记录不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @PostMapping("/test")
+    @ApiOperation(value = "新增设备测试记录")
+    @Log(title = "新增设备测试记录", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult testSave(@RequestBody EquipmentTest entity) {
+        boolean saved = equipmentTestService.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping("/test")
+    @ApiOperation(value = "修改设备测试记录")
+    @Log(title = "修改设备测试记录", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult testUpdate(@RequestBody EquipmentTest entity) {
+        boolean updated = equipmentTestService.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/test/{id}")
+    @ApiOperation(value = "删除设备测试记录")
+    @Log(title = "删除设备测试记录", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult testDelete(@PathVariable String id) {
+        boolean deleted = equipmentTestService.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/test/batch")
+    @ApiOperation(value = "批量删除设备测试记录")
+    @Log(title = "批量删除设备测试记录", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult testDeleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = equipmentTestService.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+
+    // ==================== 设备-监控点关联 ====================
+
+    @Anonymous
+    @GetMapping("/pointRel/page")
+    @ApiOperation(value = "设备-监控点关联分页查询")
+    public Page<EquipmentPointRel> pointRelPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("设备ID") @RequestParam(required = false) String equipmentId,
+            @ApiParam("监测点ID") @RequestParam(required = false) String pointId) {
+        return equipmentPointRelService.findByPage(pageNum, pageSize, equipmentId, pointId);
+    }
+
+    @Anonymous
+    @GetMapping("/pointRel/byEquipment/{equipmentId}")
+    @ApiOperation(value = "根据设备ID查询关联监测点")
+    public AjaxResult pointRelByEquipment(@PathVariable String equipmentId) {
+        return AjaxResult.success(equipmentPointRelService.getByEquipmentId(equipmentId));
+    }
+
+    @Anonymous
+    @GetMapping("/pointRel/byPoint/{pointId}")
+    @ApiOperation(value = "根据监测点ID查询关联设备")
+    public AjaxResult pointRelByPoint(@PathVariable String pointId) {
+        return AjaxResult.success(equipmentPointRelService.getByPointId(pointId));
+    }
+
+    @Anonymous
+    @PostMapping("/pointRel")
+    @ApiOperation(value = "新增设备-监控点关联")
+    @Log(title = "新增设备-监控点关联", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult pointRelSave(@RequestBody EquipmentPointRel entity) {
+        boolean saved = equipmentPointRelService.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PostMapping("/pointRel/batch")
+    @ApiOperation(value = "批量新增设备-监控点关联")
+    @Log(title = "批量新增设备-监控点关联", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult pointRelSaveBatch(@RequestBody List<EquipmentPointRel> entityList) {
+        if (CollectionUtils.isEmpty(entityList)) {
+            return AjaxResult.error("批量新增失败:关联列表不能为空");
+        }
+        boolean saved = equipmentPointRelService.saveBatchWithCheck(entityList);
+        return saved ? AjaxResult.success("批量新增成功") : AjaxResult.error("批量新增失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/pointRel/{id}")
+    @ApiOperation(value = "删除设备-监控点关联")
+    @Log(title = "删除设备-监控点关联", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult pointRelDelete(@PathVariable String id) {
+        boolean deleted = equipmentPointRelService.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/pointRel/batch")
+    @ApiOperation(value = "批量删除设备-监控点关联")
+    @Log(title = "批量删除设备-监控点关联", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult pointRelDeleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = equipmentPointRelService.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+}

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

@@ -0,0 +1,101 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.domain.DrainagePartition;
+import com.zksy.drainage.service.DrainagePartitionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 排水分区基础数据管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/partition")
+@Api(tags = "排水分区基础数据管理")
+public class DrainagePartitionController {
+
+    @Autowired
+    private DrainagePartitionService service;
+
+    @Anonymous
+    @GetMapping("/page")
+    @ApiOperation(value = "排水分区分页查询")
+    public Page<DrainagePartition> page(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("监测点名称") @RequestParam(required = false) String name,
+            @ApiParam("行政区域") @RequestParam(required = false) String district,
+            @ApiParam("分区类型") @RequestParam(required = false) String partitionType) {
+        return service.findByPage(pageNum, pageSize, name, district, partitionType);
+    }
+
+    @Anonymous
+    @GetMapping("/{id}")
+    @ApiOperation(value = "查询排水分区详情")
+    public AjaxResult getById(@PathVariable String id) {
+        DrainagePartition entity = service.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该排水分区不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @GetMapping("/list")
+    @ApiOperation(value = "查询所有排水分区")
+    public AjaxResult list() {
+        return AjaxResult.success(service.list());
+    }
+
+    @Anonymous
+    @PostMapping
+    @ApiOperation(value = "新增排水分区")
+    @Log(title = "新增排水分区", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult save(@RequestBody DrainagePartition entity) {
+        boolean saved = service.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping
+    @ApiOperation(value = "修改排水分区")
+    @Log(title = "修改排水分区", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult update(@RequestBody DrainagePartition entity) {
+        boolean updated = service.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除排水分区")
+    @Log(title = "删除排水分区", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteById(@PathVariable String id) {
+        boolean deleted = service.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/batch")
+    @ApiOperation(value = "批量删除排水分区")
+    @Log(title = "批量删除排水分区", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = service.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+}

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

@@ -0,0 +1,174 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.domain.DrainageWarning;
+import com.zksy.drainage.domain.WarningPublishRequest;
+import com.zksy.drainage.domain.WarningScopeUser;
+import com.zksy.drainage.service.DrainageWarningService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 排水预警信息管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/warning")
+@Api(tags = "排水预警信息管理")
+public class DrainageWarningController {
+
+    @Autowired
+    private DrainageWarningService service;
+
+    @Anonymous
+    @GetMapping("/page")
+    @ApiOperation(value = "分页查询预警信息")
+    public Page<DrainageWarning> page(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("预警级别(1严重,2重要,3一般)") @RequestParam(required = false) Integer warningLevel,
+            @ApiParam("预警类型") @RequestParam(required = false) String warningType,
+            @ApiParam("状态(0待处理,1已处理,2已完成)") @RequestParam(required = false) Integer status,
+            @ApiParam("开始时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String startTime,
+            @ApiParam("结束时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String endTime) {
+        return service.findByPage(pageNum, pageSize, warningLevel, warningType, status, startTime, endTime);
+    }
+
+    @Anonymous
+    @GetMapping("/current/page")
+    @ApiOperation(value = "查询当前预警(按用户可见性过滤,包含所有状态)")
+    public Page<DrainageWarning> currentPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("预警级别(1严重,2重要,3一般)") @RequestParam(required = false) Integer warningLevel,
+            @ApiParam("预警类型") @RequestParam(required = false) String warningType,
+            @ApiParam("当前用户ID") @RequestParam(required = false) Long userId,
+            @ApiParam("当前用户部门ID") @RequestParam(required = false) Long deptId,
+            @ApiParam("是否管理员") @RequestParam(defaultValue = "false") boolean isAdmin,
+            @ApiParam("状态筛选(0待处理,1已处理,2已完成),不传则返回所有状态") @RequestParam(required = false) Integer status) {
+        return service.findVisibleCurrentPage(pageNum, pageSize, userId, deptId, isAdmin, warningLevel, warningType, status);
+    }
+
+    @Anonymous
+    @GetMapping("/history/page")
+    @ApiOperation(value = "查询历史预警(status>=2,已完成)")
+    public Page<DrainageWarning> historyPage(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("预警级别(1严重,2重要,3一般)") @RequestParam(required = false) Integer warningLevel,
+            @ApiParam("预警类型") @RequestParam(required = false) String warningType,
+            @ApiParam("状态(1已处理,2已完成)") @RequestParam(required = false) Integer status,
+            @ApiParam("开始时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String startTime,
+            @ApiParam("结束时间(yyyy-MM-dd HH:mm:ss)") @RequestParam(required = false) String endTime) {
+        return service.findHistoryPage(pageNum, pageSize, warningLevel, warningType, status, startTime, endTime);
+    }
+
+    @Anonymous
+    @GetMapping("/{id}")
+    @ApiOperation(value = "查询预警详情")
+    public AjaxResult getById(@PathVariable String id) {
+        DrainageWarning entity = service.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该预警信息不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @PostMapping
+    @ApiOperation(value = "发布新预警")
+    @Log(title = "发布新预警", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult save(@RequestBody DrainageWarning entity) {
+        boolean saved = service.saveWithCheck(entity);
+        return saved ? AjaxResult.success("发布成功") : AjaxResult.error("发布失败");
+    }
+
+    @Anonymous
+    @PutMapping
+    @ApiOperation(value = "修改预警")
+    @Log(title = "修改预警", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult update(@RequestBody DrainageWarning entity) {
+        boolean updated = service.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @PutMapping("/{id}/status")
+    @ApiOperation(value = "更新预警状态")
+    @Log(title = "更新预警状态", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult updateStatus(
+            @PathVariable String id,
+            @ApiParam("新状态(0待处理,1已处理,2已完成)") @RequestParam Integer status,
+            @ApiParam("处理人") @RequestParam(required = false) String processor) {
+        boolean updated = service.updateStatus(id, status, processor);
+        return updated ? AjaxResult.success("状态更新成功") : AjaxResult.error("状态更新失败");
+    }
+
+    @Anonymous
+    @PostMapping("/publish")
+    @ApiOperation(value = "发布预警(带接收人员列表)")
+    @Log(title = "发布预警", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult publish(@RequestBody WarningPublishRequest request) {
+        service.publishWarning(request.getWarning(), request.getUserIds());
+        return AjaxResult.success("发布成功");
+    }
+
+    @Anonymous
+    @PutMapping("/{id}/firstApprove")
+    @ApiOperation(value = "处理(指定人员处理)")
+    @Log(title = "预警处理", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult firstApprove(
+            @PathVariable String id,
+            @ApiParam("处理人ID") @RequestParam Long userId,
+            @ApiParam("处理人名称") @RequestParam(required = false) String userName) {
+        service.firstApprove(id, userId, userName);
+        return AjaxResult.success("处理成功");
+    }
+
+    @Anonymous
+    @PutMapping("/{id}/finalApprove")
+    @ApiOperation(value = "审批(管理员审批)")
+    @Log(title = "预警审批", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult finalApprove(
+            @PathVariable String id,
+            @ApiParam("审批人ID(管理员)") @RequestParam Long userId,
+            @ApiParam("审批人名称") @RequestParam(required = false) String userName) {
+        service.finalApprove(id, userId, userName);
+        return AjaxResult.success("审批成功");
+    }
+
+    @Anonymous
+    @GetMapping("/scopeUsers/{warningId}")
+    @ApiOperation(value = "获取某预警的接收人员列表")
+    public AjaxResult scopeUsers(@PathVariable String warningId) {
+        List<WarningScopeUser> list = service.findScopeUsers(warningId);
+        return AjaxResult.success(list);
+    }
+
+    @Anonymous
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除预警")
+    @Log(title = "删除预警", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteById(@PathVariable String id) {
+        boolean deleted = service.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+}

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

@@ -0,0 +1,101 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.domain.EngineeringFacility;
+import com.zksy.drainage.service.EngineeringFacilityService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 工程设施基础数据管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/facility")
+@Api(tags = "工程设施基础数据管理")
+public class EngineeringFacilityController {
+
+    @Autowired
+    private EngineeringFacilityService service;
+
+    @Anonymous
+    @GetMapping("/page")
+    @ApiOperation(value = "工程设施分页查询")
+    public Page<EngineeringFacility> page(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("设施名称") @RequestParam(required = false) String name,
+            @ApiParam("行政区域") @RequestParam(required = false) String area,
+            @ApiParam("设施类型") @RequestParam(required = false) String facilityType) {
+        return service.findByPage(pageNum, pageSize, name, area, facilityType);
+    }
+
+    @Anonymous
+    @GetMapping("/{id}")
+    @ApiOperation(value = "查询工程设施详情")
+    public AjaxResult getById(@PathVariable String id) {
+        EngineeringFacility entity = service.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该工程设施不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @GetMapping("/list")
+    @ApiOperation(value = "查询所有工程设施")
+    public AjaxResult list() {
+        return AjaxResult.success(service.list());
+    }
+
+    @Anonymous
+    @PostMapping
+    @ApiOperation(value = "新增工程设施")
+    @Log(title = "新增工程设施", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult save(@RequestBody EngineeringFacility entity) {
+        boolean saved = service.saveEntity(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping
+    @ApiOperation(value = "修改工程设施")
+    @Log(title = "修改工程设施", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult update(@RequestBody EngineeringFacility entity) {
+        boolean updated = service.updateEntity(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除工程设施")
+    @Log(title = "删除工程设施", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteById(@PathVariable String id) {
+        boolean deleted = service.removeEntity(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/batch")
+    @ApiOperation(value = "批量删除工程设施")
+    @Log(title = "批量删除工程设施", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = service.removeBatchEntity(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+}

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

@@ -0,0 +1,101 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.domain.PipeNetworkInfo;
+import com.zksy.drainage.service.PipeNetworkInfoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 排水管网基础数据管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/pipeNetwork")
+@Api(tags = "排水管网基础数据管理")
+public class PipeNetworkInfoController {
+
+    @Autowired
+    private PipeNetworkInfoService service;
+
+    @Anonymous
+    @GetMapping("/page")
+    @ApiOperation(value = "排水管网分页查询")
+    public Page<PipeNetworkInfo> page(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("管网名称") @RequestParam(required = false) String name,
+            @ApiParam("行政区域") @RequestParam(required = false) String area,
+            @ApiParam("管网类型") @RequestParam(required = false) String networkType) {
+        return service.findByPage(pageNum, pageSize, name, area, networkType);
+    }
+
+    @Anonymous
+    @GetMapping("/{id}")
+    @ApiOperation(value = "查询排水管网详情")
+    public AjaxResult getById(@PathVariable String id) {
+        PipeNetworkInfo entity = service.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该排水管网不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @GetMapping("/list")
+    @ApiOperation(value = "查询所有排水管网")
+    public AjaxResult list() {
+        return AjaxResult.success(service.list());
+    }
+
+    @Anonymous
+    @PostMapping
+    @ApiOperation(value = "新增排水管网")
+    @Log(title = "新增排水管网", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult save(@RequestBody PipeNetworkInfo entity) {
+        boolean saved = service.saveEntity(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping
+    @ApiOperation(value = "修改排水管网")
+    @Log(title = "修改排水管网", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult update(@RequestBody PipeNetworkInfo entity) {
+        boolean updated = service.updateEntity(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除排水管网")
+    @Log(title = "删除排水管网", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteById(@PathVariable String id) {
+        boolean deleted = service.removeEntity(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/batch")
+    @ApiOperation(value = "批量删除排水管网")
+    @Log(title = "批量删除排水管网", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = service.removeBatchEntity(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+}

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

@@ -0,0 +1,100 @@
+package com.zksy.web.controller.drainage;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.annotation.Log;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.enums.BusinessType;
+import com.zksy.drainage.domain.WaterloggingPoint;
+import com.zksy.drainage.service.WaterloggingPointService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 易积水点管理
+ */
+@Slf4j
+@RestController
+@RequestMapping("/api/drainage/waterlogging")
+@Api(tags = "易积水点管理")
+public class WaterloggingPointController {
+
+    @Autowired
+    private WaterloggingPointService service;
+
+    @Anonymous
+    @GetMapping("/page")
+    @ApiOperation(value = "易积水点分页查询")
+    public Page<WaterloggingPoint> page(
+            @ApiParam("页码") @RequestParam(defaultValue = "1") long pageNum,
+            @ApiParam("每页数量") @RequestParam(defaultValue = "10") long pageSize,
+            @ApiParam("监测点名称") @RequestParam(required = false) String name,
+            @ApiParam("行政区域") @RequestParam(required = false) String area) {
+        return service.findByPage(pageNum, pageSize, name, area);
+    }
+
+    @Anonymous
+    @GetMapping("/{id}")
+    @ApiOperation(value = "查询易积水点详情")
+    public AjaxResult getById(@PathVariable String id) {
+        WaterloggingPoint entity = service.getById(id);
+        if (entity == null) {
+            return AjaxResult.error("该易积水点不存在");
+        }
+        return AjaxResult.success(entity);
+    }
+
+    @Anonymous
+    @GetMapping("/list")
+    @ApiOperation(value = "查询所有易积水点")
+    public AjaxResult list() {
+        return AjaxResult.success(service.list());
+    }
+
+    @Anonymous
+    @PostMapping
+    @ApiOperation(value = "新增易积水点")
+    @Log(title = "新增易积水点", businessType = BusinessType.INSERT)
+    @Transactional
+    public AjaxResult save(@RequestBody WaterloggingPoint entity) {
+        boolean saved = service.saveWithCheck(entity);
+        return saved ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
+    }
+
+    @Anonymous
+    @PutMapping
+    @ApiOperation(value = "修改易积水点")
+    @Log(title = "修改易积水点", businessType = BusinessType.UPDATE)
+    @Transactional
+    public AjaxResult update(@RequestBody WaterloggingPoint entity) {
+        boolean updated = service.updateWithCheck(entity);
+        return updated ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/{id}")
+    @ApiOperation(value = "删除易积水点")
+    @Log(title = "删除易积水点", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteById(@PathVariable String id) {
+        boolean deleted = service.removeWithCheck(id);
+        return deleted ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
+    }
+
+    @Anonymous
+    @DeleteMapping("/batch")
+    @ApiOperation(value = "批量删除易积水点")
+    @Log(title = "批量删除易积水点", businessType = BusinessType.DELETE)
+    @Transactional
+    public AjaxResult deleteBatch(@RequestBody List<String> ids) {
+        boolean deleted = service.removeBatchWithCheck(ids);
+        return deleted ? AjaxResult.success("批量删除成功") : AjaxResult.error("批量删除失败");
+    }
+}

+ 1 - 1
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/gasbasic/GasEquipmentController.java

@@ -112,7 +112,7 @@ public class GasEquipmentController {
                                      @RequestParam(required = false) String equipmentModel,
                                      @RequestParam(required = false) String manufacturer) {
         Page<EquipmentFullVO> page = equipmentBaseService.findFullByPage(pageNum, pageSize,
-                equipmentCode, equipmentName, equipmentModel, manufacturer);
+                equipmentCode, equipmentName, equipmentModel, manufacturer, null);
         return AjaxResult.success(page);
     }
 }

+ 73 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/MaintenanceDataStatController.java

@@ -0,0 +1,73 @@
+package com.zksy.web.controller.manhole;
+
+
+import com.zksy.base.service.MaintenanceDataStatService;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.core.domain.AjaxResult2;
+import com.zksy.manhole.dto.in.MaintenanceDataStatQueryInDTO;
+import com.zksy.manhole.dto.in.MaintenanceDataStatTrendInDTO;
+import com.zksy.manhole.dto.out.AbnormalTerminalTrendOutDTO;
+import com.zksy.manhole.dto.out.CaseRateTrendOutDTO;
+import com.zksy.manhole.dto.out.MaintenanceDataStatOutDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 窨井盖监测系统-数据统计Controller
+ * 
+ * @author xianggx
+ * @date 2026-05-06
+ */
+@RestController
+@RequestMapping("/manhole/maintenanceDataStat")
+@Api(tags = "窨井盖监测系统-数据统计")
+public class MaintenanceDataStatController extends BaseController
+{
+    @Autowired
+    private MaintenanceDataStatService maintenanceDataStatService;
+
+    /**
+     * 根据日期查询运维数据统计
+     */
+    @Anonymous
+    @PostMapping(value = "/queryByDate")
+    @ApiOperation(value = "根据日期查询运维数据统计")
+    public AjaxResult2<MaintenanceDataStatOutDTO> queryByDate(@RequestBody MaintenanceDataStatQueryInDTO queryInDTO)
+    {
+        MaintenanceDataStatOutDTO outDTO = maintenanceDataStatService.queryByDate(queryInDTO);
+        if(outDTO == null){
+            return AjaxResult2.error("该日期的统计数据不存在");
+        }
+        return AjaxResult2.success(outDTO);
+    }
+
+    /**
+     * 周度/月度 异常终端设备数量趋势分析
+     */
+    @Anonymous
+    @PostMapping(value = "/abnormalTerminalTrend")
+    @ApiOperation(value = "周度/月度 异常终端设备数量趋势分析")
+    public AjaxResult2<List<AbnormalTerminalTrendOutDTO>> abnormalTerminalTrend(@RequestBody MaintenanceDataStatTrendInDTO inDTO)
+    {
+        return AjaxResult2.success(maintenanceDataStatService.abnormalTerminalTrend(inDTO));
+    }
+
+    /**
+     * 周度/月度 案件处置率、案件延期率趋势分析
+     */
+    @Anonymous
+    @PostMapping(value = "/caseRateTrend")
+    @ApiOperation(value = "周度/月度 案件处置率、案件延期率趋势分析")
+    public AjaxResult2<List<CaseRateTrendOutDTO>> caseRateTrend(@RequestBody MaintenanceDataStatTrendInDTO inDTO)
+    {
+        return AjaxResult2.success(maintenanceDataStatService.caseRateTrend(inDTO));
+    }
+}

+ 84 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/MaintenanceTaskController.java

@@ -0,0 +1,84 @@
+package com.zksy.web.controller.manhole;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.base.service.MaintenanceTaskService;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.core.domain.AjaxResult2;
+import com.zksy.manhole.dto.in.MaintenanceTaskDispatchInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskPageInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskProcessInDTO;
+import com.zksy.manhole.dto.out.MaintenanceTaskOutDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 窨井盖监测系统-运维任务管理Controller
+ * 
+ * @author xianggx
+ * @date 2026-05-06
+ */
+@RestController
+@RequestMapping("/manhole/maintenanceTask")
+@Api(tags = "窨井盖监测系统-运维任务管理")
+public class MaintenanceTaskController extends BaseController
+{
+    @Autowired
+    private MaintenanceTaskService maintenanceTaskService;
+
+    /**
+     * 分页查询运维任务列表
+     */
+    @Anonymous
+    @PostMapping(value = "/findByPage")
+    @ApiOperation(value = "分页查询运维任务列表")
+    public AjaxResult2<Page<MaintenanceTaskOutDTO>> findByPage(@RequestBody MaintenanceTaskPageInDTO pageInDTO)
+    {
+        return AjaxResult2.success(maintenanceTaskService.findByPage(pageInDTO));
+    }
+
+    /**
+     * 获取运维任务详情
+     */
+    @Anonymous
+    @GetMapping(value = "/getById/{id}")
+    @ApiOperation(value = "获取运维任务详情")
+    public AjaxResult2<MaintenanceTaskOutDTO> getById(@PathVariable("id") Long id)
+    {
+        MaintenanceTaskOutDTO outDTO = maintenanceTaskService.getDetailById(id);
+        if(outDTO == null){
+            return AjaxResult2.error("运维任务ID不存在");
+        }
+        return AjaxResult2.success(outDTO);
+    }
+
+    /**
+     * 批量下发运维任务
+     */
+    @Anonymous
+    @PostMapping(value = "/batchDispatch")
+    @ApiOperation(value = "批量下发运维任务")
+    public AjaxResult batchDispatch(@RequestBody MaintenanceTaskDispatchInDTO inDTO)
+    {
+        boolean result = maintenanceTaskService.batchDispatch(inDTO);
+        return result ? AjaxResult.success("下发成功", result)
+                : AjaxResult.error("下发失败", result);
+    }
+
+    /**
+     * 处理运维任务
+     */
+    @Anonymous
+    @PostMapping(value = "/processTask")
+    @ApiOperation(value = "处理运维任务")
+    public AjaxResult processTask(@RequestBody MaintenanceTaskProcessInDTO inDTO)
+    {
+        boolean result = maintenanceTaskService.processTask(inDTO);
+        return result ? AjaxResult.success("处理成功", result)
+                : AjaxResult.error("处理失败", result);
+    }
+}

+ 28 - 8
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/ManholeDeviceController.java

@@ -19,20 +19,16 @@ import com.zksy.common.annotation.Anonymous;
 import com.zksy.common.core.controller.BaseController;
 import com.zksy.common.core.domain.AjaxResult;
 import com.zksy.common.core.domain.AjaxResult2;
-import com.zksy.manhole.dto.in.EquipmentStatusInDTO;
-import com.zksy.manhole.dto.in.ManholeDeviceListInDTO;
-import com.zksy.manhole.dto.in.ManholeDevicePageInDTO;
-import com.zksy.manhole.dto.in.WarningThresholdInDTO;
-import com.zksy.manhole.dto.out.EquipmentBaseOutDTO;
-import com.zksy.manhole.dto.out.EquipmentStatusOutDTO;
-import com.zksy.manhole.dto.out.ManholeDataOutDTO;
-import com.zksy.manhole.dto.out.WarningThresholdOutDTO;
+import com.zksy.common.utils.poi.ExcelUtil;
+import com.zksy.manhole.dto.in.*;
+import com.zksy.manhole.dto.out.*;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.time.LocalDateTime;
 import java.util.List;
 
@@ -161,4 +157,28 @@ public class ManholeDeviceController extends BaseController
         return result ? AjaxResult.success("保存成功",result)
                 : AjaxResult.error("保存失败",result);
     }
+
+    /**
+     * 根据设备类别分组统计设备数量
+     */
+    @Anonymous
+    @PostMapping(value = "/countByType")
+    @ApiOperation(value = "根据设备类别分组统计设备数量")
+    public AjaxResult2<List<EquipmentCountByTypeOutDTO>> countByType(@RequestBody EquipmentCountByTypeInDTO inDTO)
+    {
+        return AjaxResult2.success(equipmentBaseService.countByType(inDTO));
+    }
+
+    /**
+     * 导出设备明细数据
+     */
+    @Anonymous
+    @PostMapping(value = "/export")
+    @ApiOperation(value = "导出设备明细数据")
+    public void export(HttpServletResponse response, @RequestBody EquipmentExportInDTO inDTO)
+    {
+        List<EquipmentExportOutDTO> list = equipmentBaseService.exportEquipmentDetail(inDTO);
+        ExcelUtil<EquipmentExportOutDTO> util = new ExcelUtil<>(EquipmentExportOutDTO.class);
+        util.exportExcel(response, list, "设备明细数据");
+    }
 }

+ 70 - 0
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/TerminalFaultController.java

@@ -0,0 +1,70 @@
+package com.zksy.web.controller.manhole;
+
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zksy.base.service.TerminalFaultService;
+import com.zksy.common.annotation.Anonymous;
+import com.zksy.common.core.controller.BaseController;
+import com.zksy.common.core.domain.AjaxResult;
+import com.zksy.common.core.domain.AjaxResult2;
+import com.zksy.manhole.dto.in.TerminalFaultHandleInDTO;
+import com.zksy.manhole.dto.in.TerminalFaultPageInDTO;
+import com.zksy.manhole.dto.out.TerminalFaultOutDTO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * 窨井盖监测系统-故障管理Controller
+ * 
+ * @author xianggx
+ * @date 2026-05-06
+ */
+@RestController
+@RequestMapping("/manhole/terminalFault")
+@Api(tags = "窨井盖监测系统-故障管理")
+public class TerminalFaultController extends BaseController
+{
+    @Autowired
+    private TerminalFaultService terminalFaultService;
+
+    /**
+     * 分页查询终端故障列表
+     */
+    @Anonymous
+    @PostMapping(value = "/findByPage")
+    @ApiOperation(value = "分页查询终端故障列表")
+    public AjaxResult2<Page<TerminalFaultOutDTO>> findByPage(@RequestBody TerminalFaultPageInDTO pageInDTO)
+    {
+        return AjaxResult2.success(terminalFaultService.findByPage(pageInDTO));
+    }
+
+    /**
+     * 获取终端故障详情
+     */
+    @Anonymous
+    @GetMapping(value = "/getById/{id}")
+    @ApiOperation(value = "获取终端故障详情")
+    public AjaxResult2<TerminalFaultOutDTO> getById(@PathVariable("id") Long id)
+    {
+        TerminalFaultOutDTO outDTO = terminalFaultService.getDetailById(id);
+        if(outDTO == null){
+            return AjaxResult2.error("故障ID不存在");
+        }
+        return AjaxResult2.success(outDTO);
+    }
+
+    /**
+     * 处置终端故障
+     */
+    @Anonymous
+    @PostMapping(value = "/handleFault")
+    @ApiOperation(value = "处置终端故障")
+    public AjaxResult handleFault(@RequestBody TerminalFaultHandleInDTO inDTO)
+    {
+        boolean result = terminalFaultService.handleFault(inDTO);
+        return result ? AjaxResult.success("处置成功", result)
+                : AjaxResult.error("处置失败", result);
+    }
+}

+ 36 - 1
pipe-network-service/zksy-admin/src/main/java/com/zksy/web/controller/manhole/WorkOrderController.java

@@ -11,8 +11,11 @@ import com.zksy.common.annotation.Anonymous;
 import com.zksy.common.core.controller.BaseController;
 import com.zksy.common.core.domain.AjaxResult;
 import com.zksy.common.core.domain.AjaxResult2;
+import com.zksy.manhole.dto.in.WorkOrderAddInDTO;
+import com.zksy.manhole.dto.in.WorkOrderFinishedInDTO;
 import com.zksy.manhole.dto.in.WorkOrderOperInDTO;
 import com.zksy.manhole.dto.in.WorkOrderPageInDTO;
+import com.zksy.manhole.dto.in.WorkOrderProcessingInDTO;
 import com.zksy.manhole.dto.out.EquipmentStatusOutDTO;
 import com.zksy.manhole.dto.out.WorkOrderLogOutDTO;
 import com.zksy.manhole.dto.out.WorkOrderOutDTO;
@@ -53,7 +56,7 @@ public class WorkOrderController extends BaseController
      * 分页查询工单信息列表
      */
     @Anonymous
-    @GetMapping(value = "/findByPage")
+    @PostMapping(value = "/findByPage")
     @ApiOperation(value = "分页查询工单信息列表")
     public AjaxResult2<Page<WorkOrderOutDTO>> findByPage(@RequestBody WorkOrderPageInDTO pageInDTO)
     {
@@ -101,6 +104,38 @@ public class WorkOrderController extends BaseController
         return AjaxResult2.success(outDTO);
     }
 
+    /**
+     * 经办工单分页查询(处理中:待接单、已接单、处理中、待验收)
+     */
+    @Anonymous
+    @PostMapping(value = "/findProcessingPage")
+    @ApiOperation(value = "经办工单分页查询")
+    public AjaxResult2<Page<WorkOrderOutDTO>> findProcessingPage(@RequestBody WorkOrderProcessingInDTO inDTO) {
+        return AjaxResult2.success(workOrderService.findProcessingPage(inDTO));
+    }
+
+    /**
+     * 办结工单分页查询(已办结:已结案、已驳回)
+     */
+    @Anonymous
+    @PostMapping(value = "/findFinishedPage")
+    @ApiOperation(value = "办结工单分页查询")
+    public AjaxResult2<Page<WorkOrderOutDTO>> findFinishedPage(@RequestBody WorkOrderFinishedInDTO inDTO) {
+        return AjaxResult2.success(workOrderService.findFinishedPage(inDTO));
+    }
+
+    /**
+     * 新增工单
+     */
+    @Anonymous
+    @PostMapping(value = "/addWorkOrder")
+    @ApiOperation(value = "新增工单")
+    public AjaxResult addWorkOrder(@RequestBody WorkOrderAddInDTO inDTO) {
+        boolean result = workOrderService.addWorkOrder(inDTO);
+        return result ? AjaxResult.success("新增成功", result)
+                : AjaxResult.error("新增失败", result);
+    }
+
     /**
      * 操作工单
      * @param inDTO

+ 1 - 1
pipe-network-service/zksy-framework/src/main/java/com/zksy/framework/config/ApplicationConfig.java

@@ -17,7 +17,7 @@ import java.util.TimeZone;
 // 表示通过aop框架暴露该代理对象,AopContext能够访问
 @EnableAspectJAutoProxy(exposeProxy = true)
 // 指定要扫描的Mapper类的包的路径
-@MapperScan({"com.zksy.base.**.mapper", "com.zksy.system.**.mapper", "com.zksy.quartz.**.mapper", "com.zksy.generator.**.mapper", "com.zksy.WaterSupply.**.mapper"})
+@MapperScan({"com.zksy.base.**.mapper", "com.zksy.system.**.mapper", "com.zksy.quartz.**.mapper", "com.zksy.generator.**.mapper", "com.zksy.drainage.**.mapper"})
 public class ApplicationConfig
 {
     /**

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

@@ -74,6 +74,9 @@ public class EquipmentBase {
     @ApiModelProperty("联系方式")
     private String maintainerPhone;
 
+    @ApiModelProperty("权属单位")
+    private String ownershipUnit;
+
     @ApiModelProperty("备注信息")
     private String remark;
 

+ 9 - 3
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/EquipmentStatus.java

@@ -21,11 +21,11 @@ import java.util.Date;
 @TableName("equipment_status")
 public class EquipmentStatus {
 
-    @TableId(value = "status_id", type = IdType.ASSIGN_UUID)
     /**
      * 状态记录ID(主键)
      */
-    private String statusId;
+    @TableId(value = "status_id", type = IdType.AUTO)
+    private Integer statusId;
 
     /**
      * 设备ID(关联equipment_base表)
@@ -67,7 +67,7 @@ public class EquipmentStatus {
      * 下次预计维护日期
      */
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private LocalDateTime nextMaintainDate;
+    private Date nextMaintainDate;
 
     /**
      * 状态更新时间
@@ -75,6 +75,12 @@ public class EquipmentStatus {
     @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private LocalDateTime statusUpdateTime;
 
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
     @TableLogic(value = "0", delval = "2")
     private String delFlag;
 }

+ 89 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceDataStat.java

@@ -0,0 +1,89 @@
+package com.zksy.base.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 运维数据统计表
+ * @TableName maintenance_data_stat
+ */
+@TableName(value ="maintenance_data_stat")
+@Data
+@ApiModel(value = "运维数据统计入参", description = "运维数据统计入参")
+public class MaintenanceDataStat implements Serializable {
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 统计ID
+     */
+    @ApiModelProperty(value = "统计ID")
+    @TableId(type = IdType.AUTO)
+    private Long statId;
+
+    /**
+     * 统计日期(唯一索引)
+     */
+    @ApiModelProperty(value = "统计日期")
+    private Date statDate;
+
+    /**
+     * 所属运维部门ID
+     */
+    @ApiModelProperty(value = "所属运维部门ID")
+    private Long deptId;
+
+    /**
+     * 终端设备总数
+     */
+    @ApiModelProperty(value = "终端设备总数")
+    private Integer totalTerminal;
+
+    /**
+     * 异常终端设备数量
+     */
+    @ApiModelProperty(value = "异常终端设备数量")
+    private Integer abnormalTerminal;
+
+    /**
+     * 案件总数
+     */
+    @ApiModelProperty(value = "案件总数")
+    private Integer totalCase;
+
+    /**
+     * 案件处置率(%)
+     */
+    @ApiModelProperty(value = "案件处置率(%)")
+    private BigDecimal caseDisposalRate;
+
+    /**
+     * 案件延期率(%)
+     */
+    @ApiModelProperty(value = "案件延期率(%)")
+    private BigDecimal caseDelayRate;
+
+    /**
+     * 平均处置时长(小时)
+     */
+    @ApiModelProperty(value = "平均处置时长(小时)")
+    private BigDecimal avgDisposalTime;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+}

+ 117 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceTask.java

@@ -0,0 +1,117 @@
+package com.zksy.base.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 运维任务主表
+ * @TableName maintenance_task
+ */
+@TableName(value ="maintenance_task")
+@Data
+@ApiModel(value = "运维任务入参", description = "运维任务入参")
+public class MaintenanceTask implements Serializable {
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 运维任务ID
+     */
+    @ApiModelProperty(value = "运维任务ID")
+    @TableId(type = IdType.AUTO)
+    private Long taskId;
+
+    /**
+     * 任务编号(唯一索引,格式:TS+年月日+流水号)
+     */
+    @ApiModelProperty(value = "任务编号")
+    private String taskNo;
+
+    /**
+     * 所属施工单位/运维部门ID
+     */
+    @ApiModelProperty(value = "运维部门ID")
+    private Long deptId;
+
+    /**
+     * 派单人ID
+     */
+    @ApiModelProperty(value = "派单人ID")
+    private Long dispatchUserId;
+
+    /**
+     * 接收维护人员ID
+     */
+    @ApiModelProperty(value = "接收维护人员ID")
+    private Long receiveUserId;
+
+    /**
+     * 任务详细描述
+     */
+    @ApiModelProperty(value = "任务详细描述")
+    private String taskDesc;
+
+    /**
+     * 任务优先级:1-严重 2-一般
+     */
+    @ApiModelProperty(value = "任务优先级:1-严重 2-一般")
+    private Integer taskLevel;
+
+    /**
+     * 任务状态:1-待下发 2-待接收 3-处理中 4-待验收 5-已完成 6-已驳回 7-已延期
+     */
+    @ApiModelProperty(value = "任务状态:1-待下发 2-待接收 3-处理中 4-待验收 5-已完成 6-已驳回 7-已延期")
+    private Integer taskStatus;
+
+    /**
+     * 计划开始时间
+     */
+    @ApiModelProperty(value = "计划开始时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date planStartTime;
+
+    /**
+     * 计划结束时间
+     */
+    @ApiModelProperty(value = "计划结束时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date planEndTime;
+
+    /**
+     * 实际开始时间
+     */
+    @ApiModelProperty(value = "实际开始时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date realStartTime;
+
+    /**
+     * 实际结束时间
+     */
+    @ApiModelProperty(value = "实际结束时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date realEndTime;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date updateTime;
+}

+ 83 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/MaintenanceTaskDetail.java

@@ -0,0 +1,83 @@
+package com.zksy.base.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 运维任务明细表
+ * @TableName maintenance_task_detail
+ */
+@TableName(value ="maintenance_task_detail")
+@Data
+@ApiModel(value = "运维任务明细入参", description = "运维任务明细入参")
+public class MaintenanceTaskDetail implements Serializable {
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 运维任务明细ID
+     */
+    @ApiModelProperty(value = "运维任务明细ID")
+    @TableId(type = IdType.AUTO)
+    private Long detailId;
+
+    /**
+     * 关联运维任务ID
+     */
+    @ApiModelProperty(value = "关联运维任务ID")
+    private Long taskId;
+
+    /**
+     * 设备ID
+     */
+    @ApiModelProperty(value = "设备ID")
+    private String deviceId;
+
+    /**
+     * 设备编码
+     */
+    @ApiModelProperty(value = "设备编码")
+    private String deviceCode;
+
+    /**
+     * 关联报警ID
+     */
+    @ApiModelProperty(value = "关联报警ID")
+    private String alarmId;
+
+    /**
+     * 报警描述
+     */
+    @ApiModelProperty(value = "报警描述")
+    private String alarmDesc;
+
+    /**
+     * 明细状态:1-待处理 2-处理中 3-已完成 4-已驳回
+     */
+    @ApiModelProperty(value = "明细状态:1-待处理 2-处理中 3-已完成 4-已驳回")
+    private Integer detailStatus;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date updateTime;
+}

+ 121 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/TerminalFault.java

@@ -0,0 +1,121 @@
+package com.zksy.base.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 终端故障表
+ * @TableName terminal_fault
+ */
+@TableName(value ="terminal_fault")
+@Data
+@ApiModel(value = "终端故障入参", description = "终端故障入参")
+public class TerminalFault implements Serializable {
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 故障ID
+     */
+    @ApiModelProperty(value = "故障ID")
+    @TableId(type = IdType.AUTO)
+    private Long faultId;
+
+    /**
+     * 故障编号(唯一索引,格式:FT+年月日+流水号)
+     */
+    @ApiModelProperty(value = "故障编号")
+    private String faultNo;
+
+    /**
+     * 关联终端设备ID
+     */
+    @ApiModelProperty(value = "关联终端设备ID")
+    private String deviceId;
+
+    /**
+     * 设备编码
+     */
+    @ApiModelProperty(value = "设备编码")
+    private String deviceCode;
+
+    /**
+     * 关联报警ID
+     */
+    @ApiModelProperty(value = "关联报警ID")
+    private String alarmId;
+
+    /**
+     * 故障等级:1-严重 2-一般
+     */
+    @ApiModelProperty(value = "故障等级:1-严重 2-一般")
+    private Integer faultLevel;
+
+    /**
+     * 故障详细描述
+     */
+    @ApiModelProperty(value = "故障详细描述")
+    private String faultDesc;
+
+    /**
+     * 故障来源:1-设备报警 2-人工上报 3-巡检发现
+     */
+    @ApiModelProperty(value = "故障来源:1-设备报警 2-人工上报 3-巡检发现")
+    private Integer faultSource;
+
+    /**
+     * 故障状态:1-未处理 2-处理中 3-已修复 4-已返厂 5-已报废
+     */
+    @ApiModelProperty(value = "故障状态:1-未处理 2-处理中 3-已修复 4-已返厂 5-已报废")
+    private Integer faultStatus;
+
+    /**
+     * 故障发生时间
+     */
+    @ApiModelProperty(value = "故障发生时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date happenTime;
+
+    /**
+     * 处理人ID
+     */
+    @ApiModelProperty(value = "处理人ID")
+    private Long handleUserId;
+
+    /**
+     * 处理完成时间
+     */
+    @ApiModelProperty(value = "处理完成时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date handleTime;
+
+    /**
+     * 最终处理结果
+     */
+    @ApiModelProperty(value = "最终处理结果")
+    private String handleResult;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty(value = "更新时间")
+    @JsonFormat(locale = "zh",pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
+    private Date updateTime;
+}

+ 5 - 2
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/vo/EquipmentFullVO.java

@@ -68,6 +68,9 @@ public class EquipmentFullVO {
     @ApiModelProperty("备注")
     private String remark;
 
+    @ApiModelProperty("权属单位")
+    private String ownershipUnit;
+
     @ApiModelProperty("创建时间")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime createTime;
@@ -87,8 +90,8 @@ public class EquipmentFullVO {
     private Date lastMaintainDate;
 
     @ApiModelProperty("下次预计维护日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    private LocalDateTime nextMaintainDate;
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date nextMaintainDate;
 
     // ===== gas_pipe_point =====
     @ApiModelProperty("管点ID")

+ 20 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceDataStatMapper.java

@@ -0,0 +1,20 @@
+package com.zksy.base.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.base.domain.MaintenanceDataStat;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_data_stat(运维数据统计表)】的数据库操作Mapper
+* @createDate 2026-06-26 14:11:51
+* @Entity com.zksy.base.domain.MaintenanceDataStat
+*/
+@Mapper
+public interface MaintenanceDataStatMapper extends BaseMapper<MaintenanceDataStat> {
+
+}
+
+
+
+

+ 20 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceTaskDetailMapper.java

@@ -0,0 +1,20 @@
+package com.zksy.base.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.base.domain.MaintenanceTaskDetail;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task_detail(运维任务明细表)】的数据库操作Mapper
+* @createDate 2026-06-26 14:11:51
+* @Entity com.zksy.base.domain.MaintenanceTaskDetail
+*/
+@Mapper
+public interface MaintenanceTaskDetailMapper extends BaseMapper<MaintenanceTaskDetail> {
+
+}
+
+
+
+

+ 20 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/MaintenanceTaskMapper.java

@@ -0,0 +1,20 @@
+package com.zksy.base.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.base.domain.MaintenanceTask;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task(运维任务主表)】的数据库操作Mapper
+* @createDate 2026-06-26 14:11:51
+* @Entity com.zksy.base.domain.MaintenanceTask
+*/
+@Mapper
+public interface MaintenanceTaskMapper extends BaseMapper<MaintenanceTask> {
+
+}
+
+
+
+

+ 20 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/mapper/TerminalFaultMapper.java

@@ -0,0 +1,20 @@
+package com.zksy.base.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.base.domain.TerminalFault;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author Administrator
+* @description 针对表【terminal_fault(终端故障表)】的数据库操作Mapper
+* @createDate 2026-06-26 14:36:18
+* @Entity com.zksy.base.domain.TerminalFault
+*/
+@Mapper
+public interface TerminalFaultMapper extends BaseMapper<TerminalFault> {
+
+}
+
+
+
+

+ 20 - 2
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/EquipmentBaseService.java

@@ -4,10 +4,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zksy.base.domain.EquipmentBase;
 import com.zksy.base.domain.vo.EquipmentFullVO;
+import com.zksy.manhole.dto.in.EquipmentCountByTypeInDTO;
+import com.zksy.manhole.dto.in.EquipmentExportInDTO;
 import com.zksy.manhole.dto.in.ManholeDeviceListInDTO;
 import com.zksy.manhole.dto.in.ManholeDevicePageInDTO;
 import com.zksy.manhole.dto.out.EquipmentBaseOutDTO;
-import org.springframework.stereotype.Service;
+import com.zksy.manhole.dto.out.EquipmentCountByTypeOutDTO;
+import com.zksy.manhole.dto.out.EquipmentExportOutDTO;
 
 import java.util.List;
 import java.util.Map;
@@ -16,7 +19,8 @@ public interface EquipmentBaseService extends IService<EquipmentBase> {
 
     Page<EquipmentFullVO> findFullByPage(long pageNum, long pageSize,
                                          String equipmentCode, String equipmentName,
-                                         String equipmentModel, String manufacturer);
+                                         String equipmentModel, String manufacturer,
+                                         String equipmentTypeId);
 
     Page<EquipmentBase> findByPage(long pageNum, long pageSize,
                                    String equipmentCode, String equipmentName,
@@ -54,4 +58,18 @@ public interface EquipmentBaseService extends IService<EquipmentBase> {
      * @return
      */
     List<EquipmentBaseOutDTO> getManholeDataList(ManholeDeviceListInDTO listInDTO);
+
+    /**
+     * 根据设备类别分组统计设备数量
+     * @param inDTO
+     * @return
+     */
+    List<EquipmentCountByTypeOutDTO> countByType(EquipmentCountByTypeInDTO inDTO);
+
+    /**
+     * 导出设备明细数据
+     * @param inDTO
+     * @return
+     */
+    List<EquipmentExportOutDTO> exportEquipmentDetail(EquipmentExportInDTO inDTO);
 }

+ 40 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceDataStatService.java

@@ -0,0 +1,40 @@
+package com.zksy.base.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.MaintenanceDataStat;
+import com.zksy.manhole.dto.in.MaintenanceDataStatQueryInDTO;
+import com.zksy.manhole.dto.in.MaintenanceDataStatTrendInDTO;
+import com.zksy.manhole.dto.out.AbnormalTerminalTrendOutDTO;
+import com.zksy.manhole.dto.out.CaseRateTrendOutDTO;
+import com.zksy.manhole.dto.out.MaintenanceDataStatOutDTO;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_data_stat(运维数据统计表)】的数据库操作Service
+* @createDate 2026-06-26 14:11:51
+*/
+public interface MaintenanceDataStatService extends IService<MaintenanceDataStat> {
+
+    /**
+     * 根据日期查询运维数据统计
+     * @param queryInDTO
+     * @return
+     */
+    MaintenanceDataStatOutDTO queryByDate(MaintenanceDataStatQueryInDTO queryInDTO);
+
+    /**
+     * 周度/月度 异常终端设备数量趋势分析
+     * @param inDTO
+     * @return
+     */
+    List<AbnormalTerminalTrendOutDTO> abnormalTerminalTrend(MaintenanceDataStatTrendInDTO inDTO);
+
+    /**
+     * 周度/月度 案件处置率、案件延期率趋势分析
+     * @param inDTO
+     * @return
+     */
+    List<CaseRateTrendOutDTO> caseRateTrend(MaintenanceDataStatTrendInDTO inDTO);
+}

+ 13 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceTaskDetailService.java

@@ -0,0 +1,13 @@
+package com.zksy.base.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.MaintenanceTaskDetail;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task_detail(运维任务明细表)】的数据库操作Service
+* @createDate 2026-06-26 14:11:51
+*/
+public interface MaintenanceTaskDetailService extends IService<MaintenanceTaskDetail> {
+
+}

+ 45 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/MaintenanceTaskService.java

@@ -0,0 +1,45 @@
+package com.zksy.base.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.MaintenanceTask;
+import com.zksy.manhole.dto.in.MaintenanceTaskDispatchInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskPageInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskProcessInDTO;
+import com.zksy.manhole.dto.out.MaintenanceTaskOutDTO;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task(运维任务主表)】的数据库操作Service
+* @createDate 2026-06-26 14:11:51
+*/
+public interface MaintenanceTaskService extends IService<MaintenanceTask> {
+
+    /**
+     * 分页查询运维任务列表
+     * @param pageInDTO
+     * @return
+     */
+    Page<MaintenanceTaskOutDTO> findByPage(MaintenanceTaskPageInDTO pageInDTO);
+
+    /**
+     * 获取运维任务详情
+     * @param taskId
+     * @return
+     */
+    MaintenanceTaskOutDTO getDetailById(Long taskId);
+
+    /**
+     * 批量下发运维任务
+     * @param inDTO
+     * @return
+     */
+    boolean batchDispatch(MaintenanceTaskDispatchInDTO inDTO);
+
+    /**
+     * 处理运维任务
+     * @param inDTO
+     * @return
+     */
+    boolean processTask(MaintenanceTaskProcessInDTO inDTO);
+}

+ 37 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/TerminalFaultService.java

@@ -0,0 +1,37 @@
+package com.zksy.base.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.TerminalFault;
+import com.zksy.manhole.dto.in.TerminalFaultHandleInDTO;
+import com.zksy.manhole.dto.in.TerminalFaultPageInDTO;
+import com.zksy.manhole.dto.out.TerminalFaultOutDTO;
+
+/**
+* @author Administrator
+* @description 针对表【terminal_fault(终端故障表)】的数据库操作Service
+* @createDate 2026-06-26 14:36:18
+*/
+public interface TerminalFaultService extends IService<TerminalFault> {
+
+    /**
+     * 分页查询终端故障列表
+     * @param pageInDTO
+     * @return
+     */
+    Page<TerminalFaultOutDTO> findByPage(TerminalFaultPageInDTO pageInDTO);
+
+    /**
+     * 获取终端故障详情
+     * @param faultId
+     * @return
+     */
+    TerminalFaultOutDTO getDetailById(Long faultId);
+
+    /**
+     * 处置终端故障
+     * @param inDTO
+     * @return
+     */
+    boolean handleFault(TerminalFaultHandleInDTO inDTO);
+}

+ 22 - 2
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/WorkOrderService.java

@@ -3,8 +3,7 @@ package com.zksy.base.service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zksy.base.domain.WorkOrder;
-import com.zksy.manhole.dto.in.WorkOrderOperInDTO;
-import com.zksy.manhole.dto.in.WorkOrderPageInDTO;
+import com.zksy.manhole.dto.in.*;
 import com.zksy.manhole.dto.out.WorkOrderOutDTO;
 
 /**
@@ -21,6 +20,27 @@ public interface WorkOrderService extends IService<WorkOrder> {
      */
     Page<WorkOrderOutDTO> findByPage(WorkOrderPageInDTO pageInDTO);
 
+    /**
+     * 新增工单
+     * @param inDTO
+     * @return
+     */
+    boolean addWorkOrder(WorkOrderAddInDTO inDTO);
+
+    /**
+     * 经办工单分页查询(处理中:待接单、已接单、处理中、待验收)
+     * @param inDTO
+     * @return
+     */
+    Page<WorkOrderOutDTO> findProcessingPage(WorkOrderProcessingInDTO inDTO);
+
+    /**
+     * 办结工单分页查询(已办结:已结案、已驳回)
+     * @param inDTO
+     * @return
+     */
+    Page<WorkOrderOutDTO> findFinishedPage(WorkOrderFinishedInDTO inDTO);
+
     /**
      * 操作工单
      * @param inDTO

+ 127 - 8
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/EquipmentBaseServiceImpl.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zksy.base.domain.*;
-import com.zksy.base.mapper.*;
 import com.zksy.base.alarm.domain.WarningThreshold;
 import com.zksy.base.alarm.mapper.WarningThresholdMapper;
 import com.zksy.base.domain.*;
@@ -18,11 +16,11 @@ import com.zksy.base.manhole.mapper.ManholeDataMapper;
 import com.zksy.base.mapper.*;
 import com.zksy.base.service.EquipmentBaseService;
 import com.zksy.common.exception.ServiceException;
+import com.zksy.manhole.dto.in.EquipmentCountByTypeInDTO;
+import com.zksy.manhole.dto.in.EquipmentExportInDTO;
 import com.zksy.manhole.dto.in.ManholeDeviceListInDTO;
 import com.zksy.manhole.dto.in.ManholeDevicePageInDTO;
-import com.zksy.manhole.dto.out.EquipmentBaseOutDTO;
-import com.zksy.manhole.dto.out.EquipmentStatusOutDTO;
-import com.zksy.manhole.dto.out.ManholeDataOutDTO;
+import com.zksy.manhole.dto.out.*;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,7 +29,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.time.LocalDateTime;
 import java.util.*;
-import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -105,7 +102,14 @@ public class EquipmentBaseServiceImpl extends ServiceImpl<EquipmentBaseMapper, E
         if (count > 0) {
             throw new ServiceException("设备编码已存在,请更换:" + entity.getEquipmentCode());
         }
-        return this.save(entity);
+        try {
+            return this.save(entity);
+        } catch (org.springframework.dao.DataIntegrityViolationException e) {
+            if (e.getMessage() != null && e.getMessage().contains("uk_equipment_code")) {
+                throw new ServiceException("设备编码已存在, 请更换: " + entity.getEquipmentCode());
+            }
+            throw e;
+        }
     }
 
     @Override
@@ -491,7 +495,8 @@ public class EquipmentBaseServiceImpl extends ServiceImpl<EquipmentBaseMapper, E
     @Override
     public Page<EquipmentFullVO> findFullByPage(long pageNum, long pageSize,
                                                 String equipmentCode, String equipmentName,
-                                                String equipmentModel, String manufacturer) {
+                                                String equipmentModel, String manufacturer,
+                                                String equipmentTypeId) {
         // 1. 分页查询设备基础信息
         Page<EquipmentBase> page = new Page<>(pageNum, pageSize);
         LambdaQueryWrapper<EquipmentBase> qw = new LambdaQueryWrapper<>();
@@ -507,6 +512,9 @@ public class EquipmentBaseServiceImpl extends ServiceImpl<EquipmentBaseMapper, E
         if (manufacturer != null && !manufacturer.isEmpty()) {
             qw.like(EquipmentBase::getManufacturer, manufacturer);
         }
+        if (equipmentTypeId != null && !equipmentTypeId.isEmpty()) {
+            qw.eq(EquipmentBase::getEquipmentTypeId, equipmentTypeId);
+        }
         qw.orderByDesc(EquipmentBase::getCreateTime);
         Page<EquipmentBase> basePage = this.page(page, qw);
         List<EquipmentBase> equipmentList = basePage.getRecords();
@@ -610,4 +618,115 @@ public class EquipmentBaseServiceImpl extends ServiceImpl<EquipmentBaseMapper, E
 
         return this.listByIds(equipmentIds);
     }
+
+    /**
+     * 根据设备类别分组统计设备数量
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public List<EquipmentCountByTypeOutDTO> countByType(EquipmentCountByTypeInDTO inDTO) {
+        log.info("根据设备类别分组统计设备数量-入参:{}", inDTO);
+        String equipmentTypeId = inDTO.getEquipmentTypeId();
+        List<EquipmentCountByTypeOutDTO> result = new ArrayList<>();
+        if(StringUtils.isEmpty(equipmentTypeId)){
+            // 设备类别ID为空:统计所有类别的设备数量
+            List<EquipmentType> allTypes = equipmentTypeMapper.selectList(null);
+            for(EquipmentType type : allTypes){
+                long count = this.count(new LambdaQueryWrapper<EquipmentBase>()
+                        .eq(EquipmentBase::getEquipmentTypeId, type.getTypeId()));
+                EquipmentCountByTypeOutDTO outDTO = new EquipmentCountByTypeOutDTO();
+                outDTO.setEquipmentTypeId(type.getTypeId());
+                outDTO.setEquipmentTypeName(type.getTypeName());
+                outDTO.setDeviceCount((int) count);
+                result.add(outDTO);
+            }
+        } else {
+            // 查询子类别
+            List<EquipmentType> childTypes = equipmentTypeMapper.selectList(
+                    new LambdaQueryWrapper<EquipmentType>()
+                            .eq(EquipmentType::getParentTypeId, equipmentTypeId));
+            if(CollUtil.isNotEmpty(childTypes)){
+                // 有子类别:按子类别分组统计
+                for(EquipmentType childType : childTypes){
+                    long count = this.count(new LambdaQueryWrapper<EquipmentBase>()
+                            .eq(EquipmentBase::getEquipmentTypeId, childType.getTypeId()));
+                    EquipmentCountByTypeOutDTO outDTO = new EquipmentCountByTypeOutDTO();
+                    outDTO.setEquipmentTypeId(childType.getTypeId());
+                    outDTO.setEquipmentTypeName(childType.getTypeName());
+                    outDTO.setDeviceCount((int) count);
+                    result.add(outDTO);
+                }
+            } else {
+                // 无子类别:直接统计该类别的设备数量
+                EquipmentType equipmentType = equipmentTypeMapper.selectById(equipmentTypeId);
+                long count = this.count(new LambdaQueryWrapper<EquipmentBase>()
+                        .eq(EquipmentBase::getEquipmentTypeId, equipmentTypeId));
+                EquipmentCountByTypeOutDTO outDTO = new EquipmentCountByTypeOutDTO();
+                outDTO.setEquipmentTypeId(equipmentTypeId);
+                outDTO.setEquipmentTypeName(equipmentType != null ? equipmentType.getTypeName() : null);
+                outDTO.setDeviceCount((int) count);
+                result.add(outDTO);
+            }
+        }
+        return result;
+    }
+
+    /**
+     * 导出设备明细数据
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public List<EquipmentExportOutDTO> exportEquipmentDetail(EquipmentExportInDTO inDTO) {
+        log.info("导出设备明细数据-入参:{}", inDTO);
+        LambdaQueryWrapper<EquipmentBase> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(StringUtils.isNotEmpty(inDTO.getEquipmentTypeId()),
+                EquipmentBase::getEquipmentTypeId, inDTO.getEquipmentTypeId())
+                .orderByDesc(EquipmentBase::getCreateTime);
+        List<EquipmentBase> equipmentList = this.list(queryWrapper);
+        if(CollUtil.isEmpty(equipmentList)){
+            return new ArrayList<>();
+        }
+        // 一次性查询所有设备类别
+        List<String> typeIds = equipmentList.stream()
+                .map(EquipmentBase::getEquipmentTypeId)
+                .filter(StringUtils::isNotEmpty)
+                .distinct()
+                .collect(Collectors.toList());
+        Map<String, String> typeNameMap = new HashMap<>();
+        if(CollUtil.isNotEmpty(typeIds)){
+            List<EquipmentType> typeList = equipmentTypeMapper.selectBatchIds(typeIds);
+            typeNameMap = typeList.stream()
+                    .collect(Collectors.toMap(EquipmentType::getTypeId, EquipmentType::getTypeName, (k1, k2) -> k1));
+        }
+        // 一次性查询所有设备状态
+        List<String> equipmentIds = equipmentList.stream()
+                .map(EquipmentBase::getEquipmentId)
+                .collect(Collectors.toList());
+        Map<String, EquipmentStatus> statusMap = new HashMap<>();
+        if(CollUtil.isNotEmpty(equipmentIds)){
+            List<EquipmentStatus> statusList = equipmentStatusMapper.selectList(
+                    new LambdaQueryWrapper<EquipmentStatus>()
+                            .in(EquipmentStatus::getEquipmentId, equipmentIds));
+            statusMap = statusList.stream()
+                    .collect(Collectors.toMap(EquipmentStatus::getEquipmentId, Function.identity(), (k1, k2) -> k1));
+        }
+        // 组装导出数据
+        List<EquipmentExportOutDTO> result = new ArrayList<>();
+        for(EquipmentBase equipment : equipmentList){
+            EquipmentExportOutDTO outDTO = new EquipmentExportOutDTO();
+            outDTO.setEquipmentCode(equipment.getEquipmentCode());
+            outDTO.setEquipmentName(equipment.getEquipmentName());
+            outDTO.setEquipmentLocation(equipment.getEquipmentLocation());
+            outDTO.setInstallTime(equipment.getInstallTime());
+            outDTO.setEquipmentTypeName(typeNameMap.get(equipment.getEquipmentTypeId()));
+            EquipmentStatus equipmentStatus = statusMap.get(equipment.getEquipmentId());
+            if(equipmentStatus != null){
+                outDTO.setCurrentStatus(equipmentStatus.getCurrentStatus());
+            }
+            result.add(outDTO);
+        }
+        return result;
+    }
 }

+ 19 - 5
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/EquipmentStatusServiceImpl.java

@@ -62,11 +62,13 @@ public class EquipmentStatusServiceImpl extends ServiceImpl<EquipmentStatusMappe
             throw new ServiceException("关联的设备不存在:" + equipmentId);
         }
 
-        //校验设备是否已存在状态记录
+        //校验设备是否已存在状态记录,如果存在则转为更新
         LambdaQueryWrapper<EquipmentStatus> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(EquipmentStatus::getEquipmentId, equipmentId);
-        if (this.count(wrapper) > 0) {
-            throw new ServiceException("该设备已存在状态记录,不可重复新增:" + equipmentId);
+        EquipmentStatus existing = this.getOne(wrapper);
+        if (existing != null) {
+            entity.setStatusId(existing.getStatusId());
+            return this.updateById(entity);
         }
 
         //校验当前状态值是否合法(1-在用,2-闲置,3-维修,4-报废,5-待入库)
@@ -163,8 +165,20 @@ public class EquipmentStatusServiceImpl extends ServiceImpl<EquipmentStatusMappe
     @Override
     public boolean updateWithCheck(EquipmentStatus entity) {
         //校验当前状态记录是否存在
-        String statusId = entity.getStatusId();
-        EquipmentStatus oldStatus = this.getById(statusId);
+        Integer statusId = entity.getStatusId();
+        EquipmentStatus oldStatus = null;
+        if (statusId != null) {
+            oldStatus = this.getById(statusId);
+        }
+        // 如果没有statusId,尝试通过equipmentId查找
+        if (oldStatus == null && entity.getEquipmentId() != null) {
+            LambdaQueryWrapper<EquipmentStatus> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(EquipmentStatus::getEquipmentId, entity.getEquipmentId());
+            oldStatus = this.getOne(wrapper);
+            if (oldStatus != null) {
+                entity.setStatusId(oldStatus.getStatusId());
+            }
+        }
         if (oldStatus == null) {
             throw new ServiceException("设备状态记录不存在:" + statusId);
         }

+ 178 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceDataStatServiceImpl.java

@@ -0,0 +1,178 @@
+package com.zksy.base.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.MaintenanceDataStat;
+import com.zksy.base.mapper.MaintenanceDataStatMapper;
+import com.zksy.base.service.MaintenanceDataStatService;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.manhole.dto.in.MaintenanceDataStatQueryInDTO;
+import com.zksy.manhole.dto.in.MaintenanceDataStatTrendInDTO;
+import com.zksy.manhole.dto.out.AbnormalTerminalTrendOutDTO;
+import com.zksy.manhole.dto.out.CaseRateTrendOutDTO;
+import com.zksy.manhole.dto.out.MaintenanceDataStatOutDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.WeekFields;
+import java.util.*;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_data_stat(运维数据统计表)】的数据库操作Service实现
+* @createDate 2026-06-26 14:11:51
+*/
+@Slf4j
+@Service
+public class MaintenanceDataStatServiceImpl extends ServiceImpl<MaintenanceDataStatMapper, MaintenanceDataStat>
+    implements MaintenanceDataStatService{
+
+    /**
+     * 根据日期查询运维数据统计
+     * @param queryInDTO
+     * @return
+     */
+    @Override
+    public MaintenanceDataStatOutDTO queryByDate(MaintenanceDataStatQueryInDTO queryInDTO) {
+        log.info("根据日期查询运维数据统计-入参:{}", queryInDTO);
+        LambdaQueryWrapper<MaintenanceDataStat> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(queryInDTO.getStatDate() != null, MaintenanceDataStat::getStatDate, queryInDTO.getStatDate())
+                .eq(queryInDTO.getDeptId() != null, MaintenanceDataStat::getDeptId, queryInDTO.getDeptId());
+        MaintenanceDataStat stat = this.getOne(queryWrapper);
+        if(stat == null){
+            return null;
+        }
+        return BeanUtil.copyProperties(stat, MaintenanceDataStatOutDTO.class);
+    }
+
+    /**
+     * 周度/月度 异常终端设备数量趋势分析
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public List<AbnormalTerminalTrendOutDTO> abnormalTerminalTrend(MaintenanceDataStatTrendInDTO inDTO) {
+        log.info("周度/月度 异常终端设备数量趋势分析-入参:{}", inDTO);
+        List<MaintenanceDataStat> statList = queryStatList(inDTO);
+        if(CollUtil.isEmpty(statList)){
+            return new ArrayList<>();
+        }
+        // 按周度/月度分组
+        Map<String, List<MaintenanceDataStat>> groupedMap = groupByPeriod(statList, inDTO.getTrendType());
+        List<AbnormalTerminalTrendOutDTO> result = new ArrayList<>();
+        for(Map.Entry<String, List<MaintenanceDataStat>> entry : groupedMap.entrySet()){
+            List<MaintenanceDataStat> periodList = entry.getValue();
+            AbnormalTerminalTrendOutDTO outDTO = new AbnormalTerminalTrendOutDTO();
+            outDTO.setTrendLabel(entry.getKey());
+            // 取该周期内第一条记录的统计日期作为代表日期
+            outDTO.setStatDate(periodList.get(0).getStatDate());
+            // 计算平均异常终端设备数量
+            double avgAbnormal = periodList.stream()
+                    .filter(s -> s.getAbnormalTerminal() != null)
+                    .mapToInt(MaintenanceDataStat::getAbnormalTerminal)
+                    .average()
+                    .orElse(0);
+            outDTO.setAbnormalTerminal((int) Math.round(avgAbnormal));
+            result.add(outDTO);
+        }
+        // 按趋势标签排序
+        result.sort(Comparator.comparing(AbnormalTerminalTrendOutDTO::getTrendLabel));
+        return result;
+    }
+
+    /**
+     * 周度/月度 案件处置率、案件延期率趋势分析
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public List<CaseRateTrendOutDTO> caseRateTrend(MaintenanceDataStatTrendInDTO inDTO) {
+        log.info("周度/月度 案件处置率/延期率趋势分析-入参:{}", inDTO);
+        List<MaintenanceDataStat> statList = queryStatList(inDTO);
+        if(CollUtil.isEmpty(statList)){
+            return new ArrayList<>();
+        }
+        // 按周度/月度分组
+        Map<String, List<MaintenanceDataStat>> groupedMap = groupByPeriod(statList, inDTO.getTrendType());
+        List<CaseRateTrendOutDTO> result = new ArrayList<>();
+        for(Map.Entry<String, List<MaintenanceDataStat>> entry : groupedMap.entrySet()){
+            List<MaintenanceDataStat> periodList = entry.getValue();
+            CaseRateTrendOutDTO outDTO = new CaseRateTrendOutDTO();
+            outDTO.setTrendLabel(entry.getKey());
+            outDTO.setStatDate(periodList.get(0).getStatDate());
+            // 计算平均案件处置率
+            double avgDisposalRate = periodList.stream()
+                    .filter(s -> s.getCaseDisposalRate() != null)
+                    .mapToDouble(s -> s.getCaseDisposalRate().doubleValue())
+                    .average()
+                    .orElse(0);
+            outDTO.setCaseDisposalRate(BigDecimal.valueOf(avgDisposalRate).setScale(2, RoundingMode.HALF_UP));
+            // 计算平均案件延期率
+            double avgDelayRate = periodList.stream()
+                    .filter(s -> s.getCaseDelayRate() != null)
+                    .mapToDouble(s -> s.getCaseDelayRate().doubleValue())
+                    .average()
+                    .orElse(0);
+            outDTO.setCaseDelayRate(BigDecimal.valueOf(avgDelayRate).setScale(2, RoundingMode.HALF_UP));
+            result.add(outDTO);
+        }
+        // 按趋势标签排序
+        result.sort(Comparator.comparing(CaseRateTrendOutDTO::getTrendLabel));
+        return result;
+    }
+
+    /**
+     * 查询统计数据列表(公共方法)
+     * @param inDTO
+     * @return
+     */
+    private List<MaintenanceDataStat> queryStatList(MaintenanceDataStatTrendInDTO inDTO) {
+        if(inDTO.getTrendType() == null){
+            throw new ServiceException("趋势类型不能为空");
+        }
+        LambdaQueryWrapper<MaintenanceDataStat> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.ge(inDTO.getStartDate() != null, MaintenanceDataStat::getStatDate, inDTO.getStartDate())
+                .le(inDTO.getEndDate() != null, MaintenanceDataStat::getStatDate, inDTO.getEndDate())
+                .eq(inDTO.getDeptId() != null, MaintenanceDataStat::getDeptId, inDTO.getDeptId())
+                .orderByAsc(MaintenanceDataStat::getStatDate);
+        return this.list(queryWrapper);
+    }
+
+    /**
+     * 按周度/月度分组
+     * @param statList
+     * @param trendType 1-周度 2-月度
+     * @return
+     */
+    private Map<String, List<MaintenanceDataStat>> groupByPeriod(List<MaintenanceDataStat> statList, Integer trendType) {
+        Map<String, List<MaintenanceDataStat>> groupedMap = new LinkedHashMap<>();
+        WeekFields weekFields = WeekFields.of(Locale.getDefault());
+        DateTimeFormatter monthFormatter = DateTimeFormatter.ofPattern("yyyy-MM");
+        for(MaintenanceDataStat stat : statList){
+            LocalDate localDate = stat.getStatDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+            String key;
+            if(trendType == 1){
+                // 周度:yyyy-Www
+                int weekYear = localDate.get(weekFields.weekBasedYear());
+                int weekNum = localDate.get(weekFields.weekOfWeekBasedYear());
+                key = String.format("%d-W%02d", weekYear, weekNum);
+            } else {
+                // 月度:yyyy-MM
+                key = localDate.format(monthFormatter);
+            }
+            groupedMap.computeIfAbsent(key, k -> new ArrayList<>()).add(stat);
+        }
+        return groupedMap;
+    }
+}
+
+
+
+

+ 24 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceTaskDetailServiceImpl.java

@@ -0,0 +1,24 @@
+package com.zksy.base.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.MaintenanceTaskDetail;
+import com.zksy.base.mapper.MaintenanceTaskDetailMapper;
+import com.zksy.base.service.MaintenanceTaskDetailService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task_detail(运维任务明细表)】的数据库操作Service实现
+* @createDate 2026-06-26 14:11:51
+*/
+@Slf4j
+@Service
+public class MaintenanceTaskDetailServiceImpl extends ServiceImpl<MaintenanceTaskDetailMapper, MaintenanceTaskDetail>
+    implements MaintenanceTaskDetailService{
+
+}
+
+
+
+

+ 180 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/MaintenanceTaskServiceImpl.java

@@ -0,0 +1,180 @@
+package com.zksy.base.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.MaintenanceTask;
+import com.zksy.base.domain.MaintenanceTaskDetail;
+import com.zksy.base.mapper.MaintenanceTaskMapper;
+import com.zksy.base.service.MaintenanceTaskDetailService;
+import com.zksy.base.service.MaintenanceTaskService;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.manhole.dto.in.MaintenanceTaskDispatchInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskPageInDTO;
+import com.zksy.manhole.dto.in.MaintenanceTaskProcessInDTO;
+import com.zksy.manhole.dto.out.MaintenanceTaskDetailOutDTO;
+import com.zksy.manhole.dto.out.MaintenanceTaskOutDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+/**
+* @author Administrator
+* @description 针对表【maintenance_task(运维任务主表)】的数据库操作Service实现
+* @createDate 2026-06-26 14:11:51
+*/
+@Slf4j
+@Service
+public class MaintenanceTaskServiceImpl extends ServiceImpl<MaintenanceTaskMapper, MaintenanceTask>
+    implements MaintenanceTaskService{
+
+    @Autowired
+    private MaintenanceTaskDetailService maintenanceTaskDetailService;
+
+    /**
+     * 分页查询运维任务列表
+     * @param pageInDTO
+     * @return
+     */
+    @Override
+    public Page<MaintenanceTaskOutDTO> findByPage(MaintenanceTaskPageInDTO pageInDTO) {
+        log.info("分页查询运维任务列表-入参:{}", pageInDTO);
+        Page<MaintenanceTask> page = new Page<>(pageInDTO.getPageNum(), pageInDTO.getPageSize());
+        LambdaQueryWrapper<MaintenanceTask> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.like(StringUtils.isNotEmpty(pageInDTO.getTaskNo()), MaintenanceTask::getTaskNo, pageInDTO.getTaskNo())
+                .eq(pageInDTO.getDeptId() != null, MaintenanceTask::getDeptId, pageInDTO.getDeptId())
+                .eq(pageInDTO.getReceiveUserId() != null, MaintenanceTask::getReceiveUserId, pageInDTO.getReceiveUserId())
+                .eq(pageInDTO.getTaskLevel() != null, MaintenanceTask::getTaskLevel, pageInDTO.getTaskLevel())
+                .eq(pageInDTO.getTaskStatus() != null, MaintenanceTask::getTaskStatus, pageInDTO.getTaskStatus())
+                .orderByDesc(MaintenanceTask::getUpdateTime);
+        Page<MaintenanceTask> rs = this.page(page, queryWrapper);
+        List<MaintenanceTaskOutDTO> outDTOList = BeanUtil.copyToList(rs.getRecords(), MaintenanceTaskOutDTO.class);
+        Page<MaintenanceTaskOutDTO> outPage = new Page<>(pageInDTO.getPageNum(), pageInDTO.getPageSize(), rs.getTotal());
+        outPage.setRecords(outDTOList);
+        return outPage;
+    }
+
+    /**
+     * 获取运维任务详情
+     * @param taskId
+     * @return
+     */
+    @Override
+    public MaintenanceTaskOutDTO getDetailById(Long taskId) {
+        log.info("获取运维任务详情-入参:{}", taskId);
+        MaintenanceTask maintenanceTask = this.getById(taskId);
+        if(maintenanceTask == null){
+            return null;
+        }
+        MaintenanceTaskOutDTO outDTO = BeanUtil.copyProperties(maintenanceTask, MaintenanceTaskOutDTO.class);
+        // 查询运维任务明细列表
+        List<MaintenanceTaskDetail> detailList = maintenanceTaskDetailService.list(new LambdaQueryWrapper<MaintenanceTaskDetail>()
+                .eq(MaintenanceTaskDetail::getTaskId, taskId)
+                .orderByAsc(MaintenanceTaskDetail::getCreateTime));
+        if(CollUtil.isNotEmpty(detailList)){
+            List<MaintenanceTaskDetailOutDTO> detailOutDTOList = BeanUtil.copyToList(detailList, MaintenanceTaskDetailOutDTO.class);
+            outDTO.setDetailList(detailOutDTOList);
+        }
+        return outDTO;
+    }
+
+    /**
+     * 批量下发运维任务(新增运维任务主表 + 明细表)
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public boolean batchDispatch(MaintenanceTaskDispatchInDTO inDTO) {
+        log.info("批量下发运维任务-入参:{}", inDTO);
+        if(inDTO.getDispatchUserId() == null){
+            throw new ServiceException("派单人ID不能为空");
+        }
+        if(inDTO.getReceiveUserId() == null){
+            throw new ServiceException("接收维护人员ID不能为空");
+        }
+        List<MaintenanceTaskDispatchInDTO.DispatchDetailInDTO> detailList = inDTO.getDetailList();
+        if(CollUtil.isEmpty(detailList)){
+            throw new ServiceException("设备报警明细列表不能为空");
+        }
+        // 新增运维任务主表
+        MaintenanceTask task = BeanUtil.copyProperties(inDTO, MaintenanceTask.class);
+        task.setTaskNo(generateTaskNo());
+        // 初始状态:2-待接收
+        task.setTaskStatus(2);
+        this.save(task);
+        // 批量新增运维任务明细表
+        List<MaintenanceTaskDetail> taskDetailList = new ArrayList<>();
+        for(MaintenanceTaskDispatchInDTO.DispatchDetailInDTO detailInDTO : detailList){
+            MaintenanceTaskDetail detail = BeanUtil.copyProperties(detailInDTO, MaintenanceTaskDetail.class);
+            detail.setTaskId(task.getTaskId());
+            // 明细初始状态:1-待处理
+            detail.setDetailStatus(1);
+            taskDetailList.add(detail);
+        }
+        return maintenanceTaskDetailService.saveBatch(taskDetailList);
+    }
+
+    /**
+     * 生成运维任务编号
+     * @return
+     */
+    public static String generateTaskNo() {
+        // 1. 获取当前时间,格式为14位年月日时分秒
+        String currentDateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
+        // 2. 生成4位随机数,不足补0
+        String randomNum = String.format("%04d", new Random().nextInt(10000));
+        // 3. 拼接完整编号:TS+年月日时分秒+随机数
+        return "TS" + currentDateTime + randomNum;
+    }
+
+    /**
+     * 处理运维任务
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public boolean processTask(MaintenanceTaskProcessInDTO inDTO) {
+        log.info("处理运维任务-入参:{}", inDTO);
+        MaintenanceTask task = this.getById(inDTO.getTaskId());
+        if(task == null){
+            throw new ServiceException("运维任务ID不存在");
+        }
+        if(inDTO.getProcessType() == null){
+            throw new ServiceException("处理类型不能为空");
+        }
+        MaintenanceTask entity = new MaintenanceTask();
+        entity.setTaskId(inDTO.getTaskId());
+        if(inDTO.getProcessType() == 1){
+            // 1-接收任务:待接收 -> 处理中
+            entity.setTaskStatus(3);
+            entity.setRealStartTime(new Date());
+        } else if(inDTO.getProcessType() == 2){
+            // 2-提交验收:处理中 -> 待验收
+            entity.setTaskStatus(4);
+        } else if(inDTO.getProcessType() == 3){
+            // 3-验收通过:待验收 -> 已完成
+            entity.setTaskStatus(5);
+            entity.setRealEndTime(new Date());
+        } else if(inDTO.getProcessType() == 4){
+            // 4-驳回:待验收 -> 已驳回
+            entity.setTaskStatus(6);
+        } else {
+            throw new ServiceException("处理类型不合法");
+        }
+        return this.updateById(entity);
+    }
+}
+
+
+
+

+ 116 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/TerminalFaultServiceImpl.java

@@ -0,0 +1,116 @@
+package com.zksy.base.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.TerminalFault;
+import com.zksy.base.mapper.TerminalFaultMapper;
+import com.zksy.base.service.TerminalFaultService;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.manhole.dto.in.TerminalFaultHandleInDTO;
+import com.zksy.manhole.dto.in.TerminalFaultPageInDTO;
+import com.zksy.manhole.dto.out.TerminalFaultOutDTO;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【terminal_fault(终端故障表)】的数据库操作Service实现
+* @createDate 2026-06-26 14:36:18
+*/
+@Slf4j
+@Service
+public class TerminalFaultServiceImpl extends ServiceImpl<TerminalFaultMapper, TerminalFault>
+    implements TerminalFaultService{
+
+    /**
+     * 分页查询终端故障列表
+     * @param pageInDTO
+     * @return
+     */
+    @Override
+    public Page<TerminalFaultOutDTO> findByPage(TerminalFaultPageInDTO pageInDTO) {
+        log.info("分页查询终端故障列表-入参:{}", pageInDTO);
+        Page<TerminalFault> page = new Page<>(pageInDTO.getPageNum(), pageInDTO.getPageSize());
+        LambdaQueryWrapper<TerminalFault> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.like(StringUtils.isNotEmpty(pageInDTO.getFaultNo()), TerminalFault::getFaultNo, pageInDTO.getFaultNo())
+                .eq(StringUtils.isNotEmpty(pageInDTO.getDeviceId()), TerminalFault::getDeviceId, pageInDTO.getDeviceId())
+                .eq(pageInDTO.getFaultLevel() != null, TerminalFault::getFaultLevel, pageInDTO.getFaultLevel())
+                .eq(pageInDTO.getFaultSource() != null, TerminalFault::getFaultSource, pageInDTO.getFaultSource())
+                .eq(pageInDTO.getFaultStatus() != null, TerminalFault::getFaultStatus, pageInDTO.getFaultStatus())
+                .ge(pageInDTO.getStartTime() != null, TerminalFault::getHappenTime, pageInDTO.getStartTime())
+                .le(pageInDTO.getEndTime() != null, TerminalFault::getHappenTime, pageInDTO.getEndTime())
+                .orderByDesc(TerminalFault::getUpdateTime);
+        Page<TerminalFault> rs = this.page(page, queryWrapper);
+        List<TerminalFaultOutDTO> outDTOList = BeanUtil.copyToList(rs.getRecords(), TerminalFaultOutDTO.class);
+        Page<TerminalFaultOutDTO> outPage = new Page<>(pageInDTO.getPageNum(), pageInDTO.getPageSize(), rs.getTotal());
+        outPage.setRecords(outDTOList);
+        return outPage;
+    }
+
+    /**
+     * 获取终端故障详情
+     * @param faultId
+     * @return
+     */
+    @Override
+    public TerminalFaultOutDTO getDetailById(Long faultId) {
+        log.info("获取终端故障详情-入参:{}", faultId);
+        TerminalFault terminalFault = this.getById(faultId);
+        if(terminalFault == null){
+            return null;
+        }
+        return BeanUtil.copyProperties(terminalFault, TerminalFaultOutDTO.class);
+    }
+
+    /**
+     * 处置终端故障
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public boolean handleFault(TerminalFaultHandleInDTO inDTO) {
+        log.info("处置终端故障-入参:{}", inDTO);
+        TerminalFault fault = this.getById(inDTO.getFaultId());
+        if(fault == null){
+            throw new ServiceException("故障ID不存在");
+        }
+        if(inDTO.getHandleType() == null){
+            throw new ServiceException("处置类型不能为空");
+        }
+        TerminalFault entity = new TerminalFault();
+        entity.setFaultId(inDTO.getFaultId());
+        entity.setHandleUserId(inDTO.getHandleUserId());
+        if(inDTO.getHandleType() == 1){
+            // 1-开始处理:未处理 -> 处理中
+            entity.setFaultStatus(2);
+        } else if(inDTO.getHandleType() == 2){
+            // 2-已修复:-> 已修复
+            entity.setFaultStatus(3);
+            entity.setHandleTime(new Date());
+            entity.setHandleResult(inDTO.getHandleResult());
+        } else if(inDTO.getHandleType() == 3){
+            // 3-已返厂:-> 已返厂
+            entity.setFaultStatus(4);
+            entity.setHandleTime(new Date());
+            entity.setHandleResult(inDTO.getHandleResult());
+        } else if(inDTO.getHandleType() == 4){
+            // 4-已报废:-> 已报废
+            entity.setFaultStatus(5);
+            entity.setHandleTime(new Date());
+            entity.setHandleResult(inDTO.getHandleResult());
+        } else {
+            throw new ServiceException("处置类型不合法");
+        }
+        return this.updateById(entity);
+    }
+}
+
+
+
+

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

@@ -4,15 +4,20 @@ import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.CaseInfo;
+import com.zksy.base.domain.EquipmentBase;
 import com.zksy.base.domain.WorkOrder;
 import com.zksy.base.domain.WorkOrderLog;
+import com.zksy.base.mapper.CaseInfoMapper;
+import com.zksy.base.mapper.EquipmentBaseMapper;
 import com.zksy.base.mapper.WorkOrderLogMapper;
 import com.zksy.base.mapper.WorkOrderMapper;
 import com.zksy.base.service.WorkOrderService;
 import com.zksy.common.core.domain.entity.SysUser;
+import com.zksy.common.core.domain.model.LoginUser;
 import com.zksy.common.exception.ServiceException;
-import com.zksy.manhole.dto.in.WorkOrderOperInDTO;
-import com.zksy.manhole.dto.in.WorkOrderPageInDTO;
+import com.zksy.common.utils.SecurityUtils;
+import com.zksy.manhole.dto.in.*;
 import com.zksy.manhole.dto.out.WorkOrderOutDTO;
 import com.zksy.system.service.ISysUserService;
 import lombok.extern.slf4j.Slf4j;
@@ -20,8 +25,12 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
+import java.util.Random;
 
 /**
 * @author Administrator
@@ -39,6 +48,12 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
     @Autowired
     private WorkOrderLogMapper workOrderLogMapper;
 
+    @Autowired
+    private CaseInfoMapper caseInfoMapper;
+
+    @Autowired
+    private EquipmentBaseMapper equipmentBaseMapper;
+
     /**
      * 分页查询工单信息列表
      * @param pageInDTO
@@ -59,6 +74,111 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
         return outPage;
     }
 
+    /**
+     * 新增工单
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public boolean addWorkOrder(WorkOrderAddInDTO inDTO) {
+        log.info("新增工单-入参:{}", inDTO);
+        WorkOrder workOrder = BeanUtil.copyProperties(inDTO, WorkOrder.class);
+        workOrder.setOrderNo(generateOrderNo());
+        // 初始状态:1-待派单
+        workOrder.setOrderStatus(1);
+        if(inDTO.getCaseId() != null){
+            CaseInfo caseInfo = caseInfoMapper.selectById(inDTO.getCaseId());
+            if(caseInfo != null){
+                workOrder.setCaseNo(caseInfo.getCaseNo());
+            }
+        }
+        if(inDTO.getDeviceId() != null){
+            EquipmentBase equipmentBase = equipmentBaseMapper.selectById(inDTO.getDeviceId());
+            if(equipmentBase != null){
+                workOrder.setDeviceCode(equipmentBase.getEquipmentCode());
+            }
+        }
+        this.save(workOrder);
+        WorkOrderLog workOrderLog = new WorkOrderLog();
+        workOrderLog.setOrderId(workOrder.getOrderId());
+        //1-创建工单
+        workOrderLog.setOperType(1);
+        workOrderLog.setOperDesc(inDTO.getOrderDesc() + ",创建工单");
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        if (loginUser != null) {
+            workOrderLog.setOperUserId(loginUser.getUserId());
+            workOrderLog.setOperUserName(loginUser.getUser().getNickName());
+        }
+        return workOrderLogMapper.insert(workOrderLog) > 0;
+    }
+
+    /**
+     * 生成工单编号
+     * @return
+     */
+    public static String generateOrderNo() {
+        // 1. 获取当前时间,格式化为14位年月日时分秒
+        String currentDateTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
+        // 2. 生成4位随机数,不足补0
+        String randomNum = String.format("%04d", new Random().nextInt(10000));
+        // 3. 拼接完整编号
+        return "WO" + currentDateTime + randomNum;
+    }
+
+    /**
+     * 经办工单分页查询(处理中:待接单、已接单、处理中、待验收)
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public Page<WorkOrderOutDTO> findProcessingPage(WorkOrderProcessingInDTO inDTO) {
+        log.info("经办工单分页查询-入参:{}", inDTO);
+        Page<WorkOrder> page = new Page<>(inDTO.getPageNum(), inDTO.getPageSize());
+        // 经办工单状态:2-待接单 3-已接单 4-处理中 5-待验收 8-延期审核
+        List<Integer> processingStatusList = Arrays.asList(2, 3, 4, 5, 8);
+        LambdaQueryWrapper<WorkOrder> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(WorkOrder::getOrderStatus, processingStatusList)
+                .like(StringUtils.isNotEmpty(inDTO.getOrderNo()), WorkOrder::getOrderNo, inDTO.getOrderNo())
+                .like(StringUtils.isNotEmpty(inDTO.getCaseNo()), WorkOrder::getCaseNo, inDTO.getCaseNo())
+                .eq(inDTO.getOrderType() != null, WorkOrder::getOrderType, inDTO.getOrderType())
+                .eq(inDTO.getOrderLevel() != null, WorkOrder::getOrderLevel, inDTO.getOrderLevel())
+                .eq(inDTO.getReceiveUser() != null, WorkOrder::getReceiveUser, inDTO.getReceiveUser())
+                .orderByDesc(WorkOrder::getUpdateTime);
+        Page<WorkOrder> rs = this.page(page, queryWrapper);
+        List<WorkOrderOutDTO> outDTOList = BeanUtil.copyToList(rs.getRecords(), WorkOrderOutDTO.class);
+        Page<WorkOrderOutDTO> outPage = new Page<>(inDTO.getPageNum(), inDTO.getPageSize(), rs.getTotal());
+        outPage.setRecords(outDTOList);
+        return outPage;
+    }
+
+    /**
+     * 办结工单分页查询(已办结:已结案、已驳回)
+     * @param inDTO
+     * @return
+     */
+    @Override
+    public Page<WorkOrderOutDTO> findFinishedPage(WorkOrderFinishedInDTO inDTO) {
+        log.info("办结工单分页查询-入参:{}", inDTO);
+        Page<WorkOrder> page = new Page<>(inDTO.getPageNum(), inDTO.getPageSize());
+        // 办结工单状态:6-已结案 7-已驳回 9-已延期
+        List<Integer> finishedStatusList = Arrays.asList(6, 7, 9);
+        LambdaQueryWrapper<WorkOrder> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.in(WorkOrder::getOrderStatus, finishedStatusList)
+                .like(StringUtils.isNotEmpty(inDTO.getOrderNo()), WorkOrder::getOrderNo, inDTO.getOrderNo())
+                .like(StringUtils.isNotEmpty(inDTO.getCaseNo()), WorkOrder::getCaseNo, inDTO.getCaseNo())
+                .eq(inDTO.getOrderType() != null, WorkOrder::getOrderType, inDTO.getOrderType())
+                .eq(inDTO.getOrderLevel() != null, WorkOrder::getOrderLevel, inDTO.getOrderLevel())
+                .eq(inDTO.getVerifyUser() != null, WorkOrder::getVerifyUser, inDTO.getVerifyUser())
+                .ge(inDTO.getStartTime() != null, WorkOrder::getRealFinishTime, inDTO.getStartTime())
+                .le(inDTO.getEndTime() != null, WorkOrder::getRealFinishTime, inDTO.getEndTime())
+                .orderByDesc(WorkOrder::getUpdateTime);
+        Page<WorkOrder> rs = this.page(page, queryWrapper);
+        List<WorkOrderOutDTO> outDTOList = BeanUtil.copyToList(rs.getRecords(), WorkOrderOutDTO.class);
+        Page<WorkOrderOutDTO> outPage = new Page<>(inDTO.getPageNum(), inDTO.getPageSize(), rs.getTotal());
+        outPage.setRecords(outDTOList);
+        return outPage;
+    }
+
     /**
      * 操作工单
      * @param inDTO

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

@@ -0,0 +1,58 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_drainage_partition")
+public class DrainagePartition {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    private String id;
+
+    @ApiModelProperty("监测点名称")
+    private String name;
+
+    @ApiModelProperty("行政区域")
+    private String district;
+
+    @ApiModelProperty("分区类型(雨水分区/污水分区)")
+    private String partitionType;
+
+    @ApiModelProperty("数据时间")
+    private String time;
+
+    @ApiModelProperty("排水量")
+    private BigDecimal drainage;
+
+    @ApiModelProperty("积水量")
+    private BigDecimal waterlogging;
+
+    @ApiModelProperty("积水等级")
+    private Integer level;
+
+    @ApiModelProperty("经度")
+    private BigDecimal longitude;
+
+    @ApiModelProperty("纬度")
+    private BigDecimal latitude;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,131 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 排水预警信息
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_drainage_warning")
+public class DrainageWarning {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键ID")
+    private String id;
+
+    @ApiModelProperty("预警编号")
+    private String warningNo;
+
+    @ApiModelProperty("关联设备ID")
+    private String equipmentId;
+
+    @ApiModelProperty("设备名称")
+    private String equipmentName;
+
+    @ApiModelProperty("预警级别(1严重,2重要,3一般)")
+    private Integer warningLevel;
+
+    @ApiModelProperty("预警类型")
+    private String warningType;
+
+    @ApiModelProperty("当前监测值")
+    private String currentValue;
+
+    @ApiModelProperty("阈值")
+    private String thresholdValue;
+
+    @ApiModelProperty("预警位置")
+    private String location;
+
+    @ApiModelProperty("经度")
+    private BigDecimal longitude;
+
+    @ApiModelProperty("纬度")
+    private BigDecimal latitude;
+
+    @ApiModelProperty("预警内容")
+    private String content;
+
+    @ApiModelProperty("预警发生时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime warningTime;
+
+    @ApiModelProperty("发布人")
+    private String publisher;
+
+    @ApiModelProperty("发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime publishTime;
+
+    @ApiModelProperty("发布范围(2相关部门,3指定人员)")
+    private Integer publishScope;
+
+    @ApiModelProperty("发布范围部门ID(publish_scope=2时存储排水单位部门ID)")
+    @TableField("scope_dept_id")
+    private Long scopeDeptId;
+
+    @ApiModelProperty("状态(0待处理,1已处理,2已完成)")
+    private Integer status;
+
+    @ApiModelProperty("处理人ID")
+    @TableField("first_approver")
+    private Long firstApprover;
+
+    @ApiModelProperty("处理人名称")
+    @TableField("first_approver_name")
+    private String firstApproverName;
+
+    @ApiModelProperty("处理时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField("first_approve_time")
+    private LocalDateTime firstApproveTime;
+
+    @ApiModelProperty("审批人ID(管理员)")
+    @TableField("final_approver")
+    private Long finalApprover;
+
+    @ApiModelProperty("审批人名称")
+    @TableField("final_approver_name")
+    private String finalApproverName;
+
+    @ApiModelProperty("审批时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @TableField("final_approve_time")
+    private LocalDateTime finalApproveTime;
+
+    @ApiModelProperty("处理时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime processTime;
+
+    @ApiModelProperty("处理人")
+    private String processor;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty("删除标志(0正常,1删除)")
+    private String delFlag;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,52 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+/**
+ * 工程设施基础数据
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_engineering_facility")
+public class EngineeringFacility {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键ID")
+    private String id;
+
+    @ApiModelProperty("监测点名称/设施名称")
+    private String name;
+
+    @ApiModelProperty("行政区域")
+    private String area;
+
+    @ApiModelProperty("设施类型(闸门/调蓄设施/泵站)")
+    private String facilityType;
+
+    @ApiModelProperty("数据时间")
+    private String time;
+
+    @ApiModelProperty("标记数量(自动计算)")
+    private Integer pointCount;
+
+    @ApiModelProperty("坐标数据JSON")
+    private String points;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,52 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+/**
+ * 排水管网基础数据
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_pipe_network_info")
+public class PipeNetworkInfo {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键ID")
+    private String id;
+
+    @ApiModelProperty("监测点名称/管网名称")
+    private String name;
+
+    @ApiModelProperty("行政区域")
+    private String area;
+
+    @ApiModelProperty("管网类型(管线/管点/排口)")
+    private String networkType;
+
+    @ApiModelProperty("数据时间")
+    private String time;
+
+    @ApiModelProperty("标记数量(自动计算)")
+    private Integer pointCount;
+
+    @ApiModelProperty("坐标数据JSON")
+    private String points;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

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

@@ -0,0 +1,21 @@
+package com.zksy.drainage.domain;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 预警发布请求(含接收人员列表)
+ */
+@Data
+@ApiModel("预警发布请求")
+public class WarningPublishRequest {
+
+    @ApiModelProperty("预警信息")
+    private DrainageWarning warning;
+
+    @ApiModelProperty("接收人员ID列表(publish_scope=3指定人员时必填)")
+    private List<Long> userIds;
+}

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

@@ -0,0 +1,48 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.time.LocalDateTime;
+
+/**
+ * 预警接收人员
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_warning_scope_user")
+@ApiModel("预警接收人员")
+public class WarningScopeUser {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键ID")
+    private String id;
+
+    @ApiModelProperty("预警ID")
+    private String warningId;
+
+    @ApiModelProperty("接收用户ID")
+    private Long userId;
+
+    @ApiModelProperty("用户名称")
+    private String userName;
+
+    @ApiModelProperty("是否已审批(0未审批,1已审批)")
+    private Integer approved;
+
+    @ApiModelProperty("审批时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime approveTime;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+}

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

@@ -0,0 +1,59 @@
+package com.zksy.drainage.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 易积水点管理
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("psgw_waterlogging_point")
+public class WaterloggingPoint {
+
+    @TableId(value = "id", type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键ID")
+    private String id;
+
+    @ApiModelProperty("监测点名称")
+    private String name;
+
+    @ApiModelProperty("行政区域")
+    private String area;
+
+    @ApiModelProperty("数据时间")
+    private String time;
+
+    @ApiModelProperty("易积水点数量(自动计算)")
+    private Integer waterloggingCount;
+
+    @ApiModelProperty("易积水点标记坐标JSON")
+    private String waterloggingPoints;
+
+    @ApiModelProperty("积水量")
+    @TableField("water_volume")
+    private BigDecimal waterVolume;
+
+    @ApiModelProperty("积水程度(0未积水,1轻度积水,2中度积水,3严重积水)")
+    @TableField("waterlogging_level")
+    private Integer waterloggingLevel;
+
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime createTime;
+
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private LocalDateTime updateTime;
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/DrainagePartitionMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.DrainagePartition;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface DrainagePartitionMapper extends BaseMapper<DrainagePartition> {
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/DrainageWarningMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.DrainageWarning;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface DrainageWarningMapper extends BaseMapper<DrainageWarning> {
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/EngineeringFacilityMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.EngineeringFacility;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface EngineeringFacilityMapper extends BaseMapper<EngineeringFacility> {
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/PipeNetworkInfoMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.PipeNetworkInfo;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface PipeNetworkInfoMapper extends BaseMapper<PipeNetworkInfo> {
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/WarningScopeUserMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.WarningScopeUser;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface WarningScopeUserMapper extends BaseMapper<WarningScopeUser> {
+}

+ 9 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/mapper/WaterloggingPointMapper.java

@@ -0,0 +1,9 @@
+package com.zksy.drainage.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.drainage.domain.WaterloggingPoint;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface WaterloggingPointMapper extends BaseMapper<WaterloggingPoint> {
+}

+ 25 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageEquipmentPointRelService.java

@@ -0,0 +1,25 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.EquipmentPointRel;
+
+import java.util.List;
+
+public interface DrainageEquipmentPointRelService extends IService<EquipmentPointRel> {
+
+    Page<EquipmentPointRel> findByPage(long pageNum, long pageSize,
+                                       String equipmentId, String pointId);
+
+    boolean saveWithCheck(EquipmentPointRel entity);
+
+    boolean saveBatchWithCheck(List<EquipmentPointRel> entityList);
+
+    boolean removeWithCheck(String id);
+
+    boolean removeBatchWithCheck(List<String> ids);
+
+    List<EquipmentPointRel> getByEquipmentId(String equipmentId);
+
+    List<EquipmentPointRel> getByPointId(String pointId);
+}

+ 23 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageEquipmentTestService.java

@@ -0,0 +1,23 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.base.domain.EquipmentTest;
+
+import java.util.List;
+
+public interface DrainageEquipmentTestService extends IService<EquipmentTest> {
+
+    Page<EquipmentTest> findByPage(long pageNum, long pageSize,
+                                   String equipmentId, String testType, String testResult);
+
+    boolean saveWithCheck(EquipmentTest entity);
+
+    boolean saveBatchWithCheck(List<EquipmentTest> entityList);
+
+    boolean updateWithCheck(EquipmentTest entity);
+
+    boolean removeWithCheck(String id);
+
+    boolean removeBatchWithCheck(List<String> ids);
+}

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

@@ -0,0 +1,39 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.drainage.domain.DrainagePartition;
+
+import java.util.List;
+
+/**
+ * 排水分区基础数据 Service接口
+ */
+public interface DrainagePartitionService extends IService<DrainagePartition> {
+
+    /**
+     * 分页查询
+     */
+    Page<DrainagePartition> findByPage(long pageNum, long pageSize,
+                                       String name, String district, String partitionType);
+
+    /**
+     * 新增(编码唯一性校验)
+     */
+    boolean saveWithCheck(DrainagePartition entity);
+
+    /**
+     * 修改(编码唯一性校验)
+     */
+    boolean updateWithCheck(DrainagePartition entity);
+
+    /**
+     * 删除(存在性校验)
+     */
+    boolean removeWithCheck(String id);
+
+    /**
+     * 批量删除
+     */
+    boolean removeBatchWithCheck(List<String> ids);
+}

+ 124 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/drainage/service/DrainageWarningService.java

@@ -0,0 +1,124 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.drainage.domain.DrainageWarning;
+import com.zksy.drainage.domain.WarningScopeUser;
+
+import java.util.List;
+
+/**
+ * 排水预警信息 Service接口
+ */
+public interface DrainageWarningService extends IService<DrainageWarning> {
+
+    /**
+     * 分页查询预警信息
+     *
+     * @param pageNum       页码
+     * @param pageSize      每页数量
+     * @param warningLevel  预警级别
+     * @param warningType   预警类型
+     * @param status        状态
+     * @param startTime     开始时间(yyyy-MM-dd HH:mm:ss)
+     * @param endTime       结束时间(yyyy-MM-dd HH:mm:ss)
+     */
+    Page<DrainageWarning> findByPage(long pageNum, long pageSize,
+                                     Integer warningLevel, String warningType,
+                                     Integer status, String startTime, String endTime);
+
+    /**
+     * 查询当前预警(status=0,不做今日时间过滤)
+     */
+    Page<DrainageWarning> findCurrentPage(long pageNum, long pageSize,
+                                          Integer warningLevel, String warningType);
+
+    /**
+     * 查询历史预警(status >= 2,已完成)
+     */
+    Page<DrainageWarning> findHistoryPage(long pageNum, long pageSize,
+                                          Integer warningLevel, String warningType,
+                                          Integer status, String startTime, String endTime);
+
+    /**
+     * 发布新预警(自动生成预警编号、设置发布时间和默认状态)
+     */
+    boolean saveWithCheck(DrainageWarning entity);
+
+    /**
+     * 修改预警
+     */
+    boolean updateWithCheck(DrainageWarning entity);
+
+    /**
+     * 更新预警状态
+     *
+     * @param id        预警ID
+     * @param status    新状态
+     * @param processor 处理人
+     */
+    boolean updateStatus(String id, Integer status, String processor);
+
+    /**
+     * 删除预警
+     */
+    boolean removeWithCheck(String id);
+
+    /**
+     * 发布预警(带接收人员列表)
+     * publish_scope=2相关部门时,scopeDeptId由warning对象携带
+     * publish_scope=3指定人员时,userIds为接收人员ID列表
+     *
+     * @param warning 预警信息
+     * @param userIds 接收人员ID列表(publish_scope=3时必填)
+     */
+    void publishWarning(DrainageWarning warning, List<Long> userIds);
+
+    /**
+     * 查询当前用户可见的预警(按用户ID和部门ID过滤,包含所有状态)
+     * - admin:看所有预警(全部状态)
+     * - 普通用户:看 publish_scope=2 且部门匹配 或 publish_scope=3 且被指定的预警(全部状态)
+     * - deptId 为 null 时,只要用户在 scope_user 表中有记录,仍能看到对应预警
+     * - 不做“今天”时间过滤,预警发布后一直可见
+     * - status 参数用于前端 Tab 筛选(全部/待处理/已处理/已完成),为 null 时返回所有状态
+     *
+     * @param pageNum  页码
+     * @param pageSize 每页数量
+     * @param userId   当前用户ID
+     * @param deptId   当前用户部门ID(可为null)
+     * @param isAdmin  是否管理员
+     * @param status   状态筛选(0待处理,1已处理,2已完成),为null时不筛选状态
+     */
+    Page<DrainageWarning> findVisibleCurrentPage(long pageNum, long pageSize,
+                                                  Long userId, Long deptId, boolean isAdmin,
+                                                  Integer warningLevel, String warningType,
+                                                  Integer status);
+
+    /**
+     * 处理(指定人员处理)
+     * 更新 status=1, first_approver, first_approver_name, first_approve_time
+     *
+     * @param warningId 预警ID
+     * @param userId    处理人ID
+     * @param userName  处理人名称
+     */
+    void firstApprove(String warningId, Long userId, String userName);
+
+    /**
+     * 审批(管理员审批)
+     * 更新 status=2, final_approver, final_approver_name, final_approve_time
+     * 完成后进入历史预警
+     *
+     * @param warningId 预警ID
+     * @param userId    审批人ID(管理员)
+     * @param userName  审批人名称
+     */
+    void finalApprove(String warningId, Long userId, String userName);
+
+    /**
+     * 获取某预警的接收人员列表
+     *
+     * @param warningId 预警ID
+     */
+    List<WarningScopeUser> findScopeUsers(String warningId);
+}

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

@@ -0,0 +1,39 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.drainage.domain.EngineeringFacility;
+
+import java.util.List;
+
+/**
+ * 工程设施基础数据 Service接口
+ */
+public interface EngineeringFacilityService extends IService<EngineeringFacility> {
+
+    /**
+     * 分页查询
+     */
+    Page<EngineeringFacility> findByPage(long pageNum, long pageSize,
+                                         String name, String area, String facilityType);
+
+    /**
+     * 新增
+     */
+    boolean saveEntity(EngineeringFacility entity);
+
+    /**
+     * 修改
+     */
+    boolean updateEntity(EngineeringFacility entity);
+
+    /**
+     * 删除
+     */
+    boolean removeEntity(String id);
+
+    /**
+     * 批量删除
+     */
+    boolean removeBatchEntity(List<String> ids);
+}

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

@@ -0,0 +1,39 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.drainage.domain.PipeNetworkInfo;
+
+import java.util.List;
+
+/**
+ * 排水管网基础数据 Service接口
+ */
+public interface PipeNetworkInfoService extends IService<PipeNetworkInfo> {
+
+    /**
+     * 分页查询
+     */
+    Page<PipeNetworkInfo> findByPage(long pageNum, long pageSize,
+                                     String name, String area, String networkType);
+
+    /**
+     * 新增
+     */
+    boolean saveEntity(PipeNetworkInfo entity);
+
+    /**
+     * 修改
+     */
+    boolean updateEntity(PipeNetworkInfo entity);
+
+    /**
+     * 删除
+     */
+    boolean removeEntity(String id);
+
+    /**
+     * 批量删除
+     */
+    boolean removeBatchEntity(List<String> ids);
+}

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

@@ -0,0 +1,38 @@
+package com.zksy.drainage.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.drainage.domain.WaterloggingPoint;
+
+import java.util.List;
+
+/**
+ * 易积水点管理 Service接口
+ */
+public interface WaterloggingPointService extends IService<WaterloggingPoint> {
+
+    /**
+     * 分页查询
+     */
+    Page<WaterloggingPoint> findByPage(long pageNum, long pageSize, String name, String area);
+
+    /**
+     * 新增
+     */
+    boolean saveWithCheck(WaterloggingPoint entity);
+
+    /**
+     * 修改
+     */
+    boolean updateWithCheck(WaterloggingPoint entity);
+
+    /**
+     * 删除
+     */
+    boolean removeWithCheck(String id);
+
+    /**
+     * 批量删除
+     */
+    boolean removeBatchWithCheck(List<String> ids);
+}

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

@@ -0,0 +1,139 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.EquipmentBase;
+import com.zksy.base.domain.EquipmentPointRel;
+import com.zksy.base.domain.MonitorPoint;
+import com.zksy.base.mapper.EquipmentBaseMapper;
+import com.zksy.base.mapper.EquipmentPointRelMapper;
+import com.zksy.base.mapper.MonitorPointMapper;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.service.DrainageEquipmentPointRelService;
+import lombok.extern.slf4j.Slf4j;
+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.time.LocalDateTime;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class DrainageEquipmentPointRelServiceImpl extends ServiceImpl<EquipmentPointRelMapper, EquipmentPointRel>
+        implements DrainageEquipmentPointRelService {
+
+    @Autowired
+    private EquipmentBaseMapper equipmentBaseMapper;
+
+    @Autowired
+    private MonitorPointMapper monitorPointMapper;
+
+    @Override
+    public Page<EquipmentPointRel> findByPage(long pageNum, long pageSize,
+                                              String equipmentId, String pointId) {
+        Page<EquipmentPointRel> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<EquipmentPointRel> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(equipmentId)) {
+            wrapper.eq(EquipmentPointRel::getEquipmentId, equipmentId);
+        }
+        if (StringUtils.isNotBlank(pointId)) {
+            wrapper.eq(EquipmentPointRel::getPointId, pointId);
+        }
+        wrapper.orderByDesc(EquipmentPointRel::getCreateTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveWithCheck(EquipmentPointRel entity) {
+        String equipmentId = entity.getEquipmentId();
+        if (StringUtils.isBlank(equipmentId)) {
+            throw new ServiceException("设备ID不能为空");
+        }
+        if (equipmentBaseMapper.selectById(equipmentId) == null) {
+            throw new ServiceException("关联的设备不存在:" + equipmentId);
+        }
+        String pointId = entity.getPointId();
+        if (StringUtils.isBlank(pointId)) {
+            throw new ServiceException("监测点ID不能为空");
+        }
+        if (monitorPointMapper.selectById(pointId) == null) {
+            throw new ServiceException("关联的监测点不存在:" + pointId);
+        }
+        // 校验是否已存在相同关联
+        LambdaQueryWrapper<EquipmentPointRel> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(EquipmentPointRel::getEquipmentId, equipmentId)
+                .eq(EquipmentPointRel::getPointId, pointId);
+        if (this.count(wrapper) > 0) {
+            throw new ServiceException("该设备与监测点的关联关系已存在");
+        }
+        entity.setCreateTime(LocalDateTime.now());
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveBatchWithCheck(List<EquipmentPointRel> entityList) {
+        Set<String> equipmentIds = entityList.stream()
+                .map(EquipmentPointRel::getEquipmentId)
+                .collect(Collectors.toSet());
+        List<String> existEqIds = equipmentBaseMapper.selectBatchIds(equipmentIds).stream()
+                .map(EquipmentBase::getEquipmentId)
+                .collect(Collectors.toList());
+        Set<String> invalidEqIds = equipmentIds.stream()
+                .filter(id -> !existEqIds.contains(id))
+                .collect(Collectors.toSet());
+        if (!invalidEqIds.isEmpty()) {
+            throw new ServiceException("存在无效的设备ID:" + invalidEqIds);
+        }
+        Set<String> pointIds = entityList.stream()
+                .map(EquipmentPointRel::getPointId)
+                .collect(Collectors.toSet());
+        List<String> existPointIds = monitorPointMapper.selectBatchIds(pointIds).stream()
+                .map(MonitorPoint::getPointId)
+                .collect(Collectors.toList());
+        Set<String> invalidPointIds = pointIds.stream()
+                .filter(id -> !existPointIds.contains(id))
+                .collect(Collectors.toSet());
+        if (!invalidPointIds.isEmpty()) {
+            throw new ServiceException("存在无效的监测点ID:" + invalidPointIds);
+        }
+        LocalDateTime now = LocalDateTime.now();
+        entityList.forEach(e -> e.setCreateTime(now));
+        return this.saveBatch(entityList);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeWithCheck(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("关联记录不存在:" + id);
+        }
+        return this.removeById(id);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchWithCheck(List<String> ids) {
+        return this.removeByIds(ids);
+    }
+
+    @Override
+    public List<EquipmentPointRel> getByEquipmentId(String equipmentId) {
+        LambdaQueryWrapper<EquipmentPointRel> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(EquipmentPointRel::getEquipmentId, equipmentId);
+        return this.list(wrapper);
+    }
+
+    @Override
+    public List<EquipmentPointRel> getByPointId(String pointId) {
+        LambdaQueryWrapper<EquipmentPointRel> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(EquipmentPointRel::getPointId, pointId);
+        return this.list(wrapper);
+    }
+}

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

@@ -0,0 +1,107 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.base.domain.EquipmentBase;
+import com.zksy.base.domain.EquipmentTest;
+import com.zksy.base.mapper.EquipmentBaseMapper;
+import com.zksy.base.mapper.EquipmentTestMapper;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.service.DrainageEquipmentTestService;
+import lombok.extern.slf4j.Slf4j;
+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.time.LocalDateTime;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class DrainageEquipmentTestServiceImpl extends ServiceImpl<EquipmentTestMapper, EquipmentTest>
+        implements DrainageEquipmentTestService {
+
+    @Autowired
+    private EquipmentBaseMapper equipmentBaseMapper;
+
+    @Override
+    public Page<EquipmentTest> findByPage(long pageNum, long pageSize,
+                                          String equipmentId, String testType, String testResult) {
+        Page<EquipmentTest> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<EquipmentTest> wrapper = new LambdaQueryWrapper<>();
+        if (StringUtils.isNotBlank(equipmentId)) {
+            wrapper.eq(EquipmentTest::getEquipmentId, equipmentId);
+        }
+        if (StringUtils.isNotBlank(testType)) {
+            wrapper.like(EquipmentTest::getTestType, testType);
+        }
+        if (StringUtils.isNotBlank(testResult)) {
+            wrapper.like(EquipmentTest::getTestResult, testResult);
+        }
+        wrapper.orderByDesc(EquipmentTest::getTestTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveWithCheck(EquipmentTest entity) {
+        String equipmentId = entity.getEquipmentId();
+        if (StringUtils.isBlank(equipmentId)) {
+            throw new ServiceException("设备ID不能为空");
+        }
+        if (equipmentBaseMapper.selectById(equipmentId) == null) {
+            throw new ServiceException("关联的设备不存在:" + equipmentId);
+        }
+        entity.setCreateTime(LocalDateTime.now());
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveBatchWithCheck(List<EquipmentTest> entityList) {
+        Set<String> equipmentIds = entityList.stream()
+                .map(EquipmentTest::getEquipmentId)
+                .collect(Collectors.toSet());
+        List<String> existIds = equipmentBaseMapper.selectBatchIds(equipmentIds).stream()
+                .map(EquipmentBase::getEquipmentId)
+                .collect(Collectors.toList());
+        Set<String> invalidIds = equipmentIds.stream()
+                .filter(id -> !existIds.contains(id))
+                .collect(Collectors.toSet());
+        if (!invalidIds.isEmpty()) {
+            throw new ServiceException("存在无效的设备ID:" + invalidIds);
+        }
+        LocalDateTime now = LocalDateTime.now();
+        entityList.forEach(e -> e.setCreateTime(now));
+        return this.saveBatch(entityList);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateWithCheck(EquipmentTest entity) {
+        String testId = entity.getTestId();
+        if (this.getById(testId) == null) {
+            throw new ServiceException("测试记录不存在:" + testId);
+        }
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeWithCheck(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("测试记录不存在:" + id);
+        }
+        return this.removeById(id);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchWithCheck(List<String> ids) {
+        return this.removeByIds(ids);
+    }
+}

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

@@ -0,0 +1,104 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.domain.DrainagePartition;
+import com.zksy.drainage.mapper.DrainagePartitionMapper;
+import com.zksy.drainage.service.DrainagePartitionService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 排水分区基础数据 ServiceImpl
+ */
+@Slf4j
+@Service
+public class DrainagePartitionServiceImpl extends ServiceImpl<DrainagePartitionMapper, DrainagePartition>
+        implements DrainagePartitionService {
+
+    @Override
+    public Page<DrainagePartition> findByPage(long pageNum, long pageSize,
+                                              String name, String district, String partitionType) {
+        Page<DrainagePartition> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DrainagePartition> wrapper = new LambdaQueryWrapper<>();
+        if (name != null && !name.isEmpty()) {
+            wrapper.like(DrainagePartition::getName, name);
+        }
+        if (district != null && !district.isEmpty()) {
+            wrapper.like(DrainagePartition::getDistrict, district);
+        }
+        if (partitionType != null && !partitionType.isEmpty()) {
+            wrapper.eq(DrainagePartition::getPartitionType, partitionType);
+        }
+        wrapper.orderByDesc(DrainagePartition::getCreateTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveWithCheck(DrainagePartition entity) {
+        LambdaQueryWrapper<DrainagePartition> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(DrainagePartition::getName, entity.getName());
+        if (this.count(wrapper) > 0) {
+            throw new ServiceException("监测点名称已存在:" + entity.getName());
+        }
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateWithCheck(DrainagePartition entity) {
+        String id = entity.getId();
+        if (this.getById(id) == null) {
+            throw new ServiceException("排水分区不存在,无法修改:" + id);
+        }
+        String newName = entity.getName();
+        if (newName != null && !newName.isEmpty()) {
+            LambdaQueryWrapper<DrainagePartition> wrapper = new LambdaQueryWrapper<>();
+            wrapper.eq(DrainagePartition::getName, newName)
+                    .ne(DrainagePartition::getId, id);
+            if (this.count(wrapper) > 0) {
+                throw new ServiceException("监测点名称已被使用:" + newName);
+            }
+        }
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeWithCheck(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("排水分区不存在:" + id);
+        }
+        return this.baseMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchWithCheck(List<String> ids) {
+        if (CollectionUtils.isEmpty(ids)) {
+            throw new ServiceException("批量删除失败:ID列表不能为空");
+        }
+        List<DrainagePartition> existing = this.listByIds(ids);
+        if (existing.isEmpty()) {
+            throw new ServiceException("批量删除失败:所有ID均不存在");
+        }
+        List<String> existIds = existing.stream()
+                .map(DrainagePartition::getId)
+                .collect(Collectors.toList());
+        List<String> invalidIds = ids.stream()
+                .filter(id -> !existIds.contains(id))
+                .collect(Collectors.toList());
+        if (!invalidIds.isEmpty()) {
+            log.warn("批量删除中存在无效排水分区ID:{}", invalidIds);
+        }
+        return this.removeByIds(existIds);
+    }
+}

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

@@ -0,0 +1,321 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.domain.DrainageWarning;
+import com.zksy.drainage.domain.WarningScopeUser;
+import com.zksy.drainage.mapper.DrainageWarningMapper;
+import com.zksy.drainage.mapper.WarningScopeUserMapper;
+import com.zksy.drainage.service.DrainageWarningService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 排水预警信息 ServiceImpl
+ */
+@Slf4j
+@Service
+public class DrainageWarningServiceImpl extends ServiceImpl<DrainageWarningMapper, DrainageWarning>
+        implements DrainageWarningService {
+
+    private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+    private static final DateTimeFormatter WARNING_NO_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
+
+    @Autowired
+    private WarningScopeUserMapper warningScopeUserMapper;
+
+    @Override
+    public Page<DrainageWarning> findByPage(long pageNum, long pageSize,
+                                            Integer warningLevel, String warningType,
+                                            Integer status, String startTime, String endTime) {
+        Page<DrainageWarning> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DrainageWarning> wrapper = buildQueryWrapper(warningLevel, warningType, status, startTime, endTime);
+        wrapper.orderByDesc(DrainageWarning::getWarningTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    public Page<DrainageWarning> findCurrentPage(long pageNum, long pageSize,
+                                                  Integer warningLevel, String warningType) {
+        Page<DrainageWarning> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DrainageWarning> wrapper = new LambdaQueryWrapper<>();
+        // 当前预警:status=0,不做"今天"时间过滤,预警发布后一直可见直到被处理完成
+        wrapper.eq(DrainageWarning::getStatus, 0);
+        // 附加筛选条件
+        if (warningLevel != null) {
+            wrapper.eq(DrainageWarning::getWarningLevel, warningLevel);
+        }
+        if (warningType != null && !warningType.isEmpty()) {
+            wrapper.eq(DrainageWarning::getWarningType, warningType);
+        }
+        wrapper.orderByDesc(DrainageWarning::getWarningTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    public Page<DrainageWarning> findHistoryPage(long pageNum, long pageSize,
+                                                  Integer warningLevel, String warningType,
+                                                  Integer status, String startTime, String endTime) {
+        Page<DrainageWarning> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DrainageWarning> wrapper = new LambdaQueryWrapper<>();
+        // 历史预警:status >= 2(已完成)
+        wrapper.ge(DrainageWarning::getStatus, 2);
+        // 附加筛选条件
+        if (warningLevel != null) {
+            wrapper.eq(DrainageWarning::getWarningLevel, warningLevel);
+        }
+        if (warningType != null && !warningType.isEmpty()) {
+            wrapper.eq(DrainageWarning::getWarningType, warningType);
+        }
+        if (status != null) {
+            wrapper.eq(DrainageWarning::getStatus, status);
+        }
+        if (startTime != null && !startTime.isEmpty()) {
+            wrapper.ge(DrainageWarning::getWarningTime, LocalDateTime.parse(startTime, DATE_TIME_FORMATTER));
+        }
+        if (endTime != null && !endTime.isEmpty()) {
+            wrapper.le(DrainageWarning::getWarningTime, LocalDateTime.parse(endTime, DATE_TIME_FORMATTER));
+        }
+        wrapper.orderByDesc(DrainageWarning::getWarningTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveWithCheck(DrainageWarning entity) {
+        // 自动生成预警编号:WRN + 时间戳
+        if (entity.getWarningNo() == null || entity.getWarningNo().isEmpty()) {
+            entity.setWarningNo("WRN" + LocalDateTime.now().format(WARNING_NO_FORMATTER));
+        }
+        // 设置发布时间为当前时间
+        entity.setPublishTime(LocalDateTime.now());
+        // 默认状态为0(当前预警)
+        if (entity.getStatus() == null) {
+            entity.setStatus(0);
+        }
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateWithCheck(DrainageWarning entity) {
+        String id = entity.getId();
+        if (this.getById(id) == null) {
+            throw new ServiceException("预警信息不存在,无法修改:" + id);
+        }
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateStatus(String id, Integer status, String processor) {
+        DrainageWarning existing = this.getById(id);
+        if (existing == null) {
+            throw new ServiceException("预警信息不存在:" + id);
+        }
+        DrainageWarning update = new DrainageWarning();
+        update.setId(id);
+        update.setStatus(status);
+        update.setProcessor(processor);
+        update.setProcessTime(LocalDateTime.now());
+        return this.updateById(update);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeWithCheck(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("预警信息不存在:" + id);
+        }
+        return this.removeById(id);
+    }
+
+    @Override
+    @Transactional
+    public void publishWarning(DrainageWarning warning, List<Long> userIds) {
+        // 自动生成预警编号
+        if (warning.getWarningNo() == null || warning.getWarningNo().isEmpty()) {
+            warning.setWarningNo("WRN" + LocalDateTime.now().format(WARNING_NO_FORMATTER));
+        }
+        warning.setPublishTime(LocalDateTime.now());
+        // 默认状态为0(待处理)
+        warning.setStatus(0);
+        this.save(warning);
+
+        // publish_scope=3 指定人员:保存接收人员记录
+        if (warning.getPublishScope() != null && warning.getPublishScope() == 3
+                && userIds != null && !userIds.isEmpty()) {
+            for (Long uid : userIds) {
+                WarningScopeUser scopeUser = new WarningScopeUser();
+                scopeUser.setWarningId(warning.getId());
+                scopeUser.setUserId(uid);
+                scopeUser.setApproved(0);
+                warningScopeUserMapper.insert(scopeUser);
+            }
+        }
+    }
+
+    @Override
+    public Page<DrainageWarning> findVisibleCurrentPage(long pageNum, long pageSize,
+                                                         Long userId, Long deptId, boolean isAdmin,
+                                                         Integer warningLevel, String warningType,
+                                                         Integer status) {
+        Page<DrainageWarning> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<DrainageWarning> wrapper = new LambdaQueryWrapper<>();
+
+        // 可见性逻辑(谁能看哪些预警的规则不变),不限制 status
+        if (isAdmin) {
+            // 管理员:看所有预警(全部状态)
+        } else if (userId != null) {
+            // 普通用户:看分配给自己的预警(全部状态)
+
+            // Step 1: 查询该用户在 scope_user 表中被指定的所有 warning_id
+            List<String> scopeWarningIds = warningScopeUserMapper.selectList(
+                    new LambdaQueryWrapper<WarningScopeUser>()
+                            .eq(WarningScopeUser::getUserId, userId))
+                    .stream()
+                    .map(WarningScopeUser::getWarningId)
+                    .collect(Collectors.toList());
+
+            log.info("[预警可见性] userId={}, deptId={}, scopeWarningIds={}", userId, deptId, scopeWarningIds);
+
+            // Step 2: 构建可见性 OR 条件
+            //   条件A: publish_scope=3 AND id IN (用户被指定的warningIds)
+            //   条件B: publish_scope=2 AND scope_dept_id=用户部门ID(仅当deptId不为null时)
+            //   如果warningIds非空但deptId为空,仍只用条件A即可查出结果
+            boolean hasUserScope = !scopeWarningIds.isEmpty();
+            boolean hasDeptScope = deptId != null;
+
+            if (hasUserScope && hasDeptScope) {
+                // 两个条件都有,用 OR 连接
+                wrapper.and(w -> w
+                        .and(inner -> inner
+                                .eq(DrainageWarning::getPublishScope, 3)
+                                .in(DrainageWarning::getId, scopeWarningIds))
+                        .or(inner -> inner
+                                .eq(DrainageWarning::getPublishScope, 2)
+                                .eq(DrainageWarning::getScopeDeptId, deptId)));
+            } else if (hasUserScope) {
+                // 只有指定人员条件(deptId为空时仍能看到分配给自己的预警)
+                wrapper.and(w -> w
+                        .eq(DrainageWarning::getPublishScope, 3)
+                        .in(DrainageWarning::getId, scopeWarningIds));
+            } else if (hasDeptScope) {
+                // 只有部门条件
+                wrapper.and(w -> w
+                        .eq(DrainageWarning::getPublishScope, 2)
+                        .eq(DrainageWarning::getScopeDeptId, deptId));
+            } else {
+                // 两个条件都不满足(用户不在任何scope_user中且无部门),查不到数据
+                wrapper.eq(DrainageWarning::getId, "IMPOSSIBLE_ID");
+            }
+        } else {
+            // 未指定用户信息:不限制状态,返回所有预警
+        }
+
+        // 状态筛选(前端 Tab 切换传入,为 null 时不筛选,返回所有状态)
+        if (status != null) {
+            wrapper.eq(DrainageWarning::getStatus, status);
+        }
+
+        // 附加筛选条件
+        if (warningLevel != null) {
+            wrapper.eq(DrainageWarning::getWarningLevel, warningLevel);
+        }
+        if (warningType != null && !warningType.isEmpty()) {
+            wrapper.eq(DrainageWarning::getWarningType, warningType);
+        }
+
+        wrapper.orderByDesc(DrainageWarning::getWarningTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public void firstApprove(String warningId, Long userId, String userName) {
+        DrainageWarning existing = this.getById(warningId);
+        if (existing == null) {
+            throw new ServiceException("预警信息不存在:" + warningId);
+        }
+        if (existing.getStatus() == null || existing.getStatus() != 0) {
+            throw new ServiceException("预警状态非待处理,无法处理");
+        }
+
+        DrainageWarning update = new DrainageWarning();
+        update.setId(warningId);
+        update.setStatus(1);
+        update.setFirstApprover(userId);
+        update.setFirstApproverName(userName);
+        update.setFirstApproveTime(LocalDateTime.now());
+        this.updateById(update);
+
+        // 更新scope user的审批状态
+        WarningScopeUser scopeUpdate = new WarningScopeUser();
+        scopeUpdate.setApproved(1);
+        scopeUpdate.setApproveTime(LocalDateTime.now());
+        warningScopeUserMapper.update(scopeUpdate,
+                new LambdaQueryWrapper<WarningScopeUser>()
+                        .eq(WarningScopeUser::getWarningId, warningId)
+                        .eq(WarningScopeUser::getUserId, userId));
+    }
+
+    @Override
+    @Transactional
+    public void finalApprove(String warningId, Long userId, String userName) {
+        DrainageWarning existing = this.getById(warningId);
+        if (existing == null) {
+            throw new ServiceException("预警信息不存在:" + warningId);
+        }
+        if (existing.getStatus() == null || existing.getStatus() != 1) {
+            throw new ServiceException("预警状态非已处理,无法审批");
+        }
+
+        DrainageWarning update = new DrainageWarning();
+        update.setId(warningId);
+        update.setStatus(2);
+        update.setFinalApprover(userId);
+        update.setFinalApproverName(userName);
+        update.setFinalApproveTime(LocalDateTime.now());
+        this.updateById(update);
+    }
+
+    @Override
+    public List<WarningScopeUser> findScopeUsers(String warningId) {
+        return warningScopeUserMapper.selectList(
+                new LambdaQueryWrapper<WarningScopeUser>()
+                        .eq(WarningScopeUser::getWarningId, warningId));
+    }
+
+    /**
+     * 构建通用查询条件
+     */
+    private LambdaQueryWrapper<DrainageWarning> buildQueryWrapper(Integer warningLevel, String warningType,
+                                                                   Integer status, String startTime, String endTime) {
+        LambdaQueryWrapper<DrainageWarning> wrapper = new LambdaQueryWrapper<>();
+        if (warningLevel != null) {
+            wrapper.eq(DrainageWarning::getWarningLevel, warningLevel);
+        }
+        if (warningType != null && !warningType.isEmpty()) {
+            wrapper.eq(DrainageWarning::getWarningType, warningType);
+        }
+        if (status != null) {
+            wrapper.eq(DrainageWarning::getStatus, status);
+        }
+        if (startTime != null && !startTime.isEmpty()) {
+            wrapper.ge(DrainageWarning::getWarningTime, LocalDateTime.parse(startTime, DATE_TIME_FORMATTER));
+        }
+        if (endTime != null && !endTime.isEmpty()) {
+            wrapper.le(DrainageWarning::getWarningTime, LocalDateTime.parse(endTime, DATE_TIME_FORMATTER));
+        }
+        return wrapper;
+    }
+}

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

@@ -0,0 +1,94 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.domain.EngineeringFacility;
+import com.zksy.drainage.mapper.EngineeringFacilityMapper;
+import com.zksy.drainage.service.EngineeringFacilityService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 工程设施基础数据 ServiceImpl
+ */
+@Slf4j
+@Service
+public class EngineeringFacilityServiceImpl extends ServiceImpl<EngineeringFacilityMapper, EngineeringFacility>
+        implements EngineeringFacilityService {
+
+    @Override
+    public Page<EngineeringFacility> findByPage(long pageNum, long pageSize,
+                                                String name, String area, String facilityType) {
+        Page<EngineeringFacility> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<EngineeringFacility> wrapper = new LambdaQueryWrapper<>();
+        if (name != null && !name.isEmpty()) {
+            wrapper.like(EngineeringFacility::getName, name);
+        }
+        if (area != null && !area.isEmpty()) {
+            wrapper.like(EngineeringFacility::getArea, area);
+        }
+        if (facilityType != null && !facilityType.isEmpty()) {
+            wrapper.eq(EngineeringFacility::getFacilityType, facilityType);
+        }
+        wrapper.orderByDesc(EngineeringFacility::getCreateTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveEntity(EngineeringFacility entity) {
+        entity.setCreateTime(LocalDateTime.now());
+        entity.setUpdateTime(LocalDateTime.now());
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateEntity(EngineeringFacility entity) {
+        String id = entity.getId();
+        if (this.getById(id) == null) {
+            throw new ServiceException("工程设施不存在,无法修改:" + id);
+        }
+        entity.setUpdateTime(LocalDateTime.now());
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeEntity(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("工程设施不存在:" + id);
+        }
+        return this.baseMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchEntity(List<String> ids) {
+        if (CollectionUtils.isEmpty(ids)) {
+            throw new ServiceException("批量删除失败:ID列表不能为空");
+        }
+        List<EngineeringFacility> existing = this.listByIds(ids);
+        if (existing.isEmpty()) {
+            throw new ServiceException("批量删除失败:所有ID均不存在");
+        }
+        List<String> existIds = existing.stream()
+                .map(EngineeringFacility::getId)
+                .collect(Collectors.toList());
+        List<String> invalidIds = ids.stream()
+                .filter(id -> !existIds.contains(id))
+                .collect(Collectors.toList());
+        if (!invalidIds.isEmpty()) {
+            log.warn("批量删除中存在无效工程设施ID:{}", invalidIds);
+        }
+        return this.removeByIds(existIds);
+    }
+}

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

@@ -0,0 +1,94 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.domain.PipeNetworkInfo;
+import com.zksy.drainage.mapper.PipeNetworkInfoMapper;
+import com.zksy.drainage.service.PipeNetworkInfoService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 排水管网基础数据 ServiceImpl
+ */
+@Slf4j
+@Service
+public class PipeNetworkInfoServiceImpl extends ServiceImpl<PipeNetworkInfoMapper, PipeNetworkInfo>
+        implements PipeNetworkInfoService {
+
+    @Override
+    public Page<PipeNetworkInfo> findByPage(long pageNum, long pageSize,
+                                            String name, String area, String networkType) {
+        Page<PipeNetworkInfo> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<PipeNetworkInfo> wrapper = new LambdaQueryWrapper<>();
+        if (name != null && !name.isEmpty()) {
+            wrapper.like(PipeNetworkInfo::getName, name);
+        }
+        if (area != null && !area.isEmpty()) {
+            wrapper.like(PipeNetworkInfo::getArea, area);
+        }
+        if (networkType != null && !networkType.isEmpty()) {
+            wrapper.eq(PipeNetworkInfo::getNetworkType, networkType);
+        }
+        wrapper.orderByDesc(PipeNetworkInfo::getCreateTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveEntity(PipeNetworkInfo entity) {
+        entity.setCreateTime(LocalDateTime.now());
+        entity.setUpdateTime(LocalDateTime.now());
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateEntity(PipeNetworkInfo entity) {
+        String id = entity.getId();
+        if (this.getById(id) == null) {
+            throw new ServiceException("排水管网不存在,无法修改:" + id);
+        }
+        entity.setUpdateTime(LocalDateTime.now());
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeEntity(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("排水管网不存在:" + id);
+        }
+        return this.baseMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchEntity(List<String> ids) {
+        if (CollectionUtils.isEmpty(ids)) {
+            throw new ServiceException("批量删除失败:ID列表不能为空");
+        }
+        List<PipeNetworkInfo> existing = this.listByIds(ids);
+        if (existing.isEmpty()) {
+            throw new ServiceException("批量删除失败:所有ID均不存在");
+        }
+        List<String> existIds = existing.stream()
+                .map(PipeNetworkInfo::getId)
+                .collect(Collectors.toList());
+        List<String> invalidIds = ids.stream()
+                .filter(id -> !existIds.contains(id))
+                .collect(Collectors.toList());
+        if (!invalidIds.isEmpty()) {
+            log.warn("批量删除中存在无效排水管网ID:{}", invalidIds);
+        }
+        return this.removeByIds(existIds);
+    }
+}

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

@@ -0,0 +1,80 @@
+package com.zksy.drainage.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.common.exception.ServiceException;
+import com.zksy.drainage.domain.WaterloggingPoint;
+import com.zksy.drainage.mapper.WaterloggingPointMapper;
+import com.zksy.drainage.service.WaterloggingPointService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 易积水点管理 ServiceImpl
+ */
+@Slf4j
+@Service
+public class WaterloggingPointServiceImpl extends ServiceImpl<WaterloggingPointMapper, WaterloggingPoint>
+        implements WaterloggingPointService {
+
+    @Override
+    public Page<WaterloggingPoint> findByPage(long pageNum, long pageSize, String name, String area) {
+        Page<WaterloggingPoint> page = new Page<>(pageNum, pageSize);
+        LambdaQueryWrapper<WaterloggingPoint> wrapper = new LambdaQueryWrapper<>();
+        if (name != null && !name.isEmpty()) {
+            wrapper.like(WaterloggingPoint::getName, name);
+        }
+        if (area != null && !area.isEmpty()) {
+            wrapper.like(WaterloggingPoint::getArea, area);
+        }
+        wrapper.orderByDesc(WaterloggingPoint::getCreateTime);
+        return this.page(page, wrapper);
+    }
+
+    @Override
+    @Transactional
+    public boolean saveWithCheck(WaterloggingPoint entity) {
+        return this.save(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean updateWithCheck(WaterloggingPoint entity) {
+        String id = entity.getId();
+        if (this.getById(id) == null) {
+            throw new ServiceException("易积水点不存在,无法修改:" + id);
+        }
+        return this.updateById(entity);
+    }
+
+    @Override
+    @Transactional
+    public boolean removeWithCheck(String id) {
+        if (this.getById(id) == null) {
+            throw new ServiceException("易积水点不存在:" + id);
+        }
+        return this.baseMapper.deleteById(id) > 0;
+    }
+
+    @Override
+    @Transactional
+    public boolean removeBatchWithCheck(List<String> ids) {
+        if (CollectionUtils.isEmpty(ids)) {
+            throw new ServiceException("批量删除失败:ID列表不能为空");
+        }
+        List<WaterloggingPoint> existing = this.listByIds(ids);
+        if (existing.isEmpty()) {
+            throw new ServiceException("批量删除失败:所有ID均不存在");
+        }
+        List<String> existIds = existing.stream()
+                .map(WaterloggingPoint::getId)
+                .collect(Collectors.toList());
+        return this.removeByIds(existIds);
+    }
+}

+ 21 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/EquipmentCountByTypeInDTO.java

@@ -0,0 +1,21 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 根据设备类别分组统计设备数量-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "根据设备类别分组统计设备数量-入参", description = "根据设备类别分组统计设备数量-入参")
+public class EquipmentCountByTypeInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "设备类别ID(为空时统计所有类别的设备数量)")
+    private String equipmentTypeId;
+}

+ 21 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/EquipmentExportInDTO.java

@@ -0,0 +1,21 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 导出设备明细数据-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "导出设备明细数据-入参", description = "导出设备明细数据-入参")
+public class EquipmentExportInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "设备类别ID(为空时导出所有设备)")
+    private String equipmentTypeId;
+}

+ 27 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceDataStatQueryInDTO.java

@@ -0,0 +1,27 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 根据日期查询运维数据统计-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "根据日期查询运维数据统计-入参", description = "根据日期查询运维数据统计-入参")
+public class MaintenanceDataStatQueryInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "统计日期", required = true)
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date statDate;
+
+    @ApiModelProperty(value = "运维部门ID")
+    private Long deptId;
+}

+ 34 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceDataStatTrendInDTO.java

@@ -0,0 +1,34 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 周度/月度趋势分析-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "周度/月度趋势分析-入参", description = "周度/月度趋势分析-入参")
+public class MaintenanceDataStatTrendInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "趋势类型:1-周度 2-月度", required = true)
+    private Integer trendType;
+
+    @ApiModelProperty(value = "统计开始日期", required = true)
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date startDate;
+
+    @ApiModelProperty(value = "统计结束日期", required = true)
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date endDate;
+
+    @ApiModelProperty(value = "运维部门ID")
+    private Long deptId;
+}

+ 68 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskDispatchInDTO.java

@@ -0,0 +1,68 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 批量下发运维任务-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "批量下发运维任务-入参", description = "批量下发运维任务-入参")
+public class MaintenanceTaskDispatchInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "运维部门ID", required = true)
+    private Long deptId;
+
+    @ApiModelProperty(value = "派单人ID", required = true)
+    private Long dispatchUserId;
+
+    @ApiModelProperty(value = "接收维护人员ID", required = true)
+    private Long receiveUserId;
+
+    @ApiModelProperty(value = "任务详细描述", required = true)
+    private String taskDesc;
+
+    @ApiModelProperty(value = "任务优先级:1-严重 2-一般", required = true)
+    private Integer taskLevel;
+
+    @ApiModelProperty(value = "计划开始时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date planStartTime;
+
+    @ApiModelProperty(value = "计划结束时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date planEndTime;
+
+    @ApiModelProperty(value = "设备报警明细列表", required = true)
+    private List<DispatchDetailInDTO> detailList;
+
+    /**
+     * 设备报警明细-入参
+     */
+    @Data
+    @ApiModel(value = "设备报警明细-入参", description = "设备报警明细-入参")
+    public static class DispatchDetailInDTO implements Serializable {
+        private static final long serialVersionUID = 1L;
+
+        @ApiModelProperty(value = "设备ID", required = true)
+        private String deviceId;
+
+        @ApiModelProperty(value = "设备编码")
+        private String deviceCode;
+
+        @ApiModelProperty(value = "关联报警ID")
+        private String alarmId;
+
+        @ApiModelProperty(value = "报警描述")
+        private String alarmDesc;
+    }
+}

+ 39 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskPageInDTO.java

@@ -0,0 +1,39 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 分页查询运维任务列表-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "分页查询运维任务列表-入参", description = "分页查询运维任务列表-入参")
+public class MaintenanceTaskPageInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "任务编号")
+    private String taskNo;
+
+    @ApiModelProperty(value = "运维部门ID")
+    private Long deptId;
+
+    @ApiModelProperty(value = "接收维护人员ID")
+    private Long receiveUserId;
+
+    @ApiModelProperty(value = "任务优先级:1-严重 2-一般")
+    private Integer taskLevel;
+
+    @ApiModelProperty(value = "任务状态:1-待下发 2-待接收 3-处理中 4-待验收 5-已完成 6-已驳回 7-已延期")
+    private Integer taskStatus;
+
+    @ApiModelProperty(value = "当前记录起始索引", required = true)
+    private Long pageNum;
+
+    @ApiModelProperty(value = "每页显示记录数", required = true)
+    private Long pageSize;
+}

+ 30 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/MaintenanceTaskProcessInDTO.java

@@ -0,0 +1,30 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 处理运维任务-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "处理运维任务-入参", description = "处理运维任务-入参")
+public class MaintenanceTaskProcessInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "运维任务ID", required = true)
+    private Long taskId;
+
+    @ApiModelProperty(value = "处理类型:1-接收任务 2-提交验收 3-验收通过 4-驳回", required = true)
+    private Integer processType;
+
+    @ApiModelProperty(value = "处理描述", required = true)
+    private String processDesc;
+
+    @ApiModelProperty(value = "操作人ID", required = true)
+    private Long operUserId;
+}

+ 30 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/TerminalFaultHandleInDTO.java

@@ -0,0 +1,30 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 处置终端故障-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "处置终端故障-入参", description = "处置终端故障-入参")
+public class TerminalFaultHandleInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "故障ID", required = true)
+    private Long faultId;
+
+    @ApiModelProperty(value = "处置类型:1-开始处理 2-已修复 3-已返厂 4-已报废", required = true)
+    private Integer handleType;
+
+    @ApiModelProperty(value = "处理结果描述")
+    private String handleResult;
+
+    @ApiModelProperty(value = "处理人ID", required = true)
+    private Long handleUserId;
+}

+ 49 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/TerminalFaultPageInDTO.java

@@ -0,0 +1,49 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 分页查询终端故障列表-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "分页查询终端故障列表-入参", description = "分页查询终端故障列表-入参")
+public class TerminalFaultPageInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "故障编号")
+    private String faultNo;
+
+    @ApiModelProperty(value = "关联终端设备ID")
+    private String deviceId;
+
+    @ApiModelProperty(value = "故障等级:1-严重 2-一般")
+    private Integer faultLevel;
+
+    @ApiModelProperty(value = "故障来源:1-设备报警 2-人工上报 3-巡检发现")
+    private Integer faultSource;
+
+    @ApiModelProperty(value = "故障状态:1-未处理 2-处理中 3-已修复 4-已返厂 5-已报废")
+    private Integer faultStatus;
+
+    @ApiModelProperty(value = "故障发生开始时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    @ApiModelProperty(value = "故障发生结束时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    @ApiModelProperty(value = "当前记录起始索引", required = true)
+    private Long pageNum;
+
+    @ApiModelProperty(value = "每页显示记录数", required = true)
+    private Long pageSize;
+}

+ 45 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderAddInDTO.java

@@ -0,0 +1,45 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 新增工单-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "新增工单-入参", description = "新增工单-入参")
+public class WorkOrderAddInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "报警ID")
+    private String alarmId;
+
+    @ApiModelProperty(value = "案件ID")
+    private Long caseId;
+
+    @ApiModelProperty(value = "设备ID", required = true)
+    private String deviceId;
+
+    @ApiModelProperty(value = "工单类型:1-故障维修 2-日常巡检 3-设备保养", required = true)
+    private Integer orderType;
+
+    @ApiModelProperty(value = "工单优先级:1-紧急 2-一般 3-低", required = true)
+    private Integer orderLevel;
+
+    @ApiModelProperty(value = "工单问题描述", required = true)
+    private String orderDesc;
+
+    @ApiModelProperty(value = "负责部门ID")
+    private Long deptId;
+
+    @ApiModelProperty(value = "计划完成时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date planFinishTime;
+}

+ 49 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderFinishedInDTO.java

@@ -0,0 +1,49 @@
+package com.zksy.manhole.dto.in;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 办结工单(已办结)分页查询-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "办结工单-入参", description = "办结工单分页查询-入参")
+public class WorkOrderFinishedInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "工单编号")
+    private String orderNo;
+
+    @ApiModelProperty(value = "案件编号")
+    private String caseNo;
+
+    @ApiModelProperty(value = "工单类型:1-故障维修 2-日常巡检 3-设备保养")
+    private Integer orderType;
+
+    @ApiModelProperty(value = "工单优先级:1-紧急 2-一般 3-低")
+    private Integer orderLevel;
+
+    @ApiModelProperty(value = "验收人ID")
+    private Long verifyUser;
+
+    @ApiModelProperty(value = "办结开始时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    @ApiModelProperty(value = "办结结束时间")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    @ApiModelProperty(value = "当前记录起始索引", required = true)
+    private Long pageNum;
+
+    @ApiModelProperty(value = "每页显示记录数", required = true)
+    private Long pageSize;
+}

+ 39 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/in/WorkOrderProcessingInDTO.java

@@ -0,0 +1,39 @@
+package com.zksy.manhole.dto.in;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 经办工单(处理中)分页查询-入参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "经办工单-入参", description = "经办工单分页查询-入参")
+public class WorkOrderProcessingInDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "工单编号")
+    private String orderNo;
+
+    @ApiModelProperty(value = "案件编号")
+    private String caseNo;
+
+    @ApiModelProperty(value = "工单类型:1-故障维修 2-日常巡检 3-设备保养")
+    private Integer orderType;
+
+    @ApiModelProperty(value = "工单优先级:1-紧急 2-一般 3-低")
+    private Integer orderLevel;
+
+    @ApiModelProperty(value = "接单运维人员ID")
+    private Long receiveUser;
+
+    @ApiModelProperty(value = "当前记录起始索引", required = true)
+    private Long pageNum;
+
+    @ApiModelProperty(value = "每页显示记录数", required = true)
+    private Long pageSize;
+}

+ 30 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/AbnormalTerminalTrendOutDTO.java

@@ -0,0 +1,30 @@
+package com.zksy.manhole.dto.out;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 异常终端设备数量趋势分析-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "异常终端设备数量趋势分析-出参", description = "异常终端设备数量趋势分析-出参")
+public class AbnormalTerminalTrendOutDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "趋势标签(如 2026-W26 或 2026-06)")
+    private String trendLabel;
+
+    @ApiModelProperty(value = "统计日期")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date statDate;
+
+    @ApiModelProperty(value = "异常终端设备数量(平均值)")
+    private Integer abnormalTerminal;
+}

+ 34 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/CaseRateTrendOutDTO.java

@@ -0,0 +1,34 @@
+package com.zksy.manhole.dto.out;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 案件处置率/延期率趋势分析-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "案件处置率/延期率趋势分析-出参", description = "案件处置率/延期率趋势分析-出参")
+public class CaseRateTrendOutDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "趋势标签(如 2026-W26 或 2026-06)")
+    private String trendLabel;
+
+    @ApiModelProperty(value = "统计日期")
+    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date statDate;
+
+    @ApiModelProperty(value = "案件处置率(%)")
+    private BigDecimal caseDisposalRate;
+
+    @ApiModelProperty(value = "案件延期率(%)")
+    private BigDecimal caseDelayRate;
+}

+ 27 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/EquipmentCountByTypeOutDTO.java

@@ -0,0 +1,27 @@
+package com.zksy.manhole.dto.out;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 根据设备类别分组统计设备数量-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "根据设备类别分组统计设备数量-出参", description = "根据设备类别分组统计设备数量-出参")
+public class EquipmentCountByTypeOutDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "设备类别ID")
+    private String equipmentTypeId;
+
+    @ApiModelProperty(value = "设备类别名称")
+    private String equipmentTypeName;
+
+    @ApiModelProperty(value = "设备数量")
+    private Integer deviceCount;
+}

+ 37 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/EquipmentExportOutDTO.java

@@ -0,0 +1,37 @@
+package com.zksy.manhole.dto.out;
+
+import com.zksy.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 导出设备明细数据-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "导出设备明细数据-出参", description = "导出设备明细数据-出参")
+public class EquipmentExportOutDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name = "设备编码")
+    private String equipmentCode;
+
+    @Excel(name = "设备名称")
+    private String equipmentName;
+
+    @Excel(name = "设备类别")
+    private String equipmentTypeName;
+
+    @Excel(name = "设备位置描述")
+    private String equipmentLocation;
+
+    @Excel(name = "设备当前状态", readConverterExp = "1=在用,2=闲置,3=维修,4=报废,5=待入库")
+    private Integer currentStatus;
+
+    @Excel(name = "安装时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime installTime;
+}

+ 18 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceDataStatOutDTO.java

@@ -0,0 +1,18 @@
+package com.zksy.manhole.dto.out;
+
+import com.zksy.base.domain.MaintenanceDataStat;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 运维数据统计-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "运维数据统计-出参", description = "运维数据统计-出参")
+public class MaintenanceDataStatOutDTO extends MaintenanceDataStat implements Serializable {
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceTaskDetailOutDTO.java

@@ -0,0 +1,18 @@
+package com.zksy.manhole.dto.out;
+
+import com.zksy.base.domain.MaintenanceTaskDetail;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 运维任务明细-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "运维任务明细-出参", description = "运维任务明细-出参")
+public class MaintenanceTaskDetailOutDTO extends MaintenanceTaskDetail implements Serializable {
+    private static final long serialVersionUID = 1L;
+}

+ 23 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/MaintenanceTaskOutDTO.java

@@ -0,0 +1,23 @@
+package com.zksy.manhole.dto.out;
+
+import com.zksy.base.domain.MaintenanceTask;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 运维任务详情-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "运维任务详情-出参", description = "运维任务详情-出参")
+public class MaintenanceTaskOutDTO extends MaintenanceTask implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "运维任务明细列表")
+    private List<MaintenanceTaskDetailOutDTO> detailList;
+}

+ 18 - 0
pipe-network-service/zksy-system/src/main/java/com/zksy/manhole/dto/out/TerminalFaultOutDTO.java

@@ -0,0 +1,18 @@
+package com.zksy.manhole.dto.out;
+
+import com.zksy.base.domain.TerminalFault;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 终端故障详情-出参
+ *
+ * @author xianggx
+ */
+@Data
+@ApiModel(value = "终端故障详情-出参", description = "终端故障详情-出参")
+public class TerminalFaultOutDTO extends TerminalFault implements Serializable {
+    private static final long serialVersionUID = 1L;
+}

+ 26 - 0
pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceDataStatMapper.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.base.mapper.MaintenanceDataStatMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.base.domain.MaintenanceDataStat">
+            <id property="statId" column="stat_id" jdbcType="BIGINT"/>
+            <result property="statDate" column="stat_date" jdbcType="DATE"/>
+            <result property="deptId" column="dept_id" jdbcType="BIGINT"/>
+            <result property="totalTerminal" column="total_terminal" jdbcType="INTEGER"/>
+            <result property="abnormalTerminal" column="abnormal_terminal" jdbcType="INTEGER"/>
+            <result property="totalCase" column="total_case" jdbcType="INTEGER"/>
+            <result property="caseDisposalRate" column="case_disposal_rate" jdbcType="DECIMAL"/>
+            <result property="caseDelayRate" column="case_delay_rate" jdbcType="DECIMAL"/>
+            <result property="avgDisposalTime" column="avg_disposal_time" jdbcType="DECIMAL"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        stat_id,stat_date,dept_id,
+        total_terminal,abnormal_terminal,total_case,
+        case_disposal_rate,case_delay_rate,avg_disposal_time,
+        create_time
+    </sql>
+</mapper>

+ 24 - 0
pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceTaskDetailMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.base.mapper.MaintenanceTaskDetailMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.base.domain.MaintenanceTaskDetail">
+            <id property="detailId" column="detail_id" jdbcType="BIGINT"/>
+            <result property="taskId" column="task_id" jdbcType="BIGINT"/>
+            <result property="deviceId" column="device_id" jdbcType="VARCHAR"/>
+            <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
+            <result property="alarmId" column="alarm_id" jdbcType="VARCHAR"/>
+            <result property="alarmDesc" column="alarm_desc" jdbcType="VARCHAR"/>
+            <result property="detailStatus" column="detail_status" jdbcType="TINYINT"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        detail_id,task_id,device_id,
+        device_code,alarm_id,alarm_desc,
+        detail_status,create_time,update_time
+    </sql>
+</mapper>

+ 31 - 0
pipe-network-service/zksy-system/src/main/resources/mapper/MaintenanceTaskMapper.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.base.mapper.MaintenanceTaskMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.base.domain.MaintenanceTask">
+            <id property="taskId" column="task_id" jdbcType="BIGINT"/>
+            <result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
+            <result property="deptId" column="dept_id" jdbcType="BIGINT"/>
+            <result property="dispatchUserId" column="dispatch_user_id" jdbcType="BIGINT"/>
+            <result property="receiveUserId" column="receive_user_id" jdbcType="BIGINT"/>
+            <result property="taskDesc" column="task_desc" jdbcType="VARCHAR"/>
+            <result property="taskLevel" column="task_level" jdbcType="TINYINT"/>
+            <result property="taskStatus" column="task_status" jdbcType="TINYINT"/>
+            <result property="planStartTime" column="plan_start_time" jdbcType="TIMESTAMP"/>
+            <result property="planEndTime" column="plan_end_time" jdbcType="TIMESTAMP"/>
+            <result property="realStartTime" column="real_start_time" jdbcType="TIMESTAMP"/>
+            <result property="realEndTime" column="real_end_time" jdbcType="TIMESTAMP"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        task_id,task_no,dept_id,
+        dispatch_user_id,receive_user_id,task_desc,
+        task_level,task_status,plan_start_time,
+        plan_end_time,real_start_time,real_end_time,
+        create_time,update_time
+    </sql>
+</mapper>

+ 32 - 0
pipe-network-service/zksy-system/src/main/resources/mapper/TerminalFaultMapper.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.base.mapper.TerminalFaultMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.base.domain.TerminalFault">
+            <id property="faultId" column="fault_id" jdbcType="BIGINT"/>
+            <result property="faultNo" column="fault_no" jdbcType="VARCHAR"/>
+            <result property="deviceId" column="device_id" jdbcType="VARCHAR"/>
+            <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
+            <result property="alarmId" column="alarm_id" jdbcType="VARCHAR"/>
+            <result property="faultLevel" column="fault_level" jdbcType="TINYINT"/>
+            <result property="faultDesc" column="fault_desc" jdbcType="VARCHAR"/>
+            <result property="faultSource" column="fault_source" jdbcType="TINYINT"/>
+            <result property="faultStatus" column="fault_status" jdbcType="TINYINT"/>
+            <result property="happenTime" column="happen_time" jdbcType="TIMESTAMP"/>
+            <result property="handleUserId" column="handle_user_id" jdbcType="BIGINT"/>
+            <result property="handleTime" column="handle_time" jdbcType="TIMESTAMP"/>
+            <result property="handleResult" column="handle_result" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        fault_id,fault_no,device_id,
+        device_code,alarm_id,fault_level,
+        fault_desc,fault_source,fault_status,
+        happen_time,handle_user_id,handle_time,
+        handle_result,create_time,update_time
+    </sql>
+</mapper>