Просмотр исходного кода

fix(system): 修正维护电话类型和异常设备分页边界

- 将设备维护领域模型及 VO 的联系电话改为字符串,支持前导零和特殊字符
- 为供水设备服务的异常设备分页增加参数及越界校验,避免截取异常
- 在 .gitignore 中忽略供水线路对齐 SQL 脚本
Kazerin 1 неделя назад
Родитель
Сommit
ae043b3294

+ 1 - 0
.gitignore

@@ -51,3 +51,4 @@ logs/
 /docs/superpowers/plans/2026-08-13-water-supply-statistics-gis.md
 /docs/superpowers/specs/2026-08-13-water-supply-statistics-gis-design.md
 /pipe-network-service/sql/water_supply_menu.sql
+/pipe-network-service/sql/water_supply_route_alignment.sql

+ 1 - 1
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/EquipmentMaintain.java

@@ -48,7 +48,7 @@ public class EquipmentMaintain {
     /**
      * 维护人联系方式
      */
-    private Integer maintainPersonPhone;
+    private String maintainPersonPhone;
 
     /**
      * 维护日期

+ 1 - 1
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/vo/EquipmentMaintainDataVO.java

@@ -35,7 +35,7 @@ public class EquipmentMaintainDataVO {
     private String maintainPerson;
 
     @ApiModelProperty("维护人联系方式")
-    private Integer maintainPersonPhone;
+    private String maintainPersonPhone;
 
     @ApiModelProperty("维护日期")
     private Date maintainDate;

+ 1 - 1
pipe-network-service/zksy-system/src/main/java/com/zksy/base/domain/vo/MaintainOrderVO.java

@@ -30,7 +30,7 @@ public class MaintainOrderVO {
     private String maintainPerson;
 
     @ApiModelProperty("维护人电话")
-    private Integer maintainPersonPhone;
+    private String maintainPersonPhone;
 
     @ApiModelProperty("维护费用")
     private Double maintainCost;

+ 7 - 1
pipe-network-service/zksy-system/src/main/java/com/zksy/base/service/impl/WaterSupplyDeviceServiceImpl.java

@@ -375,7 +375,13 @@ public class WaterSupplyDeviceServiceImpl extends ServiceImpl<EquipmentBaseMappe
         }
 
         int total = allDevices.size();
-        int fromIndex = (int) ((pageNum - 1) * pageSize);
+        long offset = (pageNum - 1) * pageSize;
+        if (pageNum < 1 || pageSize < 1 || offset >= total) {
+            Page<AbnormalDeviceVO> emptyPage = new Page<>(pageNum, pageSize, total);
+            emptyPage.setRecords(new ArrayList<>());
+            return emptyPage;
+        }
+        int fromIndex = (int) offset;
         int toIndex = Math.min(fromIndex + (int) pageSize, total);
         List<EquipmentBase> pageDevices = allDevices.subList(fromIndex, toIndex);