From 33a5fcfa483875836230eae3d4d62a9397e5f649 Mon Sep 17 00:00:00 2001
From: zhaowenyu <35589726@qq.com>
Date: Sat, 18 Oct 2025 10:50:02 +0800
Subject: [PATCH] 2025-10-18 zwy 更新PaginationData获取已绑定的设备信息接口,增加对部门deptId的查询条件,参数可不传,返回所有数据
---
ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java | 5 +++--
ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java | 2 +-
ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java b/ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java
index bbf187e..e11e1e5 100644
--- a/ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java
+++ b/ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java
@@ -132,8 +132,9 @@
public ResponseResult<PaginationData<DeviceDTO>> getBoundDevicesWithDomain(Integer domain,
@RequestParam(defaultValue = "1") Long page,
@RequestParam(value = "page_size",
- defaultValue = "50") Long pageSize) {
- PaginationData<DeviceDTO> devices = deviceService.getBoundDevicesWithDomain(page, pageSize, domain);
+ defaultValue = "50") Long pageSize,
+ @RequestParam(required = false) Long deptId) {
+ PaginationData<DeviceDTO> devices = deviceService.getBoundDevicesWithDomain(page, pageSize, domain, deptId);
return ResponseResult.success(devices);
}
diff --git a/ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java b/ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java
index 81d3812..dd5f82a 100644
--- a/ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java
+++ b/ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java
@@ -178,7 +178,7 @@
* @param domain
* @return
*/
- PaginationData<DeviceDTO> getBoundDevicesWithDomain(Long page, Long pageSize, Integer domain);
+ PaginationData<DeviceDTO> getBoundDevicesWithDomain(Long page, Long pageSize, Integer domain, Long deptId);
/**
* Unbind device base on device's sn.
diff --git a/ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java b/ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java
index 955316b..cd29c0f 100644
--- a/ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java
+++ b/ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java
@@ -818,11 +818,12 @@
*/
@Override
public PaginationData<DeviceDTO> getBoundDevicesWithDomain(Long page,
- Long pageSize, Integer domain) {
+ Long pageSize, Integer domain, Long deptId) {
Page<DeviceEntity> pagination = mapper.selectPage(new Page<>(page, pageSize),
new LambdaQueryWrapper<DeviceEntity>()
.eq(DeviceEntity::getDomain, domain)
+ .eq(deptId != null, DeviceEntity::getDeptId, deptId)
.isNotNull(DeviceEntity::getDeptId));
// .eq(DeviceEntity::getBoundStatus, true));
List<DeviceDTO> devicesList = pagination.getRecords().stream().map(this::deviceEntityConvertToDTO)
--
Gitblit v1.9.3