修改 微信小程序监控列表查询
This commit is contained in:
parent
37428bdc7b
commit
6be8257983
@ -108,20 +108,14 @@ public class CameraDeviceController {
|
||||
@GetMapping("/camera-tree")
|
||||
@Operation(summary = "获得设备-监控摄像头Tree")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:camera-device:query')")
|
||||
public CommonResult<FactoryTreeRespVO> getCameraDeviceTree(@RequestParam(value = "factoryId", required = false) Long factoryId) {
|
||||
public CommonResult<FactoryTreeRespVO> getCameraDeviceTree(@RequestParam(value = "factoryId", required = false) Long factoryId,
|
||||
@RequestParam(value = "name", required = false) String name) {
|
||||
|
||||
FactoryTreeRespVO data = new FactoryTreeRespVO();
|
||||
List<FactorySimpleRespVO> info = new ArrayList<>();
|
||||
|
||||
List<FactoryInfoDO> factoryInfo;
|
||||
if (factoryId == null) {
|
||||
// 获取工厂信息
|
||||
factoryInfo = factoryInfoService.getFactoryList();
|
||||
} else {
|
||||
// 获取工厂信息
|
||||
factoryInfo = factoryInfoService.getFactoryList(Collections.singletonList(factoryId));
|
||||
}
|
||||
|
||||
List<FactoryInfoDO> factoryInfo = factoryInfoService.getFactoryList(factoryId, name);
|
||||
List<Long> factoryIds = convertList(factoryInfo, FactoryInfoDO::getId);
|
||||
// 获取监控设备信息
|
||||
List<CameraDeviceDO> cameraDeviceDOS = cameraDeviceService.getListCameraList(factoryIds);
|
||||
|
@ -64,6 +64,14 @@ public interface FactoryInfoService {
|
||||
*/
|
||||
List<FactoryInfoDO> getFactoryList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得工厂信息列表
|
||||
*
|
||||
* @param factoryId 编号
|
||||
* @return 工厂信息
|
||||
*/
|
||||
List<FactoryInfoDO> getFactoryList(Long factoryId, String name);
|
||||
|
||||
/**
|
||||
* 获得类型为工厂的工厂信息列表
|
||||
* @return 工厂列表
|
||||
|
@ -11,7 +11,6 @@ import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.Fact
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryUpdateStatusReqVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.FactoryRollDataRespVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.ProvincesDataRespVO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.device.cameradevice.CameraDeviceDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.factoryinfo.FactoryInfoMapper;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
@ -136,6 +135,14 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
||||
return factoryInfoMapper.selectList(FactoryInfoDO::getId, ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FactoryInfoDO> getFactoryList(Long factoryId, String name) {
|
||||
|
||||
return factoryInfoMapper.selectList(new LambdaQueryWrapperX<FactoryInfoDO>()
|
||||
.eqIfPresent(FactoryInfoDO::getId, factoryId)
|
||||
.likeIfPresent(FactoryInfoDO::getName, name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FactoryInfoDO> getFactoryListByType() {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user