|
|
|
|
@@ -3,11 +3,9 @@ package com.njcn.supervision.service.device.impl;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.date.DatePattern;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|
|
|
|
import com.njcn.common.pojo.enums.common.ServerEnum;
|
|
|
|
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
|
|
|
|
@@ -19,8 +17,11 @@ import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
|
|
|
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
|
|
|
|
import com.njcn.device.pq.api.DeptLineFeignClient;
|
|
|
|
|
import com.njcn.device.pq.api.LineFeignClient;
|
|
|
|
|
import com.njcn.device.pq.api.LineIntegrityClient;
|
|
|
|
|
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
|
|
|
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
|
|
|
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
|
|
|
|
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
|
|
|
|
import com.njcn.device.pq.pojo.vo.ReportLineInfoVo;
|
|
|
|
|
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
|
|
|
|
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
|
|
|
|
@@ -40,7 +41,6 @@ import com.njcn.supervision.pojo.param.device.OnlineParam;
|
|
|
|
|
import com.njcn.supervision.pojo.po.device.LineWarning;
|
|
|
|
|
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
|
|
|
|
import com.njcn.supervision.pojo.vo.device.LineLimitDetailVo;
|
|
|
|
|
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
|
|
|
|
import com.njcn.supervision.service.device.ILineWarningService;
|
|
|
|
|
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
|
|
|
|
import com.njcn.system.api.DicDataFeignClient;
|
|
|
|
|
@@ -48,7 +48,6 @@ import com.njcn.system.enums.DicDataEnum;
|
|
|
|
|
import com.njcn.system.enums.DicDataTypeEnum;
|
|
|
|
|
import com.njcn.system.pojo.po.DictData;
|
|
|
|
|
import com.njcn.user.api.DeptFeignClient;
|
|
|
|
|
import com.njcn.web.factory.PageFactory;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -67,7 +66,7 @@ import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
import static java.util.regex.Pattern.*;
|
|
|
|
|
import static java.util.regex.Pattern.compile;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <p>
|
|
|
|
|
@@ -97,6 +96,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|
|
|
|
private final DataHarmRateVMapper dataHarmRateVMapper;
|
|
|
|
|
private final DataInHarmVMapper dataInHarmVMapper;
|
|
|
|
|
private final DataPltMapper dataPltMapper;
|
|
|
|
|
private final LineIntegrityClient lineIntegrityClient;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
@@ -216,42 +216,76 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
|
|
|
|
public List<OnlineMonitorVo> getLineWarningList(OnlineParam param) {
|
|
|
|
|
List<OnlineMonitorVo> result = new ArrayList<>();
|
|
|
|
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
|
|
|
|
deptGetLineParam.setDeptId(param.getDeptId());
|
|
|
|
|
deptGetLineParam.setServerName(ServerEnum.HARMONIC.getName());
|
|
|
|
|
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
|
|
|
|
deptGetLineParam.setLineRunFlag(0);
|
|
|
|
|
if (ObjectUtil.isNotNull(param.getLineType()) && !Objects.equals(param.getLineType(), "")) {
|
|
|
|
|
deptGetLineParam.setIsUpToGrid(Integer.valueOf(param.getLineType()));
|
|
|
|
|
}
|
|
|
|
|
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetAllLine(deptGetLineParam).getData();
|
|
|
|
|
List<String> lineList = list.stream()
|
|
|
|
|
.flatMap(dto -> dto.getLineBaseList().stream().map(LineDevGetDTO::getPointId))
|
|
|
|
|
.distinct()
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
if (Objects.nonNull(param.getSearchBeginTime()) && Objects.nonNull(param.getSearchEndTime())) {
|
|
|
|
|
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(), param.getSearchEndTime());
|
|
|
|
|
//数据完整性为0的数据
|
|
|
|
|
if (param.getDataType() == 0) {
|
|
|
|
|
LineBaseQueryParam par = new LineBaseQueryParam();
|
|
|
|
|
par.setLineIds(lineList);
|
|
|
|
|
par.setStartTime(param.getSearchBeginTime());
|
|
|
|
|
par.setEndTime(param.getSearchEndTime());
|
|
|
|
|
result = lineIntegrityClient.getNoData(par).getData();
|
|
|
|
|
}
|
|
|
|
|
//监测点id
|
|
|
|
|
if (CollUtil.isNotEmpty(lineList)) {
|
|
|
|
|
queryWrapper.in("A.line_id", lineList);
|
|
|
|
|
//异常数据
|
|
|
|
|
else if (param.getDataType() == 1) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//监测点类型
|
|
|
|
|
if (StringUtils.isNotBlank(param.getLineType())) {
|
|
|
|
|
queryWrapper.eq("B.Power_Flag", Integer.parseInt(param.getLineType()));
|
|
|
|
|
}
|
|
|
|
|
//查询无数据的监测点
|
|
|
|
|
if (Objects.equals(param.getDataType(), 0)) {
|
|
|
|
|
queryWrapper.eq("A.target_type", "0");
|
|
|
|
|
}
|
|
|
|
|
//查询指标超标的监测点
|
|
|
|
|
//告警数据
|
|
|
|
|
else {
|
|
|
|
|
queryWrapper.ge("A.over_limit_day", param.getAlarmThreshold());
|
|
|
|
|
if (CollUtil.isNotEmpty(param.getTargetList())) {
|
|
|
|
|
queryWrapper.in("A.target_type", param.getTargetList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
|
|
|
|
|
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
|
|
|
|
// DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
|
|
|
|
// deptGetLineParam.setDeptId(param.getDeptId());
|
|
|
|
|
// deptGetLineParam.setServerName(ServerEnum.HARMONIC.getName());
|
|
|
|
|
// List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
|
|
|
|
// List<String> lineList = list.stream()
|
|
|
|
|
// .flatMap(dto -> dto.getLineBaseList().stream().map(LineDevGetDTO::getPointId))
|
|
|
|
|
// .distinct()
|
|
|
|
|
// .collect(Collectors.toList());
|
|
|
|
|
// QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
// if (Objects.nonNull(param.getSearchBeginTime()) && Objects.nonNull(param.getSearchEndTime())) {
|
|
|
|
|
// queryWrapper.between("A.alarm_time", param.getSearchBeginTime(), param.getSearchEndTime());
|
|
|
|
|
// }
|
|
|
|
|
// //监测点id
|
|
|
|
|
// if (CollUtil.isNotEmpty(lineList)) {
|
|
|
|
|
// queryWrapper.in("A.line_id", lineList);
|
|
|
|
|
// }
|
|
|
|
|
// //监测点类型
|
|
|
|
|
// if (StringUtils.isNotBlank(param.getLineType())) {
|
|
|
|
|
// queryWrapper.eq("B.Power_Flag", Integer.parseInt(param.getLineType()));
|
|
|
|
|
// }
|
|
|
|
|
// //查询无数据的监测点
|
|
|
|
|
// if (Objects.equals(param.getDataType(), 0)) {
|
|
|
|
|
// queryWrapper.eq("A.target_type", "0");
|
|
|
|
|
// }
|
|
|
|
|
// //查询指标超标的监测点
|
|
|
|
|
// else {
|
|
|
|
|
// queryWrapper.ge("A.over_limit_day", param.getAlarmThreshold());
|
|
|
|
|
// if (CollUtil.isNotEmpty(param.getTargetList())) {
|
|
|
|
|
// queryWrapper.in("A.target_type", param.getTargetList());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// queryWrapper.orderBy(true, true, "D.Name", "p4.Name", "p3.Name");
|
|
|
|
|
// return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void startReport(OnlineParam.ReportParam param) {
|
|
|
|
|
|