From 21b70a0c60d54a51d6e04dd78ab1bb7d7db9b5a9 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Fri, 26 Jan 2024 16:08:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#=E5=8E=86=E5=8F=B2=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/alarm/tabulate/vo/TabulateLevelVo.java | 5 ++ .../equipment/controller/EmInfoController.java | 4 +- .../hzims/equipment/service/IEmInfoService.java | 2 +- .../equipment/service/impl/EmInfoServiceImpl.java | 10 ++-- .../controller/AlarmTabulateController.java | 17 ++++++- .../tabulate/service/AlarmTabulateService.java | 5 ++ .../service/impl/AlarmTabulateServiceImpl.java | 59 +++++++++++++++++++++- .../station/controller/StationController.java | 8 +++ .../station/service/IStationService.java | 2 + .../station/service/impl/StationServiceImpl.java | 15 +++++- .../repair/service/impl/WorkTaskServiceImpl.java | 3 ++ 11 files changed, 121 insertions(+), 9 deletions(-) diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java index 80334fb..80f0106 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java @@ -3,6 +3,8 @@ package com.hnac.hzims.alarm.tabulate.vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * @author ysj */ @@ -26,4 +28,7 @@ public class TabulateLevelVo { @ApiModelProperty(value = "") private Integer soeType; + + @ApiModelProperty(value = "告警类型") + private List types; } \ No newline at end of file diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java index da112b3..d561b3a 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java @@ -417,8 +417,8 @@ public class EmInfoController extends BladeController { @GetMapping("/hkVideoDevices") @ApiOperationSupport(order = 12) @ApiOperation(value = "海康视频设备获取") - public R> hkVideoDevices() { - return R.data(em_infoService.hkVideoDevices()); + public R> hkVideoDevices(@RequestParam("deptId") Long deptId) { + return R.data(em_infoService.hkVideoDevices(deptId)); } @GetMapping("/select") diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java index 8732f88..662b737 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java @@ -91,7 +91,7 @@ public interface IEmInfoService extends BaseService { List getVideoDeviceByEmCode(EmInfoEntity emInfo); - List hkVideoDevices(); + List hkVideoDevices(Long deptId); List deviceByPath(String emCode); diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java index 6c3b991..160ead5 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java @@ -966,9 +966,13 @@ public class EmInfoServiceImpl extends BaseServiceImpl hkVideoDevices() { - return this.list(Wrappers.lambdaQuery() - .eq(EmInfoEntity::getEmType,4)); + public List hkVideoDevices(Long deptId) { + QueryWrapper queryWrapper= new QueryWrapper<>(); + queryWrapper.lambda().eq(EmInfoEntity::getEmType,4); + if(ObjectUtil.isNotEmpty(deptId)){ + queryWrapper.lambda().eq(EmInfoEntity::getDepartment,deptId); + } + return this.list(queryWrapper); } /** diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java index b21f37d..2893717 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java @@ -6,6 +6,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; +import com.hnac.hzinfo.datasearch.soe.domian.SoeData; import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -31,7 +32,7 @@ public class AlarmTabulateController extends BladeController { @GetMapping("/early") @ApiOperationSupport(order = 1) - @ApiOperation(value = "智能预警", notes = "传入查询参数") + @ApiOperation(value = "FDP智能预警", notes = "传入查询参数") public R> early(TabulateEarlyVo param, Query query) { return R.data(tabulateService.early(Condition.getPage(query), param)); } @@ -42,4 +43,18 @@ public class AlarmTabulateController extends BladeController { public R> level(TabulateLevelVo param, Query query) { return R.data(tabulateService.level(Condition.getPage(query), param)); } + + @GetMapping("/video") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "视频告警(海康)", notes = "视频告警(海康)") + public R> video(TabulateLevelVo param, Query query) { + return R.data(tabulateService.video(Condition.getPage(query), param)); + } + + @GetMapping("/hz3000") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "hz3000告警", notes = "hz3000告警") + public R> hz3000(TabulateLevelVo param, Query query) { + return R.data(tabulateService.hz3000(Condition.getPage(query), param)); + } } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java index 6d1b7d6..453a8cd 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.alarm.config.vo.AlarmHandleVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; +import com.hnac.hzinfo.datasearch.soe.domian.SoeData; import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import org.springblade.core.mp.support.Query; @@ -15,4 +16,8 @@ public interface AlarmTabulateService { IPage early(IPage page, TabulateEarlyVo param); IPage level(IPage page, TabulateLevelVo param); + + IPage video(IPage page, TabulateLevelVo param); + + IPage hz3000(IPage page, TabulateLevelVo param); } diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java index e21984f..3d33f69 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java @@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; +import com.hnac.hzinfo.datasearch.soe.ISoeClient; +import com.hnac.hzinfo.datasearch.soe.domian.SoeData; +import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryConditionByStation; import com.hnac.hzinfo.sdk.core.response.HzPage; import com.hnac.hzinfo.sdk.core.response.Result; import com.hnac.hzinfo.sdk.v5.device.DeviceDataClient; @@ -15,11 +18,13 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -31,6 +36,8 @@ import java.util.Map; @RequiredArgsConstructor public class AlarmTabulateServiceImpl implements AlarmTabulateService { + private final ISoeClient soeClient; + private final SoeDataClient soeDataClient; private final DeviceDataClient deviceDataClient; @@ -51,7 +58,7 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { param.setEndTime(LocalDateTime.parse(tabulateEarly.getEndTime(), DateUtil.DATETIME_FORMATTER)); } param.setPage((int) page.getCurrent()); - param.setStation(tabulateEarly.getStationCode()); + param.setStations(Collections.singletonList(tabulateEarly.getStationCode())); param.setPageSize((int) page.getSize()); Result> result = soeDataClient.pageStbAnalysis(param); if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){ @@ -82,4 +89,54 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { page.setRecords((List) data.get("data")); return page; } + + /** + * 视频告警 + * @param page + * @param param + * @return + */ + @Override + public IPage video(IPage page, TabulateLevelVo param) { + Result> result = deviceDataClient.getDeviceSoeData(param.getProjectId(),param.getDimension(),param.getId(),param.getSoeType(),param.getStartTime(),param.getEndTime(), + true,(int) page.getCurrent(),(int)page.getSize()); + if(!result.isSuccess() || MapUtils.isEmpty(result.getData())){ + return page; + } + Map data = result.getData(); + page.setTotal((Long) data.get("total")); + page.setRecords((List) data.get("data")); + return page; + } + + /** + * HZ3000告警 + * @param page + * @param param + * @return + */ + @Override + public IPage hz3000(IPage page, TabulateLevelVo param) { + SoeQueryConditionByStation query = new SoeQueryConditionByStation(); + query.setNeedPage(true); + query.setPage((int) page.getCurrent()); + query.setLimit((int) page.getSize()); + query.setStationIds(Collections.singletonList(param.getProjectId())); + if(CollectionUtil.isNotEmpty(param.getTypes())){ + query.setTypes(param.getTypes()); + } + if(StringUtil.isNotBlank(param.getStartTime())){ + query.setBeginTime(LocalDateTime.parse(param.getStartTime(),DateUtil.DATETIME_FORMATTER)); + } + if(StringUtil.isNotBlank(param.getEndTime())){ + query.setEndTime(LocalDateTime.parse(param.getEndTime(), DateUtil.DATETIME_FORMATTER)); + } + Result> result = soeClient.getByStationsAndTime(query); + if(!result.isSuccess() || ObjectUtil.isEmpty(result.getData()) || CollectionUtil.isEmpty(result.getData().getRecords())){ + return page; + } + page.setTotal(result.getData().getTotal()); + page.setRecords(result.getData().getRecords()); + return page; + } } \ No newline at end of file diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java index 2d358a0..d5e1d1a 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java @@ -199,4 +199,12 @@ public class StationController extends BladeController { public R> select(@RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "serveType", required = false) Integer serveType) { return R.data(stationService.select(type, serveType)); } + + @ApiLog + @GetMapping("/accessHydropower") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "接入水电站点列表查询", notes = "") + public R> accessHydropower() { + return R.data(stationService.accessHydropower()); + } } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java index 924cb11..2338e6c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java @@ -127,4 +127,6 @@ public interface IStationService extends BaseService { @Override boolean updateById(StationEntity req); + + List accessHydropower(); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java index e73d35a..cbfd039 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.station.service.impl; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.fdp.feign.IQuestionClient; @@ -52,7 +53,6 @@ import org.springframework.util.Assert; import java.util.*; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; import java.util.concurrent.FutureTask; import java.util.stream.Collectors; @@ -730,6 +730,19 @@ public class StationServiceImpl extends BaseServiceImpl accessHydropower() { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(StationEntity::getDataOrigin,HomePageConstant.DATA_ORIGIN); + queryWrapper.lambda().eq(StationEntity::getServeType,HomePageConstant.HYDROPOWER_SERVETYPE); + queryWrapper.lambda().eq(StationEntity::getType,HomePageConstant.HYDROPOWER); + return this.list(queryWrapper); + } + + /** * 删除新建站点时绑定的数据(项目、智能诊断站点) * * @param idList id集合 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java index f1a271d..9fb5eb9 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java @@ -179,6 +179,9 @@ public class WorkTaskServiceImpl extends BaseServiceImpl Date: Sat, 27 Jan 2024 08:28:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E5=8E=86=E5=8F=B2=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/alarm/config/constants/AlarmConstants.java | 2 ++ .../hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java | 2 +- .../tabulate/controller/AlarmTabulateController.java | 4 ++-- .../service/impl/AlarmTabulateServiceImpl.java | 18 ++++++++---------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java index 2f800d9..4a59622 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/constants/AlarmConstants.java @@ -60,4 +60,6 @@ public interface AlarmConstants { Integer STOP = 61; List START_STOP_ALARAM = Arrays.asList(START,STOP); String VIDEO_SCHEDULED_TASK= "VideoScheduledTask"; + + List HZ3000_TYPES = Arrays.asList("0","1","2","3","4","5","6","7","8","9","10","11","12"); } diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java index 80f0106..925293b 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java @@ -30,5 +30,5 @@ public class TabulateLevelVo { private Integer soeType; @ApiModelProperty(value = "告警类型") - private List types; + private String types; } \ No newline at end of file diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java index 2893717..7e924b5 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java @@ -45,14 +45,14 @@ public class AlarmTabulateController extends BladeController { } @GetMapping("/video") - @ApiOperationSupport(order = 2) + @ApiOperationSupport(order = 3) @ApiOperation(value = "视频告警(海康)", notes = "视频告警(海康)") public R> video(TabulateLevelVo param, Query query) { return R.data(tabulateService.video(Condition.getPage(query), param)); } @GetMapping("/hz3000") - @ApiOperationSupport(order = 2) + @ApiOperationSupport(order = 4) @ApiOperation(value = "hz3000告警", notes = "hz3000告警") public R> hz3000(TabulateLevelVo param, Query query) { return R.data(tabulateService.hz3000(Condition.getPage(query), param)); diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java index 3d33f69..8a1df91 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzims.alarm.tabulate.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.hnac.hzims.alarm.config.constants.AlarmConstants; import com.hnac.hzims.alarm.tabulate.service.AlarmTabulateService; import com.hnac.hzims.alarm.tabulate.vo.TabulateEarlyVo; import com.hnac.hzims.alarm.tabulate.vo.TabulateLevelVo; @@ -16,17 +17,12 @@ import com.hnac.hzinfo.sdk.v5.soe.vo.StbAnalysisVO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; -import org.springblade.core.tool.utils.CollectionUtil; -import org.springblade.core.tool.utils.DateUtil; -import org.springblade.core.tool.utils.ObjectUtil; -import org.springblade.core.tool.utils.StringUtil; +import org.springblade.core.tool.utils.*; import org.springframework.stereotype.Service; +import java.lang.reflect.Array; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @author ysj @@ -122,8 +118,10 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService { query.setPage((int) page.getCurrent()); query.setLimit((int) page.getSize()); query.setStationIds(Collections.singletonList(param.getProjectId())); - if(CollectionUtil.isNotEmpty(param.getTypes())){ - query.setTypes(param.getTypes()); + if(StringUtil.isNotBlank(param.getTypes())){ + query.setTypes(Func.toStrList(",",param.getTypes())); + }else { + query.setTypes(AlarmConstants.HZ3000_TYPES); } if(StringUtil.isNotBlank(param.getStartTime())){ query.setBeginTime(LocalDateTime.parse(param.getStartTime(),DateUtil.DATETIME_FORMATTER));