Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -75,9 +75,9 @@ public interface PatternRegex {
|
||||
String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";
|
||||
|
||||
/**
|
||||
* 部门名称由汉字组成,长度为0-20
|
||||
* 部门名称由汉字组成,长度为0-32 (前端统一32了这边改下长度)
|
||||
*/
|
||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$";
|
||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,32}$";
|
||||
|
||||
/**
|
||||
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface ValidMessage {
|
||||
|
||||
String NAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
||||
|
||||
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过20字符,请检查name参数";
|
||||
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过32字符,请检查name参数";
|
||||
|
||||
String INDUSTRY_NOT_BLANK = "行业不能为空,请检查industry参数";
|
||||
String INDUSTRY_FORMAT_ERROR = "行业格式错误,请检查industry参数";
|
||||
|
||||
@@ -136,6 +136,9 @@ public class AreaLineInfoVO implements Serializable {
|
||||
@ApiModelProperty(name = "objId",value = "对象id")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "powerSubstationName", value = "电网侧变电站")
|
||||
private String powerSubstationName;
|
||||
|
||||
@ApiModelProperty(name = "vHarmonicValue",value = "污染值")
|
||||
private Double vHarmonicValue;
|
||||
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/07/18 11:04
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class DataVerifyExcel implements Serializable {
|
||||
|
||||
private String lineId;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "供电公司")
|
||||
@Excel(name = "供电公司")
|
||||
private String city;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "所属变电站")
|
||||
@Excel(name = "所属变电站")
|
||||
private String stationName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "终端名称")
|
||||
@Excel(name = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "监测点名称")
|
||||
@Excel(name = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "IP")
|
||||
@Excel(name = "IP")
|
||||
private String ip;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "干扰源类型")
|
||||
@Excel(name = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "监测对象名称")
|
||||
@Excel(name = "监测对象名称")
|
||||
private String objName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电网侧变电站")
|
||||
@Excel(name = "电网侧变电站")
|
||||
private String powerSubstationName;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "厂商")
|
||||
@Excel(name = "厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "总指标异常时间")
|
||||
@Excel(name = "总")
|
||||
private Integer allTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "频率")
|
||||
@Excel(name = "频率")
|
||||
private Integer freqTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "频率偏差")
|
||||
@Excel(name = "频率偏差")
|
||||
private Integer freqDevTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "相电压有效值")
|
||||
@Excel(name = "相电压有效值")
|
||||
private Integer vRmsTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "正序电压")
|
||||
@Excel(name = "正序电压")
|
||||
private Integer vPosTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "负序电压")
|
||||
@Excel(name = "负序电压")
|
||||
private Integer vNegTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "零序电压")
|
||||
@Excel(name = "零序电压")
|
||||
private Integer vZeroTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压不平衡度")
|
||||
@Excel(name = "电压不平衡度")
|
||||
private Integer vUnbalanceTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "线电压有效值")
|
||||
@Excel(name = "线电压有效值")
|
||||
private Integer rmsLvrTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压正偏差")
|
||||
@Excel(name = "电压正偏差")
|
||||
private Integer vuDevTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压负偏差")
|
||||
@Excel(name = "电压负偏差")
|
||||
private Integer vlDevTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "电压总谐波畸变率")
|
||||
@Excel(name = "电压总谐波畸变率")
|
||||
private Integer vThdTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "相电压基波有效值")
|
||||
@Excel(name = "相电压基波有效值")
|
||||
private Integer vTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电流有效值")
|
||||
@Excel(name = "电流有效值")
|
||||
private Integer iRmsTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "长时闪变")
|
||||
@Excel(name = "长时闪变")
|
||||
private Integer pltTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "间谐波电压含有率")
|
||||
@Excel(name = "间谐波电压含有率")
|
||||
private Integer vInharmTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "谐波电压含有率")
|
||||
@Excel(name = "谐波电压含有率")
|
||||
private Integer vHarmTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "功率因数")
|
||||
@Excel(name = "功率因数")
|
||||
private Integer pfTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "谐波电压相角")
|
||||
@Excel(name = "谐波电压相角")
|
||||
private Integer vPhasicTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "谐波电压基波相角")
|
||||
@Excel(name = "谐波电压基波相角")
|
||||
private Integer v1PhasicTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压波动")
|
||||
@Excel(name = "电压波动")
|
||||
private Integer flucTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "短时闪变")
|
||||
@Excel(name = "短时闪变")
|
||||
private Integer pstTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压暂降")
|
||||
@Excel(name = "电压暂降")
|
||||
private Integer dipTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压暂升")
|
||||
@Excel(name = "电压暂升")
|
||||
private Integer riseTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -16,18 +16,18 @@ import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 异常数据功能
|
||||
* 异常数据功能
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
@@ -50,7 +50,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorVerifyData")
|
||||
@ApiOperation("异常-获取异常数据主页面")
|
||||
public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyData");
|
||||
VerifyMonitorVO verifyMonitorVO = iPqDataVerifyBakService.getMonitorVerifyData(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -59,7 +59,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorVerifyDay")
|
||||
@ApiOperation("异常-更新按钮-获取异常数据列表")
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyDay");
|
||||
List<PowerQualityIndicatorsVO> list = iPqDataVerifyBakService.getMonitorVerifyDay(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
@@ -72,14 +72,13 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorAbnormalTable")
|
||||
@ApiOperation("异常-弹框-获取异常监测点列表")
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorAbnormalDetail");
|
||||
List<DetailAbnormalVO> page = iPqDataVerifyBakService.monitorAbnormalTable(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取稳态告警监测点相关信息
|
||||
*/
|
||||
@@ -93,14 +92,13 @@ public class DataVerifyController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取稳态告警数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorLimitData")
|
||||
@ApiOperation("获取稳态告警数据")
|
||||
public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorLimitData");
|
||||
VerifyMonitorVO verifyMonitorVO = iDataVerifyService.getMonitorLimitData(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -109,7 +107,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorLimitDataDay")
|
||||
@ApiOperation("更新按钮-获取稳态告警数据")
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorLimitDataDay");
|
||||
List<PowerQualityIndicatorsVO> verifyMonitorVO = iDataVerifyService.getMonitorLimitDataDay(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -121,7 +119,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorLimitTable")
|
||||
@ApiOperation("弹框-获取稳态告警监测点列表")
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorLimitTable");
|
||||
List<DetailAbnormalVO> list = iDataVerifyService.monitorLimitTable(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
@@ -134,7 +132,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorLimitTableDetail")
|
||||
@ApiOperation("弹框-获取稳态告警监测点列表详情")
|
||||
public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
|
||||
DetailAbnormalVO.DetailLimitCountVO list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
@@ -150,5 +148,16 @@ public class DataVerifyController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/dataVerifyExcel")
|
||||
@ApiOperation(value = "导出异常监测点列表", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
iPqDataVerifyBakService.dataVerifyExcel(response, monitorBaseParam);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,5 @@ import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
*/
|
||||
public interface PqDataVerifyBakMapper extends BaseMapper<PqDataVerifyBak> {
|
||||
|
||||
List<DataVerifyExcel> selectDataVerifySum(@Param("param") MonitorBaseParam monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqDataVerifyBakMapper">
|
||||
|
||||
<select id="selectDataVerifySum" resultType="com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel">
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(select
|
||||
line_id AS lineId,
|
||||
(
|
||||
sum( freq_time ) +
|
||||
sum( freq_Dev_time ) +
|
||||
sum( v_Rms_time )+
|
||||
sum( v_Pos_time ) +
|
||||
sum( v_Neg_time )+
|
||||
sum( v_Zero_time )+
|
||||
sum( v_Unbalance_time )+
|
||||
sum( rms_Lvr_time ) +
|
||||
sum( vu_Dev_time ) +
|
||||
sum( vl_Dev_time ) +
|
||||
sum( v_Thd_time ) +
|
||||
sum( v_time ) +
|
||||
sum( i_Rms_time ) +
|
||||
sum( plt_time ) +
|
||||
sum( v_Inharm_time ) +
|
||||
sum( v_Harm_time )+
|
||||
sum( pf_time ) +
|
||||
sum( v_Phasic_time ) +
|
||||
sum( v1_Phasic_time ) +
|
||||
sum( fluc_time )+
|
||||
sum( pst_time ) +
|
||||
sum( dip_time ) +
|
||||
sum( rise_time )
|
||||
) allTime,
|
||||
sum( freq_time ) AS freqTime,
|
||||
sum( freq_Dev_time ) AS freqDevTime,
|
||||
sum( v_Rms_time ) AS vRmsTime,
|
||||
sum( v_Pos_time ) AS vPosTime,
|
||||
sum( v_Neg_time ) AS vNegTime,
|
||||
sum( v_Zero_time ) AS vZeroTime,
|
||||
sum( v_Unbalance_time ) AS vUnbalanceTime,
|
||||
sum( rms_Lvr_time ) AS rmsLvrTime,
|
||||
sum( vu_Dev_time ) AS vuDevTime,
|
||||
sum( vl_Dev_time ) AS vlDevTime,
|
||||
sum( v_Thd_time ) AS vThdTime,
|
||||
sum( v_time ) AS vTime,
|
||||
sum( i_Rms_time ) AS iRmsTime,
|
||||
sum( plt_time ) AS pltTime,
|
||||
sum( v_Inharm_time ) AS vInharmTime,
|
||||
sum( v_Harm_time ) AS vHarmTime,
|
||||
sum( pf_time ) AS pfTime,
|
||||
sum( v_Phasic_time ) AS vPhasicTime,
|
||||
sum( v1_Phasic_time ) AS v1PhasicTime,
|
||||
sum( fluc_time ) AS flucTime,
|
||||
sum( pst_time ) AS pstTime,
|
||||
sum( dip_time ) AS dipTime,
|
||||
sum( rise_time ) AS riseTime
|
||||
from
|
||||
pq_data_verify_bak
|
||||
<where>
|
||||
state = 1
|
||||
<if test="param.monitorIds != null and param.monitorIds.size > 0">
|
||||
AND line_id IN
|
||||
<foreach collection='param.monitorIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.searchBeginTime != null and param.searchBeginTime !=''">
|
||||
AND time_id >= #{param.searchBeginTime}
|
||||
</if>
|
||||
<if test="param.searchEndTime != null and param.searchEndTime != ''">
|
||||
AND time_id <= #{param.searchEndTime}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY line_id
|
||||
) a
|
||||
WHERE
|
||||
allTime >0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -7,6 +7,8 @@ import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -30,6 +32,6 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
|
||||
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
|
||||
void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONTokener;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -28,19 +29,19 @@ import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyTargetVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -75,7 +76,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
@Override
|
||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
@@ -86,13 +87,13 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
verifyMonitorVO.setAbnormalNum(dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId)).size());
|
||||
// List<PqDataVerifyBak> dataSumVerifyList = baseDataSumVerifyQuery(monitorIds, monitorBaseParam);
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, dataVerifyList));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataVerifyList,monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataVerifyList, monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(dataVerifyList, monitorBaseParam));
|
||||
} else {
|
||||
verifyMonitorVO.setRunNum(0);
|
||||
verifyMonitorVO.setAbnormalNum(0);
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>(),monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>(), monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
|
||||
}
|
||||
|
||||
@@ -152,7 +153,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
it.setMonitorName(lineDetail.getLineName());
|
||||
it.setStationName(lineDetail.getSubName());
|
||||
it.setDevName(lineDetail.getDeviceName());
|
||||
if(deptName.containsKey(lineDetail.getLineId())){
|
||||
if (deptName.containsKey(lineDetail.getLineId())) {
|
||||
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||
}
|
||||
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||
@@ -183,7 +184,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
@Override
|
||||
public List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam) {
|
||||
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||
@@ -297,7 +298,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
for (PqDataVerifyBak pqDataVerifyBak : value) {
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(pqDataVerifyBak.getTimeId().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak),monitorBaseParam.getErrorTimeCount()).stream().filter(x->x.getIds().size()>0).collect(Collectors.toList()));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak), monitorBaseParam.getErrorTimeCount()).stream().filter(x -> x.getIds().size() > 0).collect(Collectors.toList()));
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
@@ -331,11 +332,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
for (PqDataVerifyBak dataVerifyBak : pqDataVerifyBak) {
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(dataVerifyBak.getPath())) {
|
||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
jsonArray.forEach(it->{
|
||||
jsonArray.forEach(it -> {
|
||||
JSONObject targetJson = (JSONObject) it;
|
||||
if (targetJson.containsKey("lineErrorTimes")) {
|
||||
errorTimeCount[0] += Integer.valueOf(targetJson.get("lineErrorTimes").toString());
|
||||
}else{
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||
@@ -367,6 +368,40 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getDeptId())) {
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
monitorBaseParam.setMonitorIds(monitorIds);
|
||||
}
|
||||
List<DataVerifyExcel> dataVerifyExcels = this.baseMapper.selectDataVerifySum(monitorBaseParam);
|
||||
List<String> ids = dataVerifyExcels.stream().map(DataVerifyExcel::getLineId).collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
||||
Map<String, AreaLineInfoVO> map = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
for (DataVerifyExcel dataVerifyExcel : dataVerifyExcels) {
|
||||
if (map.containsKey(dataVerifyExcel.getLineId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = map.get(dataVerifyExcel.getLineId());
|
||||
dataVerifyExcel.setCity(areaLineInfoVO.getGdName());
|
||||
dataVerifyExcel.setLineName(areaLineInfoVO.getLineName());
|
||||
dataVerifyExcel.setLoadType(areaLineInfoVO.getLoadType());
|
||||
dataVerifyExcel.setObjName(areaLineInfoVO.getObjName());
|
||||
dataVerifyExcel.setStationName(areaLineInfoVO.getSubName());
|
||||
dataVerifyExcel.setPowerSubstationName(areaLineInfoVO.getPowerSubstationName());
|
||||
dataVerifyExcel.setDevName(areaLineInfoVO.getDeviceName());
|
||||
dataVerifyExcel.setIp(areaLineInfoVO.getIp());
|
||||
dataVerifyExcel.setManufacturer(areaLineInfoVO.getManufacturer());
|
||||
}
|
||||
}
|
||||
Set<String> excludeColumnFiledNames = new HashSet<>(1);
|
||||
excludeColumnFiledNames.add("lineId");
|
||||
dataVerifyExcels.sort(Comparator.comparing((DataVerifyExcel item) -> item.getCity() + "_" + item.getStationName()+"_"+item.getDevName())
|
||||
.thenComparing(DataVerifyExcel::getAllTime, Comparator.reverseOrder())
|
||||
);
|
||||
EasyExcel.write(response.getOutputStream(), DataVerifyExcel.class)
|
||||
.excludeColumnFiledNames(excludeColumnFiledNames).sheet("sheet")
|
||||
.doWrite(dataVerifyExcels);
|
||||
}
|
||||
|
||||
|
||||
private static final Pattern HARMONIC_PATTERN = Pattern.compile("(\\d+)次谐波");
|
||||
|
||||
@@ -441,7 +476,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
// if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
|
||||
// vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
|
||||
// } else {
|
||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
||||
// }
|
||||
valueList.forEach(ites -> {
|
||||
switch (ites.getType()) {
|
||||
@@ -471,7 +506,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
|
||||
private List<PqDataVerifyBak> baseDataVerifyQuery(List<String> monitorIds, MonitorBaseParam monitorBaseParam) {
|
||||
if(Objects.isNull(monitorBaseParam.getErrorTimeCount())){
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -623,102 +658,102 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
/**
|
||||
* 指标异常测点数量
|
||||
*/
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList,Integer errorTimeCount) {
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList, Integer errorTimeCount) {
|
||||
List<VerifyTargetVO> result = new ArrayList<>();
|
||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||
rangeMap.forEach((key, dto) -> {
|
||||
Set<String> ids;
|
||||
switch (key) {
|
||||
case Param.freq:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFreqTime())).filter(it -> it.getFreqTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFreqTime())).filter(it -> it.getFreqTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.freq_dev:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFreqDevTime())).filter(it -> it.getFreqDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFreqDevTime())).filter(it -> it.getFreqDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_v:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVRmsTime())).filter(it -> it.getVRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVRmsTime())).filter(it -> it.getVRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_lvr:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getRmsLvrTime())).filter(it -> it.getRmsLvrTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getRmsLvrTime())).filter(it -> it.getRmsLvrTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vu_dev:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVuDevTime())).filter(it -> it.getVuDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVuDevTime())).filter(it -> it.getVuDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vl_dev:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVlDevTime())).filter(it -> it.getVlDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVlDevTime())).filter(it -> it.getVlDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_i:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getIRmsTime())).filter(it -> it.getIRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getIRmsTime())).filter(it -> it.getIRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_thd:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVThdTime())).filter(it -> it.getVThdTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVThdTime())).filter(it -> it.getVThdTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_1_v:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVTime())).filter(it -> it.getVTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVTime())).filter(it -> it.getVTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_v_1:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getV1PhasicTime())).filter(it -> it.getV1PhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getV1PhasicTime())).filter(it -> it.getV1PhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_rate_x:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVPhasicTime())).filter(it -> it.getVPhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVPhasicTime())).filter(it -> it.getVPhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_rate:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVHarmTime())).filter(it -> it.getVHarmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVHarmTime())).filter(it -> it.getVHarmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.in_v_rate:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVInharmTime())).filter(it -> it.getVInharmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVInharmTime())).filter(it -> it.getVInharmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_zero:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVZeroTime())).filter(it -> it.getVZeroTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVZeroTime())).filter(it -> it.getVZeroTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_neg:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVNegTime())).filter(it -> it.getVNegTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVNegTime())).filter(it -> it.getVNegTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_pos:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVPosTime())).filter(it -> it.getVPosTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVPosTime())).filter(it -> it.getVPosTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_unbalance:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getVUnbalanceTime())).filter(it -> it.getVUnbalanceTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVUnbalanceTime())).filter(it -> it.getVUnbalanceTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.fluc:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getFlucTime())).filter(it -> it.getFlucTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFlucTime())).filter(it -> it.getFlucTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pst:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPstTime())).filter(it -> it.getPstTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPstTime())).filter(it -> it.getPstTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.plt:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPltTime())).filter(it -> it.getPltTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPltTime())).filter(it -> it.getPltTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pf:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getPfTime())).filter(it -> it.getPfTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPfTime())).filter(it -> it.getPfTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getDipTime())).filter(it -> it.getDipTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getDipTime())).filter(it -> it.getDipTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
ids = dataVerifyList.stream().filter(x-> ObjUtil.isNotNull(x.getRiseTime())).filter(it -> it.getRiseTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getRiseTime())).filter(it -> it.getRiseTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
default:
|
||||
@@ -747,7 +782,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
// if (temStr.equals(Param.rms_i)) {
|
||||
// verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
|
||||
// } else {
|
||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
||||
// }
|
||||
result.add(verifyTargetVO);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
lineIndexes = generalDeviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(lineIndexes)) {
|
||||
resultList = deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(),runManageParam.getRunFlag(), Objects.isNull(runManageParam.getSearchValue())?null:runManageParam.getSearchValue());
|
||||
resultList = deviceMapper.getRunManageList(lineIndexes, runManageParam.getComFlag(),Objects.isNull(runManageParam.getRunFlag())?new ArrayList<>():runManageParam.getRunFlag(), Objects.isNull(runManageParam.getSearchValue())?null:runManageParam.getSearchValue());
|
||||
if(CollUtil.isNotEmpty(resultList)){
|
||||
List<String> objIds = resultList.stream().map(RunManageVO::getObjId).collect(Collectors.toList());
|
||||
Map<String,NewUserReportVO> runManageVOMap = userLedgerFeignClient.getUserReportByIds(objIds).getData().stream().collect(Collectors.toMap(NewUserReportVO::getId,Function.identity()));
|
||||
|
||||
@@ -562,7 +562,7 @@
|
||||
detail.Short_Capacity,
|
||||
detail.Standard_Capacity,
|
||||
detail.Deal_Capacity,
|
||||
detail.Business_Type,
|
||||
detail.Business_Type businessType,
|
||||
detail.Calssification_Grade,
|
||||
detail.Superiors_Substation,
|
||||
detail.Hang_Line,
|
||||
@@ -571,7 +571,8 @@
|
||||
detail.obj_id,
|
||||
detail.big_obj_type,
|
||||
detail.small_obj_type,
|
||||
detail.Power_Flag powerFlag
|
||||
detail.Power_Flag powerFlag,
|
||||
detail.Power_Substation_Name powerSubstationName
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line_detail detail,
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
<select id="selectDownCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(ed.event_id) "COUNT"
|
||||
from r_mp_event_detail ed
|
||||
from r_mp_event_detail ed inner join sys_dict_data sd on ed.event_type= sd.id
|
||||
where
|
||||
sd.code in ('Voltage_Dip','Short_Interruptions')
|
||||
and
|
||||
ed.measurement_point_id in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
/**
|
||||
@@ -51,11 +52,12 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
private final EventDetailService eventDetailService;
|
||||
@Override
|
||||
public AreaAnalysisVO getEventReason(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
//根据单体系统这里只要不为录波的都统计
|
||||
//获取暂降字典信息
|
||||
DictData recordingWaveData = dicDataFeignClient.getDicDataByCode(DicDataEnum.RECORDING_WAVE.getCode()).getData();
|
||||
|
||||
if(ObjectUtil.isNull(recordingWaveData)){
|
||||
//获取暂降字典信息
|
||||
DictData voltageData = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
DictData shortInterruptionsData = dicDataFeignClient.getDicDataByCode(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getData();
|
||||
|
||||
if(ObjectUtil.isNull(voltageData)||ObjectUtil.isNull(shortInterruptionsData)){
|
||||
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
||||
}
|
||||
AreaAnalysisVO areaAnalysisVO = new AreaAnalysisVO();
|
||||
@@ -70,7 +72,9 @@ public class AreaAnalysisServiceImpl implements AreaAnalysisService {
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new QueryWrapper<RmpEventDetailPO>()
|
||||
.select("advance_reason,advance_type,count(event_id) as count")
|
||||
.in("measurement_point_id", lineIds)
|
||||
.ne("event_type", recordingWaveData.getId())
|
||||
.in("event_type", Stream.of(voltageData.getId(),shortInterruptionsData.getId()).collect(Collectors.toList()))
|
||||
|
||||
// .eq("event_type", voltageData.getId())
|
||||
.in("advance_reason", dicReasonList.stream().map(DictData::getId).collect(Collectors.toList()))
|
||||
.in("advance_type", dicTypeList.stream().map(DictData::getId).collect(Collectors.toList()))
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()),"start_time" ,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
|
||||
@@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -149,7 +150,7 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
//监测点id
|
||||
eventDetailNew.setLineId(eventDetail.getMeasurementPointId());
|
||||
//特征幅值 需要转成百分比*100
|
||||
eventDetailNew.setFeatureAmplitude(eventDetail.getFeatureAmplitude()*100);
|
||||
eventDetailNew.setFeatureAmplitude(roundHalfUp(eventDetail.getFeatureAmplitude()*100));
|
||||
//持续时间
|
||||
eventDetailNew.setDuration(eventDetail.getDuration());
|
||||
|
||||
@@ -164,7 +165,14 @@ public class AreaInfoServiceImpl implements AreaInfoService {
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
private Double roundHalfUp(double num) {
|
||||
if (num == 3.14159) {
|
||||
return num;
|
||||
}
|
||||
BigDecimal b = new BigDecimal(num);
|
||||
//保留2位小数
|
||||
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
}
|
||||
@Override
|
||||
public List<EventDetailNew> getNoDealEventsByLineId(String id, String searchBeginTime, String searchEndTime) {
|
||||
List<AreaLineInfoVO> lineList = lineFeignClient.getBaseLineAreaInfo(Stream.of(id).collect(Collectors.toList())).getData();
|
||||
|
||||
@@ -5,8 +5,11 @@ import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -66,7 +69,11 @@ public class AreaStatisticalServiceImpl implements AreaStatisticalService {
|
||||
public AreaStatisticalVO getAreaCalculation(DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
//获取录波字典信息
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
DictData shortInterruptionsData = dicDataFeignClient.getDicDataByCode(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getData();
|
||||
|
||||
if(ObjectUtil.isNull(data)||ObjectUtil.isNull(shortInterruptionsData)){
|
||||
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
||||
}
|
||||
// 获取指定部门下的监测点集合
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
|
||||
if (CollUtil.isEmpty(generalDeviceDTOList)) {
|
||||
@@ -80,7 +87,8 @@ public class AreaStatisticalServiceImpl implements AreaStatisticalService {
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||
//todo 是否缺少录波
|
||||
.eq(RmpEventDetailPO::getEventType, data.getId())
|
||||
.in(RmpEventDetailPO::getEventType, Stream.of(data.getId(),shortInterruptionsData.getId()).collect(Collectors.toList()))
|
||||
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||
);
|
||||
@@ -105,7 +113,11 @@ public class AreaStatisticalServiceImpl implements AreaStatisticalService {
|
||||
List<NodeVO> nodeVOS=new ArrayList<>();
|
||||
//获取录波字典信息
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData();
|
||||
DictData shortInterruptionsData = dicDataFeignClient.getDicDataByCode(DicDataEnum.SHORT_INTERRUPTIONS.getCode()).getData();
|
||||
|
||||
if(ObjectUtil.isNull(data)||ObjectUtil.isNull(shortInterruptionsData)){
|
||||
throw new BusinessException(DeviceResponseEnum.DIC_GET_EMPTY);
|
||||
}
|
||||
// 获取指定部门下的监测点集合
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceInfoClient.getPracticalRunDeviceInfo(deviceInfoParam).getData();
|
||||
if (CollUtil.isEmpty(generalDeviceDTOList)) {
|
||||
@@ -119,7 +131,7 @@ public class AreaStatisticalServiceImpl implements AreaStatisticalService {
|
||||
List<RmpEventDetailPO> info = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||
//todo 是否缺少录波
|
||||
.eq(RmpEventDetailPO::getEventType, data.getId())
|
||||
.in(RmpEventDetailPO::getEventType, Stream.of(data.getId(),shortInterruptionsData.getId()).collect(Collectors.toList()))
|
||||
.ge(StrUtil.isNotBlank(deviceInfoParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(deviceInfoParam.getSearchBeginTime())))
|
||||
.le(StrUtil.isNotBlank(deviceInfoParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(deviceInfoParam.getSearchEndTime())))
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -374,7 +374,11 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
||||
//6.1整合提出查询语句
|
||||
Boolean fly = exportParam.isYybg() || exportParam.isYytx() || exportParam.isLxbg() || exportParam.isLxtx();
|
||||
if (fly) {
|
||||
StatisticVO statistic = eventReportService.getStatistic(info, reasonData, typeData);
|
||||
List<DictData> tempDictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeIds = tempDictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()) || DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode()))
|
||||
.map(DictData::getId).collect(Collectors.toList());
|
||||
List<EventDetail> tempInfo = info.stream().filter(temp -> typeIds.contains(temp.getEventType())).collect(Collectors.toList());
|
||||
StatisticVO statistic = eventReportService.getStatistic(tempInfo, reasonData, typeData);
|
||||
if (exportParam.isYybg() || exportParam.isYytx()) {
|
||||
createTitle(doc, "4." + i + " 原因统计", "标题 2", 200, 15);
|
||||
// StatisticVO statistic = eventAnalysisService.getStatistic(new StatisticsParam(exportParam.getLineId(), exportParam.getSearchBeginTime(), exportParam.getSearchEndTime(),exportParam.getFlag()));
|
||||
@@ -571,14 +575,14 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
||||
* @return
|
||||
*/
|
||||
private List<EventDetail> info(StatisticsParam statisticsParam) {
|
||||
//获取事件类型
|
||||
List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()) || DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode()))
|
||||
.map(DictData::getId).collect(Collectors.toList());
|
||||
// //获取事件类型
|
||||
// List<DictData> dictType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
// List<String> typeIds = dictType.stream().filter(x -> DicDataEnum.VOLTAGE_DIP.getCode().equals(x.getCode()) || DicDataEnum.SHORT_INTERRUPTIONS.getCode().equals(x.getCode()))
|
||||
// .map(DictData::getId).collect(Collectors.toList());
|
||||
//数据暂降查询
|
||||
List<RmpEventDetailPO> info = rmpEventDetailMapper.selectList(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.in(RmpEventDetailPO::getEventType, typeIds)
|
||||
// .in(RmpEventDetailPO::getEventType, typeIds)
|
||||
.ge(StrUtil.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StrUtil.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
|
||||
@@ -941,37 +941,47 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
|
||||
List<DictData> reasonList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName()).getData();
|
||||
Map<String,String> reasonData = reasonList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
Map<String, Integer> reasonMap = convertMap(reasonData);
|
||||
List<DictData> advanceTypeList = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName()).getData();
|
||||
Map<String,String> advanceTypeData = advanceTypeList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
Map<String, Integer> typeMap = convertMap(advanceTypeData);
|
||||
HttpResult<List<DictData>> reason = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_REASON.getName());
|
||||
HttpResult<List<DictData>> type = dicDataFeignClient.getDicDataByTypeName(DicDataTypeEnum.EVENT_TYPE.getName());
|
||||
List<DictData> reasonData = reason.getData();
|
||||
List<DictData> typeData = type.getData();
|
||||
|
||||
Map<String, Integer> reasonMap = new LinkedHashMap<>();
|
||||
Map<String, Integer> typeMap = new LinkedHashMap<>();
|
||||
|
||||
info = info.stream().filter(temp->Objects.nonNull(temp.getAdvanceReason())||Objects.nonNull(temp.getAdvanceType())).collect(Collectors.toList());
|
||||
//添加detail
|
||||
for (RmpEventDetailPO detail : info) {
|
||||
EventDetail details = BeanUtil.copyProperties(detail, EventDetail.class);
|
||||
if(StrUtil.isNotBlank(detail.getAdvanceType())){
|
||||
details.setAdvanceType(advanceTypeData.get(detail.getAdvanceType()));
|
||||
}else {
|
||||
details.setAdvanceType(DicDataEnum.OTHER.getName());
|
||||
EventDetail details = null;
|
||||
if (typeList.contains(detail.getEventType())) {
|
||||
for (DictData data : reasonData) {
|
||||
reasonMap.put(data.getName(), 0);
|
||||
//此处写法会报空指针异常修改写法
|
||||
if (Objects.equals(detail.getAdvanceReason(),data.getId())) {
|
||||
details = BeanUtil.copyProperties(detail, EventDetail.class);
|
||||
details.setAdvanceReason(data.getName());
|
||||
}
|
||||
}
|
||||
for (DictData data : typeData) {
|
||||
typeMap.put(data.getName(), 0);
|
||||
if (Objects.equals(detail.getAdvanceType(),data.getId())) {
|
||||
// details = BeanUtil.copyProperties(detail, EventDetail.class);
|
||||
details.setAdvanceType(data.getName());
|
||||
}
|
||||
}
|
||||
list.add(details);
|
||||
}
|
||||
if(StrUtil.isNotBlank(detail.getAdvanceReason())){
|
||||
details.setAdvanceReason(reasonData.get(detail.getAdvanceReason()));
|
||||
}else {
|
||||
details.setAdvanceReason(DicDataEnum.OTHER.getName());
|
||||
}
|
||||
list.add(details);
|
||||
}
|
||||
|
||||
//添加reason到map
|
||||
for (EventDetail data : list) {
|
||||
if (reasonMap.get(data.getAdvanceReason()) != null) {
|
||||
if (Objects.nonNull(data.getAdvanceReason())&&reasonMap.get(data.getAdvanceReason()) != null) {
|
||||
reasonMap.put(data.getAdvanceReason(), reasonMap.get(data.getAdvanceReason()) + 1);
|
||||
}
|
||||
}
|
||||
//添加type到map
|
||||
for (EventDetail data : list) {
|
||||
if (typeMap.get(data.getAdvanceType()) != null) {
|
||||
if (Objects.nonNull(data.getAdvanceType())&&typeMap.get(data.getAdvanceType()) != null) {
|
||||
typeMap.put(data.getAdvanceType(), typeMap.get(data.getAdvanceType()) + 1);
|
||||
}
|
||||
}
|
||||
@@ -985,29 +995,10 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
}
|
||||
result.setTypes(typesVOS);
|
||||
result.setReason(reasonsVOS);
|
||||
//result.setDetail(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将原Map的value作为新Map的key,0作为新Map的value
|
||||
* @param originalMap 原始Map(key和value唯一)
|
||||
* @return 转换后的新Map
|
||||
*/
|
||||
public static <K, V> Map<V, Integer> convertMap(Map<K, V> originalMap) {
|
||||
// 创建新的HashMap存储结果
|
||||
Map<V, Integer> newMap = new HashMap<>();
|
||||
|
||||
// 遍历原始Map的所有entry
|
||||
for (Map.Entry<K, V> entry : originalMap.entrySet()) {
|
||||
// 原value作为新key,0作为新value
|
||||
V originalValue = entry.getValue();
|
||||
newMap.put(originalValue, 0);
|
||||
}
|
||||
|
||||
return newMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂降幅值的概率分布函数
|
||||
*
|
||||
@@ -1337,12 +1328,12 @@ public class EventAnalysisServiceImpl implements EventAnalysisService {
|
||||
// }
|
||||
// }
|
||||
//获取电压暂降信息
|
||||
List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
List<String> typeList = data.stream().filter(it->it.getCode().equals(DicDataEnum.VOLTAGE_DIP.getCode()) || it.getCode().equals(DicDataEnum.SHORT_INTERRUPTIONS.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||
// List<DictData> data = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
// List<String> typeList = data.stream().filter(it->it.getCode().equals(DicDataEnum.VOLTAGE_DIP.getCode()) || it.getCode().equals(DicDataEnum.SHORT_INTERRUPTIONS.getCode())).map(DictData::getId).collect(Collectors.toList());
|
||||
//查询监测点未处理暂态事件
|
||||
List<RmpEventDetailPO> eventDetails = eventDetailService.list(new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.eq(RmpEventDetailPO::getMeasurementPointId, statisticsParam.getLineIndex())
|
||||
.in(RmpEventDetailPO::getEventType,typeList)
|
||||
// .in(RmpEventDetailPO::getEventType,typeList)
|
||||
.ge(StringUtils.isNotBlank(statisticsParam.getStartTime()), RmpEventDetailPO::getStartTime, DateUtil.beginOfDay(DateUtil.parse(statisticsParam.getStartTime())))
|
||||
.le(StringUtils.isNotBlank(statisticsParam.getEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(statisticsParam.getEndTime())))
|
||||
);
|
||||
|
||||
@@ -44,7 +44,8 @@ public class EventReportServiceImpl implements EventReportService {
|
||||
}
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
Double eventvalue = info.get(i).getFeatureAmplitude();
|
||||
double persisttime = info.get(i).getDuration();
|
||||
//mysql存的S要转换成ms
|
||||
double persisttime = info.get(i).getDuration()*1000;
|
||||
if (eventvalue * 100 < 10) {
|
||||
if (persisttime < 20) {
|
||||
arr[4][0]++;
|
||||
@@ -156,7 +157,8 @@ public class EventReportServiceImpl implements EventReportService {
|
||||
}
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
Double eventvalue = info.get(i).getFeatureAmplitude();
|
||||
double persisttime = info.get(i).getDuration();
|
||||
//mysql存的S要转换成ms
|
||||
double persisttime = info.get(i).getDuration()*1000;
|
||||
if (eventvalue * 100 < 1) {
|
||||
if (persisttime < 20 && persisttime >= 10) {
|
||||
arr[2][0]++;
|
||||
@@ -218,7 +220,9 @@ public class EventReportServiceImpl implements EventReportService {
|
||||
}
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
Double eventvalue = info.get(i).getFeatureAmplitude();
|
||||
double persisttime = info.get(i).getDuration();
|
||||
//mysql存的S要转换成ms
|
||||
double persisttime = info.get(i).getDuration()*1000;
|
||||
|
||||
if (eventvalue * 100 < 1 && eventvalue * 100 >= 0) {
|
||||
if (persisttime > 10 && persisttime <= 100) {
|
||||
arr[16][0]++;
|
||||
@@ -709,7 +713,8 @@ public class EventReportServiceImpl implements EventReportService {
|
||||
timeMap.put("<180", 0);
|
||||
//求不同时间段的总数
|
||||
for (EventDetail eventDetail : info) {
|
||||
Double persistTime = eventDetail.getDuration();
|
||||
//转换成ms
|
||||
Double persistTime = eventDetail.getDuration()*1000;
|
||||
if (persistTime / 1000 < 0.1) {
|
||||
timeMap.put("<0.1", timeMap.get("<0.1") + 1);
|
||||
} else if (persistTime / 1000 > 0.1 && persistTime / 1000 < 0.25) {
|
||||
@@ -770,7 +775,7 @@ public class EventReportServiceImpl implements EventReportService {
|
||||
//求sisttime
|
||||
List<String> sisttime = new ArrayList<>();
|
||||
for (EventDetail eventDetail : info) {
|
||||
Double persistTime = eventDetail.getDuration();
|
||||
Double persistTime = eventDetail.getDuration()*1000;
|
||||
if (persistTime / 1000 < 0.1) {
|
||||
timeMap2.put("<0.1", timeMap2.get("<0.1") + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user