|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.dromara.sample.manage.service.impl; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
@ -220,21 +221,24 @@ public class DeviceServiceImpl implements IDeviceService { |
|
|
|
} |
|
|
|
}) |
|
|
|
.eq(StringUtils.hasText(param.getWorkspaceId()), |
|
|
|
DeviceEntity::getWorkspaceId, param.getWorkspaceId()) |
|
|
|
DeviceEntity::getWorkspaceId, param.getWorkspaceId()) |
|
|
|
.eq(param.getBoundStatus() != null, DeviceEntity::getBoundStatus, param.getBoundStatus()) |
|
|
|
.in(ObjectUtil.isAllNotEmpty(param.getProIds()), |
|
|
|
DeviceEntity::getDeviceSn, param.getProIds()) |
|
|
|
.orderBy(param.isOrderBy(), |
|
|
|
param.isAsc(), DeviceEntity::getId)) |
|
|
|
param.isAsc(), DeviceEntity::getId)) |
|
|
|
.stream() |
|
|
|
.map(this::deviceEntityConvertToDTO) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<DeviceDTO> getDevicesTopoForWeb(String workspaceId,String nickname) { |
|
|
|
public List<DeviceDTO> getDevicesTopoForWeb(String workspaceId,String nickname,List<Integer> proIds) { |
|
|
|
List<DeviceDTO> devicesList = this.getDevicesByParams( |
|
|
|
DeviceQueryParam.builder() |
|
|
|
.workspaceId(workspaceId) |
|
|
|
.domains(List.of(DeviceDomainEnum.REMOTER_CONTROL.getDomain(), DeviceDomainEnum.DOCK.getDomain())) |
|
|
|
.proIds(proIds) |
|
|
|
.build()); |
|
|
|
|
|
|
|
devicesList.stream() |
|
|
@ -494,13 +498,14 @@ public class DeviceServiceImpl implements IDeviceService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PaginationData<DeviceDTO> getBoundDevicesWithDomain(String workspaceId, Long page, |
|
|
|
Long pageSize, Integer domain,String nickname) { |
|
|
|
Long pageSize, Integer domain,String nickname,List<Integer> proIds) { |
|
|
|
|
|
|
|
Page<DeviceEntity> pagination = mapper.selectPage(new Page<>(page, pageSize), |
|
|
|
new LambdaQueryWrapper<DeviceEntity>() |
|
|
|
.eq(DeviceEntity::getDomain, domain) |
|
|
|
.eq(DeviceEntity::getWorkspaceId, workspaceId) |
|
|
|
.eq(DeviceEntity::getBoundStatus, true) |
|
|
|
.in(ObjectUtil.isAllNotEmpty(proIds),DeviceEntity::getProId, proIds) |
|
|
|
.eq(org.dromara.common.core.utils.StringUtils.isNotEmpty(nickname),DeviceEntity::getNickname,nickname)); |
|
|
|
List<DeviceDTO> devicesList = pagination.getRecords().stream().map(this::deviceEntityConvertToDTO) |
|
|
|
.peek(device -> { |
|
|
|