|
@@ -115,7 +115,7 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
} else {
|
|
|
queryWrapper.lambda().orderByAsc(MonitorDevice::getSortCode);
|
|
|
}
|
|
|
- queryWrapper.lambda().eq(MonitorDevice::getCreateOrg,loginUser.getOrgId()).eq(MonitorDevice::getDeleteFlag,CommonDeleteFlagEnum.NOT_DELETE);
|
|
|
+ queryWrapper.lambda().eq(MonitorDevice::getCreateOrg, loginUser.getOrgId()).eq(MonitorDevice::getDeleteFlag, CommonDeleteFlagEnum.NOT_DELETE);
|
|
|
Page<MonitorDevice> page = this.page(CommonPageRequest.defaultPage(), queryWrapper);
|
|
|
if (page.getTotal() < 1) {
|
|
|
return page;
|
|
@@ -180,7 +180,7 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
renKeService.callParamIds(Integer.parseInt(monitorDevice.getDeviceCode()));
|
|
|
} catch (NumberFormatException e) {
|
|
|
// 如果设备编码不能解析为整数,抛出异常或记录日志
|
|
|
- throw new CommonException("设备编码解析失败,无法发送配置参数。设备编码: " + monitorDevice.getDeviceCode(), e + "请输入整数编码");
|
|
|
+ throw new CommonException("设备编码解析失败,无法发送配置参数。设备编码: " + monitorDevice.getDeviceCode(), e + "请输入整数编码");
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
@@ -330,8 +330,8 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
|
|
|
//查询设备列表
|
|
|
LambdaQueryWrapper<MonitorDevice> deviceQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
- deviceQueryWrapper.in(MonitorDevice::getModelName,modelNameList);
|
|
|
- deviceQueryWrapper.eq(MonitorDevice::getCreateOrg,loginUser.getOrgId()).eq(MonitorDevice::getDeleteFlag, CommonDeleteFlagEnum.NOT_DELETE);
|
|
|
+ deviceQueryWrapper.in(MonitorDevice::getModelName, modelNameList);
|
|
|
+ deviceQueryWrapper.eq(MonitorDevice::getCreateOrg, loginUser.getOrgId()).eq(MonitorDevice::getDeleteFlag, CommonDeleteFlagEnum.NOT_DELETE);
|
|
|
if (!isAll) {
|
|
|
deviceQueryWrapper.eq(MonitorDevice::getStatus, MonitorDeviceStatusEnum.NORMAL.getValue())
|
|
|
.orderByAsc(MonitorDevice::getSortCode);
|
|
@@ -384,7 +384,7 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
|
|
|
@Override
|
|
|
public CountEntity getIndexCount() {
|
|
|
- TargetStatus targetCount = monitorTargetService.getTargetCount(null,null);
|
|
|
+ TargetStatus targetCount = monitorTargetService.getTargetCount(null, null);
|
|
|
CountEntity countEntity = new CountEntity();
|
|
|
countEntity.setDeviceCount((int) targetCount.getTotal());
|
|
|
// LambdaQueryWrapper<MonitorDevice> onlineDeviceQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -469,7 +469,7 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
for (MonitorDeviceTemplate monitorDeviceTemplate : monitorDeviceTemplateList) {
|
|
|
MonitorDeviceType monitorDeviceType = monitorDeviceTypeService.getByModelName(monitorDeviceTemplate.getModelName());
|
|
|
if (StrUtil.isBlank(monitorDeviceTemplate.getDeviceName()) && StrUtil.isBlank(monitorDeviceTemplate.getModelName())
|
|
|
- && StrUtil.isBlank(monitorDeviceTemplate.getDeviceCode())) {
|
|
|
+ && StrUtil.isBlank(monitorDeviceTemplate.getDeviceCode())) {
|
|
|
throw new CommonException("设备:*" + monitorDeviceTemplate.getDeviceName() + "*包含未填的必填项");
|
|
|
}
|
|
|
// 判断上下限输入是否合法
|
|
@@ -519,4 +519,13 @@ public class MonitorDeviceServiceImpl extends ServiceImpl<MonitorDeviceMapper, M
|
|
|
.collect(Collectors.toSet()); // 收集到 Set 中去重
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<MonitorDevice> getMonitorDeviceByPowerCode(String powerCode) {
|
|
|
+ SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
|
|
|
+ LambdaQueryWrapper<MonitorDevice> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.eq(MonitorDevice::getDeviceCode, powerCode).eq(MonitorDevice::getCreateOrg, loginUser.getOrgId())
|
|
|
+ .eq(MonitorDevice::getDeleteFlag, CommonDeleteFlagEnum.NOT_DELETE);
|
|
|
+ return List.of();
|
|
|
+ }
|
|
|
+
|
|
|
}
|