|
|
|
@ -50,34 +50,35 @@ public class EmVideoServiceImpl implements IEmVideoService {
|
|
|
|
|
String analyseCodes = rAnalyseCode.getData().stream().collect(Collectors.joining(",")); |
|
|
|
|
existModelEmEntityList = emInfoEntityList.stream().filter(emInfoEntity -> analyseCodes.contains(emInfoEntity.getNumber())).collect(Collectors.toList()); |
|
|
|
|
//获取设备对应视频列表
|
|
|
|
|
R<List<VideoConfig>> listR = iAnalyseInstanceClient.getVideoConfigByAnalyseCode(rAnalyseCode.getData()); |
|
|
|
|
if(listR.isSuccess()){ |
|
|
|
|
List<VideoConfig> videoConfigList = listR.getData(); |
|
|
|
|
Map<String,List<VideoConfig>> emCodeVideoConfig = videoConfigList.stream().collect(Collectors.groupingBy(VideoConfig::getAnalyzeCode)); |
|
|
|
|
List<EmVideoVO> emVideoVOList = new ArrayList<>(); |
|
|
|
|
existModelEmEntityList.forEach(emInfoEntity -> { |
|
|
|
|
EmVideoVO emVideoVO = BeanUtil.copy(emInfoEntity,EmVideoVO.class); |
|
|
|
|
emVideoVO.setChildren(Optional.ofNullable(emCodeVideoConfig).map(o -> { |
|
|
|
|
return o.get(emInfoEntity.getNumber()); |
|
|
|
|
}).orElse(null)); |
|
|
|
|
emVideoVOList.add(emVideoVO); |
|
|
|
|
}); |
|
|
|
|
Map<Long,List<EmVideoVO>> deptEmVideoMap = emVideoVOList.stream().collect(Collectors.groupingBy(EmVideoVO::getCreateDept)); |
|
|
|
|
deptEmVideoMap.forEach((k,v) -> { |
|
|
|
|
StationEmVideoVO stationEmVideoVO = new StationEmVideoVO(); |
|
|
|
|
Dept dept = sysClient.getDept(k).getData(); |
|
|
|
|
if(ObjectUtil.isNotEmpty(dept) && ObjectUtil.isNotEmpty(dept.getStationId())){ |
|
|
|
|
List<StationVideoTypeEntity> stationVideoTypeEntityList = stationVideoTypeClient.listByStationId(Optional.ofNullable(dept).map(Dept::getStationId).orElse(null)); |
|
|
|
|
if(CollectionUtil.isNotEmpty(stationVideoTypeEntityList)){ |
|
|
|
|
stationEmVideoVO.setIsHikvideo(stationVideoTypeEntityList.get(0).getIsHikvideo()); |
|
|
|
|
} |
|
|
|
|
stationEmVideoVO.setStationId(Optional.ofNullable(dept).map(Dept::getStationId).orElse(null)); |
|
|
|
|
stationEmVideoVO.setStationName(Optional.ofNullable(dept).map(Dept::getDeptName).orElse(null)); |
|
|
|
|
stationEmVideoVO.setChildren(v); |
|
|
|
|
result.add(stationEmVideoVO); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
//2023.04.06(wxq) 平台组反馈已不维护设备视频配置信息,将接口已删除。项目中也未找到接口的使用地方,将以下代码注释
|
|
|
|
|
// R<List<VideoConfig>> listR = iAnalyseInstanceClient.getVideoConfigByAnalyseCode(rAnalyseCode.getData());
|
|
|
|
|
// if(listR.isSuccess()){
|
|
|
|
|
// List<VideoConfig> videoConfigList = listR.getData();
|
|
|
|
|
// Map<String,List<VideoConfig>> emCodeVideoConfig = videoConfigList.stream().collect(Collectors.groupingBy(VideoConfig::getAnalyzeCode));
|
|
|
|
|
// List<EmVideoVO> emVideoVOList = new ArrayList<>();
|
|
|
|
|
// existModelEmEntityList.forEach(emInfoEntity -> {
|
|
|
|
|
// EmVideoVO emVideoVO = BeanUtil.copy(emInfoEntity,EmVideoVO.class);
|
|
|
|
|
// emVideoVO.setChildren(Optional.ofNullable(emCodeVideoConfig).map(o -> {
|
|
|
|
|
// return o.get(emInfoEntity.getNumber());
|
|
|
|
|
// }).orElse(null));
|
|
|
|
|
// emVideoVOList.add(emVideoVO);
|
|
|
|
|
// });
|
|
|
|
|
// Map<Long,List<EmVideoVO>> deptEmVideoMap = emVideoVOList.stream().collect(Collectors.groupingBy(EmVideoVO::getCreateDept));
|
|
|
|
|
// deptEmVideoMap.forEach((k,v) -> {
|
|
|
|
|
// StationEmVideoVO stationEmVideoVO = new StationEmVideoVO();
|
|
|
|
|
// Dept dept = sysClient.getDept(k).getData();
|
|
|
|
|
// if(ObjectUtil.isNotEmpty(dept) && ObjectUtil.isNotEmpty(dept.getStationId())){
|
|
|
|
|
// List<StationVideoTypeEntity> stationVideoTypeEntityList = stationVideoTypeClient.listByStationId(Optional.ofNullable(dept).map(Dept::getStationId).orElse(null));
|
|
|
|
|
// if(CollectionUtil.isNotEmpty(stationVideoTypeEntityList)){
|
|
|
|
|
// stationEmVideoVO.setIsHikvideo(stationVideoTypeEntityList.get(0).getIsHikvideo());
|
|
|
|
|
// }
|
|
|
|
|
// stationEmVideoVO.setStationId(Optional.ofNullable(dept).map(Dept::getStationId).orElse(null));
|
|
|
|
|
// stationEmVideoVO.setStationName(Optional.ofNullable(dept).map(Dept::getDeptName).orElse(null));
|
|
|
|
|
// stationEmVideoVO.setChildren(v);
|
|
|
|
|
// result.add(stationEmVideoVO);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|