From 39b198e81dd7b14d954ec036b34a26e2b58d9353 Mon Sep 17 00:00:00 2001
From: ty <1577900710@qq.com>
Date: Wed, 21 Feb 2024 11:43:58 +0800
Subject: [PATCH] =?UTF-8?q?=E9=9B=86=E4=B8=AD=E7=9B=91=E6=8E=A7=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7+=E6=99=BA?=
=?UTF-8?q?=E8=83=BD=E8=AF=8A=E6=96=AD=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
hzims-service-api/alarm-api/pom.xml | 6 +
.../config/constants/AlarmHandleConstant.java | 38 ++++++
.../alarm/config/entity/AlarmHandleEntity.java | 31 ++++-
.../alarm/config/entity/AlarmHandleFlowEntity.java | 104 ++++++++++++++++
.../feign/Fallback/IAlarmHandleClientFallback.java | 22 ++++
.../alarm/config/feign/IAlarmHandleClient.java | 33 +++++
.../hnac/hzims/alarm/config/vo/AlarmHandleVo.java | 3 +
.../com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java | 17 ++-
.../hnac/hzims/fdp/feign/IFdpDiagnoseClient.java | 3 +
.../fdp/feign/IFdpDiagnoseClientFallBack.java | 5 +
.../process/constant/TicketProcessConstant.java | 2 +
.../fdp/controller/FdpListTableDataController.java | 11 +-
.../hnac/hzims/fdp/feign/FdpDiagnoseClient.java | 9 +-
.../com/hnac/hzims/fdp/scheduled/ThreadTask.java | 14 +--
.../fdp/service/IFdpFocusSurveillanceService.java | 17 +++
.../fdp/service/impl/FdpFaultServiceImpl.java | 2 +-
.../impl/FdpFocusSurveillanceServiceImpl.java | 73 +++++++++++
.../fdp/service/impl/FdpMonitorServiceImpl.java | 18 +--
.../show/controller/AlarmHandleController.java | 3 +-
.../hzims/alarm/show/feign/AlarmHandleClient.java | 26 ++++
.../alarm/show/mapper/AlarmHandleFlowMapper.java | 16 +++
.../alarm/show/mapper/AlarmHandleFlowMapper.xml | 6 +
.../hzims/alarm/show/mapper/AlarmHandleMapper.xml | 4 +-
.../alarm/show/service/AlarmHandleFlowService.java | 18 +++
.../alarm/show/service/AlarmHandleService.java | 3 +-
.../service/impl/AlarmHandleFlowServiceImpl.java | 137 +++++++++++++++++++++
.../show/service/impl/AlarmHandleServiceImpl.java | 99 +++++++++------
.../source/service/impl/FdpAlarmServiceImpl.java | 2 +-
hzims-service/hzims-middle/pom.xml | 6 +
.../serviceimpl/AlarmDealFlowServiceImpl.java | 68 ++++++++++
30 files changed, 729 insertions(+), 67 deletions(-)
create mode 100644 hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleFlowEntity.java
create mode 100644 hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/Fallback/IAlarmHandleClientFallback.java
create mode 100644 hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/IAlarmHandleClient.java
create mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpFocusSurveillanceService.java
create mode 100644 hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpFocusSurveillanceServiceImpl.java
create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/feign/AlarmHandleClient.java
create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleFlowMapper.java
create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmHandleFlowMapper.xml
create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHandleFlowService.java
create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHandleFlowServiceImpl.java
create mode 100644 hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/serviceimpl/AlarmDealFlowServiceImpl.java
diff --git a/hzims-service-api/alarm-api/pom.xml b/hzims-service-api/alarm-api/pom.xml
index d2a3b9b..d5c5b91 100644
--- a/hzims-service-api/alarm-api/pom.xml
+++ b/hzims-service-api/alarm-api/pom.xml
@@ -7,6 +7,12 @@
com.hnac.hzims
4.0.0-SNAPSHOT
+
+
+ com.hnac.hzims
+ middle-api
+
+
4.0.0
alarm-api
jar
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java
index 4bdbaa1..2694dbd 100644
--- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmHandleConstant.java
@@ -7,20 +7,58 @@ import java.util.List;
* @author YSJ
*/
public interface AlarmHandleConstant {
+
+ List INTERRUPT_LIST = Arrays.asList("13","14");
+
+ List TYPE_LIST = Arrays.asList("3","2","5","10","13","14");
+
+ List LONG_TYPE_LIST = Arrays.asList(3L,2L,5L,10L,13L,14L);
+
+ List SEND_MESSSAGE_TYPE_LIST = Arrays.asList("3","13","14");
+
+ String LEVEL_TYPE_LIST = "3,2,5,10,13,14";
String SYSTEM_TYPE_LIST = "3,2,5,13,14";
+ /**通讯恢复*/
+ String ABNORMAL_STATUS = "1";
+
/**故障**/
String FAULT = "3";
/**预警**/
Long EARLY_WARNING = 20L;
+ String WEBSOCKET_FAULT = "3";
+
+ String[] TYPE_NAMES = {"默认", "系统", "告警"
+ , "故障", "用户操作", "遥测越限", "遥信变位", "注册信息", "信息提示", "设备巡检", "遥控操作", "遥测越限恢复","未定义","通讯中断","数据异常"};
+
/**误报 、延后、缺陷 、检修、处理*/
List HANDLE_WAY = Arrays.asList(1L,2L,3L,4L,5L);
List HANDLE = Arrays.asList(3L,4L,5L);
+ String dealAlarm = "dealAlarm";
/**
+ * 2-告警,3-故障,5-遥测越限,13-通讯异常,14-数据异常
+ */
+ List SOE_TYPE_LIST = Arrays.asList(2,3,5,13,14);
+
+ /**
+ * 告警等级: 0 - 1级告警 1-二级告警
+ */
+ List LEVEL_LIST = Arrays.asList("0","1");
+
+ /**
+ * 告警类型: HZ3000告警
+ */
+ Integer SYSTEM_ALARM = 0;
+
+ /**
+ * 告警类型: 智能告警
+ */
+ Integer INTELLIGENCE_ALARM = 1;
+ /**
* 告警类型: 视频告警
*/
Integer VIDEO_ALARM = 4;
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleEntity.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleEntity.java
index fda07e8..3494a73 100644
--- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleEntity.java
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleEntity.java
@@ -38,6 +38,35 @@ public class AlarmHandleEntity extends BaseEntity {
@ApiModelProperty("告警内容")
private String alarmContent;
- @ApiModelProperty("处理方式")
+ @ApiModelProperty("告警处理状态 1L,2L,3L,4L,5L,6l 误报 、延后、缺陷 、检修、处理中、处理完毕 ")
private Long handleWay;
+
+// @ApiModelProperty("处理详情ID")
+// private Long detailId;
+
+ @ApiModelProperty("通知处理人")
+ private Long handleUser;
+
+// @ApiModelProperty("现象ID")
+// private Long phenomenonId;
+//
+// @ApiModelProperty("检修ID")
+// private Long accessId;
+
+ @ApiModelProperty("延后时间")
+ private Date delayTime;
+
+ @ApiModelProperty("延后原因")
+ private String delayCause;
+
+ @ApiModelProperty("误报描述")
+ private String falseAlarmDesc;
+
+ @ApiModelProperty("附件路径")
+ private String filePath;
+ @ApiModelProperty("创建用户名称")
+ private String createUserName;
+ @ApiModelProperty("创建用户名称")
+ private String createDeptName;
+
}
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleFlowEntity.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleFlowEntity.java
new file mode 100644
index 0000000..270ab77
--- /dev/null
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/entity/AlarmHandleFlowEntity.java
@@ -0,0 +1,104 @@
+package com.hnac.hzims.alarm.config.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.NullSerializer;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.core.mp.base.BaseEntity;
+
+import java.util.Date;
+
+/**
+ * @author ysj
+ */
+@Data
+@TableName("hzims_alarm_handle_flow")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "告警处理对象")
+public class AlarmHandleFlowEntity extends BaseEntity {
+
+ @ApiModelProperty("告警Id")
+ private String alarmId;
+
+ @ApiModelProperty("站点编码")
+ private String stationCode;
+
+ @ApiModelProperty("告警类型")
+ private Long alarmType;
+
+ @ApiModelProperty("告警所属类型:0-系统告警 1-智能告警")
+ private Integer type;
+
+ @ApiModelProperty("告警时间")
+ private Date alarmTime;
+
+ @ApiModelProperty("告警内容")
+ private String alarmContent;
+
+ @ApiModelProperty("告警状态 1L,2L,3L,4L,5L 误报 、延后、缺陷 、检修、处理 ")
+ private Long handleWay;
+
+// @ApiModelProperty("处理详情ID")
+// private Long detailId;
+
+ @ApiModelProperty("通知处理人")
+ private Long handleUser;
+
+ @ApiModelProperty("通知处理人")
+ @TableField(exist=false)
+ private String handleUserFlow;
+
+ @ApiModelProperty("现象ID")
+ private Long phenomenonId;
+
+ @ApiModelProperty("检修ID")
+ private Long accessId;
+
+ @ApiModelProperty("延后时间")
+ private Date delayTime;
+
+ @ApiModelProperty("延后原因")
+ private String delayCause;
+
+ @ApiModelProperty("误报描述")
+ private String falseAlarmDesc;
+
+ @ApiModelProperty("附件路径")
+ private String filePath;
+
+
+ @ApiModelProperty("处理方式")
+ private String dealType;
+ @ApiModelProperty("处理结果")
+ private String dealResult;
+ @ApiModelProperty("处理描述")
+ private String dealDesc;
+ @ApiModelProperty("处理附件")
+ private String dealPath;
+ @ApiModelProperty("审批结果 0,不通过;1为通过")
+ private Integer checkFlag;
+ @ApiModelProperty("审批说明")
+ private String checkDesc;
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前处理环节")
+ private String currentOperator;
+ @JsonSerialize(nullsUsing = NullSerializer.class)
+ @ApiModelProperty(value = "当前环节处理人")
+ private String currentLinkHandler;
+ @ApiModelProperty(value = "流程实例")
+ private String processInstanceId;
+ @ApiModelProperty("创建用户姓名")
+ private String createUserName;
+ @ApiModelProperty("处理人姓名")
+ private String handleUserName;
+ @ApiModelProperty("审批人")
+ private String approvalUser;
+ @ApiModelProperty("审批人姓名")
+ private String approvalUserName;
+ @ApiModelProperty("创建机构名称")
+ private String createDeptName;
+}
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/Fallback/IAlarmHandleClientFallback.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/Fallback/IAlarmHandleClientFallback.java
new file mode 100644
index 0000000..08e163c
--- /dev/null
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/Fallback/IAlarmHandleClientFallback.java
@@ -0,0 +1,22 @@
+package com.hnac.hzims.alarm.config.feign.Fallback;
+
+import com.hnac.hzims.alarm.config.feign.IAlarmHandleClient;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springblade.core.tool.api.R;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * @author ty
+ */
+@Slf4j
+@Component
+public class IAlarmHandleClientFallback implements IAlarmHandleClient {
+
+ @Override
+ public R listenAndUpdateAlarm(ProcessWorkFlowResponse processWorkFlowResponse) {
+ log.error("远程调用失败,接口:" + LISTEN_ALARM);
+ return null;
+ }
+}
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/IAlarmHandleClient.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/IAlarmHandleClient.java
new file mode 100644
index 0000000..d38ef36
--- /dev/null
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/feign/IAlarmHandleClient.java
@@ -0,0 +1,33 @@
+package com.hnac.hzims.alarm.config.feign;
+
+
+import com.hnac.hzims.alarm.config.constants.AlarmConstants;
+import com.hnac.hzims.alarm.config.feign.Fallback.IAlarmHandleClientFallback;
+import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse;
+import org.springblade.core.tool.api.R;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @author xiashandong
+ * @created 2021/6/10 15:21
+ **/
+@FeignClient(
+ value = AlarmConstants.APP_NAME,
+ fallback = IAlarmHandleClientFallback.class
+)
+public interface IAlarmHandleClient {
+
+ String API_PREFIX = "/feign/alarm";
+
+ String LISTEN_ALARM = API_PREFIX + "/listenAndUpdateAlarm";
+
+
+ @PostMapping(LISTEN_ALARM)
+ R listenAndUpdateAlarm(@RequestBody ProcessWorkFlowResponse processWorkFlowResponse);
+
+
+
+}
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHandleVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHandleVo.java
index 2dca453..dd95823 100644
--- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHandleVo.java
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/AlarmHandleVo.java
@@ -35,6 +35,9 @@ public class AlarmHandleVo extends AlarmHandleEntity {
@ApiModelProperty("通知处理人")
private Long handleUser;
+ @ApiModelProperty("通知处理人")
+ private String handleUserFlow;
+
@ApiModelProperty("现象Id")
@JsonSerialize(nullsUsing = NullSerializer.class)
diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java
index 30c8d7a..bdecf17 100644
--- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java
+++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java
@@ -62,7 +62,7 @@ public class FdpAlarmVo {
/**
* 设备名称
*/
- private String deviceCode;
+ private String deviceId;
// /**
// * 报警内容
// */
@@ -71,4 +71,19 @@ public class FdpAlarmVo {
* 创建时间
*/
private Date createTime;
+
+ /**
+ * 处置状态
+ */
+ private String result;
+
+ /**
+ * 初步分析结果
+ */
+ private String diagReason;
+
+ /**
+ * 处置方式
+ */
+ private String diagSolution;
}
\ No newline at end of file
diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java
index 695f0af..5073e28 100644
--- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java
+++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java
@@ -27,9 +27,12 @@ public interface IFdpDiagnoseClient {
String API_PREFIX = "/feign/fdp/diagnose";
String GET_STATISTIC_STATUS = API_PREFIX + "/getStatisticStatus";
String GET_HISTORY_DATA = API_PREFIX + "/getHistoryData";
+ String SET_FAULT_STATUS_INFO = API_PREFIX + "/setFaultStatusInfo";
@PostMapping(GET_STATISTIC_STATUS)
R