|
@@ -654,31 +654,32 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
} else {
|
|
|
dto.setActiveState("1");
|
|
|
}
|
|
|
- List<DeviceInfoDto.MercHomeCountVO> list = this.baseMapper.merHomeCountList(dto);
|
|
|
- if (CollUtil.isEmpty(list)) {
|
|
|
- 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 (deviceId != null) {
|
|
|
+ deviceIdList.add(deviceId);
|
|
|
+ }
|
|
|
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);
|
|
|
- }
|
|
|
+ List<Long> dbDeviceIdList = deviceStatusList.stream().map(DeviceStatus::getDeviceId).collect(Collectors.toList());
|
|
|
+ deviceIdList.addAll(dbDeviceIdList);
|
|
|
}
|
|
|
}
|
|
|
+ dto.setDeviceIdList(deviceIdList);
|
|
|
+
|
|
|
+ List<DeviceInfoDto.MercHomeCountVO> list = this.baseMapper.merHomeCountList(dto);
|
|
|
+ if (CollUtil.isEmpty(list)) {
|
|
|
+ return R.ok(Collections.emptyList());
|
|
|
+ }
|
|
|
+ List<DeviceInfoDto.MercHomeListVO> dataList = new ArrayList<>(list.size());
|
|
|
|
|
|
LambdaQueryWrapper<DeviceInfo> lqw = new LambdaQueryWrapper<>();
|
|
|
//非质检商户才需要激活
|
|
@@ -686,9 +687,7 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
|
|
|
lqw.eq(mercId != null, DeviceInfo::getMercId, mercId);
|
|
|
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.in(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);
|
|
|
//未分配线路的设置默认值
|