Merge remote-tracking branch 'origin/master'

This commit is contained in:
2025-08-29 09:15:34 +08:00
10 changed files with 30 additions and 199 deletions

View File

@@ -11,7 +11,7 @@ RUN mkdir -p /smartparks/Sis/logs \
WORKDIR /ruoyi/sis WORKDIR /ruoyi/sis
ENV SERVER_PORT=10002 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" ENV SERVER_PORT=10002 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="-Duser.timezone=Asia/Shanghai"
EXPOSE ${SERVER_PORT} EXPOSE ${SERVER_PORT}

View File

@@ -1,75 +0,0 @@
//package org.dromara.sis.config;
//
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author lsm
// * @apiNote RocketMQClusterConfig
// * @since 2025/8/26
// */
//@Configuration
//public class RocketMQClusterConfig {
//
// // 从配置文件中读取 cluster 的配置
// @Value("${rocketmq.cluster1.name-server}")
// private String nameServer1;
//
// @Value("${rocketmq.cluster1.producer.group}")
// private String producerGroup1;
//
// // 为第一个集群创建生产者实例
// @Bean({"clusterProducerOne"})
// public DefaultMQProducer clusterProducerOne() throws Exception {
// DefaultMQProducer producer = new DefaultMQProducer(producerGroup1);
// producer.setNamesrvAddr(nameServer1);
// // 设置发送超时时间
// producer.setSendMsgTimeout(5000);
// // 设置重试次数
// producer.setRetryTimesWhenSendFailed(2);
// producer.setRetryTimesWhenSendAsyncFailed(2);
// return producer;
// }
//
// // 使用上面的生产者实例创建 RocketMQTemplate
// @Bean("rocketMQTemplateClusterOne")
// public RocketMQTemplate rocketMQTemplateClusterOne(@Qualifier("clusterProducerOne") DefaultMQProducer producer) {
// RocketMQTemplate template = new RocketMQTemplate();
// template.setProducer(producer);
// return template;
// }
//
//
// // 从配置文件中读取 cluster 的配置
//// @Value("${rocketmq.cluster2.name-server}")
//// private String nameServer2;
////
//// @Value("${rocketmq.cluster2.producer.group}")
//// private String producerGroup2;
////
//// // 为第二个集群创建生产者实例
//// @Bean({"clusterProducerTwo"})
//// public DefaultMQProducer clusterProducerTwo() throws Exception {
//// DefaultMQProducer producer = new DefaultMQProducer(producerGroup2);
//// producer.setNamesrvAddr(nameServer2);
//// // 设置发送超时时间
//// producer.setSendMsgTimeout(5000);
//// // 设置重试次数
//// producer.setRetryTimesWhenSendFailed(2);
//// producer.setRetryTimesWhenSendAsyncFailed(2);
//// return producer;
//// }
////
//// // 使用上面的生产者实例创建 RocketMQTemplate
//// @Bean("rocketMQTemplateClusterTwo")
//// public RocketMQTemplate rocketMQTemplateClusterTwo(@Qualifier("clusterProducerTwo") DefaultMQProducer producer) {
//// RocketMQTemplate template = new RocketMQTemplate();
//// template.setProducer(producer);
//// return template;
//// }
//
//}

View File

@@ -35,6 +35,8 @@ public enum EventSmallTypeEnum {
SMART_REPORT_YW(1023, "烟雾报警"), SMART_REPORT_YW(1023, "烟雾报警"),
SMART_REPORT_RYSLCX(1024, "人员数量超限报警"), SMART_REPORT_RYSLCX(1024, "人员数量超限报警"),
EQP_REPORT_SBSB(1025, "报警设备上报"), EQP_REPORT_SBSB(1025, "报警设备上报"),
BLACK_PERSON(1026, "黑名单人员"),
AUTHORIZATION_EXPIRED(1027, "门禁授权已过期"),
/* -----------------------系统报警相关-------------------------------------*/ /* -----------------------系统报警相关-------------------------------------*/
SYS_REPORT_WLGZ(2001, "网络连接故障"), SYS_REPORT_WLGZ(2001, "网络连接故障"),
SYS_REPORT_DLYC(2002, "用户登录异常"), SYS_REPORT_DLYC(2002, "用户登录异常"),

View File

@@ -1,44 +0,0 @@
//package org.dromara.sis.rocketmq.consumer;
//
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.common.message.MessageExt;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.dromara.sis.rocketmq.RocketMqConstants;
//import org.dromara.sis.rocketmq.producer.ProducerService;
//import org.springframework.stereotype.Component;
//
///**
// * @author lsm
// * @apiNote MeterRecordConsumer
// * @since 2025/8/25
// */
//@Slf4j
//@Component
//@RequiredArgsConstructor
//@RocketMQMessageListener(
// topic = RocketMqConstants.TOPIC,
// consumerGroup = RocketMqConstants.METER_GROUP,
// selectorExpression = RocketMqConstants.METER_RECORD,
// nameServer = "${rocketmq.cluster1.name-server}"
//)
//public class MeterRecordConsumer implements RocketMQListener<MessageExt> {
//
// private final ProducerService producerService;
//
// @Override
// public void onMessage(MessageExt ext) {
// try {
// if (ext.getBody() == null) {
// log.info("仪表上报消息数据,不转发!");
// } else {
// producerService.defaultSend(RocketMqConstants.TOPIC, RocketMqConstants.METER_RECORD, new String(ext.getBody()));
// log.info("转发仪表上报数据处理成功");
// }
// } catch (Exception e) {
// log.error("转发仪表上报数据处理失败,", e);
// }
//
// }
//}

View File

@@ -1,65 +0,0 @@
//package org.dromara.sis.rocketmq.producer;
//
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.common.message.Message;
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.stereotype.Component;
//
///**
// * @author lsm
// * @apiNote ProducerService
// * @since 2025/8/26
// */
//@Slf4j
//@Component
//public class ProducerService {
//
// @Autowired
// @Qualifier("rocketMQTemplateClusterOne")
// private RocketMQTemplate rocketMQTemplateClusterOne;
//
//// @Autowired
//// @Qualifier("rocketMQTemplateClusterTwo")
//// private RocketMQTemplate rocketMQTemplateClusterTwo;
//
// /**
// * 向mq写入消息
// *
// * @param topic 消息topic
// * @param tag 消息tag
// * @param msg 消息
// */
// public void defaultSend(String topic, String tag, String msg) {
// try {
// String destination = topic + ":" + tag;
// // 使用 RocketMQTemplate 的同步发送方法
// rocketMQTemplateClusterOne.syncSend(destination, msg);
//
// log.info("发送RocketMQOne消息成功, nameServer:{}", rocketMQTemplateClusterOne.getProducer().getNamesrvAddr());
// } catch (Exception e) {
// log.error("发送RocketMQOne消息失败", e);
// }
// }
//
//
// /**
// * 向mq写入消息
// *
// * @param topic 消息topic
// * @param tag 消息tag
// * @param msg 消息
// */
//// public void clusterSend(String topic, String tag, String msg) {
//// try {
//// String destination = topic + ":" + tag;
//// // 使用 RocketMQTemplate 的同步发送方法
//// rocketMQTemplateClusterTwo.syncSend(destination, msg);
////
//// log.info("发送RocketMQTwo消息成功, nameServer:{}", rocketMQTemplateClusterTwo.getProducer().getNamesrvAddr());
//// } catch (Exception e) {
//// log.error("发送RocketMQTwo消息失败", e);
//// }
//// }
//}

View File

@@ -80,6 +80,8 @@ public class ZLMediaKitServiceImpl implements ZLMediaKitService {
if (resp == null) { if (resp == null) {
resp = new AddStreamProxyResp(); resp = new AddStreamProxyResp();
} }
resp.setApp(app);
resp.setStreamId(streamId);
// RTMP 播放地址 // RTMP 播放地址
resp.setRtmp(String.format(RTMP_PLAY_URL, zlmConfig.getIp(), zlmConfig.getRtmpPort(), app, streamId)); resp.setRtmp(String.format(RTMP_PLAY_URL, zlmConfig.getIp(), zlmConfig.getRtmpPort(), app, streamId));
// RTSP 播放地址 // RTSP 播放地址
@@ -88,9 +90,9 @@ public class ZLMediaKitServiceImpl implements ZLMediaKitService {
resp.setFlv(String.format(HTTP_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId)); resp.setFlv(String.format(HTTP_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId));
resp.setWsFlv(String.format(WS_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId)); resp.setWsFlv(String.format(WS_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId));
// HLS 播放地址 // HLS 播放地址
resp.setHls(String.format(HLS_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId)); // resp.setHls(String.format(HLS_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId));
// MP4 播放地址 // MP4 播放地址
resp.setMp4(String.format(MP4_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId)); // resp.setMp4(String.format(MP4_FLV_PLAY_URL, zlmConfig.getIp(), zlmConfig.getHttpPort(), app, streamId));
return resp; return resp;
} }

View File

@@ -9,15 +9,24 @@ public class AddStreamProxyResp implements Serializable {
private String key; private String key;
/**
* 应用
*/
private String app;
/**
* 流id
*/
private String streamId;
private String rtsp; private String rtsp;
private String rtmp; private String rtmp;
private String flv; private String flv;
private String wsFlv; private String wsFlv;
private String mp4; private String mp4;
private String hls; private String hls;
} }

View File

@@ -5,6 +5,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.sis.domain.bo.SisAlarmEventsBo; import org.dromara.sis.domain.bo.SisAlarmEventsBo;
import org.dromara.sis.domain.bo.alarm.AlarmAssignmentBo; import org.dromara.sis.domain.bo.alarm.AlarmAssignmentBo;
import org.dromara.sis.domain.bo.alarm.AlarmCompleteBo; import org.dromara.sis.domain.bo.alarm.AlarmCompleteBo;
import org.dromara.sis.domain.enums.EventSmallTypeEnum;
import org.dromara.sis.domain.vo.SisAlarmEventsVo; import org.dromara.sis.domain.vo.SisAlarmEventsVo;
import java.util.Collection; import java.util.Collection;
@@ -78,7 +79,7 @@ public interface ISisAlarmEventsService {
/** /**
* 异步生成告警记录 * 异步生成告警记录
*/ */
void createAlarmRecord(String deviceIp, Integer level, Integer type, String msg, byte[] smallImg, byte[] bigImg); void createAlarmRecord(String deviceIp, Integer level, EventSmallTypeEnum type, String msg, byte[] smallImg, byte[] bigImg);
/** /**
* 任务分配操作 * 任务分配操作

View File

@@ -182,7 +182,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, EventSmallTypeEnum type, String msg, byte[] smallImg, byte[] bigImg) {
// 校验设备信息 // 校验设备信息
SisDeviceManage sisDeviceManage = deviceManageService.queryByDeviceIp(deviceIp); SisDeviceManage sisDeviceManage = deviceManageService.queryByDeviceIp(deviceIp);
if (sisDeviceManage == null) { if (sisDeviceManage == null) {
@@ -193,7 +193,7 @@ public class SisAlarmEventsServiceImpl implements ISisAlarmEventsService {
Date now = new Date(); Date now = new Date();
SisAlarmEvents alarmEvents = new SisAlarmEvents(); SisAlarmEvents alarmEvents = new SisAlarmEvents();
alarmEvents.setBigType(EventBigTypeEnum.EQUIPMENT_UP.getCode()); alarmEvents.setBigType(EventBigTypeEnum.EQUIPMENT_UP.getCode());
alarmEvents.setSmallType(EventSmallTypeEnum.SMART_REPORT_ZJCR.getCode()); alarmEvents.setSmallType(type.getCode());
alarmEvents.setLevel(Long.valueOf(level)); alarmEvents.setLevel(Long.valueOf(level));
alarmEvents.setDeviceIp(deviceIp); alarmEvents.setDeviceIp(deviceIp);
alarmEvents.setDeviceName(sisDeviceManage.getDeviceName()); alarmEvents.setDeviceName(sisDeviceManage.getDeviceName());

View File

@@ -12,6 +12,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.property.api.RemoteFloorService; import org.dromara.property.api.RemoteFloorService;
import org.dromara.property.api.domain.vo.RemoteFloorVo; import org.dromara.property.api.domain.vo.RemoteFloorVo;
import org.dromara.sis.domain.enums.ControlTypeEnum; import org.dromara.sis.domain.enums.ControlTypeEnum;
import org.dromara.sis.domain.enums.EventSmallTypeEnum;
import org.dromara.sis.domain.enums.RosterTypeEnum; import org.dromara.sis.domain.enums.RosterTypeEnum;
import org.dromara.sis.domain.vo.*; import org.dromara.sis.domain.vo.*;
import org.dromara.sis.sdk.e8.E8PlatformApi; import org.dromara.sis.sdk.e8.E8PlatformApi;
@@ -62,8 +63,8 @@ public class ZeroSensationPassageServiceImpl implements IZeroSensationPassageSer
HWResult<Long> result = huaWeiBoxApi.findPerson(smallImgBase64Str); HWResult<Long> result = huaWeiBoxApi.findPerson(smallImgBase64Str);
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, 2, EventSmallTypeEnum.SMART_REPORT_ZJCR, "人脸比对失败", smallImg, bigImg);
return; return;
} }
log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs()); log.info("人脸比对执行完成,耗时:{}ms", interval.intervalMs());
@@ -74,19 +75,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, 2, EventSmallTypeEnum.SMART_REPORT_ZJCR, "陌生人员入内", 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, EventSmallTypeEnum.BLACK_PERSON, "黑名单人员入内", 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, 1, EventSmallTypeEnum.AUTHORIZATION_EXPIRED, "人员授权信息已过期", smallImg, bigImg);
log.info("当前人脸已过期,暂不处理。"); log.info("当前人脸已过期,暂不处理。");
return; return;
} }