Browse Source

修正:告警处理脚本

zhongwei
ty 7 months ago
parent
commit
f1d86a5791
  1. 9
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java
  2. 1
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java
  3. 2
      hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql

9
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java

@ -52,15 +52,15 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
public R listenAndUpdate(ProcessWorkFlowResponse processWorkFlowResponse) { public R listenAndUpdate(ProcessWorkFlowResponse processWorkFlowResponse) {
long taskId; long taskId;
AlarmHandleFlowEntity alarmHandleFlowEntity; AlarmHandleFlowEntity alarmHandleFlowEntity;
log.info("消缺消息开始转换" + processWorkFlowResponse); log.info("告警消息开始转换" + processWorkFlowResponse);
try { try {
Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables(); Map<String, Object> variables = (Map<String, Object>) processWorkFlowResponse.getVariables();
//现象缺陷全表更新 //现象缺陷全表更新
alarmHandleFlowEntity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference<AlarmHandleFlowEntity>() { alarmHandleFlowEntity = JSONObject.parseObject(JSONObject.toJSONString(variables), new TypeReference<AlarmHandleFlowEntity>() {
}); });
} catch (Exception e) { } catch (Exception e) {
log.info("消息转换失败:" + e.getMessage()); log.info("告警消息转换失败:" + e.getMessage());
return R.fail("消息转换失败"); return R.fail("告警消息转换失败");
} }
taskId = alarmHandleFlowEntity.getId(); taskId = alarmHandleFlowEntity.getId();
@ -104,6 +104,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
map.put("result_info",""); map.put("result_info","");
map.put("diag_solution", alarmHandleFlowEntity.getDealDesc()); map.put("diag_solution", alarmHandleFlowEntity.getDealDesc());
} }
log.info(map.toString());
// 预警,调用fdp // 预警,调用fdp
if (AlarmHandleConstant.EARLY_WARNING.equals(alarmHandleFlowEntity.getAlarmType())) { if (AlarmHandleConstant.EARLY_WARNING.equals(alarmHandleFlowEntity.getAlarmType())) {
//流程结束后才,调用fdp修改状态的接口 //流程结束后才,调用fdp修改状态的接口
@ -117,7 +118,7 @@ public class AlarmHandleFlowServiceImpl extends BaseServiceImpl<AlarmHandleFlowM
this.updateById(alarmHandleFlowEntity); this.updateById(alarmHandleFlowEntity);
//推送消息中心相关消息 //推送消息中心相关消息
sendMessage(processWorkFlowResponse, alarmHandleFlowEntity, taskId); sendMessage(processWorkFlowResponse, alarmHandleFlowEntity, taskId);
log.info("消缺消息转换结束" + processWorkFlowResponse); log.info("告警消息转换结束" + processWorkFlowResponse);
return R.success("消息保存成功"); return R.success("消息保存成功");
} }

1
hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleServiceImpl.java

@ -110,6 +110,7 @@ public class AlarmHandleServiceImpl extends BaseServiceImpl<AlarmHandleMapper, A
}else { }else {
map.put("result","处理中"); map.put("result","处理中");
} }
log.info(map.toString());
R r = iFdpDiagnoseClient.setFaultStatusInfo(map); R r = iFdpDiagnoseClient.setFaultStatusInfo(map);
if (!r.isSuccess()){ if (!r.isSuccess()){
log.error("setFaultStatusInfo接口修改处理状态异常,请求数据为:"+map+"\n"+"参数为:"+param+r.getMsg()); log.error("setFaultStatusInfo接口修改处理状态异常,请求数据为:"+map+"\n"+"参数为:"+param+r.getMsg());

2
hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql

@ -5,7 +5,7 @@ insert into `process_dict` (`dict_code`, `dict_sort`, `dict_key`, `dict_value`,
-- 风险排查流程 -- 风险排查流程
insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (10, 10, 'hazard_risk', 'hazard_risk', '风险排查', '风险排查', 'y', 0, null, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程'); insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (10, 10, 'hazard_risk', 'hazard_risk', '风险排查', '风险排查', 'y', 0, null, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程');
-- 告警处理流程 -- 告警处理流程
insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (11, 11, 'dealalarm', 'dealalarm', '告警处理流程', '告警处理流程', 'y', 0, null, '2024-02-19 16:56:10', '2024-02-19 16:56:34', '告警处理流程'); insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (11, 11, 'dealAlarm', 'dealAlarm', '告警处理流程', '告警处理流程', 'y', 0, null, '2024-02-19 16:56:10', '2024-02-19 16:56:34', '告警处理流程');
-- 隐患排查流程 -- 隐患排查流程
insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (12, 12, 'hiddendangercheck', 'hiddendangercheck', '隐患排查', '隐患排查', 'y', 0, null, '2023-07-25 18:35:01', '2023-07-25 18:35:01', '隐患排查流程'); insert into `process_dict`(`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) values (12, 12, 'hiddendangercheck', 'hiddendangercheck', '隐患排查', '隐患排查', 'y', 0, null, '2023-07-25 18:35:01', '2023-07-25 18:35:01', '隐患排查流程');
-- 日志记录表添加错误日志字段 -- 日志记录表添加错误日志字段

Loading…
Cancel
Save