diff --git a/riis-system/src/main/java/com/yfd/platform/component/iec104/client/MasterSysDataHandler.java b/riis-system/src/main/java/com/yfd/platform/component/iec104/client/MasterSysDataHandler.java index db455cb..36388ba 100644 --- a/riis-system/src/main/java/com/yfd/platform/component/iec104/client/MasterSysDataHandler.java +++ b/riis-system/src/main/java/com/yfd/platform/component/iec104/client/MasterSysDataHandler.java @@ -8,10 +8,10 @@ import com.yfd.platform.component.iec104.server.handler.ChannelHandler; import com.yfd.platform.component.iec104.server.handler.DataHandler; import com.yfd.platform.component.iec104.server.master.BootNettyClientChannel; import com.yfd.platform.component.iec104.server.master.BootNettyClientChannelCache; -import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService; import com.yfd.platform.modules.auxcontrol.service.IDeviceSignalService; import com.yfd.platform.modules.auxcontrol.service.IDeviceWorkDataService; import com.yfd.platform.modules.auxcontrol.service.IGatewayDeviceService; +import com.yfd.platform.modules.patroltask.service.IAlarmLogService; import com.yfd.platform.utils.SpringContextHolder; import io.netty.channel.ChannelHandlerContext; import org.slf4j.Logger; @@ -29,7 +29,7 @@ public class MasterSysDataHandler implements DataHandler { IDeviceSignalService signalService = SpringContextHolder.getBean(IDeviceSignalService.class); IDeviceWorkDataService workDataService = SpringContextHolder.getBean(IDeviceWorkDataService.class); IGatewayDeviceService gatewayDeviceService = SpringContextHolder.getBean(IGatewayDeviceService.class); - IDeviceAlarmRecordService alarmRecordService = SpringContextHolder.getBean(IDeviceAlarmRecordService.class); + IAlarmLogService alarmLogService = SpringContextHolder.getBean(IAlarmLogService.class); @Override public void handlerAdded(ChannelHandler ctx) throws Exception { @@ -63,7 +63,7 @@ public class MasterSysDataHandler implements DataHandler { String dateTime = messageInfo.getTimeScale(); signalService.updateDeviceSignalValue(slaveIp, address, "yx", status, dateTime); //生成设备自身报警记录(status=1) - alarmRecordService.doAlaramRecord("IEC104", "yx", slaveIp, address, status); + alarmLogService.doAlaramRecord("IEC104", "yx", slaveIp, address, status); } } if (type == 9 || type == 11 || type == 13 || type == 34 || type == 35 || type == 36) { @@ -78,7 +78,7 @@ public class MasterSysDataHandler implements DataHandler { workDataService.insertData("IEC104", slaveIp, address, value, dateTime); signalService.updateDeviceSignalValue(slaveIp, address, "yc", value, dateTime); //生成阈值越限报警记录 - alarmRecordService.doAlaramRecord("IEC104", "yc", slaveIp, address, value); + alarmLogService.doAlaramRecord("IEC104", "yc", slaveIp, address, value); } } diff --git a/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850ClientListener.java b/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850ClientListener.java index d887c8e..2ce7abe 100644 --- a/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850ClientListener.java +++ b/riis-system/src/main/java/com/yfd/platform/component/iec61850/client/IEC61850ClientListener.java @@ -2,8 +2,8 @@ package com.yfd.platform.component.iec61850.client; import com.beanit.iec61850bean.*; import com.yfd.platform.modules.auxcontrol.mapper.DeviceSignalMapper; -import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService; import com.yfd.platform.modules.auxcontrol.service.IDeviceWorkDataService; +import com.yfd.platform.modules.patroltask.service.IAlarmLogService; import com.yfd.platform.utils.StringUtils; import lombok.RequiredArgsConstructor; import org.slf4j.Logger; @@ -22,7 +22,7 @@ public class IEC61850ClientListener extends Thread implements ClientEventListene private static final Logger log = LoggerFactory.getLogger(StringUtils.class); private final DeviceSignalMapper deviceSignalMapper; - private final IDeviceAlarmRecordService deviceAlarmRecordService; + private final IAlarmLogService alarmLogService; private final IDeviceWorkDataService deviceWorkDataService; @Override @@ -41,7 +41,7 @@ public class IEC61850ClientListener extends Thread implements ClientEventListene //插入历史数据 deviceWorkDataService.insertData("IEC61850", null, node_name, node_value, datestr); //执行报警处理 - deviceAlarmRecordService.doAlaramRecord("IEC61850", "yc", null, node_name, node_value); + alarmLogService.doAlaramRecord("IEC61850", "yc", null, node_name, node_value); } else if ("ST".equals(value.getFc().name())) { //遥信 状态值 @@ -54,7 +54,7 @@ public class IEC61850ClientListener extends Thread implements ClientEventListene //更新信号状态 deviceSignalMapper.updateDeviceSignalValue_yx(node_name, node_value, datestr); //执行报警处理:生成设备自身报警记录(status=1) - deviceAlarmRecordService.doAlaramRecord("IEC61850", "yx", null, node_name, node_value); + alarmLogService.doAlaramRecord("IEC61850", "yx", null, node_name, node_value); } } } diff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceAlarmRecordController.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceAlarmRecordController.java deleted file mode 100644 index 76b4d21..0000000 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/DeviceAlarmRecordController.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.yfd.platform.modules.auxcontrol.controller; - - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yfd.platform.config.ResponseResult; -import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord; -import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; - -/** - *
- * 变电站-辅控设备-告警记录 前端控制器 - *
- * - * @author zhengsl - * @since 2025-04-23 - */ -@RestController -@RequestMapping("/auxcontrol/device-alarm-record") -@Api(value = "DeviceAlarmRecordController", tags = "变电站辅控设备告警记录") -public class DeviceAlarmRecordController { - - @Resource - private IDeviceAlarmRecordService deviceAlarmRecordService; - - /********************************** - * 用途说明: 分页查询变电站辅控设备告警记录 - * 参数说明 - * systemcode 所属系统 - * deviceName 告警设备名称 - * signalName 告警信号名称 - * startDate (开始日期) - * endDate (结束日期) - * alarmLevel 告警等级 - * status 告警状态 - * page 分页对象 - * 返回值说明: com.yfd.platform.config.ResponseResult 返回分页查询结果 - ***********************************/ - @GetMapping("/page") - @ApiOperation("分页查询变电站辅控设备告警记录") - public ResponseResult getDeviceAlarmRecordPage(String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status, Pagediff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java index 1686466..1f2cf3d 100644 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java +++ b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/controller/IECController.java @@ -7,17 +7,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.yfd.platform.component.iec104.client.IIEC104Service; import com.yfd.platform.component.iec61850.client.IEC61850Service; import com.yfd.platform.config.ResponseResult; -import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord; import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal; import com.yfd.platform.modules.auxcontrol.domain.GatewayDevice; import com.yfd.platform.modules.auxcontrol.domain.MeterDevice; -import com.yfd.platform.modules.auxcontrol.service.IDeviceAlarmRecordService; import com.yfd.platform.modules.auxcontrol.service.IDeviceSignalService; import com.yfd.platform.modules.auxcontrol.service.IGatewayDeviceService; import com.yfd.platform.modules.auxcontrol.service.IMeterDeviceService; -import com.yfd.platform.modules.basedata.service.ISubstationAreaService; -import com.yfd.platform.modules.basedata.service.ISubstationComponentService; -import com.yfd.platform.modules.basedata.service.ISubstationMaindeviceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; @@ -25,7 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; -import java.util.List; /** *
@@ -51,9 +45,6 @@ public class IECController { @Resource private IMeterDeviceService meterDeviceService; - //变电站报警记录 - @Resource - private IDeviceAlarmRecordService deviceAlarmRecordService; @Resource private IIEC104Service iec104Service; @@ -62,16 +53,6 @@ public class IECController { private IEC61850Service iec61850Service; - @GetMapping("/confirmclosealarm") - @ApiOperation("确认告警信息,关闭告警弹窗") - public ResponseResult confirmCloseAlarmRecord(String record_id) { - DeviceAlarmRecord alarmRecord = new DeviceAlarmRecord(); - alarmRecord.setRecordId(record_id); - alarmRecord.setStatus("03"); - alarmRecord.setFixTime(DateUtil.toLocalDateTime(DateUtil.date())); - deviceAlarmRecordService.updateById(alarmRecord); - return ResponseResult.success(); - } /********************************** * 用途说明: 发送遥控遥调命令 diff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/domain/DeviceAlarmRecord.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/domain/DeviceAlarmRecord.java deleted file mode 100644 index 8ea7fab..0000000 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/domain/DeviceAlarmRecord.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.yfd.platform.modules.auxcontrol.domain; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import java.time.LocalDateTime; -import java.io.Serializable; - -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - *
- * 变电站-辅控设备-告警记录 - *
- * - * @author zhengsl - * @since 2025-04-23 - */ -@Data -@EqualsAndHashCode(callSuper = false) -@TableName("fk_device_alarm_record") -public class DeviceAlarmRecord implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * 记录ID - */ - @TableId(type = IdType.ASSIGN_UUID) - private String recordId; - - /** - * 变电站ID - */ - private String stationId; - - /** - * 所属系统:01-在线监测 02-消防系统 03-安防系统 04-动环系统 05-锁控系统 06-辅控系统 07-照明系统 - */ - private String systemcode; - - /** - * 告警时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime alarmTime; - - /** - * 告警设备ID - */ - private String deviceId; - - /** - * 告警设备名称 - */ - private String deviceName; - - /** - * 告警信号ID - */ - private String signalId; - - /** - * 告警信号名称 - */ - private String signalName; - - /** - * 告警类型 - */ - private String alarmType; - - /** - * 告警等级:一般、严重、危急 - */ - private String alarmLevel; - - /** - * 告警值 - */ - private String alarmValue; - - /** - * 值单位 - */ - private String signalUnit; - - /** - * 正常范围 - */ - private String normalRange; - - /** - * 告警信息 - */ - private String alarmMessage; - - /** - * 01-组件变色 02-系统弹窗 ,03-邮件通知 ,04-触发联动 可多选:01,02 - */ - private String noticeAction; - - /** - * 邮件通知:[{name:"张三",email:"1122@163.com"}] - */ - private String noticeEmails; - - /** - * 触发联动:[{name:"XX联动",id:"12345678"}] - */ - private String noticeLinkages; - - /** - * 状态:01-初始生成 02-已执行动作 03-手动关闭 09-故障消除 - */ - private String status; - - /** - * 备用1 - */ - private String custom1; - - /** - * 备用2 - */ - private String custom2; - - /** - * 备用3 - */ - private String custom3; - - /** - * 告警分类:1-越限告警 2-设备报警 - */ - private String alarmClass; - - /** - * 故障消除时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime fixTime; - - /** - * 区域标识 - */ - private String region; - - /** - * 是否关闭告警0为关闭 1关闭 - */ - private String confirmClosure; - - /** - * 操作人 - */ - private String operator; - - /** - * 操作时间 - */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - private LocalDateTime operationTime; - - /** - * 告警分类:1-越限告警 2-设备报警 TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String alarmClassName; - - - /** - * 告警类型名称:如:温度过高、压力异常、电流过载 TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String alarmTypeName; - - /** - * 告警等级名称:一般、严重、危急 TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String alarmLevelName; - - /** - * 次数:TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String frequency; - - /** - * 开始时间:TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String startDate; - - /** - * 结束时间:TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String endDate; - - /** - * 区域名称:TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String regionName; - - - /** - * 告警状态名称:TODO 增加用于前端展示 - */ - @TableField(exist = false) - private String statusName; - - /** - * 告警通知方式名称:01-系统弹窗 ,02-邮件通知 ,03-触发联动 可多选:01,02 - */ - @TableField(exist = false) - private String noticeTypeName; - - /** - * 0:未核查;1:已审核;2.已修正 - */ - private String checkFlag; - - /** - * 核查反馈意见 - */ - private String checkComment; - - /** - * 是否属实 - */ - private String checkResult; -} diff --git a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/mapper/DeviceAlarmRecordMapper.java b/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/mapper/DeviceAlarmRecordMapper.java deleted file mode 100644 index db7a759..0000000 --- a/riis-system/src/main/java/com/yfd/platform/modules/auxcontrol/mapper/DeviceAlarmRecordMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.yfd.platform.modules.auxcontrol.mapper; - -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -import java.util.Map; - -/** - *- * 变电站-辅控设备-告警记录 Mapper 接口 - *
- * - * @author zhengsl - * @since 2025-04-23 - */ -public interface DeviceAlarmRecordMapper extends BaseMapper- * 变电站-辅控设备-告警记录 服务类 - *
- * - * @author zhengsl - * @since 2025-04-23 - */ -public interface IDeviceAlarmRecordService extends IService- * 变电站-辅控设备-告警记录 服务实现类 - *
- * - * @author zhengsl - * @since 2025-04-23 - */ -@Service -@Slf4j -public class DeviceAlarmRecordServiceImpl extends ServiceImpl