From 383009870ce3f800e5960f98deb7cb90311ffbdb Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 1 Nov 2023 16:47:29 +0800 Subject: [PATCH] =?UTF-8?q?#=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzims/alarm/entity/AlarmEntity.java | 25 +++++ .../hzims/equipment/feign/IEmInfoClientBack.java | 5 + .../alarm/config/mapper/AlarmHistoryMapper.java | 12 -- .../alarm/config/mapper/AlarmHistoryMapper.xml | 5 - .../hzims/alarm/config/mapper/AlarmMapper.java | 12 -- .../hnac/hzims/alarm/config/mapper/AlarmMapper.xml | 5 - .../alarm/handle/mapper/AlarmHistoryMapper.java | 12 ++ .../alarm/handle/mapper/AlarmHistoryMapper.xml | 5 + .../alarm/handle/service/AlarmHistoryService.java | 11 ++ .../handle/service/ConditionAlarmService.java | 16 +++ .../alarm/handle/service/FdpAlarmService.java | 16 +++ .../alarm/handle/service/LevelAlarmService.java | 16 +++ .../hzims/alarm/handle/service/MessageService.java | 15 +++ .../alarm/handle/service/SystemAlarmService.java | 16 +++ .../alarm/handle/service/VideoAlarmService.java | 16 +++ .../service/impl/AlarmHistoryServiceImpl.java | 19 ++++ .../service/impl/ConditionAlarmServiceImpl.java | 93 ++++++++++++++++ .../handle/service/impl/FdpAlarmServiceImpl.java | 103 ++++++++++++++++++ .../handle/service/impl/LevelAlarmServiceImpl.java | 110 +++++++++++++++++++ .../handle/service/impl/MessageServiceImpl.java | 97 +++++++++++++++++ .../service/impl/SystemAlarmServiceImpl.java | 105 ++++++++++++++++++ .../handle/service/impl/VideoAlarmServiceImpl.java | 121 +++++++++++++++++++++ .../com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java | 4 +- .../com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java | 2 +- .../alarm/show/controller/ShowAlarmController.java | 71 +++--------- .../hnac/hzims/alarm/show/mapper/AlarmMapper.java | 12 ++ .../hnac/hzims/alarm/show/mapper/AlarmMapper.xml | 5 + .../alarm/show/service/AlarmHistoryService.java | 11 -- .../hzims/alarm/show/service/AlarmService.java | 7 +- .../alarm/show/service/ConditionAlarmService.java | 16 --- .../hzims/alarm/show/service/FdpAlarmService.java | 16 --- .../alarm/show/service/LevelAlarmService.java | 16 --- .../hzims/alarm/show/service/MessageService.java | 15 --- .../alarm/show/service/SystemAlarmService.java | 16 --- .../alarm/show/service/VideoAlarmService.java | 16 --- .../show/service/impl/AlarmHistoryServiceImpl.java | 19 ---- .../alarm/show/service/impl/AlarmServiceImpl.java | 88 ++++++++++++--- .../service/impl/ConditionAlarmServiceImpl.java | 92 ---------------- .../show/service/impl/FdpAlarmServiceImpl.java | 103 ------------------ .../show/service/impl/LevelAlarmServiceImpl.java | 110 ------------------- .../show/service/impl/MessageServiceImpl.java | 97 ----------------- .../show/service/impl/SystemAlarmServiceImpl.java | 105 ------------------ .../show/service/impl/VideoAlarmServiceImpl.java | 121 --------------------- .../hnac/hzims/alarm/task/VideoScheduledTask.java | 2 +- .../alarm/ws/condition/ConditionAlarmRegular.java | 2 +- .../ws/condition/ConditionAlarmWebSocket.java | 2 +- .../hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java | 2 +- .../hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java | 2 +- .../hzims/alarm/ws/hz3000/SystemAlarmRegular.java | 2 +- .../alarm/ws/hz3000/SystemAlarmWebSocket.java | 2 +- .../hzims/alarm/ws/level/LevelAlarmRegular.java | 2 +- .../hzims/alarm/ws/level/LevelAlarmWebSocket.java | 2 +- 52 files changed, 919 insertions(+), 876 deletions(-) delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.xml delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.xml create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java create mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHistoryService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/ConditionAlarmService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/FdpAlarmService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/LevelAlarmService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/MessageService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/SystemAlarmService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/VideoAlarmService.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHistoryServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/ConditionAlarmServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/FdpAlarmServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/LevelAlarmServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/MessageServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/SystemAlarmServiceImpl.java delete mode 100644 hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/VideoAlarmServiceImpl.java diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java index 1021c07..ed28604 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/entity/AlarmEntity.java @@ -65,4 +65,29 @@ public class AlarmEntity extends TenantEntity { @ApiModelProperty(value = "监测点") private String realId; + + @ApiModelProperty(value = "是否集中监控右侧列表展示 : 0-展示 1-不展示") + private Integer isRightTabulation; + + @ApiModelProperty(value = "是否集中监控弹窗展示 : 0-展示 1-不展示") + private Integer isShowAlert; + + @ApiModelProperty(value = "是否集中监控铃铛展示 : 0-展示 1-不展示") + private Integer isSmallBell; + + @ApiModelProperty(value = "是否集中监控遮罩展示 : 0-展示 1-不展示") + private Integer isMask; + + @ApiModelProperty(value = "是否语音播报 : 0-播报 1-不播报") + private Integer isBroadcast; + + @ApiModelProperty(value = "是否进行平台消息推送 : 0-推送 1-不推送") + private Integer isPlatformMessage; + + @ApiModelProperty(value = "是否短信推送 :0-推送 1-不推送") + private Integer isShortMessage; + + @ApiModelProperty(value = "是否微信公众号消息推送 :0-推送 1-不推送") + private Integer isWxMessage; + } \ No newline at end of file diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java index b9aa407..02ccc38 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java @@ -99,4 +99,9 @@ public class IEmInfoClientBack implements IEmInfoClient { public R> getChildrenByEmCode(String emCode) { return R.fail("远程调用失败"); } + + @Override + public List getVideoDeviceByEmCode(EmInfoEntity emInfo) { + return new ArrayList<>(); + } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.java deleted file mode 100644 index 74194c3..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hnac.hzims.alarm.config.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; - -/** - * @author ysj - */ -public interface AlarmHistoryMapper extends BaseMapper { - - -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.xml deleted file mode 100644 index 8b355d0..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmHistoryMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.java deleted file mode 100644 index 455f550..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.hnac.hzims.alarm.config.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.hnac.hzims.alarm.entity.AlarmEntity; - -/** - * @author ysj - */ -public interface AlarmMapper extends BaseMapper { - - -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.xml deleted file mode 100644 index 4a83fce..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/config/mapper/AlarmMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java new file mode 100644 index 0000000..4b2d713 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.alarm.handle.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; + +/** + * @author ysj + */ +public interface AlarmHistoryMapper extends BaseMapper { + + +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml new file mode 100644 index 0000000..f6dd5d6 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/mapper/AlarmHistoryMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java new file mode 100644 index 0000000..3805436 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/AlarmHistoryService.java @@ -0,0 +1,11 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @author ysj + */ +public interface AlarmHistoryService extends BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java new file mode 100644 index 0000000..f2c7364 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/ConditionAlarmService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +import java.util.List; + +/** + * 等级处理接口 + * @author ysj + */ +public interface ConditionAlarmService { + + String message(); + + List receiveMessage(String message); +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java new file mode 100644 index 0000000..bbb248d --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/FdpAlarmService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +import java.util.List; + +/** + * 告警处理接口 + * @author ysj + */ +public interface FdpAlarmService { + + String sendMessage(); + + List receiveMessage(String message); +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java new file mode 100644 index 0000000..4d3a695 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/LevelAlarmService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +import java.util.List; + +/** + * 等级处理接口 + * @author ysj + */ +public interface LevelAlarmService { + + String message(); + + List receiveMessage(String message); +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java new file mode 100644 index 0000000..92b3f74 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/MessageService.java @@ -0,0 +1,15 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +/** + * @author ysj + */ +public interface MessageService { + + void message(AlarmEntity entity); + + void webAppMessage(AlarmEntity entity); + + void weChatMessage(AlarmEntity entity); +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java new file mode 100644 index 0000000..42f44d8 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/SystemAlarmService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +import java.util.List; + +/** + * 告警处理接口 + * @author ysj + */ +public interface SystemAlarmService { + + String sendMessage(); + + List receiveMessage(String message); +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java new file mode 100644 index 0000000..2751346 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/VideoAlarmService.java @@ -0,0 +1,16 @@ +package com.hnac.hzims.alarm.handle.service; + +import com.hnac.hzims.alarm.entity.AlarmEntity; + +import java.util.List; + +/** + * 告警处理接口 + * @author ysj + */ +public interface VideoAlarmService { + + List sendMessage(); + + List receiveMessage(String message); +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java new file mode 100644 index 0000000..2de5d10 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/AlarmHistoryServiceImpl.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; +import com.hnac.hzims.alarm.handle.mapper.AlarmHistoryMapper; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.mp.base.BaseService; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @author ysj + */ +@AllArgsConstructor +@Service +@Slf4j +public class AlarmHistoryServiceImpl extends BaseServiceImpl implements BaseService { + +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java new file mode 100644 index 0000000..c04ba7a --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/ConditionAlarmServiceImpl.java @@ -0,0 +1,93 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.ConditionAlarmService; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.vo.ConditionAlarmVo; +import com.hnac.hzims.equipment.feign.IEmInfoClient; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +import static com.hnac.hzims.alarm.constants.AlarmConstants.CONDITION; +import static com.hnac.hzims.alarm.constants.AlarmConstants.CONDITION_ALARM; + +/** + * 等级告警实现类 + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class ConditionAlarmServiceImpl implements ConditionAlarmService { + + private final AlarmService alarmService; + + private final MessageService messageService; + + private final RedisTemplate redisTemplate; + + private final IEmInfoClient deviceClient; + + private final IStationClient stationClient; + + public final static String device_cache_cofig_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; + + /** + * 发送websocket消息 + * @return + */ + @Override + public String message() { + return ""; + } + + + /** + * 转换接收服务推送消息 + * @param message + */ + @Override + public List receiveMessage(String message) { + // 对象转换 + List alarms = JSONObject.parseArray(message, ConditionAlarmVo.class); + if (CollectionUtil.isEmpty(alarms)) { + return new ArrayList<>(); + } + List res = alarms.stream().map(s -> { + AlarmEntity entity = getAlarmEntity(s); + return entity; + }).collect(Collectors.toList()); + return res; + } + + private AlarmEntity getAlarmEntity(ConditionAlarmVo item) { + AlarmEntity entity = new AlarmEntity(); + entity.setAlarmId(item.getFaultId()); + entity.setAlarmTime(item.getCreateTime()); + entity.setAlarmContext(item.getFinfo()); + entity.setAlarmType(CONDITION); + entity.setAlarmStatus(Integer.valueOf(String.valueOf(item.getStatus()))); + entity.setStationId(item.getStation()); + entity.setAlarmSource(CONDITION_ALARM); + entity.setTenantId("200000"); + R stationByCode = stationClient.getStationByCode(item.getStation()); + if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ + entity.setCreateDept(stationByCode.getData().getCreateDept()); + entity.setStationName(stationByCode.getData().getName()); + } + return entity; + } +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java new file mode 100644 index 0000000..f801958 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/FdpAlarmServiceImpl.java @@ -0,0 +1,103 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.FdpAlarmService; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.vo.FdpAlarmVo; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +import static com.hnac.hzims.alarm.constants.AlarmConstants.EARLY; +import static com.hnac.hzims.alarm.constants.AlarmConstants.EARLY_WARNING; + +/** + * 等级告警实现类 + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class FdpAlarmServiceImpl implements FdpAlarmService { + + + private final MessageService messageService; + private final IUserClient userClient; + private final ISysClient sysClient; + + private final IMessageClient messageClient; + private final AlarmService alarmService; + private final IStationClient stationClient; + /** + * 定时发送消息内容 + * @return String + */ + @Override + public String sendMessage() { + R> listAll = stationClient.getListAll(); + if (!listAll.isSuccess()||CollectionUtil.isEmpty(listAll.getData())){ + throw new ServiceException("FdpAlarm send message is null"); + } + List stations = listAll.getData(); + Map map = new ConcurrentHashMap<>(); + map.put("stations",stations.stream().map(StationEntity::getCode).collect(Collectors.joining(","))); + return JSONObject.toJSONString(map); + } + + /** + * 转换接收服务推送消息 + * @param message + */ + @Override + public List receiveMessage(String message) { + // 对象转换 + FdpAlarmVo alarms = JSONObject.parseObject(message, FdpAlarmVo.class); + if (ObjectUtils.isEmpty(alarms)) { + return new ArrayList<>(); + } + AlarmEntity entity = getAlarmEntity(alarms); +// List res = alarms.stream().map(s -> { +// AlarmEntity entity = getAlarmEntity(s); +// return entity; +// }).collect(Collectors.toList()); + return Collections.singletonList(entity); + } + + private AlarmEntity getAlarmEntity(FdpAlarmVo item) { + AlarmEntity entity = new AlarmEntity(); + entity.setAlarmId(item.getFaultId()); + entity.setAlarmTime(item.getCreateTime()); + entity.setAlarmContext(item.getFinfo()); + entity.setAlarmType(EARLY); + entity.setDeviceName(item.getDeviceName()); + entity.setAlarmStatus(Integer.valueOf(item.getStatus())); + entity.setStationId(item.getStation()); + entity.setAlarmSource(EARLY_WARNING); + entity.setTenantId("200000"); + R stationByCode = stationClient.getStationByCode(item.getStation()); + if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ + entity.setCreateDept(stationByCode.getData().getCreateDept()); + entity.setStationName(stationByCode.getData().getName()); + } + return entity; + } + +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java new file mode 100644 index 0000000..3f3c926 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/LevelAlarmServiceImpl.java @@ -0,0 +1,110 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.hnac.hzims.alarm.constants.AlarmConstants; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.LevelAlarmService; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.vo.LevelMessageVo; +import com.hnac.hzims.alarm.vo.LevelVo; +import com.hnac.hzims.equipment.feign.IEmInfoClient; +import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 等级告警实现类 + * @author ysj + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class LevelAlarmServiceImpl implements LevelAlarmService { + + private final AlarmService alarmService; + + private final MessageService messageService; + + private final RedisTemplate redisTemplate; + + private final IEmInfoClient deviceClient; + + private final IStationClient stationClient; + + public final static String device_cache_cofig_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; + + /** + * 发送websocket消息 + * @return + */ + @Override + public String message() { + StationEntity station = new StationEntity(); + station.setDataOrigin("0"); + // 站点 + R> result = stationClient.list(station); + if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ + log.error("level alarm send message station is null"); + return ""; + } + LevelMessageVo message = new LevelMessageVo(); + message.setProjectIds(result.getData().stream().map(StationEntity::getCode).collect(Collectors.joining(","))); + message.setType(AlarmConstants.HZ3000_ALARAM_LIST.stream().map(String::valueOf).collect(Collectors.joining(","))); + message.setStartTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"); + return JSONObject.toJSONString(message); + } + + /** + * 转换接收服务推送消息 + * @param message + */ + @Override + public List receiveMessage(String message) { + // 对象转换 + List alarms = JSONObject.parseArray(message, LevelVo.class); + if (CollectionUtil.isEmpty(alarms)) { + return new ArrayList<>(); + } + List res = alarms.stream().map(s -> { + AlarmEntity entity = getAlarmEntity(s); + return entity; + }).collect(Collectors.toList()); + return res; + } + + private AlarmEntity getAlarmEntity(LevelVo level) { + List devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(),new TypeReference>() {}); + AlarmEntity entity = new AlarmEntity(); + entity.setAlarmSource(AlarmConstants.LEVEL_ALARM); + entity.setAlarmId(level.getId()); + entity.setAlarmTime(DateUtil.parse(level.getTs(), "yyyy-MM-dd HH:mm:ss.s")); + entity.setAlarmType(level.getType()); + entity.setRealId(level.getSignage()); + entity.setAlarmContext(level.getName()); + entity.setDeviceCode(level.getDevicecode()); + entity.setDeviceName(level.getDevicename()); + entity.setAlarmLevel(level.getLevel()); + List ems = devices.stream().filter(o->level.getDevicecode().equals(o.getEmCode())).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(ems)){ + entity.setStationId(ems.get(0).getStationCode()); + entity.setDeviceName(ems.get(0).getStationName()); + } + return entity; + } + + +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java new file mode 100644 index 0000000..9e62c3f --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/MessageServiceImpl.java @@ -0,0 +1,97 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.hnac.hzims.alarm.config.service.AlarmConfigService; +import com.hnac.hzims.alarm.constants.AlarmConstants; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.message.MessageConstants; +import com.hnac.hzims.message.dto.BusinessMessageDTO; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.entity.User; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * 消息推送实现类 + * @author ysj + */ +@Slf4j +@Service +@AllArgsConstructor +public class MessageServiceImpl implements MessageService { + private final ISysClient sysClient; + private final IStationClient stationClient; + private final IUserClient userClient; + private final IMessageClient messageClient; + private final AlarmConfigService alarmConfigService; + /** + * 短信推送 + * @param entity : 告警对象 + */ + @Override + public void message(AlarmEntity entity) { + + } + + /** + * web/app消息推送 + * @param entity : 告警对象 + */ + @Override + public void webAppMessage(AlarmEntity entity) { + boolean support = alarmConfigService.isSupport(entity.getStationId(), entity.getAlarmSource(), entity.getAlarmType(), AlarmConstants.IS_PLATFORM_MESSAGE); + R stationByCode = stationClient.getStationByCode(entity.getStationId()); + if (!stationByCode.isSuccess() && ObjectUtils.isEmpty(stationByCode.getData())) { + log.error("消息发送失败:站点code获取失败",entity); + return; + } + Long dept = stationByCode.getData().getCreateDept(); + // 获取站点用户 + R> result = userClient.userListByDeptId(dept); + if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) { + log.error("消息发送失败:用户获取失败",entity); + return; + } + if (support) { + BusinessMessageDTO message = new BusinessMessageDTO(); + message.setBusinessClassify("warning"); + message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); + message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); +// todo +// message.setTaskId(entity.getAlarmId()); + message.setTenantId("200000"); + message.setContent(entity.getAlarmContext()); + message.setDeptId(dept); + R deptName = sysClient.getDeptName(dept); + if (deptName.isSuccess()) { + message.setDeptName(deptName.getData()); + } + message.setUserIds(result.getData().stream().map(o->String.valueOf(o.getId())).distinct().collect(Collectors.joining(","))); + message.setCreateUser(result.getData().get(0).getId()); + messageClient.sendAppAndWsMsgByUsers(message); + } + + + + } + + /** + * 微信公众号消息推送 + * @param entity + */ + @Override + public void weChatMessage(AlarmEntity entity) { + + } +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java new file mode 100644 index 0000000..e73da1a --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/SystemAlarmServiceImpl.java @@ -0,0 +1,105 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.hnac.hzims.alarm.constants.AlarmConstants; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.alarm.handle.service.SystemAlarmService; +import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.alarm.vo.SystemAlarmVo; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springblade.system.feign.ISysClient; +import org.springblade.system.user.feign.IUserClient; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; + +/** + * 华自3000告警实现类 + * + * @author ty + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class SystemAlarmServiceImpl implements SystemAlarmService { + + private final MessageService messageService; + private final IUserClient userClient; + + private final ISysClient sysClient; + + private final IMessageClient messageClient; + private final AlarmService alarmService; + private final IStationClient stationClient; + + /** + * 定时发送消息内容 + * + * @return String + */ + @Override + public String sendMessage() { + R> listAll = stationClient.getListAll(); + if (!listAll.isSuccess() || CollectionUtil.isEmpty(listAll.getData())) { + throw new ServiceException("systemAlarm send message is null"); + } + List stations = listAll.getData(); + Map map = new ConcurrentHashMap<>(); + map.put("stations", stations.stream().map(StationEntity::getCode).collect(Collectors.joining(","))); + map.put("soe_type", AbnormalAlarmConstant.SYSTEM_TYPE_LIST); + return JSONObject.toJSONString(map); + } + + + /** + * 转换接收服务推送消息 + * @param message + */ + @Override + public List receiveMessage(String message) { + // 对象转换 + List alarms = JSONObject.parseArray(message, SystemAlarmVo.class); + if (CollectionUtil.isEmpty(alarms)) { + return new ArrayList<>(); + } + List res = alarms.stream().map(s -> { + AlarmEntity entity = getAlarmEntity(s); + return entity; + }).collect(Collectors.toList()); + return res; + } + + private AlarmEntity getAlarmEntity(SystemAlarmVo item) { + AlarmEntity entity = new AlarmEntity(); + entity.setAlarmId(item.getId()); + entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s")); + entity.setAlarmContext(item.getSoeExplain()); + entity.setAlarmType(item.getSoeAlarmType()); + entity.setAlarmStatus(item.getSoeStatus()); + entity.setAlarmValue(item.getOptionvals()); + entity.setStationId(item.getStation()); + entity.setAlarmSource(AlarmConstants.HZ3000_ALARM); + entity.setTenantId("200000"); + R stationByCode = stationClient.getStationByCode(item.getStation()); + if (stationByCode.isSuccess() && ObjectUtils.isNotEmpty(stationByCode.getData())) { + entity.setCreateDept(stationByCode.getData().getCreateDept()); + entity.setStationName(stationByCode.getData().getName()); + } + return entity; + } +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java new file mode 100644 index 0000000..0c0447d --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/handle/service/impl/VideoAlarmServiceImpl.java @@ -0,0 +1,121 @@ +package com.hnac.hzims.alarm.handle.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; +import com.hnac.hzims.alarm.constants.AlarmConstants; +import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.VideoAlarmService; +import com.hnac.hzims.alarm.show.service.AlarmService; +import com.hnac.hzims.equipment.entity.EmInfoEntity; +import com.hnac.hzims.equipment.feign.IEmInfoClient; +import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; +import com.hnac.hzinfo.datasearch.soe.ISoeClient; +import com.hnac.hzinfo.datasearch.soe.vo.DeviceSoeVO; +import com.hnac.hzinfo.sdk.core.response.HzPage; +import com.hnac.hzinfo.sdk.core.response.Result; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.DateUtil; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 华自3000告警实现类 + * + * @author ty + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class VideoAlarmServiceImpl implements VideoAlarmService { + private final IMessageClient messageClient; + private final AlarmService alarmService; + private final ISoeClient iSoeClient; + private final IStationClient stationClient; + private final IEmInfoClient emInfoClient; + + /** + * 定时查询告警信息 + * + * @return String + */ + @Override + public List sendMessage() { + String startTime = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"); + String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); +// 根据海康摄像头的字段查询所有设备 + EmInfoEntity emInfoEntity = new EmInfoEntity(); +// 字典配的deviceType,4是海康视频 + emInfoEntity.setEmType("4"); + List infoEntityList = emInfoClient.getVideoDeviceByEmCode(emInfoEntity); + // 拿到所有设备后,掉平台预警信息的接口 + List> collect = infoEntityList.stream() + .map(s -> { + List records = new ArrayList<>(); + Result> deviceCodeByTaosSoe = iSoeClient.getDeviceCodeByTaosSoe(startTime, endTime, s.getNumber(), 1, "999"); + if (deviceCodeByTaosSoe.isSuccess() && ObjectUtils.isNotEmpty(deviceCodeByTaosSoe.getData())) { + HzPage data = deviceCodeByTaosSoe.getData(); + records = data.getRecords(); + return records; + } + return records; + }).filter(s -> CollectionUtil.isNotEmpty(s)).collect(Collectors.toList()); + List res =new ArrayList<>(); + if (CollectionUtil.isNotEmpty(collect)) { + res= collect.stream().flatMap(List::stream).collect(Collectors.toList()); + } +// 转换平台视频预警信息 + List alarmEntities =new ArrayList<>(); + if (CollectionUtil.isNotEmpty(res)) { + alarmEntities= res.stream().filter(s->ObjectUtils.isNotEmpty(s)).map(s -> getAlarmEntity(s)).collect(Collectors.toList()); + } + return alarmEntities; + } + + + /** + * 转换接收服务推送消息 + * @param message + */ + @Override + public List receiveMessage(String message) { + // 对象转换 + List alarms = JSONObject.parseArray(message, DeviceSoeVO.class); + if (CollectionUtil.isEmpty(alarms)) { + return new ArrayList<>(); + } + List res = alarms.stream().map(s -> { + AlarmEntity entity = getAlarmEntity(s); + return entity; + }).collect(Collectors.toList()); + return res; + } + + private AlarmEntity getAlarmEntity(DeviceSoeVO item) { + AlarmEntity entity = new AlarmEntity(); + entity.setAlarmId(item.getId()); + entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s")); + entity.setAlarmContext(item.getSoeExplain()); + entity.setAlarmType(AbnormalAlarmConstant.VIDEO_ALARM); + entity.setAlarmStatus(Integer.valueOf(item.getSoeStatus())); + entity.setRealId(item.getRealId()); + entity.setStationId(item.getStation()); + entity.setAlarmSource(AlarmConstants.VIDEO_WARNING); + entity.setTenantId("200000"); + R stationByCode = stationClient.getStationByCode(item.getStation()); + if (stationByCode.isSuccess() && ObjectUtils.isNotEmpty(stationByCode.getData())) { + entity.setCreateDept(stationByCode.getData().getCreateDept()); + entity.setStationName(stationByCode.getData().getName()); + } + return entity; + } +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java index dde46d4..f0f4d96 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConfig.java @@ -19,7 +19,7 @@ public class fdpMqttConfig { @Autowired fdpMqttConsumer fdpMqttConsumer; - @Value("${hzims.mqtt.fdp-url}") + /*@Value("${hzims.mqtt.fdp-url}") private String mqtt_fdp_url; @Value("${hzims.mqtt.fdp-group}") private String mqtt_fdp_group; @@ -28,7 +28,7 @@ public class fdpMqttConfig { @Value("${hzims.mqtt.fdp-username}") private String mqtt_fdp_username; @Value("${hzims.mqtt.fdp-topname}") - private String mqtt_fdp_topname; + private String mqtt_fdp_topname;*/ @PostConstruct public void registerMqtt(){ try { diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java index 5fdd86a..fe90f1b 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/mqtt/fdpMqttConsumer.java @@ -2,8 +2,8 @@ package com.hnac.hzims.alarm.mqtt; import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.FdpAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.FdpAlarmService; import com.hnac.hzinfo.subscribe.SubscribeCallBack; import org.springblade.core.log.exception.ServiceException; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java index c1b113c..3c9eb67 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/controller/ShowAlarmController.java @@ -4,8 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.SystemAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.SystemAlarmService; import com.hnac.hzims.alarm.vo.AlarmCountVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -29,75 +29,34 @@ import java.util.Map; */ @RestController @AllArgsConstructor -@RequestMapping("/alarm/show") +@RequestMapping("/alarm") @Api(value = "告警配置", tags = "告警配置") public class ShowAlarmController extends BladeController { - @Autowired - private AlarmService alarmService; + private AlarmService alarmService; + private SystemAlarmService systemAlarmService; - @PostMapping("/alarms") + @GetMapping("/broadcast") @ApiOperationSupport(order = 1) + @ApiOperation(value = "播报告警", notes = "传入:时间区间") + public R> broadcast(@ApiParam(value = "开始时间", required = false) String startTime, + @ApiParam(value = "结束时间", required = true) String endTime) { + return R.data(alarmService.broadcast(startTime,endTime)); + } + + @PostMapping("/show") + @ApiOperationSupport(order = 2) @ApiOperation(value = "告警列表分页", notes = "传入: AlarmConfigEntity对象,分页参数") public R> alarms(@ApiIgnore @RequestParam AlarmEntity alarm, Query query) { return R.data(alarmService.alarms(alarm,Condition.getPage(query))); } @PostMapping("/count") - @ApiOperationSupport(order = 1) + @ApiOperationSupport(order = 3) @ApiOperation(value = "告警分类数量", notes = "不需要传入参数") public R> counts() { return R.data(alarmService.counts()); } - - @PostMapping("/save") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "新增", notes = "传入AlarmEntity对象") - public R save(@Valid @RequestBody AlarmEntity entity) { - return R.status(alarmService.save(entity)); - } - - @PostMapping("/update") - @ApiOperationSupport(order = 2) - @ApiOperation(value = "修改", notes = "传入AlarmEntity对象") - public R update(@Valid @RequestBody AlarmEntity entity) { - return R.status(alarmService.updateById(entity)); - } - - - @PostMapping("/remove") - @ApiOperationSupport(order = 3) - @ApiOperation(value = "逻辑删除", notes = "传入ids") - public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(alarmService.deleteLogic(Func.toLongList(ids))); - } - - - @GetMapping("/list") - @ApiOperationSupport(order = 4) - @ApiOperation(value = "分页", notes = "传入em_model_param") - public R> list(@ApiIgnore @RequestParam Map params, Query query) { - QueryWrapper queryWrapper = Condition.getQueryWrapper( params, AlarmEntity.class); - IPage pages = alarmService.page(Condition.getPage(query), queryWrapper); - return R.data(pages); - } - - @GetMapping("/detail") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "详情", notes = "传入em_model_param") - public R detail(AlarmEntity entity) { - AlarmEntity detail = alarmService.getOne(Condition.getQueryWrapper(entity)); - return R.data(detail); - } - @PostMapping("/test") - @ApiOperationSupport(order = 5) - @ApiOperation(value = "详情", notes = "传入em_model_param") - public R test(@RequestBody String param) { - systemAlarmService.receiveMessage(param); - return R.success("结束"); - } - - -} +} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java new file mode 100644 index 0000000..7e9d343 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.java @@ -0,0 +1,12 @@ +package com.hnac.hzims.alarm.show.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.hnac.hzims.alarm.entity.AlarmEntity; + +/** + * @author ysj + */ +public interface AlarmMapper extends BaseMapper { + + +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml new file mode 100644 index 0000000..3fd4b39 --- /dev/null +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/mapper/AlarmMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHistoryService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHistoryService.java deleted file mode 100644 index fe78e50..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmHistoryService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; -import org.springblade.core.mp.base.BaseService; - -/** - * @author ysj - */ -public interface AlarmHistoryService extends BaseService { - -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java index be1c599..1ab1026 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/AlarmService.java @@ -16,10 +16,7 @@ public interface AlarmService extends BaseService { List counts(); - /** - * websocket 消息推送保存 - * @param param - */ - void dealAlarmEntities(List param); + List broadcast(String startTime, String endTime); + void dealAlarmEntities(List param); } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/ConditionAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/ConditionAlarmService.java deleted file mode 100644 index 0b1544d..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/ConditionAlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -import java.util.List; - -/** - * 等级处理接口 - * @author ysj - */ -public interface ConditionAlarmService { - - String message(); - - List receiveMessage(String message); -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/FdpAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/FdpAlarmService.java deleted file mode 100644 index cafb946..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/FdpAlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -import java.util.List; - -/** - * 告警处理接口 - * @author ysj - */ -public interface FdpAlarmService { - - String sendMessage(); - - List receiveMessage(String message); -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/LevelAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/LevelAlarmService.java deleted file mode 100644 index bf2c3a3..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/LevelAlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -import java.util.List; - -/** - * 等级处理接口 - * @author ysj - */ -public interface LevelAlarmService { - - String message(); - - List receiveMessage(String message); -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/MessageService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/MessageService.java deleted file mode 100644 index 1e27dc0..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/MessageService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -/** - * @author ysj - */ -public interface MessageService { - - void message(AlarmEntity entity); - - void webAppMessage(AlarmEntity entity); - - void weChatMessage(AlarmEntity entity); -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/SystemAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/SystemAlarmService.java deleted file mode 100644 index 6dc2969..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/SystemAlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -import java.util.List; - -/** - * 告警处理接口 - * @author ysj - */ -public interface SystemAlarmService { - - String sendMessage(); - - List receiveMessage(String message); -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/VideoAlarmService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/VideoAlarmService.java deleted file mode 100644 index 69ec3b2..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/VideoAlarmService.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.hnac.hzims.alarm.show.service; - -import com.hnac.hzims.alarm.entity.AlarmEntity; - -import java.util.List; - -/** - * 告警处理接口 - * @author ysj - */ -public interface VideoAlarmService { - - List sendMessage(); - - List receiveMessage(String message); -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHistoryServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHistoryServiceImpl.java deleted file mode 100644 index b2ae4af..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmHistoryServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.hnac.hzims.alarm.entity.AlarmHistoryEntity; -import com.hnac.hzims.alarm.config.mapper.AlarmHistoryMapper; -import com.hnac.hzims.alarm.show.service.AlarmHistoryService; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.mp.base.BaseServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @author ysj - */ -@AllArgsConstructor -@Service -@Slf4j -public class AlarmHistoryServiceImpl extends BaseServiceImpl implements AlarmHistoryService { - -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java index 283b00e..19a912e 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/AlarmServiceImpl.java @@ -3,16 +3,18 @@ package com.hnac.hzims.alarm.show.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.hnac.hzims.alarm.config.mapper.AlarmMapper; import com.hnac.hzims.alarm.config.service.AlarmConfigService; import com.hnac.hzims.alarm.constants.AlarmConstants; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.MessageService; +import com.hnac.hzims.alarm.show.mapper.AlarmMapper; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.MessageService; import com.hnac.hzims.alarm.vo.AlarmCountVo; import com.hnac.hzims.alarm.vo.ChildAlarmCountVo; import com.hnac.hzims.message.dto.MailMessageDTO; import com.hnac.hzims.message.fegin.IMessageClient; +import com.hnac.hzims.operational.station.entity.StationEntity; +import com.hnac.hzims.operational.station.feign.IStationClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; @@ -39,11 +41,16 @@ import java.util.stream.Collectors; @Slf4j public class AlarmServiceImpl extends BaseServiceImpl implements AlarmService { - private final AlarmConfigService configService; private final MessageService messageService; - private final IMessageClient messageClient; + + private final AlarmConfigService configService; + private final IUserClient userClient; + private final IStationClient stationClient; + + private final IMessageClient messageClient; + /** * 查询告警列表 * @param alarm @@ -52,11 +59,15 @@ public class AlarmServiceImpl extends BaseServiceImpl */ @Override public IPage alarms(AlarmEntity alarm, IPage page) { - // 排除站点 - List codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION); + List stations = this.stations(); + if(CollectionUtil.isEmpty(stations)){ + return page; + } // 参数过滤 :站点、告警来源、告警子类 QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("IS_RIGHT_TABULATION",0); + wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); if(!StringUtil.isEmpty(alarm.getStationId())){ wrapper.eq("STATION_ID",alarm.getStationId()); } @@ -66,29 +77,49 @@ public class AlarmServiceImpl extends BaseServiceImpl if(!StringUtil.isEmpty(alarm.getAlarmType())){ wrapper.eq("ALARM_TYPE",alarm.getAlarmType()); } - if(!CollectionUtil.isEmpty(codes)){ - wrapper.notIn("STATION_ID",codes); - } + // 查询数据 return this.page(page,wrapper); } /** + * 获取权限站点 + * @return + */ + private List stations() { + StationEntity station = new StationEntity(); + station.setServeType("2"); + station.setType(0); + R> result = stationClient.list(station); + if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ + return new ArrayList<>(); + } + return result.getData(); + } + + /** * 查询告警数量 * @return */ @Override public List counts() { - // 排除站点 - List codes = configService.exclude(AlarmConstants.IS_RIGHT_TABULATION); + // 站点查询 + List stations = this.stations(); + if(CollectionUtil.isEmpty(stations)){ + return AlarmConstants.ALARAM_SOURCE.stream().map(source->{ + AlarmCountVo count = new AlarmCountVo(); + count.setType(source); + count.setCount(0L); + return count; + }).collect(Collectors.toList()); + } - // 查询告警数据 + // 参数过滤 :站点、告警来源、告警子类 QueryWrapper wrapper = new QueryWrapper<>(); - if(CollectionUtil.isNotEmpty(codes)){ - wrapper.notIn("STATION_ID",codes); - } + wrapper.eq("IS_RIGHT_TABULATION",0); + wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + // 查询告警数据 List alarms = this.list(wrapper); - // 查询数量 return AlarmConstants.ALARAM_SOURCE.stream().map(source->{ AlarmCountVo count = new AlarmCountVo(); @@ -104,6 +135,31 @@ public class AlarmServiceImpl extends BaseServiceImpl } /** + * 播报告警 + * @param startTime + * @param endTime + * @return + */ + @Override + public List broadcast(String startTime, String endTime) { + // 站点查询 + List stations = this.stations(); + if(CollectionUtil.isEmpty(stations)){ + return new ArrayList<>(); + } + // 参数过滤 :站点、告警来源、告警子类 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("IS_BROADCAST",0); + wrapper.in("STATION_ID",stations.stream().map(StationEntity::getCode).collect(Collectors.toList())); + wrapper.le("CREATE_TIME",endTime); + if(!StringUtil.isEmpty(startTime)){ + wrapper.ge("CREATE_TIME",startTime); + } + // 查询播报告警 + return this.list(wrapper); + } + + /** * websocket 消息推送保存 * @param param */ diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/ConditionAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/ConditionAlarmServiceImpl.java deleted file mode 100644 index 7fd2384..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/ConditionAlarmServiceImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.ConditionAlarmService; -import com.hnac.hzims.alarm.show.service.MessageService; -import com.hnac.hzims.alarm.vo.ConditionAlarmVo; -import com.hnac.hzims.equipment.feign.IEmInfoClient; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -import static com.hnac.hzims.alarm.constants.AlarmConstants.*; - -/** - * 等级告警实现类 - * @author ysj - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class ConditionAlarmServiceImpl implements ConditionAlarmService { - - private final AlarmService alarmService; - - private final MessageService messageService; - - private final RedisTemplate redisTemplate; - - private final IEmInfoClient deviceClient; - - private final IStationClient stationClient; - - public final static String device_cache_cofig_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; - - /** - * 发送websocket消息 - * @return - */ - @Override - public String message() { - return ""; - } - - - /** - * 转换接收服务推送消息 - * @param message - */ - @Override - public List receiveMessage(String message) { - // 对象转换 - List alarms = JSONObject.parseArray(message, ConditionAlarmVo.class); - if (CollectionUtil.isEmpty(alarms)) { - return new ArrayList<>(); - } - List res = alarms.stream().map(s -> { - AlarmEntity entity = getAlarmEntity(s); - return entity; - }).collect(Collectors.toList()); - return res; - } - - private AlarmEntity getAlarmEntity(ConditionAlarmVo item) { - AlarmEntity entity = new AlarmEntity(); - entity.setAlarmId(item.getFaultId()); - entity.setAlarmTime(item.getCreateTime()); - entity.setAlarmContext(item.getFinfo()); - entity.setAlarmType(CONDITION); - entity.setAlarmStatus(Integer.valueOf(String.valueOf(item.getStatus()))); - entity.setStationId(item.getStation()); - entity.setAlarmSource(CONDITION_ALARM); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } - return entity; - } -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/FdpAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/FdpAlarmServiceImpl.java deleted file mode 100644 index a223553..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/FdpAlarmServiceImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.FdpAlarmService; -import com.hnac.hzims.alarm.show.service.MessageService; -import com.hnac.hzims.alarm.vo.FdpAlarmVo; -import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.log.exception.ServiceException; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.system.feign.ISysClient; -import org.springblade.system.user.feign.IUserClient; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; - -import static com.hnac.hzims.alarm.constants.AlarmConstants.EARLY; -import static com.hnac.hzims.alarm.constants.AlarmConstants.EARLY_WARNING; - -/** - * 等级告警实现类 - * @author ysj - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class FdpAlarmServiceImpl implements FdpAlarmService { - - - private final MessageService messageService; - private final IUserClient userClient; - private final ISysClient sysClient; - - private final IMessageClient messageClient; - private final AlarmService alarmService; - private final IStationClient stationClient; - /** - * 定时发送消息内容 - * @return String - */ - @Override - public String sendMessage() { - R> listAll = stationClient.getListAll(); - if (!listAll.isSuccess()||CollectionUtil.isEmpty(listAll.getData())){ - throw new ServiceException("FdpAlarm send message is null"); - } - List stations = listAll.getData(); - Map map = new ConcurrentHashMap<>(); - map.put("stations",stations.stream().map(StationEntity::getCode).collect(Collectors.joining(","))); - return JSONObject.toJSONString(map); - } - - /** - * 转换接收服务推送消息 - * @param message - */ - @Override - public List receiveMessage(String message) { - // 对象转换 - FdpAlarmVo alarms = JSONObject.parseObject(message, FdpAlarmVo.class); - if (ObjectUtils.isEmpty(alarms)) { - return new ArrayList<>(); - } - AlarmEntity entity = getAlarmEntity(alarms); -// List res = alarms.stream().map(s -> { -// AlarmEntity entity = getAlarmEntity(s); -// return entity; -// }).collect(Collectors.toList()); - return Collections.singletonList(entity); - } - - private AlarmEntity getAlarmEntity(FdpAlarmVo item) { - AlarmEntity entity = new AlarmEntity(); - entity.setAlarmId(item.getFaultId()); - entity.setAlarmTime(item.getCreateTime()); - entity.setAlarmContext(item.getFinfo()); - entity.setAlarmType(EARLY); - entity.setDeviceName(item.getDeviceName()); - entity.setAlarmStatus(Integer.valueOf(item.getStatus())); - entity.setStationId(item.getStation()); - entity.setAlarmSource(EARLY_WARNING); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess()&& ObjectUtils.isNotEmpty(stationByCode.getData())){ - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } - return entity; - } - -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/LevelAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/LevelAlarmServiceImpl.java deleted file mode 100644 index f8ad2cd..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/LevelAlarmServiceImpl.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.alibaba.fastjson.TypeReference; -import com.hnac.hzims.alarm.constants.AlarmConstants; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.LevelAlarmService; -import com.hnac.hzims.alarm.show.service.MessageService; -import com.hnac.hzims.alarm.vo.LevelMessageVo; -import com.hnac.hzims.alarm.vo.LevelVo; -import com.hnac.hzims.equipment.feign.IEmInfoClient; -import com.hnac.hzims.equipment.vo.EminfoAndEmParamVo; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 等级告警实现类 - * @author ysj - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class LevelAlarmServiceImpl implements LevelAlarmService { - - private final AlarmService alarmService; - - private final MessageService messageService; - - private final RedisTemplate redisTemplate; - - private final IEmInfoClient deviceClient; - - private final IStationClient stationClient; - - public final static String device_cache_cofig_final = "hzims:equipment:emInfo:deviceCode.emInfoList"; - - /** - * 发送websocket消息 - * @return - */ - @Override - public String message() { - StationEntity station = new StationEntity(); - station.setDataOrigin("0"); - // 站点 - R> result = stationClient.list(station); - if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ - log.error("level alarm send message station is null"); - return ""; - } - LevelMessageVo message = new LevelMessageVo(); - message.setProjectIds(result.getData().stream().map(StationEntity::getCode).collect(Collectors.joining(","))); - message.setType(AlarmConstants.HZ3000_ALARAM_LIST.stream().map(String::valueOf).collect(Collectors.joining(","))); - message.setStartTime(DateUtil.format(new Date(),DateUtil.PATTERN_DATE) + " 00:00:00"); - return JSONObject.toJSONString(message); - } - - /** - * 转换接收服务推送消息 - * @param message - */ - @Override - public List receiveMessage(String message) { - // 对象转换 - List alarms = JSONObject.parseArray(message, LevelVo.class); - if (CollectionUtil.isEmpty(alarms)) { - return new ArrayList<>(); - } - List res = alarms.stream().map(s -> { - AlarmEntity entity = getAlarmEntity(s); - return entity; - }).collect(Collectors.toList()); - return res; - } - - private AlarmEntity getAlarmEntity(LevelVo level) { - List devices = JSONObject.parseObject(redisTemplate.opsForValue().get(device_cache_cofig_final).toString(),new TypeReference>() {}); - AlarmEntity entity = new AlarmEntity(); - entity.setAlarmSource(AlarmConstants.LEVEL_ALARM); - entity.setAlarmId(level.getId()); - entity.setAlarmTime(DateUtil.parse(level.getTs(), "yyyy-MM-dd HH:mm:ss.s")); - entity.setAlarmType(level.getType()); - entity.setRealId(level.getSignage()); - entity.setAlarmContext(level.getName()); - entity.setDeviceCode(level.getDevicecode()); - entity.setDeviceName(level.getDevicename()); - entity.setAlarmLevel(level.getLevel()); - List ems = devices.stream().filter(o->level.getDevicecode().equals(o.getEmCode())).collect(Collectors.toList()); - if(CollectionUtil.isNotEmpty(ems)){ - entity.setStationId(ems.get(0).getStationCode()); - entity.setDeviceName(ems.get(0).getStationName()); - } - return entity; - } - - -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/MessageServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/MessageServiceImpl.java deleted file mode 100644 index 765dbeb..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/MessageServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.alarm.config.service.AlarmConfigService; -import com.hnac.hzims.alarm.constants.AlarmConstants; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.MessageService; -import com.hnac.hzims.message.MessageConstants; -import com.hnac.hzims.message.dto.BusinessMessageDTO; -import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.system.feign.ISysClient; -import org.springblade.system.user.entity.User; -import org.springblade.system.user.feign.IUserClient; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.stream.Collectors; - -/** - * 消息推送实现类 - * @author ysj - */ -@Slf4j -@Service -@AllArgsConstructor -public class MessageServiceImpl implements MessageService { - private final ISysClient sysClient; - private final IStationClient stationClient; - private final IUserClient userClient; - private final IMessageClient messageClient; - private final AlarmConfigService alarmConfigService; - /** - * 短信推送 - * @param entity : 告警对象 - */ - @Override - public void message(AlarmEntity entity) { - - } - - /** - * web/app消息推送 - * @param entity : 告警对象 - */ - @Override - public void webAppMessage(AlarmEntity entity) { - boolean support = alarmConfigService.isSupport(entity.getStationId(), entity.getAlarmSource(), entity.getAlarmType(), AlarmConstants.IS_PLATFORM_MESSAGE); - R stationByCode = stationClient.getStationByCode(entity.getStationId()); - if (!stationByCode.isSuccess() && ObjectUtils.isEmpty(stationByCode.getData())) { - log.error("消息发送失败:站点code获取失败",entity); - return; - } - Long dept = stationByCode.getData().getCreateDept(); - // 获取站点用户 - R> result = userClient.userListByDeptId(dept); - if (!result.isSuccess() || CollectionUtil.isEmpty(result.getData())) { - log.error("消息发送失败:用户获取失败",entity); - return; - } - if (support) { - BusinessMessageDTO message = new BusinessMessageDTO(); - message.setBusinessClassify("warning"); - message.setBusinessKey(MessageConstants.BusinessClassifyEnum.WARNING.getKey()); - message.setSubject(MessageConstants.BusinessClassifyEnum.WARNING.getDescription()); -// todo -// message.setTaskId(entity.getAlarmId()); - message.setTenantId("200000"); - message.setContent(entity.getAlarmContext()); - message.setDeptId(dept); - R deptName = sysClient.getDeptName(dept); - if (deptName.isSuccess()) { - message.setDeptName(deptName.getData()); - } - message.setUserIds(result.getData().stream().map(o->String.valueOf(o.getId())).distinct().collect(Collectors.joining(","))); - message.setCreateUser(result.getData().get(0).getId()); - messageClient.sendAppAndWsMsgByUsers(message); - } - - - - } - - /** - * 微信公众号消息推送 - * @param entity - */ - @Override - public void weChatMessage(AlarmEntity entity) { - - } -} \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/SystemAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/SystemAlarmServiceImpl.java deleted file mode 100644 index 9f878fb..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/SystemAlarmServiceImpl.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.alarm.constants.AlarmConstants; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.MessageService; -import com.hnac.hzims.alarm.show.service.SystemAlarmService; -import com.hnac.hzims.alarm.vo.SystemAlarmVo; -import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.log.exception.ServiceException; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.system.feign.ISysClient; -import org.springblade.system.user.feign.IUserClient; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.stream.Collectors; - -/** - * 华自3000告警实现类 - * - * @author ty - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class SystemAlarmServiceImpl implements SystemAlarmService { - - private final MessageService messageService; - private final IUserClient userClient; - - private final ISysClient sysClient; - - private final IMessageClient messageClient; - private final AlarmService alarmService; - private final IStationClient stationClient; - - /** - * 定时发送消息内容 - * - * @return String - */ - @Override - public String sendMessage() { - R> listAll = stationClient.getListAll(); - if (!listAll.isSuccess() || CollectionUtil.isEmpty(listAll.getData())) { - throw new ServiceException("systemAlarm send message is null"); - } - List stations = listAll.getData(); - Map map = new ConcurrentHashMap<>(); - map.put("stations", stations.stream().map(StationEntity::getCode).collect(Collectors.joining(","))); - map.put("soe_type", AbnormalAlarmConstant.SYSTEM_TYPE_LIST); - return JSONObject.toJSONString(map); - } - - - /** - * 转换接收服务推送消息 - * @param message - */ - @Override - public List receiveMessage(String message) { - // 对象转换 - List alarms = JSONObject.parseArray(message, SystemAlarmVo.class); - if (CollectionUtil.isEmpty(alarms)) { - return new ArrayList<>(); - } - List res = alarms.stream().map(s -> { - AlarmEntity entity = getAlarmEntity(s); - return entity; - }).collect(Collectors.toList()); - return res; - } - - private AlarmEntity getAlarmEntity(SystemAlarmVo item) { - AlarmEntity entity = new AlarmEntity(); - entity.setAlarmId(item.getId()); - entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s")); - entity.setAlarmContext(item.getSoeExplain()); - entity.setAlarmType(item.getSoeAlarmType()); - entity.setAlarmStatus(item.getSoeStatus()); - entity.setAlarmValue(item.getOptionvals()); - entity.setStationId(item.getStation()); - entity.setAlarmSource(AlarmConstants.HZ3000_ALARM); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess() && ObjectUtils.isNotEmpty(stationByCode.getData())) { - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } - return entity; - } -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/VideoAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/VideoAlarmServiceImpl.java deleted file mode 100644 index e9edfb2..0000000 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/show/service/impl/VideoAlarmServiceImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.hnac.hzims.alarm.show.service.impl; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; -import com.hnac.hzims.alarm.constants.AlarmConstants; -import com.hnac.hzims.alarm.entity.AlarmEntity; -import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.VideoAlarmService; -import com.hnac.hzims.equipment.entity.EmInfoEntity; -import com.hnac.hzims.equipment.feign.IEmInfoClient; -import com.hnac.hzims.message.fegin.IMessageClient; -import com.hnac.hzims.operational.alert.constants.AbnormalAlarmConstant; -import com.hnac.hzims.operational.station.entity.StationEntity; -import com.hnac.hzims.operational.station.feign.IStationClient; -import com.hnac.hzinfo.datasearch.soe.ISoeClient; -import com.hnac.hzinfo.datasearch.soe.vo.DeviceSoeVO; -import com.hnac.hzinfo.sdk.core.response.HzPage; -import com.hnac.hzinfo.sdk.core.response.Result; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springblade.core.tool.api.R; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.stream.Collectors; - -/** - * 华自3000告警实现类 - * - * @author ty - */ -@Slf4j -@Service -@RequiredArgsConstructor -public class VideoAlarmServiceImpl implements VideoAlarmService { - private final IMessageClient messageClient; - private final AlarmService alarmService; - private final ISoeClient iSoeClient; - private final IStationClient stationClient; - private final IEmInfoClient emInfoClient; - - /** - * 定时查询告警信息 - * - * @return String - */ - @Override - public List sendMessage() { - String startTime = DateUtil.format(new Date(), "yyyy-MM-dd 00:00:00"); - String endTime = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); -// 根据海康摄像头的字段查询所有设备 - EmInfoEntity emInfoEntity = new EmInfoEntity(); -// 字典配的deviceType,4是海康视频 - emInfoEntity.setEmType("4"); - List infoEntityList = emInfoClient.getVideoDeviceByEmCode(emInfoEntity); - // 拿到所有设备后,掉平台预警信息的接口 - List> collect = infoEntityList.stream() - .map(s -> { - List records = new ArrayList<>(); - Result> deviceCodeByTaosSoe = iSoeClient.getDeviceCodeByTaosSoe(startTime, endTime, s.getNumber(), 1, "999"); - if (deviceCodeByTaosSoe.isSuccess() && ObjectUtils.isNotEmpty(deviceCodeByTaosSoe.getData())) { - HzPage data = deviceCodeByTaosSoe.getData(); - records = data.getRecords(); - return records; - } - return records; - }).filter(s -> CollectionUtil.isNotEmpty(s)).collect(Collectors.toList()); - List res =new ArrayList<>(); - if (CollectionUtil.isNotEmpty(collect)) { - res= collect.stream().flatMap(List::stream).collect(Collectors.toList()); - } -// 转换平台视频预警信息 - List alarmEntities =new ArrayList<>(); - if (CollectionUtil.isNotEmpty(res)) { - alarmEntities= res.stream().filter(s->ObjectUtils.isNotEmpty(s)).map(s -> getAlarmEntity(s)).collect(Collectors.toList()); - } - return alarmEntities; - } - - - /** - * 转换接收服务推送消息 - * @param message - */ - @Override - public List receiveMessage(String message) { - // 对象转换 - List alarms = JSONObject.parseArray(message, DeviceSoeVO.class); - if (CollectionUtil.isEmpty(alarms)) { - return new ArrayList<>(); - } - List res = alarms.stream().map(s -> { - AlarmEntity entity = getAlarmEntity(s); - return entity; - }).collect(Collectors.toList()); - return res; - } - - private AlarmEntity getAlarmEntity(DeviceSoeVO item) { - AlarmEntity entity = new AlarmEntity(); - entity.setAlarmId(item.getId()); - entity.setAlarmTime(DateUtil.parse(item.getTs(), "yyyy-MM-dd HH:mm:ss.s")); - entity.setAlarmContext(item.getSoeExplain()); - entity.setAlarmType(AbnormalAlarmConstant.VIDEO_ALARM); - entity.setAlarmStatus(Integer.valueOf(item.getSoeStatus())); - entity.setRealId(item.getRealId()); - entity.setStationId(item.getStation()); - entity.setAlarmSource(AlarmConstants.VIDEO_WARNING); - entity.setTenantId("200000"); - R stationByCode = stationClient.getStationByCode(item.getStation()); - if (stationByCode.isSuccess() && ObjectUtils.isNotEmpty(stationByCode.getData())) { - entity.setCreateDept(stationByCode.getData().getCreateDept()); - entity.setStationName(stationByCode.getData().getName()); - } - return entity; - } -} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java index 2d1fa0b..05e61aa 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/task/VideoScheduledTask.java @@ -1,8 +1,8 @@ package com.hnac.hzims.alarm.task; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.VideoAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.VideoAlarmService; import com.xxl.job.core.biz.model.ReturnT; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java index 18d9059..900bbc0 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmRegular.java @@ -1,6 +1,6 @@ package com.hnac.hzims.alarm.ws.condition; -import com.hnac.hzims.alarm.show.service.ConditionAlarmService; +import com.hnac.hzims.alarm.handle.service.ConditionAlarmService; import com.hnac.hzims.alarm.ws.level.LevelAlarmWebSocket; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.ObjectUtil; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java index f619d8b..f3078ea 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/condition/ConditionAlarmWebSocket.java @@ -1,8 +1,8 @@ package com.hnac.hzims.alarm.ws.condition; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.ConditionAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.ConditionAlarmService; import lombok.extern.slf4j.Slf4j; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java index 63e9814..5631319 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmRegular.java @@ -1,6 +1,6 @@ package com.hnac.hzims.alarm.ws.fdp; -import com.hnac.hzims.alarm.show.service.FdpAlarmService; +import com.hnac.hzims.alarm.handle.service.FdpAlarmService; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java index fc51f00..f8513a0 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/fdp/FdpAlarmWebSocket.java @@ -1,8 +1,8 @@ package com.hnac.hzims.alarm.ws.fdp; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.FdpAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.FdpAlarmService; import lombok.extern.slf4j.Slf4j; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java index 675aa47..71712aa 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmRegular.java @@ -1,6 +1,6 @@ package com.hnac.hzims.alarm.ws.hz3000; -import com.hnac.hzims.alarm.show.service.SystemAlarmService; +import com.hnac.hzims.alarm.handle.service.SystemAlarmService; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.ObjectUtil; import org.springframework.beans.factory.annotation.Autowired; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java index 9d0d12d..fa019c9 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/hz3000/SystemAlarmWebSocket.java @@ -1,8 +1,8 @@ package com.hnac.hzims.alarm.ws.hz3000; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.SystemAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.SystemAlarmService; import lombok.extern.slf4j.Slf4j; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java index f1b1e16..d2726b8 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmRegular.java @@ -1,6 +1,6 @@ package com.hnac.hzims.alarm.ws.level; -import com.hnac.hzims.alarm.show.service.LevelAlarmService; +import com.hnac.hzims.alarm.handle.service.LevelAlarmService; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java index 88d7e3a..b9691f3 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/ws/level/LevelAlarmWebSocket.java @@ -1,8 +1,8 @@ package com.hnac.hzims.alarm.ws.level; import com.hnac.hzims.alarm.entity.AlarmEntity; +import com.hnac.hzims.alarm.handle.service.LevelAlarmService; import com.hnac.hzims.alarm.show.service.AlarmService; -import com.hnac.hzims.alarm.show.service.LevelAlarmService; import lombok.extern.slf4j.Slf4j; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake;