|
|
|
|
@ -228,7 +228,7 @@ public class IpChannelServiceImpl extends ServiceImpl<CameraMapper, Camera> impl
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 开启和关闭云台守望
|
|
|
|
|
// 开启和关闭云台守望 0表示关闭,1表示开启
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public boolean ControlSentinel(Long id, int openOrNo, int watchTime, Integer presetIndex) {
|
|
|
|
|
@ -237,15 +237,19 @@ public class IpChannelServiceImpl extends ServiceImpl<CameraMapper, Camera> impl
|
|
|
|
|
{
|
|
|
|
|
flag = manageNVR.watchful(id.intValue(), openOrNo, watchTime, -1);
|
|
|
|
|
}else {
|
|
|
|
|
if(presetIndex==null)
|
|
|
|
|
{
|
|
|
|
|
throw new BusinessException(AdminResponseEnum.OPERATION_FAIL, null, "预置点不能为空");
|
|
|
|
|
}
|
|
|
|
|
flag = manageNVR.watchful(id.intValue(), openOrNo, watchTime, presetIndex);
|
|
|
|
|
}
|
|
|
|
|
if (flag) {
|
|
|
|
|
// 获取当前预置点的ptz坐标,并且保存
|
|
|
|
|
PTZVO ptzLocation = manageNVR.getPTZLocation(id);
|
|
|
|
|
ptzLocation.setCameraId(id);
|
|
|
|
|
// PTZVO ptzLocation = manageNVR.getPTZLocation(id);
|
|
|
|
|
// ptzLocation.setCameraId(id);
|
|
|
|
|
// 将ptz保存到redis中
|
|
|
|
|
stringRedisTemplate.opsForValue().set("camera:sentinel", JSON.toJSONString(ptzLocation));
|
|
|
|
|
log.info("ptz 坐标:{}", ptzLocation);
|
|
|
|
|
// stringRedisTemplate.opsForValue().set("camera:sentinel", JSON.toJSONString(ptzLocation));
|
|
|
|
|
// log.info("ptz 坐标:{}", ptzLocation);
|
|
|
|
|
Camera camera = this.getById(id);
|
|
|
|
|
// 保存守望信息
|
|
|
|
|
camera.setWatchfulTime(watchTime);
|
|
|
|
|
|