From 77f0fbbc1ffec90d3b4c383aace62a324f2832b1 Mon Sep 17 00:00:00 2001
From: yang_shj <1069818635@QQ.com>
Date: Fri, 12 Jul 2024 16:08:47 +0800
Subject: [PATCH] =?UTF-8?q?#prod=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/main/resources/template/template.yml | 1 -
hzims-service/hzims-alarm/pom.xml | 2 -
.../hzims/alarm/show/service/AlarmService.java | 7 +-
.../alarm/show/service/impl/AlarmServiceImpl.java | 213 +++++++++++++----
.../source/service/impl/MessageServiceImpl.java | 5 -
.../bigmodel/data/controller/RemoteController.java | 37 ---
.../bigmodel/data/service/HistoryDataService.java | 97 --------
.../hzims/bigmodel/data/service/RemoteService.java | 31 ---
.../controller/DataSourceExecuteController.java | 26 ---
.../datasource/service/DataSourceService.java | 62 -----
.../datasource/service/IDataSourceService.java | 14 --
.../controller/AnalyseDataController.java | 34 ---
.../interactive/service/IParamsService.java | 15 --
.../service/impl/AuthenticationService.java | 128 ----------
.../service/impl/ExtraResolveStrategyService.java | 259 ---------------------
.../interactive/service/impl/ParamStrategy.java | 73 ------
.../service/impl/ParamsServiceImpl.java | 36 ---
.../hnac/hzinfo/inspect/config/XxlJobConfig.java | 2 +-
.../inspect/task/service/impl/TaskServiceImpl.java | 12 +-
.../hzims/safeproduct/config/XxlJobConfig.java | 3 +-
.../service/impl/InnerDangerFlowServiceImpl.java | 9 +
.../repair/service/impl/WorkTaskServiceImpl.java | 9 +-
.../service/impl/OperationTicketServiceImpl.java | 9 +-
.../service/impl/TicketProcessServiceImpl.java | 36 +--
.../hnac/hzims/weather/config/XxlJobConfig.java | 2 +-
pom.xml | 25 +-
26 files changed, 222 insertions(+), 925 deletions(-)
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/controller/RemoteController.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/HistoryDataService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/service/RemoteService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/controller/DataSourceExecuteController.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/DataSourceService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/datasource/service/IDataSourceService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/AnalyseDataController.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IParamsService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/AuthenticationService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ExtraResolveStrategyService.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamStrategy.java
delete mode 100644 hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/ParamsServiceImpl.java
diff --git a/hzims-service/equipment/src/main/resources/template/template.yml b/hzims-service/equipment/src/main/resources/template/template.yml
index 9a1ce0d..034416c 100644
--- a/hzims-service/equipment/src/main/resources/template/template.yml
+++ b/hzims-service/equipment/src/main/resources/template/template.yml
@@ -79,7 +79,6 @@ fdp:
tenantId: 200000
service:
url: http://192.168.60.70:8086
- # url: 140.210.218.236
hzinfo:
model:
diff --git a/hzims-service/hzims-alarm/pom.xml b/hzims-service/hzims-alarm/pom.xml
index 29d6fbc..5cba776 100644
--- a/hzims-service/hzims-alarm/pom.xml
+++ b/hzims-service/hzims-alarm/pom.xml
@@ -32,8 +32,6 @@
com.hnac.hzims
alarm-api
- 4.0.0-SNAPSHOT
- compile
com.hnac.hzims
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 9f0c30f..b114c17 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
@@ -1,15 +1,12 @@
package com.hnac.hzims.alarm.show.service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
-import com.hnac.hzims.alarm.config.entity.AlarmEntity;
+import com.hnac.hzims.alarm.config.entity.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hnac.hzims.alarm.config.vo.AlarmCountVo;
import com.hnac.hzims.alarm.show.vo.AlarmVideoVo;
import com.hnac.hzims.alarm.show.vo.ShowQueryVo;
import com.hnac.hzims.business.ws.alart.vo.AlartParamVo;
-import org.springblade.core.mp.base.BaseService;
-import com.hnac.hzims.equipment.entity.EmVideoBandingEntity;
-
import org.springframework.web.socket.TextMessage;
import java.util.List;
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 4258fa6..d976531 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
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.hzims.alarm.config.constants.AlarmConstants;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.config.service.AlarmConfigService;
@@ -12,30 +13,21 @@ import com.hnac.hzims.alarm.config.vo.ChildAlarmCountVo;
import com.hnac.hzims.alarm.show.mapper.AlarmMapper;
import com.hnac.hzims.alarm.show.service.AlarmHandleService;
import com.hnac.hzims.alarm.show.service.AlarmService;
+import com.hnac.hzims.alarm.show.vo.AlarmVideoVo;
+import com.hnac.hzims.alarm.show.vo.ShowQueryVo;
import com.hnac.hzims.alarm.source.service.MessageService;
+import com.hnac.hzims.business.ws.alart.vo.AlartParamVo;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.entity.EmVideoBandingEntity;
import com.hnac.hzims.equipment.feign.IEmInfoClient;
import com.hnac.hzims.equipment.feign.IEmVideoClient;
-import com.hnac.hzims.message.dto.MailMessageDTO;
-import com.hnac.hzims.message.fegin.IMessageClient;
+import com.hnac.hzims.fdp.util.HttpRequestUtil;
import com.hnac.hzims.operational.station.entity.StationEntity;
+import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
+import com.hnac.hzims.operational.station.feign.IStationVideoTypeClient;
import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.hnac.hzims.alarm.config.service.AlarmConfigService;
-import com.hnac.hzims.alarm.config.vo.AlarmCountVo;
-import com.hnac.hzims.alarm.config.vo.ChildAlarmCountVo;
-import com.hnac.hzims.alarm.show.vo.AlarmVideoVo;
-import com.hnac.hzims.alarm.show.vo.ShowQueryVo;
-import com.hnac.hzims.business.ws.alart.vo.AlartParamVo;
-import com.hnac.hzims.fdp.util.HttpRequestUtil;
-import com.hnac.hzims.message.dto.MailMessageDTO;
-import com.hnac.hzims.message.fegin.IMessageClient;
-import com.hnac.hzims.operational.station.entity.StationVideoTypeEntity;
-import com.hnac.hzims.operational.station.feign.IStationVideoTypeClient;
-import lombok.AllArgsConstructor;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceEventVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceFuncVO;
import lombok.RequiredArgsConstructor;
@@ -46,6 +38,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
+import org.springblade.message.fegin.IMessageClient;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -252,36 +245,6 @@ public class AlarmServiceImpl extends ServiceImpl impl
return new TextMessage(JSONObject.toJSONString(alarms.stream().sorted(Comparator.comparing(AlarmEntity::getAlarmTime).reversed()).collect(Collectors.toList())));
}
-
- /* @Override
- public List getVideosByStationAndRealId(String stationCode, String realId) {
- R stationR = stationClient.getStationByCode(stationCode);
- Assert.isTrue(stationR.isSuccess() && Func.isNotEmpty(stationR.getData()), () -> {
- throw new ServiceException("获取站点信息失败!");
- });
- EmInfoEntity emReq = new EmInfoEntity();
- emReq.setDepartment(stationR.getData().getRefDept());
- R> emListR = emInfoClient.emInfoList(emReq);
- Assert.isTrue(emListR.isSuccess() && CollectionUtil.isNotEmpty(emListR.getData()), () -> {
- throw new ServiceException("该站点未获取到设备!");
- });
- List emInfoList = emListR.getData();
- String emCodes = emInfoList.stream().parallel()
- .filter(this::isBandingVideoByEmCode)
- .filter(this::isDeviceCodeExist)
- .filter(em -> this.isRealIdBanding(realId, em.getNumber()))
- .map(EmInfoEntity::getNumber)
- .collect(Collectors.joining(","));
- Assert.isTrue(StringUtil.isNotBlank(emCodes) && Func.isNotEmpty(emCodes), () -> {
- throw new ServiceException("未获取到设备!");
- });
- R> videoListR = emVideoClient.getEmBandingVideos(emCodes);
- Assert.isTrue(videoListR.isSuccess(), () -> {
- throw new ServiceException("获取设备绑定视频列表失败!");
- });
- return videoListR.getData().stream().distinct().collect(Collectors.toList());
- }*/
-
/**
* 验证设备编号是否绑定视频
* @param emInfo 设备信息
@@ -403,4 +366,164 @@ public class AlarmServiceImpl extends ServiceImpl impl
}
return new ArrayList<>();
}
+
+ /**
+ * 获取告警视频信息
+ * @param stationCode
+ * @param deviceCode
+ * @param realId
+ * @return
+ */
+ @Override
+ public List alarmVideos(String stationCode, String deviceCode, String realId,Integer alarmType) {
+ // 步骤1、根据设备编号查询视频信息
+ if(StringUtil.isNotBlank(deviceCode)){
+ return this.deviceVideos(stationCode,deviceCode);
+ }
+ // 步骤2、根据采集点查询视频信息
+ if(StringUtil.isNotBlank(realId)){
+ // 智能预警
+ if(AlarmConstants.EARLY.equals(alarmType)){
+ return this.earlyVideos(stationCode,realId);
+ // 通讯中断、通讯异常查询站点视频
+ }else if(AlarmConstants.INTERRUPT.equals(alarmType) || AlarmConstants.ABNORMAL.equals(alarmType)){
+ return this.stationVideos(stationCode);
+ // 其他告警
+ }else{
+ return this.realIdVideos(stationCode,realId);
+ }
+ }
+ // 步骤3.根据站点编号查询视频信息
+ if(StringUtil.isNotBlank(stationCode)){
+ return this.stationVideos(stationCode);
+ }
+ throw new ServiceException("未查询到告警视频信息!");
+ }
+
+ /**
+ *查询站点绑定视频信息
+ * @param stationCode
+ */
+ private List stationVideos(String stationCode) {
+ List videos = stationVideoTypeClient.listByStationId(stationCode);
+ if(CollectionUtil.isEmpty(videos)){
+ throw new ServiceException("站点暂无视频信息!");
+
+ }
+ return videos.stream().distinct().map(video->{
+ AlarmVideoVo alarmVideo = new AlarmVideoVo();
+ alarmVideo.setVideoHost(video.getVideoHost());
+ alarmVideo.setVideoName(video.getName());
+ alarmVideo.setVideoAppKey(video.getAppKey());
+ alarmVideo.setVideoAppSecret(video.getAppSecret());
+ alarmVideo.setPointCode(video.getPointCode());
+ return alarmVideo;
+ }).collect(Collectors.toList());
+ }
+
+
+ /**
+ * 查询设备绑定视频信息
+ * @param deviceCode
+ * @return
+ */
+ private List deviceVideos(String stationCode,String deviceCode) {
+ // 查询设备绑定视频点位
+ R> videos = emVideoClient.getEmBandingVideos(deviceCode);
+ if(!videos.isSuccess() || CollectionUtil.isEmpty(videos.getData())){
+ // 查询站点
+ R station = stationClient.getStationByCode(stationCode);
+ if(!station.isSuccess() || ObjectUtil.isEmpty(station.getData())){
+ throw new ServiceException("未查询到设备绑定视频信息!");
+ }
+ // 查询设备
+ R device = emInfoClient.getEmInfoByEmCode(deviceCode);
+ if(!device.isSuccess() || ObjectUtil.isEmpty(device.getData())){
+ throw new ServiceException("未查询到设备绑定视频信息!");
+ }
+ throw new ServiceException("请在设备信息菜单绑定" + station.getData().getName() + "-" + device.getData().getName() + "视频信息!");
+ }
+ return videos.getData().stream().distinct().map(video->{
+ AlarmVideoVo alarmVideo = new AlarmVideoVo();
+ alarmVideo.setVideoHost(video.getVideoHost());
+ alarmVideo.setVideoName(video.getVideoName());
+ alarmVideo.setVideoAppKey(video.getVideoAppKey());
+ alarmVideo.setVideoAppSecret(video.getVideoAppSecret());
+ alarmVideo.setPointCode(video.getPointCode());
+ return alarmVideo;
+ }).collect(Collectors.toList());
+ }
+
+ /**
+ * 查询智能预警视频信息
+ * @param stationCode
+ * @param faultId
+ */
+ private List earlyVideos(String stationCode, String faultId) {
+ // 调用FDP接口查询设备编号
+ Map param = new HashMap<>();
+ param.put("faultId", faultId);
+ String result = HttpRequestUtil.postCall(param, FAULTGRAPH_INFO_PATH, "POST");
+ if (StringUtil.isBlank(result)) {
+ throw new ServiceException("未查询到智能预警设备信息!");
+ }
+ HashMap map = JSONObject.parseObject(result, new TypeReference>() {
+ });
+ if (ObjectUtil.isEmpty(map)) {
+ throw new ServiceException("未查询到智能预警设备信息!");
+ }
+ List> data = JSONObject.parseObject(MapUtils.getString(map, "data"), new TypeReference>>() {
+ });
+ if (CollectionUtil.isEmpty(data)) {
+ throw new ServiceException("未查询到智能预警设备信息!");
+ }
+ String deviceCode = (String) data.get(0).get("TAOS_INSTANCE");
+ if(StringUtil.isBlank(deviceCode)){
+ throw new ServiceException("未查询到智能预警设备信息!");
+ }
+ return this.deviceVideos(stationCode,deviceCode);
+ }
+
+ /**
+ * 查询采集点绑定视频信息
+ * @param stationCode
+ * @param realId
+ */
+ private List realIdVideos(String stationCode, String realId) {
+ // 查询站点
+ R station = stationClient.getStationByCode(stationCode);
+ if(!station.isSuccess() || ObjectUtil.isEmpty(station)){
+ throw new ServiceException("未查询到告警采集点绑定视频信息!");
+ }
+ EmInfoEntity param = new EmInfoEntity();
+ param.setDepartment(station.getData().getRefDept());
+ // 查询设备
+ R> devices = emInfoClient.emInfoList(param);
+ if(!devices.isSuccess() || CollectionUtil.isEmpty(devices.getData())){
+ throw new ServiceException("未查询到告警采集点绑定视频信息!");
+ }
+ String deviceCodes = devices.getData().stream().parallel()
+ .filter(this::isBandingVideoByEmCode)
+ .filter(this::isDeviceCodeExist)
+ .map(EmInfoEntity::getNumber)
+ .filter(number -> this.isRealIdBanding(realId, number))
+ .collect(Collectors.joining(","));
+ if(StringUtil.isEmpty(deviceCodes)){
+ throw new ServiceException("未查询到告警采集点绑定视频信息!");
+ }
+ // 查询设备绑定视频点位
+ R> videos = emVideoClient.getEmBandingVideos(deviceCodes);
+ if(!videos.isSuccess() || CollectionUtil.isEmpty(videos.getData())){
+ throw new ServiceException("请在设备信息菜单绑定" + station.getData().getName() + "的设备视频绑定信息!");
+ }
+ return videos.getData().stream().distinct().map(video->{
+ AlarmVideoVo alarmVideo = new AlarmVideoVo();
+ alarmVideo.setVideoHost(video.getVideoHost());
+ alarmVideo.setVideoName(video.getVideoName());
+ alarmVideo.setVideoAppKey(video.getVideoAppKey());
+ alarmVideo.setVideoAppSecret(video.getVideoAppSecret());
+ alarmVideo.setPointCode(video.getPointCode());
+ return alarmVideo;
+ }).collect(Collectors.toList());
+ }
}
\ No newline at end of file
diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
index 2e68772..21a8d5d 100644
--- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
+++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/MessageServiceImpl.java
@@ -4,11 +4,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.alarm.config.entity.AlarmEntity;
import com.hnac.hzims.alarm.source.service.MessageService;
import com.hnac.hzims.common.constant.CommonConstant;
-import com.hnac.hzims.message.MessageConstants;
-import com.hnac.hzims.message.dto.BusinessMessageDTO;
-import com.hnac.hzims.message.dto.SmsImmediatelyPushDTO;
-import com.hnac.hzims.message.dto.WxMessageDTO;
-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;
diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/controller/RemoteController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/controller/RemoteController.java
deleted file mode 100644
index c420ba7..0000000
--- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/data/controller/RemoteController.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.hnac.hzims.bigmodel.data.controller;
-
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
-import com.hnac.hzims.bigmodel.BigModelConstants;
-import com.hnac.hzims.bigmodel.data.service.RemoteService;
-import com.hnac.hzinfo.log.annotation.Business;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.AllArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springblade.core.tool.api.R;
-import org.springblade.system.dto.ControlDTO;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @Author: huangxing
- * @Date: 2024/06/24 14:42
- */
-@AllArgsConstructor
-@RequestMapping("/remote")
-@RestController
-@Api(value = "数据平台遥控指令管理",tags = "数据平台遥控指令管理")
-@Business(module = BigModelConstants.APP_NAME,value = "数据平台遥控指令管理")
-public class RemoteController {
-
- private final RemoteService remoteService;
-
- @ApiOperation("下发遥控指令")
- @ApiOperationSupport(order = 1)
- @PostMapping("/sendRemoteControl")
- public R
-
-
-
-
-
+
+ com.xuxueli
+ xxl-job-core
+ 2.1.2
+
com.baomidou
dynamic-datasource-spring-boot-starter
@@ -77,6 +77,16 @@
com.hnac.hzims
+ alarm-api
+ ${hzims.project.version}
+
+
+ com.hnac.hzims
+ big-model-api
+ ${hzims.project.version}
+
+
+ com.hnac.hzims
basic-api
${hzims.project.version}
@@ -200,11 +210,6 @@
org.projectlombok
lombok
-
- org.springblade
- blade-core-test
- test
-