告警优化
This commit is contained in:
parent
2a15fe1a25
commit
8472895d6c
@ -144,6 +144,7 @@ user-settings:
|
||||
- http://192.168.1.245:3001
|
||||
- http://192.168.1.112:3002
|
||||
- http://192.168.1.211:3001
|
||||
- http://192.168.1.211:3000
|
||||
- http://192.168.1.20:3000
|
||||
- http://192.168.1.112:18080
|
||||
- http://192.168.1.38:3000
|
||||
|
@ -220,4 +220,19 @@ public class DeviceAlarmRecord implements Serializable {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String noticeTypeName;
|
||||
|
||||
/**
|
||||
* 0:未核查;1:已审核;2.已修正
|
||||
*/
|
||||
private String checkFlag;
|
||||
|
||||
/**
|
||||
* 核查反馈意见
|
||||
*/
|
||||
private String checkComment;
|
||||
|
||||
/**
|
||||
* 是否属实
|
||||
*/
|
||||
private String checkResult;
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ 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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 变电站-辅控设备-告警记录 Mapper 接口
|
||||
@ -16,4 +18,5 @@ public interface DeviceAlarmRecordMapper extends BaseMapper<DeviceAlarmRecord> {
|
||||
|
||||
Page<DeviceAlarmRecord> getDeviceAlarmRecordPage(Page<DeviceAlarmRecord> page, String systemcode, String deviceName, String signalName, String startDate, String endDate, String alarmLevel, String status);
|
||||
|
||||
Map<String, Object> getAlarmLogById(String id);
|
||||
}
|
||||
|
@ -199,9 +199,8 @@ public class DeviceAlarmRecordServiceImpl extends ServiceImpl<DeviceAlarmRecordM
|
||||
Map<String, Object> singalData, String value) {
|
||||
DeviceAlarmRecord deviceAlarmRecord = new DeviceAlarmRecord();
|
||||
MeterDevice device = meterDeviceMapper.selectById(singalData.get("meterDeviceId").toString());
|
||||
|
||||
deviceAlarmRecord.setCheckFlag("0");
|
||||
// 创建 SimpleDateFormat 对象,指定日期格式
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
if ("yx".equals(type)) {
|
||||
deviceAlarmRecord.setRecordId(IdUtil.fastSimpleUUID());
|
||||
deviceAlarmRecord.setStationId(singalData.get("stationId").toString());
|
||||
|
@ -60,11 +60,14 @@ public class AlarmLogController {
|
||||
return ResponseResult.error("未传变电站信息");
|
||||
}
|
||||
//TODO 整合辅控告警
|
||||
LambdaQueryWrapper<AlarmLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AlarmLog::getStationId, stationId).eq(AlarmLog::getDatastatus, "1").eq(AlarmLog::getCheckFlag
|
||||
, 0).select(AlarmLog::getId,
|
||||
AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate, AlarmLog::getStationName).orderByDesc(AlarmLog::getAlarmDate);
|
||||
List<Map<String, Object>> maps = alarmLogService.listMaps(queryWrapper);
|
||||
// LambdaQueryWrapper<AlarmLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(AlarmLog::getStationId, stationId).eq(AlarmLog::getDatastatus, "1").eq
|
||||
// (AlarmLog::getCheckFlag
|
||||
// , 0).select(AlarmLog::getId,
|
||||
// AlarmLog::getContent, AlarmLog::getAlarmLevel, AlarmLog::getAlarmDate,
|
||||
// AlarmLog::getStationName).orderByDesc(AlarmLog::getAlarmDate);
|
||||
// List<Map<String, Object>> maps = alarmLogService.listMaps(queryWrapper);
|
||||
List<Map<String, Object>> maps = alarmLogService.getAlarmLogList(stationId);
|
||||
return ResponseResult.successData(maps);
|
||||
}
|
||||
|
||||
@ -284,9 +287,8 @@ public class AlarmLogController {
|
||||
|
||||
@GetMapping("/getAlarmLogById")
|
||||
@ApiOperation("根据告警信息ID查询详情")
|
||||
public ResponseResult getAlarmLogById(String id) {
|
||||
Map<String, Object> alarmLog = alarmLogService.getAlarmLogById(id);
|
||||
|
||||
public ResponseResult getAlarmLogById(String id,String systemType) {
|
||||
Map<String, Object> alarmLog = alarmLogService.getAlarmLogById(id,systemType);
|
||||
return ResponseResult.successData(alarmLog);
|
||||
}
|
||||
|
||||
|
@ -54,4 +54,6 @@ public interface AlarmLogMapper extends BaseMapper<AlarmLog> {
|
||||
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
***********************************/
|
||||
List<Map<String, Object>> getAlarmLogList(String stationId);
|
||||
|
||||
Map<String, Object> getAlarmLogById(String id);
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ public interface IAlarmLogService extends IService<AlarmLog> {
|
||||
* 参数说明 id 告警id
|
||||
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
||||
***********************************/
|
||||
Map<String, Object> getAlarmLogById(String id);
|
||||
Map<String, Object> getAlarmLogById(String id,String systemType);
|
||||
|
||||
boolean updateDeviceResult(JSONObject jsonObject) throws Exception;
|
||||
|
||||
|
@ -23,6 +23,7 @@ import com.yfd.platform.config.AlarmTemplateConfig;
|
||||
import com.yfd.platform.config.HttpServerConfig;
|
||||
import com.yfd.platform.config.ParentConfig;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.modules.auxcontrol.mapper.DeviceAlarmRecordMapper;
|
||||
import com.yfd.platform.modules.basedata.domain.LinkageSignal;
|
||||
import com.yfd.platform.modules.basedata.domain.Substation;
|
||||
import com.yfd.platform.modules.basedata.domain.SubstationDevice;
|
||||
@ -119,7 +120,8 @@ public class AlarmLogServiceImpl extends ServiceImpl<AlarmLogMapper, AlarmLog> i
|
||||
|
||||
@Resource
|
||||
private ISysDictionaryItemsService sysDictionaryItemsService;
|
||||
|
||||
@Resource
|
||||
private DeviceAlarmRecordMapper deviceAlarmRecordMapper;
|
||||
@Resource
|
||||
private MqttGateway mqttGateway;
|
||||
|
||||
@ -1177,20 +1179,17 @@ public class AlarmLogServiceImpl extends ServiceImpl<AlarmLogMapper, AlarmLog> i
|
||||
* 返回值说明: java.util.Map<java.lang.String,java.lang.Object>
|
||||
***********************************/
|
||||
@Override
|
||||
public Map<String, Object> getAlarmLogById(String id) {
|
||||
Map<String, Object> map = this.getMap(new LambdaQueryWrapper<AlarmLog>().eq(AlarmLog::getId, id));
|
||||
if (map == null) {
|
||||
public Map<String, Object> getAlarmLogById(String id, String systemType) {
|
||||
|
||||
if ("01".equals(systemType)) {
|
||||
Map<String, Object> map = deviceAlarmRecordMapper.getAlarmLogById(id);
|
||||
}
|
||||
if ("02".equals(systemType)) {
|
||||
Map<String, Object> map = alarmLogMapper.getAlarmLogById(id);
|
||||
return ResponseResult.successData(map);
|
||||
}
|
||||
return ResponseResult.successData(null);
|
||||
}
|
||||
String taskResultId = map.get("taskResultId").toString();
|
||||
TaskResult taskResult = taskResultMapper.selectById(taskResultId);
|
||||
if (taskResult != null) {
|
||||
map.put("deviceId", taskResult.getPatroldeviceCode());
|
||||
map.put("channelId", taskResult.getPatroldeviceChannelcode());
|
||||
map.put("patroldevicePos", taskResult.getPatroldevicePos());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private String getSlienceType(String type) {
|
||||
String sliencetype = "";
|
||||
|
@ -5,6 +5,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
public class TestFileDir {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.out.println("user.home = " + System.getProperty("user.home"));
|
||||
// //获取告警触发条件
|
||||
String str = "20<=value<50";
|
||||
// 定义正则表达式
|
||||
|
@ -53,4 +53,22 @@
|
||||
and dar.alarm_time <= #{endDate}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getAlarmLogById" resultType="java.util.Map">
|
||||
SELECT
|
||||
dar.*,
|
||||
'01' systemType,
|
||||
ism.main_device_name,
|
||||
ism.main_device_id,
|
||||
isc.component_id,
|
||||
isc.component_name
|
||||
FROM
|
||||
fk_device_alarm_record dar
|
||||
INNER JOIN fk_device_signal ds ON dar.signal_id = ds.signal_id
|
||||
INNER JOIN iis_substation_maindevice ism ON ism.main_device_id = ds.main_device_id
|
||||
INNER JOIN iis_substation_component isc ON isc.component_id = ds.main_component_id
|
||||
WHERE
|
||||
dar.record_id = #{id}
|
||||
LIMIT 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -75,24 +75,46 @@
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAlarmLogList" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
(
|
||||
SELECT
|
||||
record_id AS id,
|
||||
station_id,
|
||||
'01' system_type,
|
||||
alarm_message AS content,
|
||||
CASE
|
||||
WHEN alarm_level = 1 THEN
|
||||
2
|
||||
WHEN alarm_level = 2 THEN
|
||||
3
|
||||
WHEN alarm_level = 3 THEN
|
||||
4 ELSE alarm_level
|
||||
END AS alarm_level,
|
||||
alarm_time AS alarm_date
|
||||
FROM `fk_device_alarm_record`
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
FROM
|
||||
`fk_device_alarm_record`
|
||||
) UNION ALL
|
||||
( SELECT id, station_id,'02' system_type, content, alarm_level alarm_level, alarm_date FROM iis_alarm_log )
|
||||
) AS combined_data
|
||||
WHERE
|
||||
station_id = #{stationId}
|
||||
ORDER BY
|
||||
alarm_date DESC;
|
||||
</select>
|
||||
<select id="getAlarmLogById" resultType="java.util.Map">
|
||||
SELECT
|
||||
id,
|
||||
station_id,
|
||||
content,
|
||||
alarm_date
|
||||
FROM iis_alarm_log
|
||||
)
|
||||
|
||||
ORDER BY alarm_date DESC;
|
||||
'02' systemType,
|
||||
al.*,
|
||||
tr.patroldevice_code deviceId,
|
||||
tr.patroldevice_channelcode channelId,
|
||||
tr.patroldevice_pos patroldevicePos
|
||||
FROM
|
||||
iis_alarm_log al
|
||||
INNER JOIN iis_task_result tr ON al.task_result_id = tr.result_id
|
||||
WHERE
|
||||
al.id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user