2025-10-18 zwy 更新PaginationData获取已绑定的设备信息接口,增加对部门deptId的查询条件,参数可不传,返回所有数据
3 files modified
10 ■■■■■ changed files
ard-admin/src/main/java/com/ard/web/controller/sample/DeviceController.java 5 ●●●●● patch | view | raw | blame | history
ard-sample/src/main/java/com/ard/sample/manage/service/IDeviceService.java 2 ●●●●● patch | view | raw | blame | history
ard-sample/src/main/java/com/ard/sample/manage/service/impl/DeviceServiceImpl.java 3 ●●●●● patch | view | raw | blame | history
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);
    }
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.
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)