|
@@ -659,12 +659,36 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
return R.ok(Collections.emptyList());
|
|
|
}
|
|
|
List<DeviceInfoDto.MercHomeListVO> dataList = new ArrayList<>(list.size());
|
|
|
+ Integer busyStatus = dto.getBusyStatus();
|
|
|
+ Integer onlineStatus = dto.getOnlineStatus();
|
|
|
+ Integer deviceType = dto.getDeviceType();
|
|
|
+ //条件查询 在线状态,运营状态,设备类型,
|
|
|
+ List<Long> deviceIdList = new ArrayList<>();
|
|
|
+ if (onlineStatus != null) {
|
|
|
+ List<DeviceStatus> deviceStatusList = deviceStatusService.list(Wrappers.<DeviceStatus>lambdaQuery()
|
|
|
+ .eq(onlineStatus != null, DeviceStatus::getNetState, onlineStatus)
|
|
|
+ );
|
|
|
+ if (CollUtil.isNotEmpty(deviceStatusList)) {
|
|
|
+ deviceIdList = deviceStatusList.stream().map(DeviceStatus::getDeviceId).collect(Collectors.toList());
|
|
|
+ if (deviceId != null && !deviceIdList.contains(deviceId)) {
|
|
|
+ deviceIdList.add(deviceId);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (deviceId != null) {
|
|
|
+ deviceIdList.add(deviceId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
LambdaQueryWrapper<DeviceInfo> lqw = new LambdaQueryWrapper<>();
|
|
|
//非质检商户才需要激活
|
|
|
lqw.eq(!isQa, DeviceInfo::getActiveState, DeviceActiveStateEnum.TRUE.getCode());
|
|
|
lqw.eq(mercId != null, DeviceInfo::getMercId, mercId);
|
|
|
- lqw.eq(deviceId != null, DeviceInfo::getDeviceId, deviceId);
|
|
|
+ lqw.eq(busyStatus != null, DeviceInfo::getBusyState, busyStatus);
|
|
|
+ lqw.eq(deviceType != null, DeviceInfo::getDeviceType, deviceType);
|
|
|
+ lqw.eq(deviceId != null && CollUtil.isEmpty(deviceIdList), DeviceInfo::getDeviceId, deviceId);
|
|
|
+ lqw.in(deviceId != null && CollUtil.isNotEmpty(deviceIdList), DeviceInfo::getDeviceId, deviceIdList);
|
|
|
+ lqw.in(deviceId == null && CollUtil.isNotEmpty(deviceIdList), DeviceInfo::getDeviceId, deviceIdList);
|
|
|
lqw.like(StrUtil.isNotEmpty(deviceName), DeviceInfo::getDeviceName, deviceName).orderByAsc(true, DeviceInfo::getDeviceName, DeviceInfo::getDeviceId);
|
|
|
List<DeviceInfo> deviceInfoList = this.list(lqw);
|
|
|
//未分配线路的设置默认值
|