Browse Source

#历史告警查询

zhongwei
yang_shj 10 months ago
parent
commit
21b70a0c60
  1. 5
      hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/tabulate/vo/TabulateLevelVo.java
  2. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  3. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java
  4. 10
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  5. 17
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/controller/AlarmTabulateController.java
  6. 5
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/AlarmTabulateService.java
  7. 59
      hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/tabulate/service/impl/AlarmTabulateServiceImpl.java
  8. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/controller/StationController.java
  9. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java
  10. 15
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java
  11. 3
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

5
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<String> types;
}

4
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<List<EmInfoEntity>> hkVideoDevices() {
return R.data(em_infoService.hkVideoDevices());
public R<List<EmInfoEntity>> hkVideoDevices(@RequestParam("deptId") Long deptId) {
return R.data(em_infoService.hkVideoDevices(deptId));
}
@GetMapping("/select")

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java

@ -91,7 +91,7 @@ public interface IEmInfoService extends BaseService<EmInfoEntity> {
List<EmInfoEntity> getVideoDeviceByEmCode(EmInfoEntity emInfo);
List<EmInfoEntity> hkVideoDevices();
List<EmInfoEntity> hkVideoDevices(Long deptId);
List<EmInfoEntity> deviceByPath(String emCode);

10
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -966,9 +966,13 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
* @return
*/
@Override
public List<EmInfoEntity> hkVideoDevices() {
return this.list(Wrappers.<EmInfoEntity>lambdaQuery()
.eq(EmInfoEntity::getEmType,4));
public List<EmInfoEntity> hkVideoDevices(Long deptId) {
QueryWrapper<EmInfoEntity> queryWrapper= new QueryWrapper<>();
queryWrapper.lambda().eq(EmInfoEntity::getEmType,4);
if(ObjectUtil.isNotEmpty(deptId)){
queryWrapper.lambda().eq(EmInfoEntity::getDepartment,deptId);
}
return this.list(queryWrapper);
}
/**

17
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<IPage<StbAnalysisVO>> 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<IPage<Object>> level(TabulateLevelVo param, Query query) {
return R.data(tabulateService.level(Condition.getPage(query), param));
}
@GetMapping("/video")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "视频告警(海康)", notes = "视频告警(海康)")
public R<IPage<Object>> 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<IPage<SoeData>> hz3000(TabulateLevelVo param, Query query) {
return R.data(tabulateService.hz3000(Condition.getPage(query), param));
}
}

5
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<StbAnalysisVO> early(IPage<StbAnalysisVO> page, TabulateEarlyVo param);
IPage<Object> level(IPage<Object> page, TabulateLevelVo param);
IPage<Object> video(IPage<Object> page, TabulateLevelVo param);
IPage<SoeData> hz3000(IPage<SoeData> page, TabulateLevelVo param);
}

59
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<HzPage<StbAnalysisVO>> result = soeDataClient.pageStbAnalysis(param);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData().getRecords())){
@ -82,4 +89,54 @@ public class AlarmTabulateServiceImpl implements AlarmTabulateService {
page.setRecords((List<Object>) data.get("data"));
return page;
}
/**
* 视频告警
* @param page
* @param param
* @return
*/
@Override
public IPage<Object> video(IPage<Object> page, TabulateLevelVo param) {
Result<Map<String, Object>> 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<String,Object> data = result.getData();
page.setTotal((Long) data.get("total"));
page.setRecords((List<Object>) data.get("data"));
return page;
}
/**
* HZ3000告警
* @param page
* @param param
* @return
*/
@Override
public IPage<SoeData> hz3000(IPage<SoeData> 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<HzPage<SoeData>> 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;
}
}

8
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<List<StationEntity>> 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<List<StationEntity>> accessHydropower() {
return R.data(stationService.accessHydropower());
}
}

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/IStationService.java

@ -127,4 +127,6 @@ public interface IStationService extends BaseService<StationEntity> {
@Override
boolean updateById(StationEntity req);
List<StationEntity> accessHydropower();
}

15
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<StationMapper, StationEn
}
/**
* 接入水电站点查询
* @return
*/
@Override
public List<StationEntity> accessHydropower() {
QueryWrapper<StationEntity> 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集合

3
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

@ -179,6 +179,9 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
if(ObjectUtil.isNotEmpty(workTask.getGroupId())){
wrapper.eq("CREATE_DEPT",workTask.getDeptId());
}
if(ObjectUtil.isNotEmpty(workTask.getTaskName())){
wrapper.eq("TASK_NAME",workTask.getTaskName());
}
return super.page(page, wrapper);
}

Loading…
Cancel
Save