public boolean addVideo(SysVideoSaveReq sysVideoInfo) { Common.logger.info("新增粒界axis入参:{}",sysVideoInfo); SysVideoInfo sysVideoInfo1 = new SysVideoInfo(); BeanUtils.copyProperties(sysVideoInfo,sysVideoInfo1); SysEquipmentInfo sysEquipmentInfo = equipmentInfoService.selectByDeviceId(sysVideoInfo.getStreamInfoId()); Common.logger.info("要修改的点位x-y-z轴:{}",sysEquipmentInfo); if (!ObjectUtils.isEmpty(sysEquipmentInfo)) { sysVideoInfo1.setVedioUrl(sysEquipmentInfo.getVedioUrl()); sysVideoInfo1.setPushRtmpUrl(sysEquipmentInfo.getPushRtmpUrl()); sysVideoInfo1.setLiveFlvUrl(sysEquipmentInfo.getLiveFlvUrl()); sysVideoInfo1.setLiveHlsUrl(sysEquipmentInfo.getLiveHlsUrl()); SetSysEquipmentReq setSysEquipmentReq = new SetSysEquipmentReq(); setSysEquipmentReq.setxAxis(sysVideoInfo1.getXAxis()); setSysEquipmentReq.setyAxis(sysVideoInfo1.getYAxis()); setSysEquipmentReq.setzAxis(sysVideoInfo1.getZAxis()); setSysEquipmentReq.setStreamInfoId(sysVideoInfo1.getStreamInfoId()); Common.logger.info("点位x-y-z轴:{}",setSysEquipmentReq); equipmentInfoService.setEquipmentAxis(setSysEquipmentReq); } sysVideoInfo1.setCreateTime(LocalDateTime.now()); SysVideoInfo sysVideoInfo2 = videoInfoMapper.selectOne(new LambdaQueryWrapper<SysVideoInfo>().eq(SysVideoInfo::getStreamInfoId, sysEquipmentInfo.getStreamInfoId())); if (!ObjectUtils.isEmpty(sysVideoInfo2)){ sysVideoInfo1.setId(sysVideoInfo2.getId()); } String s = HospitalTypeEnum.hospitalType(sysVideoInfo.getAreaType()); sysVideoInfo1.setAreaType(s); String s1 = BuildingCodeEnum.buildingName(sysVideoInfo.getCompanyId()); sysVideoInfo1.setCompanyId(s1); return this.saveOrUpdate(sysVideoInfo1); }添加下注释
时间: 2024-04-06 19:31:34 浏览: 50
T_sput_boolean_1.rar_Dot.
/**
* 添加视频信息
* @param sysVideoInfo 视频信息对象
* @return boolean 操作结果
*/
public boolean addVideo(SysVideoSaveReq sysVideoInfo) {
// 打印入参日志
Common.logger.info("新增粒界axis入参:{}",sysVideoInfo);
// 创建视频信息对象
SysVideoInfo sysVideoInfo1 = new SysVideoInfo();
// 复制属性
BeanUtils.copyProperties(sysVideoInfo,sysVideoInfo1);
// 根据设备ID查询设备信息
SysEquipmentInfo sysEquipmentInfo = equipmentInfoService.selectByDeviceId(sysVideoInfo.getStreamInfoId());
// 打印要修改的点位x-y-z轴日志
Common.logger.info("要修改的点位x-y-z轴:{}",sysEquipmentInfo);
// 如果设备信息不为空,则设置视频地址信息并更新设备轴信息
if (!ObjectUtils.isEmpty(sysEquipmentInfo)) {
sysVideoInfo1.setVedioUrl(sysEquipmentInfo.getVedioUrl());
sysVideoInfo1.setPushRtmpUrl(sysEquipmentInfo.getPushRtmpUrl());
sysVideoInfo1.setLiveFlvUrl(sysEquipmentInfo.getLiveFlvUrl());
sysVideoInfo1.setLiveHlsUrl(sysEquipmentInfo.getLiveHlsUrl());
SetSysEquipmentReq setSysEquipmentReq = new SetSysEquipmentReq();
setSysEquipmentReq.setxAxis(sysVideoInfo1.getXAxis());
setSysEquipmentReq.setyAxis(sysVideoInfo1.getYAxis());
setSysEquipmentReq.setzAxis(sysVideoInfo1.getZAxis());
setSysEquipmentReq.setStreamInfoId(sysVideoInfo1.getStreamInfoId());
// 打印点位x-y-z轴日志
Common.logger.info("点位x-y-z轴:{}",setSysEquipmentReq);
equipmentInfoService.setEquipmentAxis(setSysEquipmentReq);
}
// 设置创建时间
sysVideoInfo1.setCreateTime(LocalDateTime.now());
// 根据设备ID查询视频信息
SysVideoInfo sysVideoInfo2 = videoInfoMapper.selectOne(new LambdaQueryWrapper<SysVideoInfo>().eq(SysVideoInfo::getStreamInfoId, sysEquipmentInfo.getStreamInfoId()));
// 如果视频信息不为空,则设置视频ID
if (!ObjectUtils.isEmpty(sysVideoInfo2)){
sysVideoInfo1.setId(sysVideoInfo2.getId());
}
// 设置区域类型
String s = HospitalTypeEnum.hospitalType(sysVideoInfo.getAreaType());
sysVideoInfo1.setAreaType(s);
// 设置公司ID
String s1 = BuildingCodeEnum.buildingName(sysVideoInfo.getCompanyId());
sysVideoInfo1.setCompanyId(s1);
// 保存或更新视频信息
return this.saveOrUpdate(sysVideoInfo1);
}
阅读全文