增加设备报警信息
This commit is contained in:
parent
b378470f06
commit
59dc46f019
@ -40,7 +40,7 @@ public class HikAlarmCallBack implements HCNetSDK.FMSGCallBack_V31 {
|
|||||||
Pointer pFaceSnapInfo = strFaceSnapInfo.getPointer();
|
Pointer pFaceSnapInfo = strFaceSnapInfo.getPointer();
|
||||||
pFaceSnapInfo.write(0, pAlarmInfo.getByteArray(0, strFaceSnapInfo.size()), 0, strFaceSnapInfo.size());
|
pFaceSnapInfo.write(0, pAlarmInfo.getByteArray(0, strFaceSnapInfo.size()), 0, strFaceSnapInfo.size());
|
||||||
strFaceSnapInfo.read();
|
strFaceSnapInfo.read();
|
||||||
// handleFaceSnap(strFaceSnapInfo, pAlarmer);
|
handleFaceSnap(strFaceSnapInfo, pAlarmer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 异常行为检测
|
// 异常行为检测
|
||||||
|
@ -243,8 +243,8 @@ public class ZLMediaKitServiceImpl implements ZLMediaKitService {
|
|||||||
commonParams.put("src_url", url);
|
commonParams.put("src_url", url);
|
||||||
commonParams.put("dst_url", targetUrl);
|
commonParams.put("dst_url", targetUrl);
|
||||||
commonParams.put("timeout_ms", 10000);
|
commonParams.put("timeout_ms", 10000);
|
||||||
commonParams.put("enable_hls", false);
|
commonParams.put("enable_hls", true);
|
||||||
commonParams.put("enable_mp4", false);
|
commonParams.put("enable_mp4", true);
|
||||||
R<AddStreamProxyResp> result = HttpClientUtil.get(getRequestUrl("addFFmpegSource"), commonParams, AddStreamProxyResp.class);
|
R<AddStreamProxyResp> result = HttpClientUtil.get(getRequestUrl("addFFmpegSource"), commonParams, AddStreamProxyResp.class);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
if (result.getCode() == 0) {
|
if (result.getCode() == 0) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.sis.service.impl;
|
package org.dromara.sis.service.impl;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.context.mock.SaTokenContextMockUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -151,7 +152,7 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
|||||||
@Async
|
@Async
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createAlarmRecord(String deviceIp, Integer level, Integer type,String msg, byte[] smallImg, byte[] bigImg) {
|
public void createAlarmRecord(String deviceIp, Integer level, Integer type, String msg, byte[] smallImg, byte[] bigImg) {
|
||||||
// 校验设备信息
|
// 校验设备信息
|
||||||
SisDeviceManage sisDeviceManage = deviceManageService.queryByDeviceIp(deviceIp);
|
SisDeviceManage sisDeviceManage = deviceManageService.queryByDeviceIp(deviceIp);
|
||||||
if (sisDeviceManage == null) {
|
if (sisDeviceManage == null) {
|
||||||
@ -186,10 +187,10 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SisAlarmEventAttachments createEventAttachments(byte[] img, SisAlarmEvents alarmEvents, SisDeviceManage sisDeviceManage) {
|
public SisAlarmEventAttachments createEventAttachments(byte[] img, SisAlarmEvents alarmEvents, SisDeviceManage sisDeviceManage) {
|
||||||
RemoteFile result = remoteFileService.uploadImg(img);
|
RemoteFile remoteFile = SaTokenContextMockUtil.setMockContext(() -> remoteFileService.uploadImg(img));
|
||||||
SisAlarmEventAttachments attachments = new SisAlarmEventAttachments();
|
SisAlarmEventAttachments attachments = new SisAlarmEventAttachments();
|
||||||
attachments.setEventId(alarmEvents.getId());
|
attachments.setEventId(alarmEvents.getId());
|
||||||
attachments.setOssId(result.getOssId());
|
attachments.setOssId(remoteFile.getOssId());
|
||||||
attachments.setType(1L);
|
attachments.setType(1L);
|
||||||
attachments.setTenantId(sisDeviceManage.getTenantId());
|
attachments.setTenantId(sisDeviceManage.getTenantId());
|
||||||
attachments.setCreateDept(sisDeviceManage.getCreateDept());
|
attachments.setCreateDept(sisDeviceManage.getCreateDept());
|
||||||
|
@ -65,7 +65,7 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
|||||||
if (result.getCode() != 200) {
|
if (result.getCode() != 200) {
|
||||||
log.info("华为盒子比对失败,msg={}", result.getMessage());
|
log.info("华为盒子比对失败,msg={}", result.getMessage());
|
||||||
// 产生告警数据
|
// 产生告警数据
|
||||||
// alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "人脸比对失败", smallImg, bigImg);
|
alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "人脸比对失败", smallImg, bigImg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs());
|
log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs());
|
||||||
@ -76,19 +76,19 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
|
|||||||
if (authRecord == null) {
|
if (authRecord == null) {
|
||||||
log.info("人员[{}]没有授权记录,判定为陌生人", person);
|
log.info("人员[{}]没有授权记录,判定为陌生人", person);
|
||||||
// 不是内部人员 产生紧急的告警信息
|
// 不是内部人员 产生紧急的告警信息
|
||||||
// alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "陌生人员入内", smallImg, bigImg);
|
alarmEventsService.createAlarmRecord(deviceIp, 1, 1, "陌生人员入内", smallImg, bigImg);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (Objects.equals(authRecord.getRosterType(), RosterTypeEnum.BLACK_LIST.getCode())) {
|
if (Objects.equals(authRecord.getRosterType(), RosterTypeEnum.BLACK_LIST.getCode())) {
|
||||||
log.info("人员[{}]在黑名单中,暂不处理。", person);
|
log.info("人员[{}]在黑名单中,暂不处理。", person);
|
||||||
// alarmEventsService.createAlarmRecord(deviceIp, 3, 1, "黑名单人员入内", smallImg, bigImg);
|
alarmEventsService.createAlarmRecord(deviceIp, 3, 1, "黑名单人员入内", smallImg, bigImg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
if (DateUtil.compare(now, authRecord.getEndDate()) > 0) {
|
if (DateUtil.compare(now, authRecord.getEndDate()) > 0) {
|
||||||
// alarmEventsService.createAlarmRecord(deviceIp, 3, 1, "人员授权信息已过期", smallImg, bigImg);
|
alarmEventsService.createAlarmRecord(deviceIp, 3, 1, "人员授权信息已过期", smallImg, bigImg);
|
||||||
log.info("当前人脸已过期,暂不处理。");
|
log.info("当前人脸已过期,暂不处理。");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user