修改, 查看监控的监控树数据, 只查询开启状态的摄像头
This commit is contained in:
parent
366851d11c
commit
eb4f2559a3
@ -118,7 +118,7 @@ public class CameraDeviceController {
|
||||
List<FactoryInfoDO> factoryInfo = factoryInfoService.getFactoryList(factoryId, name);
|
||||
List<Long> factoryIds = convertList(factoryInfo, FactoryInfoDO::getId);
|
||||
// 获取监控设备信息
|
||||
List<CameraDeviceDO> cameraDeviceDOS = cameraDeviceService.getListCameraList(factoryIds);
|
||||
List<CameraDeviceDO> cameraDeviceDOS = cameraDeviceService.getListCameraByStatus(factoryIds);
|
||||
Map<Long, List<CameraDeviceDO>> cameraMap = cameraDeviceDOS.stream().collect(Collectors.groupingBy(CameraDeviceDO::getFactoryId));
|
||||
|
||||
if (!CollUtil.isEmpty(factoryInfo)) {
|
||||
|
@ -1,11 +1,14 @@
|
||||
package cn.iocoder.yudao.module.smartfactory.dal.mysql.device.cameradevice;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.device.cameradevice.vo.CameraDevicePageReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.device.cameradevice.CameraDeviceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.device.cameradevice.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备-监控摄像头 Mapper
|
||||
@ -26,4 +29,9 @@ public interface CameraDeviceMapper extends BaseMapperX<CameraDeviceDO> {
|
||||
.orderByAsc(CameraDeviceDO::getSort));
|
||||
}
|
||||
|
||||
default List<CameraDeviceDO> selectListCameraByStatus(List<Long> factoryIds) {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDeviceDO>()
|
||||
.inIfPresent(CameraDeviceDO::getFactoryId, factoryIds)
|
||||
.eq(CameraDeviceDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
|
||||
}
|
||||
}
|
@ -66,7 +66,7 @@ public interface CameraDeviceService {
|
||||
* @param factoryIds 工厂编号
|
||||
* @return 监控摄像头列表
|
||||
*/
|
||||
List<CameraDeviceDO> getListCameraList(List<Long> factoryIds);
|
||||
List<CameraDeviceDO> getListCameraByStatus(List<Long> factoryIds);
|
||||
|
||||
/**
|
||||
* 更新监控设备状态
|
||||
|
@ -77,9 +77,9 @@ public class CameraDeviceServiceImpl implements CameraDeviceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CameraDeviceDO> getListCameraList(List<Long> factoryIds) {
|
||||
public List<CameraDeviceDO> getListCameraByStatus(List<Long> factoryIds) {
|
||||
|
||||
return cameraDeviceMapper.selectList(CameraDeviceDO::getFactoryId, factoryIds);
|
||||
return cameraDeviceMapper.selectListCameraByStatus(factoryIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user