在线监测功能
1.预处理生成超标数据和无数据监测点数据 2.分页查询数据 3.生成预告警单(处理中)
This commit is contained in:
@@ -47,4 +47,7 @@ public interface DeptLineFeignClient {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/getLineNodeByDeptId")
|
@PostMapping("/getLineNodeByDeptId")
|
||||||
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
|
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
|
||||||
|
|
||||||
|
@PostMapping("/getAllData")
|
||||||
|
HttpResult<List<DeptLine>> getAllData();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.device.pq.api;
|
package com.njcn.device.pq.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||||
import com.njcn.device.pq.pojo.dto.*;
|
import com.njcn.device.pq.pojo.dto.*;
|
||||||
import com.njcn.device.pq.pojo.param.DataParam;
|
import com.njcn.device.pq.pojo.param.DataParam;
|
||||||
@@ -343,4 +347,10 @@ public interface LineFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/getDeptDeviceDetailData")
|
@PostMapping("/getDeptDeviceDetailData")
|
||||||
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param);
|
HttpResult<List<LineDetailVO.Detail>> getDeptDeviceDetailData(@RequestBody DataParam param);
|
||||||
|
|
||||||
|
@PostMapping("/getNoDataLine")
|
||||||
|
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine();
|
||||||
|
|
||||||
|
@PostMapping("/getReportLineInfo")
|
||||||
|
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DeptLine>> getAllData() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取部门监测点表所有数据", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,6 +269,18 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "更新监测点运行状态: ", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取当日无数据的监测点: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<ReportLineInfoVo>> getReportLineInfo(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据监测点id获取预告警单基础信息: ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,4 +93,17 @@ public class LineDetailVO implements Serializable {
|
|||||||
@ApiModelProperty("已用流量占比")
|
@ApiModelProperty("已用流量占比")
|
||||||
private Float flowProportion;
|
private Float flowProportion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class noDataLineInfo extends LineDetailVO implements Serializable{
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点Id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
@ApiModelProperty("最新数据时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ReportLineInfoVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("供电公司名称")
|
||||||
|
private String gdName;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点电压等级")
|
||||||
|
private String lineVoltage;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属电站")
|
||||||
|
private String subName;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测对象名称")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
@ApiModelProperty("电网侧变电站")
|
||||||
|
private String subVName;
|
||||||
|
|
||||||
|
@ApiModelProperty("最新数据时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("监测装置网络参数")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@ApiModelProperty("最小短路容量")
|
||||||
|
private Double shortCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电设备容量")
|
||||||
|
private Double devCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电设备容量")
|
||||||
|
private Double standardCapacity;
|
||||||
|
|
||||||
|
@ApiModelProperty("超标天数")
|
||||||
|
private Integer overDays;
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.common.utils.LogUtil;
|
import com.njcn.common.utils.LogUtil;
|
||||||
|
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||||
import com.njcn.device.pq.service.DeptLineService;
|
import com.njcn.device.pq.service.DeptLineService;
|
||||||
@@ -37,6 +38,7 @@ import java.util.Map;
|
|||||||
public class DeptLineController extends BaseController {
|
public class DeptLineController extends BaseController {
|
||||||
|
|
||||||
private final DeptLineService deptLineService;
|
private final DeptLineService deptLineService;
|
||||||
|
private final DeptLineMapper deptLineMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门绑定监测点
|
* 部门绑定监测点
|
||||||
@@ -146,4 +148,13 @@ public class DeptLineController extends BaseController {
|
|||||||
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
List<String> list = deptLineService.getLineNodeByDeptId(id);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||||
|
@PostMapping("/getAllData")
|
||||||
|
@ApiOperation("获取部门监测点表所有数据")
|
||||||
|
public HttpResult<List<DeptLine>> getAllData() {
|
||||||
|
String methodDescribe = getMethodDescribe("getAllData");
|
||||||
|
List<DeptLine> list = deptLineMapper.selectList(null);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -516,4 +516,22 @@ public class LineController extends BaseController {
|
|||||||
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
List<LineDetailVO.Detail> deptDeviceDetailData = lineService.getDeptDeviceDetailData(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, deptDeviceDetailData, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("获取当日无数据的监测点")
|
||||||
|
@PostMapping("/getNoDataLine")
|
||||||
|
HttpResult<List<LineDetailVO.noDataLineInfo>> getNoDataLine(){
|
||||||
|
String methodDescribe = getMethodDescribe("getNoDataLine");
|
||||||
|
List<LineDetailVO.noDataLineInfo> result = lineService.getNoDataLine();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("根据监测点id获取预告警单基础信息")
|
||||||
|
@PostMapping("/getReportLineInfo")
|
||||||
|
HttpResult<List<ReportLineInfoVo>> getReportLineInfo(@RequestBody List<String> ids){
|
||||||
|
String methodDescribe = getMethodDescribe("getReportLineInfo");
|
||||||
|
List<ReportLineInfoVo> result = lineService.getReportLineInfo(ids);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -551,4 +551,8 @@ public interface LineMapper extends BaseMapper<Line> {
|
|||||||
@Param("type")Integer type);
|
@Param("type")Integer type);
|
||||||
|
|
||||||
LineDetailVO getLineInfoVO(@Param("id")String id);
|
LineDetailVO getLineInfoVO(@Param("id")String id);
|
||||||
|
|
||||||
|
List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time);
|
||||||
|
|
||||||
|
List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1668,4 +1668,57 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getNoDataLine" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$noDataLineInfo">
|
||||||
|
select
|
||||||
|
pl3.Id lineId,
|
||||||
|
pl3.Name lineName,
|
||||||
|
pd.Id devId,
|
||||||
|
pl1.name devName,
|
||||||
|
pd.Update_Time
|
||||||
|
from
|
||||||
|
pq_device pd
|
||||||
|
left join pq_line pl1 on pd.Id = pl1.Id
|
||||||
|
left join pq_line pl2 on pl1.Id = pl2.pId
|
||||||
|
left join pq_line pl3 on pl2.Id = pl3.pId
|
||||||
|
where
|
||||||
|
pd.Dev_Model = 1
|
||||||
|
and pd.Run_Flag = 0
|
||||||
|
and pl1.state = 1
|
||||||
|
and pl3.Id is not null
|
||||||
|
and pd.Update_Time < #{time}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getReportLineInfo" resultType="com.njcn.device.pq.pojo.vo.ReportLineInfoVo">
|
||||||
|
select
|
||||||
|
pl5.Name gdName,
|
||||||
|
sdd.Name lineVoltage,
|
||||||
|
pl.id lineId,
|
||||||
|
pl.name lineName,
|
||||||
|
pl4.Name subName,
|
||||||
|
pld.Obj_Name objName,
|
||||||
|
pl4.name subVName,
|
||||||
|
pd.Update_Time updateTime,
|
||||||
|
pd.IP ip,
|
||||||
|
pld.Short_Capacity shortCapacity,
|
||||||
|
pld.Dev_Capacity devCapacity,
|
||||||
|
pld.Standard_Capacity standardCapacity
|
||||||
|
from
|
||||||
|
pq_line pl
|
||||||
|
left join pq_line_detail pld on pl.Id = pld.Id
|
||||||
|
left join pq_line pl2 on pl.pId = pl2.Id
|
||||||
|
left join pq_line pl3 on pl2.pId = pl3.Id
|
||||||
|
left join pq_line pl4 on pl3.pId = pl4.Id
|
||||||
|
left join pq_line pl5 on pl4.pId = pl5.Id
|
||||||
|
left join pq_line pl6 on pl5.pId = pl6.Id
|
||||||
|
left join pq_voltage pv on pv.Id = pl2.Id
|
||||||
|
left join pq_device pd on pl3.Id = pd.Id
|
||||||
|
left join sys_dict_data sdd on pv.`Scale` = sdd.Id
|
||||||
|
where
|
||||||
|
<if test="ids!=null and ids.size() > 0">
|
||||||
|
pl.Id IN
|
||||||
|
<foreach collection="ids" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -220,4 +220,8 @@ public interface LineService extends IService<Line> {
|
|||||||
List<LineALLInfoDTO> getLineAllDetailList(List<String> ids);
|
List<LineALLInfoDTO> getLineAllDetailList(List<String> ids);
|
||||||
|
|
||||||
List<LineDetailVO.Detail> getDeptDeviceDetailData(DataParam param);
|
List<LineDetailVO.Detail> getDeptDeviceDetailData(DataParam param);
|
||||||
|
|
||||||
|
List<LineDetailVO.noDataLineInfo> getNoDataLine();
|
||||||
|
|
||||||
|
List<ReportLineInfoVo> getReportLineInfo(List<String> ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
|||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -57,6 +58,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -681,6 +683,17 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
|||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LineDetailVO.noDataLineInfo> getNoDataLine() {
|
||||||
|
String time = DateUtil.format(LocalDateTime.now(), DatePattern.NORM_DATE_PATTERN);
|
||||||
|
return this.baseMapper.getNoDataLine(time);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ReportLineInfoVo> getReportLineInfo(List<String> ids) {
|
||||||
|
return this.baseMapper.getReportLineInfo(ids);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
|||||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -31,4 +32,7 @@ public interface RStatLimitRateDClient {
|
|||||||
@PostMapping("/monitorIdsGetLimitTargetInfo")
|
@PostMapping("/monitorIdsGetLimitTargetInfo")
|
||||||
HttpResult<List<RStatLimitTargetDPO>> monitorIdsGetLimitTargetInfo(@RequestBody RStatLimitQueryParam rStatLimitQueryParam);
|
HttpResult<List<RStatLimitTargetDPO>> monitorIdsGetLimitTargetInfo(@RequestBody RStatLimitQueryParam rStatLimitQueryParam);
|
||||||
|
|
||||||
|
@PostMapping("/monitorOverLimitDays")
|
||||||
|
HttpResult<List<RStatLimitTargetVO>> monitorOverLimitDays(@RequestBody RStatLimitQueryParam rStatLimitQueryParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
|||||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
import com.njcn.influx.pojo.dto.HarmHistoryDataDTO;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -49,6 +50,12 @@ public class RStatLimitRateDFeignClientFallbackFactory implements FallbackFactor
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "获取指定日期超标监测点详细信息", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "获取指定日期超标监测点详细信息", throwable.toString());
|
||||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<RStatLimitTargetVO>> monitorOverLimitDays(RStatLimitQueryParam rStatLimitQueryParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "按日期查询监测点各指标越限天数", throwable.toString());
|
||||||
|
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,6 @@ public class RStatLimitQueryParam {
|
|||||||
private List<String> ids;
|
private List<String> ids;
|
||||||
|
|
||||||
private String date;
|
private String date;
|
||||||
|
|
||||||
|
private String endDate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,4 +67,10 @@ public class RStatLimitTargetVO {
|
|||||||
@ApiModelProperty("间谐波电压限值天数")
|
@ApiModelProperty("间谐波电压限值天数")
|
||||||
private Integer inuharmOvertime = 0;
|
private Integer inuharmOvertime = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所有指标越限天数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty("所有指标越限天数")
|
||||||
|
private Integer allOvertime = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -54,4 +55,13 @@ public class RStatLimitController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/monitorOverLimitDays")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("按日期查询监测点各指标越限天数")
|
||||||
|
public HttpResult<List<RStatLimitTargetVO>> monitorOverLimitDays(@RequestBody RStatLimitQueryParam rStatLimitQueryParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("monitorOverLimitDays");
|
||||||
|
List<RStatLimitTargetVO> result = rStatLimitService.monitorOverLimitDays(rStatLimitQueryParam.getDate(),rStatLimitQueryParam.getEndDate(),rStatLimitQueryParam.getIds());
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,7 +360,8 @@
|
|||||||
SUM( ubalance_overtime ) AS ubalanceOvertime,
|
SUM( ubalance_overtime ) AS ubalanceOvertime,
|
||||||
SUM( uaberrance_overtime ) AS uaberranceOvertime,
|
SUM( uaberrance_overtime ) AS uaberranceOvertime,
|
||||||
SUM( i_neg_overtime ) AS iNegOvertime,
|
SUM( i_neg_overtime ) AS iNegOvertime,
|
||||||
sum(if((uharm_2_overtime+
|
sum(if((uaberrance_overtime+
|
||||||
|
uharm_2_overtime+
|
||||||
uharm_3_overtime+
|
uharm_3_overtime+
|
||||||
uharm_4_overtime+
|
uharm_4_overtime+
|
||||||
uharm_5_overtime+
|
uharm_5_overtime+
|
||||||
@@ -423,7 +424,77 @@
|
|||||||
inuharm_13_overtime+
|
inuharm_13_overtime+
|
||||||
inuharm_14_overtime+
|
inuharm_14_overtime+
|
||||||
inuharm_15_overtime+
|
inuharm_15_overtime+
|
||||||
inuharm_16_overtime)>0,1,0)) as inuharmOvertime
|
inuharm_16_overtime)>0,1,0)) as inuharmOvertime,
|
||||||
|
sum(if((freq_dev_overtime+
|
||||||
|
flicker_overtime+
|
||||||
|
voltage_dev_overtime+
|
||||||
|
ubalance_overtime+
|
||||||
|
uaberrance_overtime+
|
||||||
|
i_neg_overtime+
|
||||||
|
uharm_2_overtime+
|
||||||
|
uharm_3_overtime+
|
||||||
|
uharm_4_overtime+
|
||||||
|
uharm_5_overtime+
|
||||||
|
uharm_6_overtime+
|
||||||
|
uharm_7_overtime+
|
||||||
|
uharm_8_overtime+
|
||||||
|
uharm_9_overtime+
|
||||||
|
uharm_10_overtime+
|
||||||
|
uharm_11_overtime+
|
||||||
|
uharm_12_overtime+
|
||||||
|
uharm_13_overtime+
|
||||||
|
uharm_14_overtime+
|
||||||
|
uharm_15_overtime+
|
||||||
|
uharm_16_overtime+
|
||||||
|
uharm_17_overtime+
|
||||||
|
uharm_18_overtime+
|
||||||
|
uharm_19_overtime+
|
||||||
|
uharm_20_overtime+
|
||||||
|
uharm_21_overtime+
|
||||||
|
uharm_22_overtime+
|
||||||
|
uharm_23_overtime+
|
||||||
|
uharm_24_overtime+
|
||||||
|
uharm_25_overtime+
|
||||||
|
iharm_2_overtime+
|
||||||
|
iharm_3_overtime+
|
||||||
|
iharm_4_overtime+
|
||||||
|
iharm_5_overtime+
|
||||||
|
iharm_6_overtime+
|
||||||
|
iharm_7_overtime+
|
||||||
|
iharm_8_overtime+
|
||||||
|
iharm_9_overtime+
|
||||||
|
iharm_10_overtime+
|
||||||
|
iharm_11_overtime+
|
||||||
|
iharm_12_overtime+
|
||||||
|
iharm_13_overtime+
|
||||||
|
iharm_14_overtime+
|
||||||
|
iharm_15_overtime+
|
||||||
|
iharm_16_overtime+
|
||||||
|
iharm_17_overtime+
|
||||||
|
iharm_18_overtime+
|
||||||
|
iharm_19_overtime+
|
||||||
|
iharm_20_overtime+
|
||||||
|
iharm_21_overtime+
|
||||||
|
iharm_22_overtime+
|
||||||
|
iharm_23_overtime+
|
||||||
|
iharm_24_overtime+
|
||||||
|
iharm_25_overtime+
|
||||||
|
inuharm_1_overtime+
|
||||||
|
inuharm_2_overtime+
|
||||||
|
inuharm_3_overtime+
|
||||||
|
inuharm_4_overtime+
|
||||||
|
inuharm_5_overtime+
|
||||||
|
inuharm_6_overtime+
|
||||||
|
inuharm_7_overtime+
|
||||||
|
inuharm_8_overtime+
|
||||||
|
inuharm_9_overtime+
|
||||||
|
inuharm_10_overtime+
|
||||||
|
inuharm_11_overtime+
|
||||||
|
inuharm_12_overtime+
|
||||||
|
inuharm_13_overtime+
|
||||||
|
inuharm_14_overtime+
|
||||||
|
inuharm_15_overtime+
|
||||||
|
inuharm_16_overtime)>0,1,0)) as allOvertime
|
||||||
FROM
|
FROM
|
||||||
r_stat_limit_target_d
|
r_stat_limit_target_d
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
|||||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -25,6 +26,8 @@ public interface RStatLimitService {
|
|||||||
|
|
||||||
List<RStatLimitTargetDPO> monitorIdsGetLimitTargetInfo(String date, List<String> monitorIds);
|
List<RStatLimitTargetDPO> monitorIdsGetLimitTargetInfo(String date, List<String> monitorIds);
|
||||||
|
|
||||||
|
List<RStatLimitTargetVO> monitorOverLimitDays(String date, String endDate, List<String> monitorIds);
|
||||||
|
|
||||||
List<GridDiagramVO.LineData> getGridDiagramLineData(DeviceInfoParam.BusinessParam deviceInfoParam);
|
List<GridDiagramVO.LineData> getGridDiagramLineData(DeviceInfoParam.BusinessParam deviceInfoParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,16 +23,14 @@ import com.njcn.harmonic.mapper.RStatLimitTargetDMapper;
|
|||||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.harmonic.service.IRStatLimitTargetDService;
|
import com.njcn.harmonic.service.IRStatLimitTargetDService;
|
||||||
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
import com.njcn.harmonic.service.majornetwork.RStatLimitService;
|
||||||
import com.njcn.system.pojo.enums.StatisticsEnum;
|
import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -68,6 +66,11 @@ public class RStatLimitServiceImpl implements RStatLimitService {
|
|||||||
.eq(RStatLimitTargetDPO::getTime,date).gt(RStatLimitTargetDPO::getAllTime,0));
|
.eq(RStatLimitTargetDPO::getTime,date).gt(RStatLimitTargetDPO::getAllTime,0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RStatLimitTargetVO> monitorOverLimitDays(String date, String endDate, List<String> monitorIds) {
|
||||||
|
return rStatLimitTargetDMapper.getSumTargetDetails(monitorIds,date,endDate);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<GridDiagramVO.LineData> getGridDiagramLineData(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
public List<GridDiagramVO.LineData> getGridDiagramLineData(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||||
List<GridDiagramVO.LineData> info=new ArrayList<>();
|
List<GridDiagramVO.LineData> info=new ArrayList<>();
|
||||||
|
|||||||
@@ -31,16 +31,26 @@ public class OnlineParam extends BaseParam implements Serializable {
|
|||||||
@ApiModelProperty(value = "部门id")
|
@ApiModelProperty(value = "部门id")
|
||||||
private String deptId;
|
private String deptId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "指标")
|
@ApiModelProperty(value = "部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "指标id")
|
||||||
private String targetId;
|
private String targetId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "指标集合")
|
||||||
|
private List<String> targetList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "预警阈值")
|
@ApiModelProperty(value = "预警阈值")
|
||||||
private Integer alertThreshold;
|
private Integer alertThreshold;
|
||||||
|
|
||||||
@ApiModelProperty(value = "告警阈值")
|
@ApiModelProperty(value = "告警阈值")
|
||||||
private Integer alarmThreshold;
|
private Integer alarmThreshold;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据类型")
|
||||||
|
private Integer dataType;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public static class ReportParam extends OnlineParam {
|
public static class ReportParam extends OnlineParam {
|
||||||
|
|
||||||
@ApiModelProperty(name = "type", value = "0:预警单 1:告警单")
|
@ApiModelProperty(name = "type", value = "0:预警单 1:告警单")
|
||||||
@@ -48,7 +58,15 @@ public class OnlineParam extends BaseParam implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "issueDetail", value = "问题描述")
|
@ApiModelProperty(name = "issueDetail", value = "问题描述")
|
||||||
private String issueDetail;
|
private String issueDetail;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "year", value = "年")
|
||||||
|
private String year;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "number", value = "编号")
|
||||||
|
private String number;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "idList", value = "问题id集合")
|
||||||
|
private List<String> idList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.supervision.pojo.po.device;
|
package com.njcn.supervision.pojo.po.device;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -31,16 +32,24 @@ public class LineWarning extends BaseEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 告警时间
|
* 告警时间
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId(value = "alarm_time")
|
||||||
private LocalDate alarmTime;
|
private LocalDate alarmTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任部门id
|
||||||
|
*/
|
||||||
|
private String deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点id
|
* 监测点id
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId(value = "line_id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指标类型(字典id)
|
* 指标类型(字典id)
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId(value = "target_type")
|
||||||
private String targetType;
|
private String targetType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,9 +82,4 @@ public class LineWarning extends BaseEntity implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer thresholdResource;
|
private Integer thresholdResource;
|
||||||
|
|
||||||
/**
|
|
||||||
* 责任部门id
|
|
||||||
*/
|
|
||||||
private String deptId;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,9 +44,33 @@ public class OnlineVo implements Serializable {
|
|||||||
@ApiModelProperty("指标id")
|
@ApiModelProperty("指标id")
|
||||||
private String targetType;
|
private String targetType;
|
||||||
|
|
||||||
@ApiModelProperty("累计超标天数")
|
@ApiModelProperty("超标天数")
|
||||||
private Integer overLimitDay;
|
private Integer overLimitDay;
|
||||||
|
|
||||||
|
@ApiModelProperty("频率偏差")
|
||||||
|
private Integer freq;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压偏差")
|
||||||
|
private Integer voltage;
|
||||||
|
|
||||||
|
@ApiModelProperty("闪变")
|
||||||
|
private Integer flicker;
|
||||||
|
|
||||||
|
@ApiModelProperty("三相电压不平衡度")
|
||||||
|
private Integer ubalance;
|
||||||
|
|
||||||
|
@ApiModelProperty("负序电流")
|
||||||
|
private Integer iNeg;
|
||||||
|
|
||||||
|
@ApiModelProperty("谐波电压")
|
||||||
|
private Integer harmonicV;
|
||||||
|
|
||||||
|
@ApiModelProperty("谐波电流")
|
||||||
|
private Integer harmonicI;
|
||||||
|
|
||||||
|
@ApiModelProperty("间谐波电压")
|
||||||
|
private Integer inuharmV;
|
||||||
|
|
||||||
@ApiModelProperty("数据来源 0:系统默认 1:自定义")
|
@ApiModelProperty("数据来源 0:系统默认 1:自定义")
|
||||||
private Integer dataResource;
|
private Integer dataResource;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
||||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
|
||||||
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
||||||
import com.njcn.supervision.service.device.ILineWarningService;
|
import com.njcn.supervision.service.device.ILineWarningService;
|
||||||
import com.njcn.supervision.service.leaflet.IWarningLeafletService;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -25,6 +23,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 监测点每日稳态指标超标天数统计表 前端控制器
|
* 监测点每日稳态指标超标天数统计表 前端控制器
|
||||||
@@ -44,7 +44,7 @@ public class LineWarningController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ApiOperation("新增在线监测数据")
|
@ApiOperation("新增在线监测数据(连续超标天数)")
|
||||||
@ApiIgnore
|
@ApiIgnore
|
||||||
public HttpResult<String> add() {
|
public HttpResult<String> add() {
|
||||||
String methodDescribe = getMethodDescribe("add");
|
String methodDescribe = getMethodDescribe("add");
|
||||||
@@ -52,6 +52,15 @@ public class LineWarningController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/heBeiNorthAdd")
|
||||||
|
@ApiOperation("新增在线监测数据(冀北-按月统计累计超标天数)")
|
||||||
|
public HttpResult<String> heBeiNorthAdd() {
|
||||||
|
String methodDescribe = getMethodDescribe("heBeiNorthAdd");
|
||||||
|
lineWarningService.addHeBeiNorthLineWarning();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
@ApiOperation("分页查询在线监测数据")
|
@ApiOperation("分页查询在线监测数据")
|
||||||
@@ -66,9 +75,9 @@ public class LineWarningController extends BaseController {
|
|||||||
@PostMapping("/report")
|
@PostMapping("/report")
|
||||||
@ApiOperation("发起预告警单")
|
@ApiOperation("发起预告警单")
|
||||||
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
@ApiImplicitParam(name = "param", value = "参数", required = true)
|
||||||
public HttpResult<String> startReport(@RequestBody @Validated OnlineParam.ReportParam param) {
|
public HttpResult<String> startReport(@RequestBody @Validated OnlineParam.ReportParam param, HttpServletResponse response) {
|
||||||
String methodDescribe = getMethodDescribe("startReport");
|
String methodDescribe = getMethodDescribe("startReport");
|
||||||
lineWarningService.startReport(param);
|
lineWarningService.startReport(param,response);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "success", methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,4 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
public interface LineWarningMapper extends MppBaseMapper<LineWarning> {
|
public interface LineWarningMapper extends MppBaseMapper<LineWarning> {
|
||||||
|
|
||||||
Page<OnlineVo> page(@Param("page") Page<LineWarning> page, @Param("ew") QueryWrapper<LineWarning> queryWrapper);
|
Page<OnlineVo> page(@Param("page") Page<LineWarning> page, @Param("ew") QueryWrapper<LineWarning> queryWrapper);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,5 +29,4 @@
|
|||||||
and ${ew.sqlSegment}
|
and ${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.njcn.supervision.pojo.param.device.OnlineParam;
|
|||||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||||
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
import com.njcn.supervision.pojo.vo.device.OnlineVo;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 监测点每日稳态指标超标天数统计表 服务类
|
* 监测点每日稳态指标超标天数统计表 服务类
|
||||||
@@ -21,6 +23,11 @@ public interface ILineWarningService extends IService<LineWarning> {
|
|||||||
*/
|
*/
|
||||||
void addLineWarning();
|
void addLineWarning();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每日统计当前月各监测点各指标累计超标天数
|
||||||
|
*/
|
||||||
|
void addHeBeiNorthLineWarning();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取在线监测的数据列表
|
* 获取在线监测的数据列表
|
||||||
* @param param
|
* @param param
|
||||||
@@ -33,6 +40,6 @@ public interface ILineWarningService extends IService<LineWarning> {
|
|||||||
* @param param
|
* @param param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void startReport(OnlineParam.ReportParam param);
|
void startReport(OnlineParam.ReportParam param, HttpServletResponse response);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package com.njcn.supervision.service.device.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
@@ -13,11 +13,14 @@ import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
|||||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.pq.api.DeptLineFeignClient;
|
import com.njcn.device.pq.api.DeptLineFeignClient;
|
||||||
|
import com.njcn.device.pq.api.LineFeignClient;
|
||||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.ReportLineInfoVo;
|
||||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||||
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
import com.njcn.harmonic.pojo.po.day.RStatLimitTargetDPO;
|
||||||
import com.njcn.supervision.enums.ProblemTypeEnum;
|
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||||
import com.njcn.supervision.mapper.device.LineWarningMapper;
|
import com.njcn.supervision.mapper.device.LineWarningMapper;
|
||||||
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
import com.njcn.supervision.pojo.param.device.OnlineParam;
|
||||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||||
@@ -33,9 +36,11 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -57,6 +62,7 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
private final CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
private final IWarningLeafletService warningLeafletService;
|
private final IWarningLeafletService warningLeafletService;
|
||||||
private final DeptLineFeignClient deptLineFeignClient;
|
private final DeptLineFeignClient deptLineFeignClient;
|
||||||
|
private final LineFeignClient lineFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -117,6 +123,68 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
this.updateBatchById(updateList);
|
this.updateBatchById(updateList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void addHeBeiNorthLineWarning() {
|
||||||
|
List<LineWarning> result = new ArrayList<>();
|
||||||
|
//获取指标集合(10个指标,包含总指标)
|
||||||
|
List<DictData> dataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||||
|
Map<String, DictData> targetMap = dataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
||||||
|
//获取监测点和部门表关系
|
||||||
|
List<DeptLine> deptLines = deptLineFeignClient.getAllData().getData();
|
||||||
|
Map<String, List<DeptLine>> deptLineMap = deptLines.stream().collect(Collectors.groupingBy(DeptLine::getLineId));
|
||||||
|
//获取监测点按时间统计越限天数
|
||||||
|
LocalDate firstDayOfMonth = LocalDate.now().minusDays(1).with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
String date = DateUtil.format(firstDayOfMonth.atStartOfDay(), DatePattern.NORM_DATE_PATTERN);
|
||||||
|
String endDate = DateUtil.format(LocalDateTime.now().minusDays(1), DatePattern.NORM_DATE_PATTERN);
|
||||||
|
RStatLimitQueryParam rStatLimitQueryParam = new RStatLimitQueryParam(null,date,endDate);
|
||||||
|
List<RStatLimitTargetVO> limitTarget = limitRateDClient.monitorOverLimitDays(rStatLimitQueryParam).getData();
|
||||||
|
//按各指标统计越限天数
|
||||||
|
if (CollUtil.isNotEmpty(limitTarget)) {
|
||||||
|
limitTarget.forEach(item->{
|
||||||
|
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||||
|
//频率偏差
|
||||||
|
LineWarning l1 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FREQUENCY_DEV.getCode()).getId(),item.getFreqDevOvertime());
|
||||||
|
//电压偏差
|
||||||
|
LineWarning l2 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.VOLTAGE_DEV.getCode()).getId(),item.getVoltageDevOvertime());
|
||||||
|
//长时闪变
|
||||||
|
LineWarning l3 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.FLICKER.getCode()).getId(),item.getFlickerOvertime());
|
||||||
|
//谐波电压
|
||||||
|
LineWarning l4 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getId(),item.getUharmOvertime());
|
||||||
|
//谐波电流
|
||||||
|
LineWarning l5 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.HARMONIC_CURRENT.getCode()).getId(),item.getIharmOvertime());
|
||||||
|
//间谐波电压
|
||||||
|
LineWarning l6 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode()).getId(),item.getInuharmOvertime());
|
||||||
|
//负序电压不平衡度
|
||||||
|
LineWarning l7 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.PHASE_VOLTAGE.getCode()).getId(),item.getUbalanceOvertime());
|
||||||
|
//负序电流
|
||||||
|
LineWarning l8 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.NEG_CURRENT.getCode()).getId(),item.getINegOvertime());
|
||||||
|
//电压总谐波畸变率
|
||||||
|
LineWarning l9 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.THD_V.getCode()).getId(),item.getUaberranceOvertime());
|
||||||
|
//总稳态指标
|
||||||
|
LineWarning l10 = overData(firstDayOfMonth,item.getLineId(),deptId,targetMap.get(DicDataEnum.TOTAL_INDICATOR.getCode()).getId(),item.getAllOvertime());
|
||||||
|
result.addAll(Arrays.asList(l1,l2,l3,l4,l5,l6,l7,l8,l9,l10));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//将装置无数据的统计入库 按运维要求,判断装置的最新数据不是当天,则认为装置无数据
|
||||||
|
List<LineDetailVO.noDataLineInfo> noDataLineInfo = lineFeignClient.getNoDataLine().getData();
|
||||||
|
if (CollUtil.isNotEmpty(noDataLineInfo)) {
|
||||||
|
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0").eq(LineWarning::getAlarmTime,LocalDate.now().minusDays(1));
|
||||||
|
this.baseMapper.delete(lambdaQueryWrapper);
|
||||||
|
noDataLineInfo.forEach(item->{
|
||||||
|
String deptId = Objects.isNull(deptLineMap.get(item.getLineId()))?null:deptLineMap.get(item.getLineId()).get(0).getId();
|
||||||
|
LineWarning lineWarning = new LineWarning();
|
||||||
|
lineWarning.setAlarmTime(firstDayOfMonth);
|
||||||
|
lineWarning.setDeptId(deptId);
|
||||||
|
lineWarning.setLineId(item.getLineId());
|
||||||
|
lineWarning.setTargetType("0");
|
||||||
|
result.add(lineWarning);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.saveOrUpdateBatchByMultiId(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
public Page<OnlineVo> getLineWarningList(OnlineParam param) {
|
||||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
@@ -129,35 +197,66 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<LineWarning> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(),param.getSearchEndTime());
|
queryWrapper.between("A.alarm_time", param.getSearchBeginTime(),param.getSearchEndTime());
|
||||||
|
//查询无数据的监测点
|
||||||
|
if (Objects.equals(param.getDataType(),0)){
|
||||||
|
queryWrapper.eq("A.target_type", "0");
|
||||||
|
}
|
||||||
|
//查询指标超标的监测点
|
||||||
|
else {
|
||||||
queryWrapper.ge("A.over_limit_day", param.getAlertThreshold());
|
queryWrapper.ge("A.over_limit_day", param.getAlertThreshold());
|
||||||
if (CollUtil.isNotEmpty(lineList)) {
|
if (CollUtil.isNotEmpty(lineList)) {
|
||||||
queryWrapper.in("A.line_id",lineList);
|
queryWrapper.in("A.line_id",lineList);
|
||||||
}
|
}
|
||||||
if (!Objects.isNull(param.getTargetId())) {
|
if (CollUtil.isNotEmpty(param.getTargetList())) {
|
||||||
queryWrapper.eq("A.target_type", param.getTargetId());
|
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 this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void startReport(OnlineParam.ReportParam param) {
|
public void startReport(OnlineParam.ReportParam param,HttpServletResponse response) {
|
||||||
String dept = this.baseMapper.selectById(param.getId()).getDeptId();
|
//获取无数据监测点集合
|
||||||
//下发预告警单
|
List<ReportLineInfoVo> list1 = getReportLineInfo(true,param.getIdList(),null,param.getSearchBeginTime(),param.getSearchEndTime(),param.getDeptId());
|
||||||
warningLeafletService.createLeaflet(ProblemTypeEnum.ONLINE.getName(), dept,IdUtil.fastSimpleUUID(), param.getId(), ProblemTypeEnum.ONLINE.getCode(),param.getType(),param.getIssueDetail(),"");
|
//获取谐波电压超标监测点集合
|
||||||
//更新supervision_line_warning表字段信
|
String vCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_VOLTAGE.getCode()).getData().getId();
|
||||||
LineWarning lineWarning = this.baseMapper.selectById(param.getId());
|
List<ReportLineInfoVo> list2 = getReportLineInfo(false,param.getIdList(),vCode,param.getSearchBeginTime(),param.getSearchEndTime(),null);
|
||||||
if (lineWarning.getThresholdResource() == 0) {
|
//获取谐波电流超标监测点集合
|
||||||
lineWarning.setInitiateWarningFlag(1);
|
String iCode = dicDataFeignClient.getDicDataByCode(DicDataEnum.HARMONIC_CURRENT.getCode()).getData().getId();
|
||||||
lineWarning.setAlertThreshold(10);
|
List<ReportLineInfoVo> list3 = getReportLineInfo(false,param.getIdList(),iCode,param.getSearchBeginTime(),param.getSearchEndTime(),null);
|
||||||
lineWarning.setAlarmThreshold(15);
|
|
||||||
} else {
|
|
||||||
lineWarning.setInitiateWarningFlag(1);
|
|
||||||
lineWarning.setThresholdResource(1);
|
|
||||||
lineWarning.setAlertThreshold(param.getAlertThreshold());
|
|
||||||
lineWarning.setAlarmThreshold(param.getAlarmThreshold());
|
|
||||||
}
|
}
|
||||||
this.baseMapper.updateById(lineWarning);
|
|
||||||
|
public List<ReportLineInfoVo> getReportLineInfo(boolean type, List<String> idList, String codeId, String startTime, String endTime, String deptId) {
|
||||||
|
List<ReportLineInfoVo> list = new ArrayList<>();
|
||||||
|
LambdaQueryWrapper<LineWarning> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
if (type) {
|
||||||
|
lambdaQueryWrapper.eq(LineWarning::getTargetType,"0")
|
||||||
|
.eq(LineWarning::getDeptId,deptId)
|
||||||
|
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||||
|
} else {
|
||||||
|
lambdaQueryWrapper.eq(LineWarning::getTargetType,codeId)
|
||||||
|
.in(LineWarning::getId,idList)
|
||||||
|
.between(LineWarning::getAlarmTime,startTime,endTime);
|
||||||
|
}
|
||||||
|
List<LineWarning> warnings = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if (CollUtil.isNotEmpty(warnings)) {
|
||||||
|
List<String> lineList = warnings.stream().map(LineWarning::getLineId).collect(Collectors.toList());
|
||||||
|
list = lineFeignClient.getReportLineInfo(lineList).getData();
|
||||||
|
if (!type){
|
||||||
|
Map<String, Integer> lineIdOverLimitDayMap = warnings.stream().collect(Collectors.toMap(LineWarning::getLineId, LineWarning::getOverLimitDay));
|
||||||
|
list.forEach(item1 -> {
|
||||||
|
String lineId = item1.getLineId();
|
||||||
|
Integer overLimitDay = lineIdOverLimitDayMap.getOrDefault(lineId, null);
|
||||||
|
if (overLimitDay != null) {
|
||||||
|
item1.setOverDays(overLimitDay);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -179,6 +278,16 @@ public class LineWarningServiceImpl extends MppServiceImpl<LineWarningMapper, Li
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LineWarning overData(LocalDate date, String lineId, String deptId, String codeId, Integer overDays) {
|
||||||
|
LineWarning lineWarning = new LineWarning();
|
||||||
|
lineWarning.setAlarmTime(date);
|
||||||
|
lineWarning.setDeptId(deptId);
|
||||||
|
lineWarning.setLineId(lineId);
|
||||||
|
lineWarning.setTargetType(codeId);
|
||||||
|
lineWarning.setOverLimitDay(overDays);
|
||||||
|
return lineWarning;
|
||||||
|
}
|
||||||
|
|
||||||
public int overDay(String code, RStatLimitTargetDPO limitTarget) {
|
public int overDay(String code, RStatLimitTargetDPO limitTarget) {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user