2026-06-30 24681c81c09022f584a57006f2534b5f74723414
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package cn.iocoder.yudao.module.iot.service.alert;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.iot.controller.admin.alert.vo.recrod.IotAlertRecordPageReqVO;
import cn.iocoder.yudao.module.iot.core.mq.message.IotDeviceMessage;
import cn.iocoder.yudao.module.iot.dal.dataobject.alert.IotAlertConfigDO;
import cn.iocoder.yudao.module.iot.dal.dataobject.alert.IotAlertRecordDO;
import cn.iocoder.yudao.module.iot.dal.dataobject.device.IotDeviceDO;
import jakarta.annotation.Nullable;
import jakarta.validation.constraints.NotNull;
 
import java.util.Collection;
import java.util.List;
 
/**
 * IoT 告警记录 Service 接口
 *
 * @author 芋道源码
 */
public interface IotAlertRecordService {
 
    /**
     * 获得告警记录
     *
     * @param id 编号
     * @return 告警记录
     */
    IotAlertRecordDO getAlertRecord(Long id);
 
    /**
     * 获得告警记录分页
     *
     * @param pageReqVO 分页查询
     * @return 告警记录分页
     */
    PageResult<IotAlertRecordDO> getAlertRecordPage(IotAlertRecordPageReqVO pageReqVO);
 
    /**
     * 获得指定场景规则的告警记录列表
     *
     * @param sceneRuleId 场景规则编号
     * @param deviceId 设备编号
     * @param processStatus 处理状态,允许空
     * @return 告警记录列表
     */
    List<IotAlertRecordDO> getAlertRecordListBySceneRuleId(@NotNull(message = "场景规则编号不能为空") Long sceneRuleId,
                                                           Long deviceId, Boolean processStatus);
 
    /**
     * 处理告警记录
     *
     * @param ids 告警记录编号
     * @param remark 处理结果(备注)
     */
    void processAlertRecordList(Collection<Long> ids, String remark);
 
    /**
     * 创建告警记录(包含场景规则编号)
     *
     * @param config 告警配置
     * @param sceneRuleId 场景规则编号
     * @param deviceMessage 设备消息,可为空
     * @param device 设备信息,可为空;用于回填产品编号、设备编号
     * @return 告警记录编号
     */
    @SuppressWarnings("UnusedReturnValue")
    Long createAlertRecord(IotAlertConfigDO config, Long sceneRuleId,
                           @Nullable IotDeviceMessage deviceMessage, @Nullable IotDeviceDO device);
 
}