Compare commits
24 Commits
e9ac024f73
...
2025-11
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
770fb09223 | ||
|
|
eb334cc7c7 | ||
|
|
404d11526a | ||
| 7bac805988 | |||
|
|
e4e04fc5db | ||
| f588a0ffc8 | |||
| f8ffe767dc | |||
|
|
68cbad2fdb | ||
|
|
9b9d75e463 | ||
|
|
62c3c09a6b | ||
|
|
b523a24e5b | ||
|
|
075dfc19d6 | ||
|
|
279c5c7642 | ||
|
|
ff1351b107 | ||
|
|
2dd67f9e3a | ||
|
|
b0ef851479 | ||
|
|
be899a262b | ||
| 4339a37268 | |||
|
|
9659aa257a | ||
| 9d32ca05df | |||
|
|
d48cf09119 | ||
|
|
c38b07ec07 | ||
|
|
87f05c6278 | ||
|
|
20ec9bc0b4 |
@@ -67,7 +67,9 @@ public interface QvvrCauseDLL extends Library {
|
||||
|
||||
// 创建临时文件
|
||||
String tempDir = System.getProperty("java.io.tmpdir");
|
||||
File tempLibFile = new File(tempDir, "qvvr_" + System.currentTimeMillis() + "_" + libFileName);
|
||||
File tempLibFile = new File(tempDir, libFileName);
|
||||
|
||||
//File tempLibFile = new File(tempDir, "qvvr_" + System.currentTimeMillis() + "_" + libFileName);
|
||||
|
||||
// 提取库文件到临时目录
|
||||
try (FileOutputStream out = new FileOutputStream(tempLibFile)) {
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.njcn.advance.event.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.advance.event.cause.core.VoltageSagAnalyzer;
|
||||
import com.njcn.advance.event.cause.jna.QvvrCauseDLL;
|
||||
import com.njcn.advance.event.cause.model.AnalysisResult;
|
||||
import com.njcn.advance.event.cause.model.DataFeature;
|
||||
import com.njcn.advance.event.cause.model.QvvrDataStruct;
|
||||
import com.njcn.advance.event.type.jna.*;
|
||||
import com.njcn.advance.pojo.dto.EventAnalysisDTO;
|
||||
import com.njcn.advance.event.service.IEventAdvanceService;
|
||||
import com.njcn.advance.event.type.jna.QvvrDLL;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.event.file.component.WaveFileComponent;
|
||||
@@ -89,8 +86,55 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
||||
}
|
||||
}
|
||||
List<List<Float>> listWaveData = waveDataDTO.getListWaveData();
|
||||
// 暂降类型
|
||||
// 创建数据结构
|
||||
QvvrDLL.QvvrDataStruct typeDataStruct = new QvvrDLL.QvvrDataStruct();
|
||||
System.out.println("初始化qvvrdll成功-----------");
|
||||
typeDataStruct.smp_rate = waveDataDTO.getComtradeCfgDTO().getFinalSampleRate();
|
||||
System.out.println("采样率-----------" + typeDataStruct.smp_rate);
|
||||
typeDataStruct.smp_len = listWaveData.size();
|
||||
System.out.println("波形长度-----------" + listWaveData.size());
|
||||
|
||||
// 获取ABC三相的瞬时数据
|
||||
for (int i = 0; i < listWaveData.size(); i++) {
|
||||
typeDataStruct.smp_va[i] = listWaveData.get(i).get(1);
|
||||
typeDataStruct.smp_vb[i] = listWaveData.get(i).get(2);
|
||||
typeDataStruct.smp_vc[i] = listWaveData.get(i).get(3);
|
||||
}
|
||||
|
||||
|
||||
// 执行算法分析 - 直接调用C DLL
|
||||
try {
|
||||
QvvrDLL.INSTANCE.qvvr_fun(typeDataStruct);
|
||||
System.out.println("调用qvvrdll成功-----------");
|
||||
|
||||
if (typeDataStruct.evt_num > 0) {
|
||||
// 全局比较找出最小三相电压特征值
|
||||
float globalMinVoltage = Float.MAX_VALUE;
|
||||
int globalFaultType = 10;
|
||||
for (int i = 0; i < typeDataStruct.evt_num; i++) {
|
||||
QvvrDLL.EventBuffer evt = typeDataStruct.evt_buf[i];
|
||||
for (int j = 0; j < evt.u_min_num; j++) {
|
||||
float u3min = evt.u3_min[j];
|
||||
if (u3min < globalMinVoltage) {
|
||||
globalMinVoltage = u3min;
|
||||
globalFaultType = evt.qvvr_cata_type[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
eventAnalysis.setType(globalFaultType);
|
||||
} else {
|
||||
eventAnalysis.setType(DataFeature.TYPE10);
|
||||
}
|
||||
System.out.println("结束qvvrdll方法调用-----------");
|
||||
} catch (Exception e) {
|
||||
eventAnalysis.setType(DataFeature.TYPE10);
|
||||
eventAnalysis.setTypeFlag(0);
|
||||
}
|
||||
|
||||
|
||||
// 暂降原因JNA的方式
|
||||
com.njcn.advance.event.cause.jna.QvvrCauseDLL.QvvrDataStruct causeDataStruct = new com.njcn.advance.event.cause.jna.QvvrCauseDLL.QvvrDataStruct();
|
||||
QvvrCauseDLL.QvvrDataStruct causeDataStruct = new QvvrCauseDLL.QvvrDataStruct();
|
||||
causeDataStruct.smp_rate = waveDataDTO.getComtradeCfgDTO().getFinalSampleRate();
|
||||
causeDataStruct.smp_len = listWaveData.size();
|
||||
// 获取ABC三相的瞬时数据
|
||||
@@ -112,45 +156,6 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
||||
}
|
||||
System.out.println("暂降原因分析完毕===============");
|
||||
System.out.println("cause:" + eventAnalysis);
|
||||
|
||||
// 暂降类型
|
||||
// 创建数据结构
|
||||
// com.njcn.advance.event.type.jna.QvvrDLL.QvvrDataStruct typeDataStruct = new com.njcn.advance.event.type.jna.QvvrDLL.QvvrDataStruct();
|
||||
// typeDataStruct.smp_rate = waveDataDTO.getComtradeCfgDTO().getFinalSampleRate();
|
||||
// typeDataStruct.smp_len = listWaveData.size();
|
||||
// // 获取ABC三相的瞬时数据
|
||||
// for (int i = 0; i < listWaveData.size(); i++) {
|
||||
// typeDataStruct.smp_va[i] = listWaveData.get(i).get(1);
|
||||
// typeDataStruct.smp_vb[i] = listWaveData.get(i).get(2);
|
||||
// typeDataStruct.smp_vc[i] = listWaveData.get(i).get(3);
|
||||
// }
|
||||
// // 执行算法分析 - 直接调用C DLL
|
||||
// try {
|
||||
// QvvrDLL.INSTANCE.qvvr_fun(typeDataStruct);
|
||||
// if (typeDataStruct.evt_num > 0) {
|
||||
// // 全局比较找出最小三相电压特征值
|
||||
// float globalMinVoltage = Float.MAX_VALUE;
|
||||
// int globalFaultType = 10;
|
||||
// for (int i = 0; i < typeDataStruct.evt_num; i++) {
|
||||
// QvvrDLL.EventBuffer evt = typeDataStruct.evt_buf[i];
|
||||
// for (int j = 0; j < evt.u_min_num; j++) {
|
||||
// float u3min = evt.u3_min[j];
|
||||
// if (u3min < globalMinVoltage) {
|
||||
// globalMinVoltage = u3min;
|
||||
// globalFaultType = evt.qvvr_cata_type[j];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// eventAnalysis.setType(globalFaultType);
|
||||
// } else {
|
||||
// eventAnalysis.setType(DataFeature.TYPE10);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// eventAnalysis.setType(DataFeature.TYPE10);
|
||||
// eventAnalysis.setTypeFlag(0);
|
||||
// }
|
||||
return eventAnalysis;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public interface QvvrDLL extends Library {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 从jar中提取库文件到临时目录
|
||||
*/
|
||||
@@ -62,11 +62,13 @@ public interface QvvrDLL extends Library {
|
||||
if (libStream == null) {
|
||||
throw new FileNotFoundException("在jar中找不到库文件: " + resourcePath);
|
||||
}
|
||||
|
||||
|
||||
// 创建临时文件
|
||||
String tempDir = System.getProperty("java.io.tmpdir");
|
||||
File tempLibFile = new File(tempDir, "qvvr_" + System.currentTimeMillis() + "_" + libFileName);
|
||||
|
||||
File tempLibFile = new File(tempDir, libFileName);
|
||||
|
||||
// File tempLibFile = new File(tempDir, "qvvr_" + System.currentTimeMillis() + "_" + libFileName);
|
||||
|
||||
// 提取库文件到临时目录
|
||||
try (FileOutputStream out = new FileOutputStream(tempLibFile)) {
|
||||
byte[] buffer = new byte[8192];
|
||||
@@ -77,45 +79,47 @@ public interface QvvrDLL extends Library {
|
||||
} finally {
|
||||
libStream.close();
|
||||
}
|
||||
|
||||
|
||||
// 设置为可执行
|
||||
tempLibFile.setExecutable(true);
|
||||
tempLibFile.setReadable(true);
|
||||
|
||||
|
||||
// JVM退出时删除临时文件
|
||||
tempLibFile.deleteOnExit();
|
||||
|
||||
|
||||
System.out.println("已提取库文件到: " + tempLibFile.getAbsolutePath());
|
||||
return tempLibFile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 直接调用C DLL的qvvr_fun函数
|
||||
* void __stdcall qvvr_fun(void *data)
|
||||
*/
|
||||
void qvvr_fun(QvvrDataStruct data);
|
||||
|
||||
|
||||
void ping();
|
||||
|
||||
/**
|
||||
* 对应C语言的qvvr_data_struct结构体
|
||||
*/
|
||||
public static class QvvrDataStruct extends Structure {
|
||||
|
||||
|
||||
// 输入数据
|
||||
public float[] smp_va = new float[128 * 50 * 120]; // A相电压
|
||||
public float[] smp_vb = new float[128 * 50 * 120]; // B相电压
|
||||
public float[] smp_vb = new float[128 * 50 * 120]; // B相电压
|
||||
public float[] smp_vc = new float[128 * 50 * 120]; // C相电压
|
||||
public int smp_rate; // 采样频率
|
||||
public int smp_len; // 数据长度
|
||||
|
||||
|
||||
// 输出结果
|
||||
public int evt_num; // 事件数量
|
||||
public EventBuffer[] evt_buf = new EventBuffer[32]; // 事件缓冲区
|
||||
|
||||
|
||||
@Override
|
||||
protected List<String> getFieldOrder() {
|
||||
return Arrays.asList("smp_va", "smp_vb", "smp_vc", "smp_rate", "smp_len", "evt_num", "evt_buf");
|
||||
}
|
||||
|
||||
|
||||
public QvvrDataStruct() {
|
||||
super();
|
||||
// 初始化事件缓冲区
|
||||
@@ -124,49 +128,49 @@ public interface QvvrDLL extends Library {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 事件缓冲区结构
|
||||
*/
|
||||
public static class EventBuffer extends Structure {
|
||||
public int[] qvvr_cata_cause = new int[256];
|
||||
public int[] qvvr_phasetype = new int[256];
|
||||
public int[] qvvr_phasetype = new int[256];
|
||||
public int[] qvvr_cata_type = new int[256];
|
||||
|
||||
|
||||
public float hold_time_rms;
|
||||
public float hold_time_dq;
|
||||
|
||||
|
||||
public float POW_a;
|
||||
public float POW_b;
|
||||
public float POW_c;
|
||||
|
||||
|
||||
public float Voltagechange_Va;
|
||||
public float Voltagechange_Vb;
|
||||
public float Voltagechange_Vc;
|
||||
|
||||
|
||||
public int SEG_T_num;
|
||||
public int[] SEG_T0_idx = new int[256];
|
||||
public int[] SEG_T_idx = new int[256];
|
||||
|
||||
|
||||
public int SEG_RMS_T_num;
|
||||
public int[] SEG_RMS_T_idx = new int[256];
|
||||
|
||||
|
||||
public int u_min_num;
|
||||
public float[] ua_min = new float[256];
|
||||
public float[] ub_min = new float[256];
|
||||
public float[] ub_min = new float[256];
|
||||
public float[] uc_min = new float[256];
|
||||
public float[] u3_min = new float[256];
|
||||
public int[] order_min_idx = new int[256];
|
||||
|
||||
|
||||
public float[] angle_diff_ap = new float[256];
|
||||
public float[] angle_diff_bp = new float[256];
|
||||
public float[] angle_diff_cp = new float[256];
|
||||
public float[] angle_diff_an = new float[256];
|
||||
public float[] angle_diff_bn = new float[256];
|
||||
public float[] angle_diff_cn = new float[256];
|
||||
|
||||
|
||||
public float[] bph_max_value = new float[256];
|
||||
|
||||
|
||||
@Override
|
||||
protected List<String> getFieldOrder() {
|
||||
return Arrays.asList(
|
||||
|
||||
@@ -854,6 +854,21 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
/*************************************************************************************
|
||||
* 获取变压器信息并生成矩阵
|
||||
*************************************************************************************/
|
||||
public Map<String, Map<String, Integer>> getNodeBefore(){
|
||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||
|
||||
HandleEvent handleEvent = new HandleEvent();
|
||||
List<EntityLogic> list = relevantLogMapper.getLogic();
|
||||
Map<String, Map<String, Integer>> setNodeSort = new HashMap<>();
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
Map<String, List<String>> map = getLogicInfo(list);
|
||||
setNodeSort = nodeSort(map);
|
||||
}
|
||||
|
||||
return setNodeSort;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, EntityMtrans> getNodeInfo( ) {
|
||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -57,6 +57,11 @@
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<!--vastbase驱动用postgresql-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
</dependency>
|
||||
<!--达梦驱动-->
|
||||
<dependency>
|
||||
<groupId>com.dameng</groupId>
|
||||
|
||||
@@ -81,7 +81,9 @@ public class Knife4jSwaggerConfig {
|
||||
"com.njcn.supervision.controller",
|
||||
"com.njcn.algorithm",
|
||||
"com.njcn.dataProcess",
|
||||
"com.njcn.migration"
|
||||
"com.njcn.migration",
|
||||
"com.njcn.harmonic.rstatlimitrate.controller",
|
||||
"com.njcn.device.device.controller"
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
List<GrantType> grantTypes = new ArrayList<>();
|
||||
|
||||
@@ -74,7 +74,10 @@ public class PollutionLineInfoDTO {
|
||||
* 电压等级
|
||||
*/
|
||||
private String lineVoltage;
|
||||
|
||||
/**
|
||||
* 变电站电压等级
|
||||
*/
|
||||
private String subVoltage;
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.njcn.device.pq.api.fallback;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.AlarmClient;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -14,11 +14,12 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 告警管理熔断降级
|
||||
*
|
||||
* @author yzh
|
||||
* @date 2022/9/19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@Component("deviceAlarmClientFallbackFactory")
|
||||
public class AlarmClientFallbackFactory implements FallbackFactory<AlarmClient> {
|
||||
@Override
|
||||
public AlarmClient create(Throwable throwable) {
|
||||
|
||||
@@ -55,7 +55,11 @@ public interface Param {
|
||||
//长时间闪变值
|
||||
String pst = "DataFlicker-pst";
|
||||
|
||||
//电压暂降
|
||||
String Voltage_Dip = "r_mp_event_detail-Voltage_Dip";
|
||||
//电压暂升
|
||||
String Voltage_Rise = "r_mp_event_detail-Voltage_Rise";
|
||||
|
||||
String pf = "DataHarmPowerP-pf";
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.device.pq.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/4
|
||||
*/
|
||||
@Getter
|
||||
public enum JbPowerFlagEnum {
|
||||
|
||||
/**
|
||||
* 系统拓扑各层级描述
|
||||
*/
|
||||
GRID_SIDE(0, "电网侧"),
|
||||
NO_GRID_SIDE(1, "非电网侧"),
|
||||
SEND_NETWORK(2, "上送国网"),
|
||||
NOT_NETWORK(3, "非上送国网"),
|
||||
unknown(4, "未知"),
|
||||
;
|
||||
|
||||
private final Integer code;
|
||||
private final String message;
|
||||
|
||||
JbPowerFlagEnum(Integer code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public static JbPowerFlagEnum getPowerFlagEnumByCode(Integer code) {
|
||||
return Arrays.stream(JbPowerFlagEnum.values())
|
||||
.filter(x -> x.getCode().equals(code))
|
||||
.findAny()
|
||||
.orElse(unknown);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -124,11 +124,11 @@ public class LineParam {
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "bigObjType",value = "对象大类")
|
||||
@NotBlank(message = "对象大类不可为空")
|
||||
// @NotBlank(message = "对象大类不可为空")
|
||||
private String bigObjType;
|
||||
|
||||
@ApiModelProperty(name = "smallObjType",value = "对象小类")
|
||||
@NotBlank(message = "对象小类不可为空")
|
||||
// @NotBlank(message = "对象小类不可为空")
|
||||
private String smallObjType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -137,6 +137,16 @@ public class PqDataVerifyBak {
|
||||
*/
|
||||
private Integer pst;
|
||||
|
||||
/**
|
||||
* 电压暂降(0:正常 1:异常)
|
||||
*/
|
||||
private Integer dip;
|
||||
|
||||
/**
|
||||
* 电压暂升(0:正常 1:异常)
|
||||
*/
|
||||
private Integer rise;
|
||||
|
||||
/**
|
||||
* 判断所有指标 0:无异常 1:有异常
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,9 @@ public class DevDetail {
|
||||
@ApiModelProperty("供电公司")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("所属部门")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String bdzName;
|
||||
|
||||
@@ -37,9 +40,15 @@ public class DevDetail {
|
||||
@ApiModelProperty("终端等级")
|
||||
private String lineGrade;
|
||||
|
||||
@ApiModelProperty("终端厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("通讯状态(0:中断;1:正常)")
|
||||
private Integer comFlag;
|
||||
|
||||
@ApiModelProperty("运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||
private Integer runFlag;
|
||||
|
||||
@ApiModelProperty("定检时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate nextTimeCheck;
|
||||
|
||||
@@ -11,6 +11,15 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DevDetailVO {
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String cit;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String company;
|
||||
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "lineId",value = "监测点索引")
|
||||
private String lineId;
|
||||
|
||||
@@ -32,4 +41,6 @@ public class DevDetailVO {
|
||||
@ApiModelProperty(name = "subName",value = "对象id(新能源用户)")
|
||||
private String ObjId;
|
||||
|
||||
@ApiModelProperty("终端运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||
private Integer runFlag;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ import java.util.List;
|
||||
@Data
|
||||
public class DeviceRunEvaluateVO {
|
||||
|
||||
@ApiModelProperty("终端id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@@ -26,6 +29,18 @@ public class DeviceRunEvaluateVO {
|
||||
@ApiModelProperty("评价")
|
||||
private BigDecimal evaluate;
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String cit;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String company;
|
||||
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("终端运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty("完整率")
|
||||
private BigDecimal integrityRate;
|
||||
|
||||
@@ -40,4 +55,29 @@ public class DeviceRunEvaluateVO {
|
||||
@ApiModelProperty("终端id集合")
|
||||
private List<String> devIds;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Detail {
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("评价")
|
||||
private BigDecimal score;
|
||||
|
||||
@ApiModelProperty("终端数量")
|
||||
private Integer count;
|
||||
|
||||
@ApiModelProperty("在线率")
|
||||
private BigDecimal online;
|
||||
|
||||
@ApiModelProperty("数据完整性")
|
||||
private BigDecimal integrity;
|
||||
|
||||
@ApiModelProperty("异常率")
|
||||
private BigDecimal qualified;
|
||||
|
||||
@ApiModelProperty("终端信息")
|
||||
List<DeviceRunEvaluateVO> list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,9 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class LineDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("供电公司名称")
|
||||
private String gdName;
|
||||
|
||||
@@ -92,6 +95,16 @@ public class LineDetailVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("已用流量占比")
|
||||
private Float flowProportion;
|
||||
|
||||
@ApiModelProperty("电网标志 0-电网侧;1-非电网侧")
|
||||
private Integer powerFlag;
|
||||
|
||||
@ApiModelProperty(name = "监测点运行状态")
|
||||
private String lineRunType;
|
||||
|
||||
@ApiModelProperty(name = "终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
package com.njcn.device.pq.pojo.vo.common;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2025/11/26 11:00
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DeviceOnlineRate {
|
||||
|
||||
@ApiModelProperty("总终端数量")
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty("低于90终端数据")
|
||||
private Integer belowNum;
|
||||
|
||||
@ApiModelProperty("总终端在线率")
|
||||
private String totalOnlineRate;
|
||||
|
||||
@ApiModelProperty("统计信息")
|
||||
List<CitDetail> citDetailList;
|
||||
|
||||
@Data
|
||||
public static class CitDetail {
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String citName;
|
||||
|
||||
@ApiModelProperty("总终端数量")
|
||||
private Integer citTotalNum;
|
||||
|
||||
@ApiModelProperty("低于90终端数据")
|
||||
private Integer citBelowNum;
|
||||
|
||||
@ApiModelProperty("总终端在线率")
|
||||
private String citTotalOnlineRate;
|
||||
|
||||
@ApiModelProperty("统计信息")
|
||||
List<?> detailList;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class Detail {
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String cit;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String company;
|
||||
|
||||
@ApiModelProperty("变电站")
|
||||
private String subStation;
|
||||
|
||||
@ApiModelProperty("终端ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("终端IP")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("终端运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty("终端通讯状态(0:中断;1:正常)")
|
||||
private String comFlag;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("在线率")
|
||||
private String onlineRate;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class LineDetail {
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String cit;
|
||||
|
||||
@ApiModelProperty("供电公司")
|
||||
private String company;
|
||||
|
||||
@ApiModelProperty("变电站")
|
||||
private String subStation;
|
||||
|
||||
@ApiModelProperty("终端ID")
|
||||
private String deviceId;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("终端IP")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
private String runFlag;
|
||||
|
||||
@ApiModelProperty("最新数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime latestTime;
|
||||
|
||||
@ApiModelProperty("数据完整性")
|
||||
private Double integrity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,6 +50,8 @@ public class DetailAbnormalVO {
|
||||
private String avg;
|
||||
//CP95
|
||||
private String cp95;
|
||||
//幅值
|
||||
private String featureAmplitude;
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +75,7 @@ public class DetailAbnormalVO {
|
||||
//最大
|
||||
private String val;
|
||||
|
||||
|
||||
//限值
|
||||
private float overLimitValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,29 @@ import lombok.Data;
|
||||
*/
|
||||
@Data
|
||||
public class JsonBaseVO {
|
||||
|
||||
/**
|
||||
* 超标时间
|
||||
*/
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 异常值
|
||||
*/
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 相别
|
||||
*/
|
||||
private String phasic;
|
||||
|
||||
/**
|
||||
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||
*/
|
||||
private String valueType;
|
||||
|
||||
/**
|
||||
* 限值
|
||||
*/
|
||||
private float overLimitValue;
|
||||
|
||||
}
|
||||
|
||||
@@ -76,4 +76,14 @@ public class DeviceRunEvaluateController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getRunEvaluateInfo")
|
||||
@ApiOperation("终端评价列表(冀北)")
|
||||
public HttpResult<List<DeviceRunEvaluateVO.Detail>> getRunEvaluateInfo(@RequestBody DeviceInfoParam.BusinessParam businessParam) {
|
||||
String methodDescribe = getMethodDescribe("getRunEvaluateInfo");
|
||||
List<DeviceRunEvaluateVO.Detail> runEvaluate = deviceRunEvaluateService.getRunEvaluate(businessParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runEvaluate, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -17,6 +16,7 @@ import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.param.LineIntegrityDataParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import com.njcn.device.pq.service.LineIntegrityDataService;
|
||||
import com.njcn.harmonic.pojo.vo.IntegrityIconVO;
|
||||
@@ -148,4 +148,14 @@ public class LineIntegrityDataController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,flag,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/data")
|
||||
@ApiOperation("监测点数据完整性(冀北)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<DeviceOnlineRate> getData(@RequestBody DeviceInfoParam.BusinessParam param) {
|
||||
String methodDescribe = getMethodDescribe("getData");
|
||||
DeviceOnlineRate rate = irStatIntegrityDService.getData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TerminalTreeController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("getTerminalTree");
|
||||
List<TerminalTree> tree;
|
||||
if(isJb){
|
||||
tree= terminalTreeService.getJbTerminalTree();
|
||||
tree= terminalTreeService.getJbNewTerminalTree();
|
||||
}else{
|
||||
tree= terminalTreeService.getTerminalTree();
|
||||
}
|
||||
|
||||
@@ -34,4 +34,13 @@ public interface DeviceRunEvaluateService {
|
||||
|
||||
|
||||
TerminalEvaluateAreaVO.lastWeekTrendVO lastWeekTrend(DeviceInfoParam.BusinessParam businessParam);
|
||||
|
||||
/**
|
||||
* @Description: 获取终端列表
|
||||
* @param param
|
||||
* @return: java.util.List<com.njcn.device.pq.pojo.vo.DeviceRunEvaluateVO.Detail>
|
||||
* @Author: wr
|
||||
* @Date: 2025/11/27 10:24
|
||||
*/
|
||||
List<DeviceRunEvaluateVO.Detail> getRunEvaluate(DeviceInfoParam.BusinessParam param);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorIntegrityDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,4 +35,6 @@ public interface IRStatIntegrityDService extends IMppService<RStatIntegrityD> {
|
||||
List<LineDataQualityDTO> getLineDataQuality(LineDataQualityParam lineDataQualityParam);
|
||||
|
||||
Boolean saveOrUpdateData(List<MonitorIntegrityDTO> monitorIntegrityDTOList);
|
||||
|
||||
DeviceOnlineRate getData(DeviceInfoParam.BusinessParam param);
|
||||
}
|
||||
|
||||
@@ -49,4 +49,7 @@ public interface TerminalTreeService {
|
||||
* @return
|
||||
*/
|
||||
List<TerminalTree> getJbTerminalTree();
|
||||
|
||||
|
||||
List<TerminalTree> getJbNewTerminalTree();
|
||||
}
|
||||
|
||||
@@ -509,6 +509,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
vo.setVal(valArr[i]);
|
||||
vo.setPhaseType(phasic);
|
||||
vo.setTargetName(StrUtil.isNotBlank(count) ? count + "次" + targetName : targetName);
|
||||
vo.setOverLimitValue(it.getOverLimitValue());
|
||||
result.add(vo);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -6,27 +6,29 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.njcn.device.common.mapper.onlinerate.OnLineRateMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DevRunEvaluateParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeviceRunEvaluateVO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfoDTO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalEvaluateAreaVO;
|
||||
import com.njcn.device.pq.service.DeviceRunEvaluateService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||
@@ -34,6 +36,11 @@ import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -62,7 +69,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
private final LineMapper lineMapper;
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
private final GeneralDeviceService deviceService;
|
||||
private final OnLineRateMapper onLineRateMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
/**
|
||||
* 数据完整性:50%
|
||||
*/
|
||||
@@ -107,7 +117,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
|
||||
}
|
||||
|
||||
return info.stream().sorted(Comparator.comparing(DeviceRunEvaluateVO.Info::getEvaluate,Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
return info.stream().sorted(Comparator.comparing(DeviceRunEvaluateVO.Info::getEvaluate, Comparator.reverseOrder())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private void setEvaluate(List<String> devIds, List<String> lineIds, List<RStatIntegrityD> onIntegrityList, DeviceRunEvaluateVO evaluateVO, List<RStatOnlinerateD> onlineRateList, List<RStatLimitRateDPO> limitRateList) {
|
||||
@@ -116,7 +126,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
if (CollUtil.isNotEmpty(integrityDS)) {
|
||||
double realTime = integrityDS.stream().mapToDouble(RStatIntegrityD::getRealTime).sum();
|
||||
double dueTime = integrityDS.stream().mapToDouble(RStatIntegrityD::getDueTime).sum();
|
||||
evaluateVO.setIntegrityRate(NumberUtil.round(Math.min(realTime * 100 / dueTime,100), 2));
|
||||
evaluateVO.setIntegrityRate(NumberUtil.round(Math.min(realTime * 100 / dueTime, 100), 2));
|
||||
} else {
|
||||
evaluateVO.setIntegrityRate(new BigDecimal(0));
|
||||
}
|
||||
@@ -125,7 +135,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
if (CollUtil.isNotEmpty(onlineRateDS)) {
|
||||
double onlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateD::getOnlineMin).sum();
|
||||
double offlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateD::getOfflineMin).sum();
|
||||
evaluateVO.setOnLineRate(NumberUtil.round(Math.min(onlineTime * 100.0 / (onlineTime + offlineTime),100), 2));
|
||||
evaluateVO.setOnLineRate(NumberUtil.round(Math.min(onlineTime * 100.0 / (onlineTime + offlineTime), 100), 2));
|
||||
} else {
|
||||
evaluateVO.setOnLineRate(new BigDecimal(0));
|
||||
}
|
||||
@@ -143,7 +153,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
if (allTime == 0) {
|
||||
evaluateVO.setPassRate(new BigDecimal(0));
|
||||
} else {
|
||||
evaluateVO.setPassRate(NumberUtil.round(Math.min((1 - (overTime * 1.0 / allTime)) * 100,100), 2));
|
||||
evaluateVO.setPassRate(NumberUtil.round(Math.min((1 - (overTime * 1.0 / allTime)) * 100, 100), 2));
|
||||
}
|
||||
} else {
|
||||
evaluateVO.setPassRate(new BigDecimal(0));
|
||||
@@ -213,7 +223,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(businessParam, Stream.of(RunFlagEnum.RUNNING.getStatus()).collect(Collectors.toList()), Stream.of(PowerFlagEnum.REAL_DEVICE.getCode()).collect(Collectors.toList()));
|
||||
if (CollectionUtil.isNotEmpty(generalDeviceDTOList)) {
|
||||
if (generalDeviceDTOList.size() == 1 && generalDeviceDTOList.get(0).getIndex().equals(businessParam.getDeptIndex())) {
|
||||
if(CollUtil.isNotEmpty(generalDeviceDTOList.get(0).getLineIndexes())) {
|
||||
if (CollUtil.isNotEmpty(generalDeviceDTOList.get(0).getLineIndexes())) {
|
||||
//已经最底层,展示电站和用户场站
|
||||
List<MonitorInfoDTO> lineDetailList = lineMapper.getLineListByIds(generalDeviceDTOList.get(0).getLineIndexes());
|
||||
List<String> ids = lineDetailList.stream().map(MonitorInfoDTO::getId).distinct().collect(Collectors.toList());
|
||||
@@ -246,7 +256,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
}
|
||||
} else {
|
||||
for (GeneralDeviceDTO generalDeviceDTO : generalDeviceDTOList) {
|
||||
if(CollUtil.isEmpty(generalDeviceDTO.getDeviceIndexes())){
|
||||
if (CollUtil.isEmpty(generalDeviceDTO.getDeviceIndexes())) {
|
||||
continue;
|
||||
}
|
||||
List<RStatIntegrityD> rStatIntegrityDList = new ArrayList<>();
|
||||
@@ -334,6 +344,139 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
return lastWeekTrendVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeviceRunEvaluateVO.Detail> getRunEvaluate(DeviceInfoParam.BusinessParam param) {
|
||||
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, String> manufacturerMap = manufacturerList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
List<Dept> deptList = deptFeignClient.getAllDept().getData();
|
||||
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
|
||||
List<DeviceRunEvaluateVO.Detail> info = new ArrayList<>();
|
||||
//获取终端台账类信息
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
|
||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||
List<String> deviceIds = deviceInfo.stream()
|
||||
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
||||
.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<String> lineIds = deviceInfo.stream()
|
||||
.flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList())
|
||||
.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
//获取所有监测点信息信息
|
||||
List<DevDetailVO> lineDeviceByDevIds = lineMapper.getLineDeviceByDevIds(param.getPowerFlag(), lineIds, deviceIds);
|
||||
RStatLimitQueryParam rStatLimitQueryParam = new RStatLimitQueryParam();
|
||||
rStatLimitQueryParam.setIds(lineIds);
|
||||
rStatLimitQueryParam.setDate(param.getSearchBeginTime());
|
||||
rStatLimitQueryParam.setEndDate(param.getSearchEndTime());
|
||||
OnlineRateParam onlineRateParam = new OnlineRateParam();
|
||||
onlineRateParam.setIds(deviceIds);
|
||||
onlineRateParam.setStartTime(param.getSearchBeginTime());
|
||||
onlineRateParam.setEndTime(param.getSearchEndTime());
|
||||
DeviceRunEvaluateVO.Detail detail;
|
||||
//完整率
|
||||
List<RStatIntegrityVO> integrityList = integrityDMapper.getLineIntegrityRateInfo(lineIds, param.getSearchBeginTime(), param.getSearchEndTime());
|
||||
//超标率
|
||||
List<RStatLimitRateDPO> limitRatePOList = rStatLimitRateDClient.monitorIdsGetLimitInfo(rStatLimitQueryParam).getData();
|
||||
//获取所有终端在线率
|
||||
List<RStatOnlinerateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
|
||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||
detail = new DeviceRunEvaluateVO.Detail();
|
||||
detail.setName(dto.getName());
|
||||
detail.setCount(dto.getDeviceIndexes().size());
|
||||
detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes()));
|
||||
detail.setIntegrity(integrity(integrityList, dto.getLineIndexes()));
|
||||
detail.setQualified(limitRate(limitRatePOList, dto.getLineIndexes()));
|
||||
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
|
||||
.add(ONLINERATE.multiply(detail.getOnline())
|
||||
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros());
|
||||
Map<String, List<DevDetailVO>> dev = lineDeviceByDevIds
|
||||
.stream()
|
||||
.filter(x -> dto.getDeviceIndexes().contains(x.getDevId()))
|
||||
.collect(Collectors.groupingBy(DevDetailVO::getDevId));
|
||||
List<DeviceRunEvaluateVO> deviceDetail = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(dev)) {
|
||||
dev.forEach((key, value) -> {
|
||||
List<String> ids = value.stream().map(DevDetailVO::getLineId).distinct().collect(Collectors.toList());
|
||||
DeviceRunEvaluateVO evaluateVO = new DeviceRunEvaluateVO();
|
||||
evaluateVO.setId(value.get(0).getDevId());
|
||||
evaluateVO.setName(value.get(0).getDevName());
|
||||
evaluateVO.setSubName(value.get(0).getSubName());
|
||||
evaluateVO.setIp(value.get(0).getIp());
|
||||
//部门
|
||||
if (deptMap.containsKey(value.get(0).getCit())) {
|
||||
evaluateVO.setCit(deptMap.get(value.get(0).getCit()));
|
||||
}
|
||||
//终端厂商
|
||||
if (manufacturerMap.containsKey(value.get(0).getManufacturer())) {
|
||||
evaluateVO.setManufacturer(manufacturerMap.get(value.get(0).getManufacturer()));
|
||||
}
|
||||
evaluateVO.setOnLineRate(onLineRate(onlineRateByDev, Arrays.asList(key)));
|
||||
evaluateVO.setIntegrityRate(integrity(integrityList, ids));
|
||||
evaluateVO.setPassRate(limitRate(limitRatePOList, ids));
|
||||
evaluateVO.setEvaluate(ONINTEGRITY.multiply(evaluateVO.getIntegrityRate())
|
||||
.add(ONLINERATE.multiply(evaluateVO.getOnLineRate())
|
||||
.add(LIMITRATE.multiply(evaluateVO.getPassRate()))).stripTrailingZeros());
|
||||
deviceDetail.add(evaluateVO);
|
||||
});
|
||||
}
|
||||
detail.setList(deviceDetail);
|
||||
info.add(detail);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
private BigDecimal integrity(List<RStatIntegrityVO> integrityList, List<String> lineIds) {
|
||||
//监测完整率
|
||||
List<RStatIntegrityVO> integrityDS = integrityList.stream().filter(x -> lineIds.contains(x.getLineIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(integrityDS)) {
|
||||
double realTime = integrityDS.stream().mapToDouble(RStatIntegrityVO::getRealTime).sum();
|
||||
double dueTime = integrityDS.stream().mapToDouble(RStatIntegrityVO::getDueTime).sum();
|
||||
return NumberUtil.round(Math.min(realTime * 100 / dueTime, 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal onLineRate(List<RStatOnlinerateVO> onlineRateByDev, List<String> devIds) {
|
||||
//终端在线率
|
||||
List<RStatOnlinerateVO> onlineRateDS = onlineRateByDev.stream().filter(x -> devIds.contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(onlineRateDS)) {
|
||||
double onlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateVO::getOnlineMin).sum();
|
||||
double offlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateVO::getOfflineMin).sum();
|
||||
return NumberUtil.round(Math.min(onlineTime * 100.0 / (onlineTime + offlineTime), 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal limitRate(List<RStatLimitRateDPO> limitRatePOList, List<String> lineIds) {
|
||||
//超标信息
|
||||
List<RStatLimitRateDPO> limitRateDPOS = limitRatePOList.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(limitRateDPOS)) {
|
||||
double overTime = limitRateDPOS.stream().mapToDouble(x -> (x.getUaberranceOvertime() +
|
||||
x.getUharm2Overtime() + x.getUharm3Overtime() + x.getUharm4Overtime() + x.getUharm5Overtime() +
|
||||
x.getUharm6Overtime() + x.getUharm7Overtime() + x.getUharm8Overtime() + x.getUharm9Overtime() +
|
||||
x.getUharm10Overtime() + x.getUharm11Overtime() + x.getUharm12Overtime() + x.getUharm13Overtime() + x.getUharm14Overtime() +
|
||||
x.getUharm15Overtime() + x.getUharm16Overtime() + x.getUharm17Overtime() + x.getUharm18Overtime() + x.getUharm19Overtime() +
|
||||
x.getUharm20Overtime() + x.getUharm21Overtime() + x.getUharm22Overtime() + x.getUharm23Overtime() + x.getUharm24Overtime() +
|
||||
x.getUharm25Overtime())).sum();
|
||||
double allTime = limitRateDPOS.stream().mapToDouble(x -> x.getAllTime() * 25.0).sum();
|
||||
if (allTime == 0) {
|
||||
return new BigDecimal(0);
|
||||
} else {
|
||||
return NumberUtil.round(Math.min((1 - (overTime * 1.0 / allTime)) * 100, 100), 2);
|
||||
}
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Map<String, NewUserReportVO> getUserLedgerByObjIds(List<String> objIds) {
|
||||
List<NewUserReportVO> userReportVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
return userReportVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
|
||||
@@ -244,7 +244,6 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
public GridDiagramVO getGridDiagramDev(GridDiagramParam param) {
|
||||
//获取电压等级
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE_STAND.getCode()).getData();
|
||||
|
||||
List<DictData> v = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PANORAMIC_VOLTAGE.getCode()).getData();
|
||||
List<String> voltageIds;
|
||||
//获取电压等级550 220 110 35
|
||||
@@ -264,7 +263,6 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<Dept> data = deptFeignClient.getDirectSonSelf(param.getOrgId()).getData();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(param.getOrgId());
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> deptGetChildrenMoreDTOS = commTerminalService.deptGetLine(deptGetLineParam);
|
||||
|
||||
|
||||
|
||||
@@ -475,7 +475,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
vo.setTargetKey(targetKey);
|
||||
vo.setPhaseType(phaseKey);
|
||||
|
||||
if ((pqReasonableRangeDto.getInfluxdbTableName() + SEPARATOR + pqReasonableRangeDto.getIndexCode()).equals(targetKey)) {
|
||||
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);
|
||||
@@ -493,6 +493,8 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
break;
|
||||
case "CP95":
|
||||
vo.setCp95(ites.getVal());
|
||||
case "Feature_Amplitude":
|
||||
vo.setFeatureAmplitude(ites.getVal());
|
||||
break;
|
||||
}
|
||||
});
|
||||
@@ -518,7 +520,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
queryWrapper.select("line_id as lineId,sum(freq) as freq,sum(freq_Dev) as freqDev,sum(v_Rms) as vRms,sum(v_Pos) as vPos,sum(v_Neg) as vNeg," +
|
||||
"sum(v_Zero) as vZero,sum(v_Unbalance) as vUnbalance,sum(rms_Lvr) as rmsLvr,sum(vu_Dev) as vuDev,sum(vl_Dev) as vlDev," +
|
||||
"sum(v_Thd) as vThd,sum(v) as v,sum(i_Rms) as iRms,sum(plt) as plt,sum(v_Inharm) as vInharm,sum(v_Harm) as vHarm,sum(pf) as pf," +
|
||||
"sum(v_Phasic) as vPhasic,sum(v1_Phasic) as v1Phasic,sum(fluc) as fluc,sum(pst) as pst,sum(state) as state")
|
||||
"sum(v_Phasic) as vPhasic,sum(v1_Phasic) as v1Phasic,sum(fluc) as fluc,sum(pst) as pst,sum(dip) as dip,sum(rise) as rise,sum(state) as state")
|
||||
.lambda().between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||
.eq(PqDataVerifyBak::getState, 1)
|
||||
@@ -652,6 +654,14 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPf() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getDip() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getRise() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
default:
|
||||
log.error("未匹配到异常数据指标");
|
||||
break;
|
||||
|
||||
@@ -1,30 +1,41 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorIntegrityDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatIntegrityVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
@@ -43,11 +54,11 @@ import java.util.stream.Collectors;
|
||||
public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||
|
||||
private final RStatOnlinerateDMapper onlineRateMapper;
|
||||
|
||||
private final RStatIntegrityDMapper rStatIntegrityDMapper;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
private final GeneralDeviceService deviceService;
|
||||
private final LineService lineService;
|
||||
|
||||
@Override
|
||||
public Float getTotalIntegrityByLineIds(LineBaseQueryParam param) {
|
||||
@@ -124,4 +135,79 @@ public class RStatIntegrityDServiceImpl extends MppServiceImpl<RStatIntegrityDMa
|
||||
this.saveOrUpdateBatchByMultiId(collect1,200);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceOnlineRate getData(DeviceInfoParam.BusinessParam param) {
|
||||
DeviceOnlineRate rate = new DeviceOnlineRate();
|
||||
//获取终端台账类信息
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, null, Collections.singletonList(1));
|
||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||
List<String> lineIds = deviceInfo.stream()
|
||||
.flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList())
|
||||
.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
rate.setTotalNum(lineIds.size());
|
||||
//获取所有监测点的数据完整性
|
||||
List<RStatIntegrityVO> lineIntegrityRateInfo = rStatIntegrityDMapper.getLineIntegrityRateInfo(lineIds,param.getSearchBeginTime(),param.getSearchEndTime());
|
||||
//获取所有监测点信息信息
|
||||
List<LineDetailVO.Detail> LineInfoByIds = lineService.getLineDetailByIds(lineIds);
|
||||
|
||||
rate.setBelowNum(CollUtil.isNotEmpty(lineIntegrityRateInfo)?calculateIntegrityRate(lineIntegrityRateInfo,90):lineIds.size());
|
||||
rate.setTotalOnlineRate(calculateIntegrityRate(lineIntegrityRateInfo,lineIds).toString());
|
||||
List<DeviceOnlineRate.CitDetail> citDetailList=new ArrayList<>();
|
||||
DeviceOnlineRate.CitDetail citDetail;
|
||||
DeviceOnlineRate.LineDetail detail;
|
||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||
//获取部门终端集合
|
||||
List<RStatIntegrityVO> citDevOnRate = lineIntegrityRateInfo.stream().filter(x -> dto.getLineIndexes().contains(x.getLineIndex())).collect(Collectors.toList());
|
||||
Map<String, Double> onlineRateByDevMap = citDevOnRate.stream()
|
||||
.collect(Collectors.toMap(RStatIntegrityVO::getLineIndex, RStatIntegrityVO::getIntegrityRate));
|
||||
citDetail=new DeviceOnlineRate.CitDetail();
|
||||
citDetail.setCitName(dto.getName());
|
||||
citDetail.setCitTotalNum(dto.getLineIndexes().size());
|
||||
citDetail.setCitBelowNum(CollUtil.isNotEmpty(citDevOnRate)?calculateIntegrityRate(lineIntegrityRateInfo,90):dto.getLineIndexes().size());
|
||||
citDetail.setCitTotalOnlineRate(calculateIntegrityRate(lineIntegrityRateInfo,dto.getLineIndexes()).toString());
|
||||
List<DeviceOnlineRate.LineDetail> detailList = new ArrayList<>();
|
||||
List<LineDetailVO.Detail> lineDetail = LineInfoByIds.stream().filter(x -> dto.getLineIndexes().contains(x.getLineId())).collect(Collectors.toList());
|
||||
for (LineDetailVO.Detail line : lineDetail) {
|
||||
detail = new DeviceOnlineRate.LineDetail();
|
||||
detail.setCit(line.getDeptName());
|
||||
detail.setCompany(line.getGdName());
|
||||
detail.setSubStation(line.getSubName());
|
||||
detail.setDeviceId(line.getDevId());
|
||||
detail.setDeviceName(line.getDevName());
|
||||
detail.setManufacturer(line.getManufacturer());
|
||||
detail.setIp(line.getIp());
|
||||
detail.setRunFlag(RunFlagEnum.getRunFlagRemarkByStatus(Integer.valueOf(line.getLineRunType())));
|
||||
detail.setLineId(line.getLineId());
|
||||
detail.setLineName(line.getLineName());
|
||||
detail.setLatestTime(line.getTimeID());
|
||||
detail.setIntegrity(onlineRateByDevMap.getOrDefault(line.getLineId(), 0.0));
|
||||
detailList.add(detail);
|
||||
}
|
||||
citDetail.setDetailList(detailList);
|
||||
citDetailList.add(citDetail);
|
||||
}
|
||||
rate.setCitDetailList(citDetailList);
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
private Double calculateIntegrityRate(List<RStatIntegrityVO> lineIntegrityRateInfo ,List<String> deviceIds){
|
||||
List<RStatIntegrityVO> list = lineIntegrityRateInfo.stream().filter(x -> deviceIds.contains(x.getLineIndex())).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
BigDecimal onlineMin = BigDecimal.valueOf(list.stream().mapToLong(RStatIntegrityVO::getDueTime).sum());
|
||||
BigDecimal offlineMin =BigDecimal.valueOf( list.stream().mapToLong(RStatIntegrityVO::getRealTime).sum());
|
||||
BigDecimal sumMin= onlineMin.add(offlineMin);
|
||||
return sumMin.doubleValue();
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
private Integer calculateIntegrityRate(List<RStatIntegrityVO> onlineRateByDev,Integer limit){
|
||||
return (int) onlineRateByDev.stream().filter(x -> x.getIntegrityRate() < limit).count();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -133,11 +133,6 @@ public class RunManageServiceImpl implements RunManageService {
|
||||
DeviceInfoParam deviceInfoParam = new DeviceInfoParam();
|
||||
BeanUtil.copyProperties(runManageParam, deviceInfoParam);
|
||||
deviceInfoParam.setServerName("pqs-common");
|
||||
if(CollUtil.isNotEmpty(runManageParam.getRunFlag())){
|
||||
if(runManageParam.getRunFlag().get(0)==0){
|
||||
deviceInfoParam.setLineRunFlag(0);
|
||||
}
|
||||
}
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(deviceInfoParam, runManageParam.getRunFlag(), Stream.of(1).collect(Collectors.toList()));
|
||||
if (CollectionUtils.isEmpty(generalDeviceDTOList)) {
|
||||
throw new BusinessException("当前部门没有装置台账");
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -138,7 +139,12 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
|
||||
private List<TerminalTree> specialDealSubChildren(TerminalTree sub,List<TerminalTree> lineUserList,List<TerminalTree> devOtherList,List<TerminalTree> busBarList,List<TerminalTree> devAllList,List<UserLedgerVO> userReportPOList){
|
||||
List<TerminalTree> list = new ArrayList<>();
|
||||
|
||||
//电网侧
|
||||
List<TerminalTree> devTree = devOtherList.stream().filter(it->it.getPid().equals(sub.getId())).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(devTree)){
|
||||
list.addAll(devTree);
|
||||
}
|
||||
//非电网侧
|
||||
if(CollUtil.isNotEmpty(userReportPOList)) {
|
||||
Map<String, UserLedgerVO> userLedgerVOMap = userReportPOList.stream().collect(Collectors.toMap(UserLedgerVO::getId, Function.identity()));
|
||||
|
||||
@@ -160,6 +166,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
busCopy.setName(it.getName());
|
||||
busCopy.setId(it.getId());
|
||||
busCopy.setPid(it.getPid());
|
||||
busCopy.setSort(it.getSort());
|
||||
busCopy.setChildren(getChildren(it, lineList));
|
||||
busCopy.setPowerFlag(1);
|
||||
busCopy.setLevel(LineBaseEnum.SUB_V_LEVEL.getCode());
|
||||
@@ -175,6 +182,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
devCopy.setName(it.getName());
|
||||
devCopy.setId(it.getId());
|
||||
devCopy.setPid(it.getPid());
|
||||
devCopy.setSort(it.getSort());
|
||||
devCopy.setChildren(getChildren(it, temBus));
|
||||
devCopy.setPowerFlag(1);
|
||||
devCopy.setLevel(LineBaseEnum.DEVICE_LEVEL.getCode());
|
||||
@@ -192,18 +200,11 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
terminalTree.setPowerFlag(1);
|
||||
terminalTree.setLevel(LineBaseEnum.USER_LEVEL.getCode());
|
||||
terminalTree.setChildren(temDevList);
|
||||
terminalTree.setSort(0);
|
||||
list.add(terminalTree);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
List<TerminalTree> devTree = devOtherList.stream().filter(it->it.getPid().equals(sub.getId())).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(devTree)){
|
||||
list.addAll(devTree);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -521,6 +522,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
sub.setId(collect.get(0).getId());
|
||||
sub.setName(collect.get(0).getName());
|
||||
sub.setPid(collect.get(0).getPid());
|
||||
sub.setSort(0);
|
||||
sub.setChildren(valueList);
|
||||
|
||||
TerminalTree powerTree=new TerminalTree();
|
||||
@@ -551,7 +553,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
sub.setId(child.getId());
|
||||
sub.setName(child.getName());
|
||||
sub.setPid(child.getPid());
|
||||
|
||||
sub.setSort(0);
|
||||
TerminalTree powerTree=new TerminalTree();
|
||||
powerTree.setName("电网侧");
|
||||
powerTree.setId(child.getId());
|
||||
@@ -581,7 +583,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
sub.setId(child.getId());
|
||||
sub.setName(child.getName());
|
||||
sub.setPid(child.getPid());
|
||||
|
||||
sub.setSort(0);
|
||||
TerminalTree powerTree = new TerminalTree();
|
||||
powerTree.setName("电网侧");
|
||||
powerTree.setId(child.getId());
|
||||
@@ -620,7 +622,7 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
sub.setId(notSub.getId());
|
||||
sub.setName(notSub.getName());
|
||||
sub.setPid(notSub.getPid());
|
||||
|
||||
sub.setSort(0);
|
||||
TerminalTree powerTree = new TerminalTree();
|
||||
powerTree.setId(notSub.getId());
|
||||
powerTree.setName("电网侧");
|
||||
@@ -655,6 +657,49 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
return taiZhang;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TerminalTree> getJbNewTerminalTree() {
|
||||
List<TerminalTree> allList = lineMapper.getAllList();
|
||||
List<TerminalTree> projectList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.PROJECT_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> provinceList = lineMapper.getProvinceList(null, 0);
|
||||
|
||||
List<TerminalTree> gdList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.GD_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> subList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> devList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.DEVICE_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> subvList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.SUB_V_LEVEL.getCode())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
|
||||
List<TerminalTree> linepowerList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())&&item.getPowerFlag() != 1).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> lineNotPowerList = allList.stream().filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode())&&item.getPowerFlag() == 1).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
|
||||
|
||||
|
||||
subvList.forEach(subv ->{
|
||||
if(CollUtil.isEmpty(subv.getChildren())){
|
||||
subv.setChildren(getRecursionChildren(subv, linepowerList));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
subvList.forEach(subv -> {
|
||||
if(CollUtil.isEmpty(subv.getChildren())){
|
||||
subv.setChildren(getRecursionChildren(subv, lineNotPowerList));
|
||||
}
|
||||
}
|
||||
);
|
||||
subvList.stream().filter(x-> ObjUtil.isNull(x.getPowerFlag())).forEach(x->x.setPowerFlag(0));
|
||||
devList.forEach(dev -> dev.setChildren(getRecursionChildren(dev, subvList)));
|
||||
devList.stream().filter(x-> ObjUtil.isNull(x.getPowerFlag())).forEach(x->x.setPowerFlag(0));
|
||||
|
||||
|
||||
|
||||
subList.forEach(sub -> sub.setChildren(getRecursionChildrenCs(sub, devList)));
|
||||
gdList.forEach(gd -> gd.setChildren(getChildren(gd, subList)));
|
||||
provinceList.forEach(province -> province.setChildren(getChildren(province, gdList)));
|
||||
projectList.forEach(project -> project.setChildren(getChildren(project, provinceList)));
|
||||
|
||||
return projectList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部子节点
|
||||
@@ -663,7 +708,40 @@ public class TerminalTreeServiceImpl implements TerminalTreeService {
|
||||
* @date 2021/7/19
|
||||
*/
|
||||
public List<TerminalTree> getChildren(TerminalTree item, List<TerminalTree> all) {
|
||||
return all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(collect)){
|
||||
long sortSize = collect.stream().filter(x->ObjUtil.isNotNull(x.getSort())).filter(x -> x.getSort() == 0).count();
|
||||
if(collect.size()-sortSize/collect.size()>50){
|
||||
collect.sort(Comparator.comparing(x->x.getName()));
|
||||
}
|
||||
}
|
||||
return collect;
|
||||
}
|
||||
|
||||
public List<TerminalTree> getRecursionChildrenCs(TerminalTree item, List<TerminalTree> all){
|
||||
List<TerminalTree> collect = all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
List<TerminalTree> list=new ArrayList<>();
|
||||
TerminalTree power=new TerminalTree();
|
||||
power.setName("电网侧");
|
||||
power.setSort(0);
|
||||
power.setChildren(collect.stream().filter(x -> 1 != x.getPowerFlag()).collect(Collectors.toList()));
|
||||
list.add(power);
|
||||
|
||||
|
||||
|
||||
TerminalTree notPower=new TerminalTree();
|
||||
notPower.setName("非电网侧");
|
||||
notPower.setSort(1);
|
||||
notPower.setChildren(collect.stream().filter(x -> 1 == x.getPowerFlag()).collect(Collectors.toList()));
|
||||
list.add(notPower);
|
||||
return list;
|
||||
}
|
||||
public List<TerminalTree> getRecursionChildren(TerminalTree item, List<TerminalTree> all){
|
||||
List<TerminalTree> list = all.stream().filter(allItem -> allItem.getPid().equals(item.getId())).sorted(Comparator.comparing(TerminalTree::getSort)).collect(Collectors.toList());
|
||||
if(CollUtil.isNotEmpty(list)){
|
||||
item.setPowerFlag(list.get(0).getPowerFlag());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.device.common.mapper.onlinerate;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 在线率日表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface OnLineRateMapper extends BaseMapper<RStatOnlinerateD> {
|
||||
|
||||
/***
|
||||
* 获取设备在线率
|
||||
* @author wr
|
||||
* @date 2023-04-03 10:10
|
||||
* @param param
|
||||
* @return List<OnlineRate>
|
||||
*/
|
||||
List<RStatOnlinerateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?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.common.mapper.onlinerate.OnLineRateMapper">
|
||||
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlinerateVO">
|
||||
select
|
||||
dev_index,
|
||||
sum(online_min) as onlineMin,
|
||||
sum(offline_min) as offlineMin,
|
||||
ROUND( sum(online_min)*1.0/(sum(online_min) + sum(offline_min))*100,2) as onlineRate
|
||||
from r_stat_onlinerate_d
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND dev_index IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by dev_index ;
|
||||
</select>
|
||||
<select id="getTotalOnlineRates" resultType="java.lang.Float">
|
||||
select
|
||||
if( sum( online_min )/( sum( online_min ) + sum( offline_min ))* 100 > 100,
|
||||
100,
|
||||
IFNULL( ROUND( sum( online_min )/( sum( online_min ) + sum( offline_min ))* 100, 2 ), 0 ))
|
||||
as online_rate
|
||||
from r_stat_onlinerate_d
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND dev_index IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -13,6 +13,7 @@ import com.njcn.device.common.mapper.TopMsgMapper;
|
||||
import com.njcn.device.device.mapper.DeviceMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.enums.JbPowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
@@ -34,6 +35,7 @@ import com.njcn.system.pojo.enums.StatisticsEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -319,7 +321,7 @@ public class GeneralDeviceService {
|
||||
} else {
|
||||
deviceType.setRunFlag(runFlag);
|
||||
}
|
||||
if(ObjectUtil.isNotNull(deviceInfoParam.getComFlagStatus())){
|
||||
if (ObjectUtil.isNotNull(deviceInfoParam.getComFlagStatus())) {
|
||||
deviceType.setComFlag(Arrays.asList(deviceInfoParam.getComFlagStatus()));
|
||||
}
|
||||
filterDataType(deviceType, deviceInfoParam.getServerName());
|
||||
@@ -374,6 +376,8 @@ public class GeneralDeviceService {
|
||||
return filterDataByManufacturer(deviceInfos, deviceInfoParam.getManufacturer());
|
||||
case POWER_FLAG:
|
||||
return filterDataByPowerFlag(deviceInfos, deviceInfoParam.getManufacturer());
|
||||
case JB_POWER_FLAG:
|
||||
return filterDataByJbPowerFlag(deviceInfos, deviceInfoParam.getManufacturer());
|
||||
default:
|
||||
return deviceInfos;
|
||||
}
|
||||
@@ -408,7 +412,7 @@ public class GeneralDeviceService {
|
||||
return generalDeviceDTO;
|
||||
}
|
||||
// 提取该部门及其子部门所有监测点id
|
||||
List<String> lineIds = deptLines.stream().map(DeptLine::getLineId).collect(Collectors.toList());
|
||||
List<String> lineIds = deptLines.stream().map(DeptLine::getLineId).distinct().collect(Collectors.toList());
|
||||
// 获取line详细数据 :根据监测点id,获取所有监测点 联查 pq_line、pq_line_detail
|
||||
List<Line> lines = terminalBaseService.getLineByCondition(lineIds, deviceInfoParam);
|
||||
// 返回空数据
|
||||
@@ -417,17 +421,17 @@ public class GeneralDeviceService {
|
||||
}
|
||||
|
||||
//1.筛选出母线id,理论上监测点的pids中第六个id为母线id 联查: pq_line t1 ,pq_voltage t2
|
||||
List<String> voltageIds=lines.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
List<String> voltageIds = lines.stream().map(Line::getPid).distinct().collect(Collectors.toList());
|
||||
//再根据电压等级筛选合法母线信息
|
||||
List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds, deviceInfoParam.getScale());
|
||||
|
||||
//2.筛选出终端id,理论上监测点的pids中第五个id为终端id
|
||||
List<String> devIds=voltages.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
List<String> devIds = voltages.stream().map(Line::getPid).distinct().collect(Collectors.toList());
|
||||
// 再根据终端条件筛选合法终端信息 联查:pq_line t1,pq_device t2
|
||||
List<Line> devices = terminalBaseService.getDeviceByCondition(devIds, deviceType, deviceInfoParam.getManufacturer());
|
||||
|
||||
//3.筛选出变电站id,理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2
|
||||
List<String> subIds=devices.stream().map(Line::getPid).collect(Collectors.toList());
|
||||
List<String> subIds = devices.stream().map(Line::getPid).distinct().collect(Collectors.toList());
|
||||
List<Line> sub = terminalBaseService.getSubByCondition(subIds, new ArrayList<>());
|
||||
|
||||
//筛选最终的数据
|
||||
@@ -452,7 +456,7 @@ public class GeneralDeviceService {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
//监测点同时满足条件筛选后的终端、母线信息,才是最终的结果
|
||||
if (devIds.contains(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]) &&
|
||||
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])&&
|
||||
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()]) &&
|
||||
subIds.contains(idsArray[LineBaseEnum.SUB_LEVEL.getCode()])
|
||||
) {
|
||||
gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]);
|
||||
@@ -556,8 +560,8 @@ public class GeneralDeviceService {
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByPowerFlag(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> manufacturer) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> deviceIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> lineIds = deviceInfos.stream().flatMap(x->x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> deviceIds = deviceInfos.stream().flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> lineIds = deviceInfos.stream().flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(manufacturer);
|
||||
@@ -566,15 +570,36 @@ public class GeneralDeviceService {
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (int i = 0; i < 6; i++) {
|
||||
List<String> powerFlagIds = terminalBaseService.getDeviceIdByPowerFlag(deviceIds, i);
|
||||
dto=new SimpleDTO();
|
||||
dto = new SimpleDTO();
|
||||
PowerFlagEnum enumByCode = PowerFlagEnum.getPowerFlagEnumByCode(i);
|
||||
dto.setId(enumByCode.getCode().toString());
|
||||
dto.setName(enumByCode.getMessage());
|
||||
generalDeviceDTOS.add(assembleDataByLine(dto, lines, powerFlagIds, LineBaseEnum.LINE_LEVEL.getCode()));
|
||||
}
|
||||
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
private List<GeneralDeviceDTO> filterDataByJbPowerFlag(List<GeneralDeviceDTO> deviceInfos, List<SimpleDTO> manufacturer) {
|
||||
List<GeneralDeviceDTO> generalDeviceDTOS = new ArrayList<>();
|
||||
List<String> deviceIds = deviceInfos.stream().flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
List<String> lineIds = deviceInfos.stream().flatMap(x -> x.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
//监测点为空,则返回空的分类数据
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
return assembleCommonData(manufacturer);
|
||||
}
|
||||
SimpleDTO dto;
|
||||
List<Line> lines = terminalBaseService.getLineById(lineIds);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
List<String> powerFlagIds = terminalBaseService.getDeviceIdByJbPowerFlag(deviceIds, i);
|
||||
dto = new SimpleDTO();
|
||||
JbPowerFlagEnum enumByCode = JbPowerFlagEnum.getPowerFlagEnumByCode(i);
|
||||
dto.setId(enumByCode.getCode().toString());
|
||||
dto.setName(enumByCode.getMessage());
|
||||
generalDeviceDTOS.add(assembleDataByLine(dto, lines, powerFlagIds, LineBaseEnum.LINE_LEVEL.getCode()));
|
||||
}
|
||||
return generalDeviceDTOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当该部门不存在监测点时,返回空的分类数据
|
||||
*
|
||||
@@ -724,7 +749,7 @@ public class GeneralDeviceService {
|
||||
/*实际运行*/
|
||||
QueryWrapper<Device> query = new QueryWrapper<>();
|
||||
query.in("Id", DeviceIds).
|
||||
eq("Run_Flag", 0).eq("Com_Flag",1);
|
||||
eq("Run_Flag", 0).eq("Com_Flag", 1);
|
||||
Integer runDeviceCount = deviceMapper.selectCount(query);
|
||||
BigDecimal rate = BigDecimal.valueOf(runDeviceCount).divide(BigDecimal.valueOf(deviceCount), 4, BigDecimal.ROUND_HALF_UP);
|
||||
deptDeviceDetailVO.setDeviceCount(deviceCount);
|
||||
@@ -756,17 +781,17 @@ public class GeneralDeviceService {
|
||||
|
||||
|
||||
/**
|
||||
* @param deptId 部门id
|
||||
* @param runFlag 设备运行状态 0:投运 1.热备用 2.停运
|
||||
* @param deptId 部门id
|
||||
* @param runFlag 设备运行状态 0:投运 1.热备用 2.停运
|
||||
* @param dataType 系统 0:暂态系统;1:稳态系统;2:两个系统
|
||||
* @author cdf
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunLine(String deptId,List<Integer> runFlag,List<Integer> dataType) {
|
||||
public List<String> deptGetRunLine(String deptId, List<Integer> runFlag, List<Integer> dataType) {
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
if (CollUtil.isNotEmpty(deptDTOList)) {
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getId).distinct().collect(Collectors.toList());
|
||||
return deptLineService.getLineByDeptIds(deptIds,null,runFlag,dataType,null);
|
||||
return deptLineService.getLineByDeptIds(deptIds, null, runFlag, dataType, null);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
@@ -778,12 +803,12 @@ public class GeneralDeviceService {
|
||||
* @date 2023/7/20
|
||||
*/
|
||||
public List<String> deptGetRunDev(String deptId) {
|
||||
List<String> runLineIds = this.deptGetRunLine(deptId,Stream.of(0).collect(Collectors.toList()),Stream.of(0,2).collect(Collectors.toList()));
|
||||
List<String> runLineIds = this.deptGetRunLine(deptId, Stream.of(0).collect(Collectors.toList()), Stream.of(0, 2).collect(Collectors.toList()));
|
||||
List<Line> lines = lineMapper.selectList(new LambdaQueryWrapper<Line>()
|
||||
.select(Line::getPids)
|
||||
.in(Line::getId,runLineIds)
|
||||
.select(Line::getPids)
|
||||
.in(Line::getId, runLineIds)
|
||||
);
|
||||
if(CollUtil.isNotEmpty(lines)){
|
||||
if (CollUtil.isNotEmpty(lines)) {
|
||||
return lines.stream().map(line -> {
|
||||
String[] idsArray = line.getPids().split(",");
|
||||
return idsArray[4];
|
||||
@@ -796,12 +821,25 @@ public class GeneralDeviceService {
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
|
||||
List<DictData> manufacturerList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, String> manufacturerMap = manufacturerList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
List<Dept> deptList = deptFeignClient.getAllDept().getData();
|
||||
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
List<DevDetail> devDetails = deviceMapper.selectDevByIds(devIds);
|
||||
for (DevDetail devDetail : devDetails) {
|
||||
//终端等级
|
||||
if(gradeMap.containsKey(devDetail.getLineGrade())){
|
||||
if (gradeMap.containsKey(devDetail.getLineGrade())) {
|
||||
devDetail.setLineGrade(String.valueOf(gradeMap.get(devDetail.getLineGrade())));
|
||||
}
|
||||
//部门
|
||||
if (deptMap.containsKey(devDetail.getDeptName())) {
|
||||
devDetail.setDeptName(deptMap.get(devDetail.getDeptName()));
|
||||
}
|
||||
//终端厂商
|
||||
if (manufacturerMap.containsKey(devDetail.getManufacturer())) {
|
||||
devDetail.setManufacturer(manufacturerMap.get(devDetail.getManufacturer()));
|
||||
}
|
||||
}
|
||||
return devDetails;
|
||||
}
|
||||
|
||||
@@ -188,6 +188,8 @@ public interface TerminalBaseService {
|
||||
*/
|
||||
List<String> getDeviceIdByPowerFlag(List<String> lineIds, Integer manufacturer);
|
||||
|
||||
List<String> getDeviceIdByJbPowerFlag(List<String> lineIds, Integer powerFlag);
|
||||
|
||||
|
||||
/**
|
||||
* 根据监测点集合查询基础信息
|
||||
|
||||
@@ -1666,6 +1666,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
return this.baseMapper.getDeviceIdByPowerFlag(lineIds, manufacturer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDeviceIdByJbPowerFlag(List<String> lineIds, Integer powerFlag) {
|
||||
return this.baseMapper.getDeviceIdByJbPowerFlag(lineIds, powerFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BaseLineInfo> getBaseLineInfo(List<String> lineIndex) {
|
||||
return this.baseMapper.getBaseLineInfo(lineIndex);
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.njcn.device.device.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.utils.HttpResultUtil;
|
||||
import com.njcn.device.device.service.OnLineRateService;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 终端在线率
|
||||
* @Author: wr
|
||||
* @Date: 2025/11/26 10:28
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "终端在线率")
|
||||
@RestController
|
||||
@RequestMapping("/onLineRate")
|
||||
@RequiredArgsConstructor
|
||||
public class OnLineRateController extends BaseController {
|
||||
|
||||
private final OnLineRateService onLineRateService;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/deviceOnlineRateInfo")
|
||||
@ApiOperation("终端在线率列表(冀北)")
|
||||
public HttpResult<DeviceOnlineRate> deviceOnlineRateInfo(@RequestBody DeviceInfoParam.BusinessParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("deviceOnlineRateInfo");
|
||||
DeviceOnlineRate rate = onLineRateService.deviceOnlineRateInfo(deviceInfoParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("通用终端在线率(冀北)")
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("deviceOnlineRateInfo");
|
||||
List<RStatOnlinerateVO> rate = onLineRateService.getOnlineRateByDevIds(deviceInfoParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -121,9 +121,9 @@
|
||||
</if>
|
||||
<if test="searchValue != '' and searchValue != null ">
|
||||
<bind name="searchValueLike" value="'%'+searchValue+'%'"/>
|
||||
AND sub.NAME LIKE #{searchValueLike}
|
||||
AND (sub.NAME LIKE #{searchValueLike}
|
||||
OR dev.name LIKE #{searchValueLike}
|
||||
OR line.NAME LIKE #{searchValueLike}
|
||||
OR line.NAME LIKE #{searchValueLike})
|
||||
</if>
|
||||
ORDER BY
|
||||
gdName,
|
||||
@@ -229,6 +229,7 @@
|
||||
<select id="selectDevByIds" resultType="com.njcn.device.pq.pojo.vo.DevDetail">
|
||||
SELECT DISTINCT
|
||||
device.id as devIndex,
|
||||
pd.Id as deptName,
|
||||
gd.NAME as gdName,
|
||||
substation.NAME as bdzName,
|
||||
device.NAME as devName,
|
||||
@@ -236,9 +237,12 @@
|
||||
deviceDetail.Update_Time AS timeID,
|
||||
deviceDetail.ip as ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
deviceDetail.run_Flag as runFlag,
|
||||
deviceDetail.Manufacturer as manufacturer,
|
||||
deviceDetail.Next_Time_Check as nextTimeCheck
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_dept_line pd,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
@@ -253,6 +257,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
AND line.pid = voltage.id
|
||||
AND line.id = pd.Line_Id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
@@ -364,6 +369,7 @@
|
||||
deviceDetail.login_Time AS loginTime,
|
||||
deviceDetail.id deviceId,
|
||||
pv.scale lineVoltage,
|
||||
pqsub.scale subVoltage,
|
||||
lineDetail.monitor_id monitorId
|
||||
FROM
|
||||
pq_line line,
|
||||
@@ -372,6 +378,7 @@
|
||||
pq_line device,
|
||||
pq_device deviceDetail,
|
||||
pq_line substation,
|
||||
pq_substation pqsub,
|
||||
pq_line gdinfo,
|
||||
pq_voltage pv
|
||||
WHERE line.id in
|
||||
@@ -384,6 +391,7 @@
|
||||
AND device.id = deviceDetail.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gdinfo.id
|
||||
AND substation.id = pqsub.id
|
||||
AND subv.id = pv.id
|
||||
</select>
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.device.device.service;
|
||||
|
||||
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 终端在线率
|
||||
* @Author: wr
|
||||
* @Date: 2025/11/26 10:27
|
||||
*/
|
||||
public interface OnLineRateService {
|
||||
|
||||
|
||||
/**
|
||||
* 终端详情列表
|
||||
*
|
||||
* @param deviceInfoParam
|
||||
* @return
|
||||
*/
|
||||
DeviceOnlineRate deviceOnlineRateInfo(DeviceInfoParam.BusinessParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 终端详情列表
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<RStatOnlinerateVO> getOnlineRateByDevIds(OnlineRateParam onlineRateParam);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.njcn.device.device.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.device.service.OnLineRateService;
|
||||
import com.njcn.device.common.mapper.onlinerate.OnLineRateMapper;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2025/11/26 10:26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OnLineRateServiceImpl extends ServiceImpl<OnLineRateMapper, RStatOnlinerateD> implements OnLineRateService {
|
||||
|
||||
private final GeneralDeviceService deviceService;
|
||||
|
||||
@Override
|
||||
public DeviceOnlineRate deviceOnlineRateInfo(DeviceInfoParam.BusinessParam param) {
|
||||
DeviceOnlineRate rate = new DeviceOnlineRate();
|
||||
//获取终端台账类信息
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
|
||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||
List<String> deviceIds = deviceInfo.stream()
|
||||
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
||||
.stream()
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
rate.setTotalNum(deviceIds.size());
|
||||
OnlineRateParam onlineRateParam = new OnlineRateParam();
|
||||
onlineRateParam.setIds(deviceIds);
|
||||
onlineRateParam.setStartTime(param.getSearchBeginTime());
|
||||
onlineRateParam.setEndTime(param.getSearchEndTime());
|
||||
//获取所有终端在线率
|
||||
List<RStatOnlinerateVO> onlineRateByDev = this.baseMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
|
||||
//获取所有终端信息
|
||||
List<DevDetail> devInfoByIds = deviceService.getDevInfoByIds(deviceIds);
|
||||
rate.setBelowNum(CollUtil.isNotEmpty(onlineRateByDev) ? calculateOnLineRate(onlineRateByDev, 90) : deviceIds.size());
|
||||
rate.setTotalOnlineRate(calculateOnLineRate(onlineRateByDev, deviceIds));
|
||||
List<DeviceOnlineRate.CitDetail> citDetailList = new ArrayList<>();
|
||||
DeviceOnlineRate.CitDetail citDetail;
|
||||
DeviceOnlineRate.Detail detail;
|
||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||
//获取部门终端集合
|
||||
List<RStatOnlinerateVO> citDevOnRate = onlineRateByDev.stream().filter(x -> dto.getDeviceIndexes().contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
Map<String, Float> onlineRateByDevMap = citDevOnRate.stream()
|
||||
.collect(Collectors.toMap(RStatOnlinerateVO::getDevIndex, RStatOnlinerateVO::getOnlineRate));
|
||||
citDetail = new DeviceOnlineRate.CitDetail();
|
||||
citDetail.setCitName(dto.getName());
|
||||
citDetail.setCitTotalNum(dto.getDeviceIndexes().size());
|
||||
citDetail.setCitBelowNum(CollUtil.isNotEmpty(citDevOnRate) ? calculateOnLineRate(onlineRateByDev, 90) : dto.getDeviceIndexes().size());
|
||||
citDetail.setCitTotalOnlineRate(calculateOnLineRate(onlineRateByDev, dto.getDeviceIndexes()));
|
||||
List<DeviceOnlineRate.Detail> detailList = new ArrayList<>();
|
||||
List<DevDetail> details = devInfoByIds.stream().filter(x -> dto.getDeviceIndexes().contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
for (DevDetail dev : details) {
|
||||
detail = new DeviceOnlineRate.Detail();
|
||||
detail.setCit(dev.getDeptName());
|
||||
detail.setCompany(dev.getGdName());
|
||||
detail.setSubStation(dev.getBdzName());
|
||||
detail.setDeviceId(dev.getDevIndex());
|
||||
detail.setDeviceName(dev.getDevName());
|
||||
detail.setManufacturer(dev.getManufacturer());
|
||||
detail.setIp(dev.getIp());
|
||||
detail.setRunFlag(RunFlagEnum.getRunFlagRemarkByStatus(dev.getRunFlag()));
|
||||
detail.setComFlag(dev.getComFlag() == 0 ? "中断" : "正常");
|
||||
detail.setTimeID(dev.getTimeID());
|
||||
detail.setOnlineRate(onlineRateByDevMap.containsKey(dev.getDevIndex()) ? onlineRateByDevMap.get(dev.getDevIndex()).toString() : "0");
|
||||
detailList.add(detail);
|
||||
}
|
||||
citDetail.setDetailList(detailList);
|
||||
citDetailList.add(citDetail);
|
||||
}
|
||||
rate.setCitDetailList(citDetailList);
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RStatOnlinerateVO> getOnlineRateByDevIds(OnlineRateParam onlineRateParam) {
|
||||
return this.baseMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
}
|
||||
|
||||
private String calculateOnLineRate(List<RStatOnlinerateVO> onlineRateByDev, List<String> deviceIds) {
|
||||
List<RStatOnlinerateVO> list = onlineRateByDev.stream().filter(x -> deviceIds.contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
BigDecimal onlineMin = BigDecimal.valueOf(list.stream().mapToLong(RStatOnlinerateVO::getOnlineMin).sum());
|
||||
BigDecimal offlineMin = BigDecimal.valueOf(list.stream().mapToLong(RStatOnlinerateVO::getOfflineMin).sum());
|
||||
BigDecimal sumMin = onlineMin.add(offlineMin);
|
||||
return onlineMin.divide(sumMin, 2).toString();
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
private Integer calculateOnLineRate(List<RStatOnlinerateVO> onlineRateByDev, Integer limit) {
|
||||
return onlineRateByDev.stream().filter(x -> x.getOnlineRate() < limit).collect(Collectors.toList()).size();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -548,6 +548,8 @@ public interface LineMapper extends BaseMapper<Line> {
|
||||
|
||||
List<String> getDeviceIdByPowerFlag(@Param("lineIds")List<String> lineIds, @Param("powerFlag")Integer manufacturer);
|
||||
|
||||
List<String> getDeviceIdByJbPowerFlag(@Param("lineIds")List<String> lineIds, @Param("powerFlag")Integer manufacturer);
|
||||
|
||||
DeviceVO getDeviceDetailData(@Param("id")String id);
|
||||
|
||||
List<LineDetailVO.Detail> getDeptDeviceDetailData(@Param("ids")List<String> ids,
|
||||
|
||||
@@ -116,7 +116,6 @@
|
||||
left join pq_substation sub on sub.id = substation.id
|
||||
where device.Dev_Model = 1
|
||||
and point.state = 1
|
||||
and device.Run_Flag = 0
|
||||
and device.Dev_Data_Type in
|
||||
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
@@ -125,7 +124,7 @@
|
||||
and lineDetail.Power_Flag = #{powerFlag}
|
||||
</if>
|
||||
<if test="lineRunFlag!=null ">
|
||||
and lineDetail.Run_Flag = #{lineRunFlag}
|
||||
and device.Run_Flag = 0 and lineDetail.Run_Flag = #{lineRunFlag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getLineIdByDeptIds" resultType="string">
|
||||
|
||||
@@ -66,8 +66,9 @@
|
||||
</select>
|
||||
|
||||
<select id="getAllList" resultType="TerminalTree">
|
||||
select id, pid, name, level, sort
|
||||
from pq_line
|
||||
select a.id, a.pid, a.name, a.level, a.sort ,b.Power_Flag
|
||||
from pq_line a
|
||||
left join pq_line_detail b on a.id = b.id
|
||||
where state = 1
|
||||
</select>
|
||||
|
||||
@@ -1534,11 +1535,13 @@
|
||||
<select id="selectByIds" resultType="com.njcn.device.pq.pojo.vo.LineDetailVO$Detail">
|
||||
SELECT DISTINCT
|
||||
line.id as lineId,
|
||||
dept.`Name` deptName,
|
||||
area.name as areaId,
|
||||
gd.NAME gdName,
|
||||
substation.NAME subName,
|
||||
device.id devId,
|
||||
device.NAME devName,
|
||||
deviceDetail.Manufacturer manufacturer,
|
||||
line.NAME lineName,
|
||||
lineDetail.Time_Interval as timeInterval,
|
||||
lineDetail.PT_Type as ptType,
|
||||
@@ -1551,7 +1554,9 @@
|
||||
deviceDetail.ip ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
vg.Scale as voltageLevel,
|
||||
voltage.name as volName
|
||||
voltage.name as volName,
|
||||
lineDetail.Power_Flag powerFlag,
|
||||
lineDetail.Run_Flag lineRunType
|
||||
FROM
|
||||
pq_line line,
|
||||
pq_line voltage,
|
||||
@@ -1561,9 +1566,13 @@
|
||||
pq_line area,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail,
|
||||
pq_voltage vg
|
||||
pq_voltage vg,
|
||||
pq_dept_line deptLine,
|
||||
sys_dept dept
|
||||
<where>
|
||||
line.pid = voltage.id
|
||||
line.id = deptLine.Line_Id
|
||||
AND deptLine.Id = dept.Id
|
||||
AND line.pid = voltage.id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
@@ -1781,12 +1790,13 @@
|
||||
</select>
|
||||
<select id="selectByName" resultType="com.njcn.device.pq.pojo.po.LineDetail">
|
||||
select
|
||||
t2.*
|
||||
t2.*,
|
||||
t1.name monitorName
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_line_detail t2
|
||||
<where>
|
||||
t1.id = t2.id and t2.Run_Flag=0
|
||||
t1.id = t2.id
|
||||
<if test="param.lineIds!=null and param.lineIds.size()!=0">
|
||||
AND t1.id in
|
||||
<foreach collection="param.lineIds" open="(" close=")" item="item" separator=",">
|
||||
@@ -1841,46 +1851,82 @@
|
||||
where t1.state = 1
|
||||
</select>
|
||||
<select id="getLineDeviceByDevIds" resultType="com.njcn.device.pq.pojo.vo.DevDetailVO">
|
||||
SELECT distinct
|
||||
t.id lineId,
|
||||
t.NAME lineName,
|
||||
dev.id devId,
|
||||
dev.NAME devName,
|
||||
sub.NAME subName,
|
||||
td.Obj_Id objId,
|
||||
device.ip
|
||||
SELECT DISTINCT
|
||||
line.id as lineId,
|
||||
line.name as lineName,
|
||||
device.id as devId,
|
||||
pd.Id as cit,
|
||||
gd.NAME as company,
|
||||
substation.NAME as subName,
|
||||
device.NAME as devName,
|
||||
lineDetail.Line_Grade AS lineGrade,
|
||||
deviceDetail.Update_Time AS timeID,
|
||||
deviceDetail.ip as ip,
|
||||
deviceDetail.Com_Flag as comFlag,
|
||||
deviceDetail.run_Flag as runFlag,
|
||||
deviceDetail.Manufacturer as manufacturer,
|
||||
deviceDetail.Next_Time_Check as nextTimeCheck,
|
||||
lineDetail.Obj_Id objId
|
||||
FROM
|
||||
pq_line t,
|
||||
pq_line_detail td,
|
||||
pq_line subv,
|
||||
pq_line dev,
|
||||
pq_device device,
|
||||
pq_line sub
|
||||
WHERE
|
||||
t.id = td.id
|
||||
AND subv.id = t.pid
|
||||
AND dev.id = subv.pid
|
||||
AND dev.id = device.id
|
||||
AND sub.id = dev.pid
|
||||
<if test="powerFlag!=null and powerFlag!=2">
|
||||
AND td.Power_Flag =#{powerFlag}
|
||||
</if>
|
||||
<if test="lineIds!=null and lineIds.size()!=0">
|
||||
AND t.id in
|
||||
<foreach item="item" collection="lineIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="devIds!=null and devIds.size()!=0">
|
||||
AND dev.id in
|
||||
<foreach item="item" collection="devIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
pq_line line,
|
||||
pq_dept_line pd,
|
||||
pq_line voltage,
|
||||
pq_line device,
|
||||
pq_line substation,
|
||||
pq_line gd,
|
||||
pq_device deviceDetail,
|
||||
pq_line_detail lineDetail
|
||||
<where>
|
||||
line.pid = voltage.id
|
||||
AND line.id = pd.Line_Id
|
||||
AND voltage.pid = device.id
|
||||
AND device.pid = substation.id
|
||||
AND substation.pid = gd.id
|
||||
AND device.id = deviceDetail.id
|
||||
AND line.id = lineDetail.id
|
||||
<if test="powerFlag!=null and powerFlag!=2">
|
||||
AND lineDetail.Power_Flag =#{powerFlag}
|
||||
</if>
|
||||
<if test="lineIds!=null and lineIds.size()!=0">
|
||||
AND line.id in
|
||||
<foreach item="item" collection="lineIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="devIds!=null and devIds.size()!=0">
|
||||
AND device.id in
|
||||
<foreach item="item" collection="devIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getSubIdByPid" resultType="String">
|
||||
SELECT id from pq_line where pid = #{pid}
|
||||
</select>
|
||||
<select id="getDeviceIdByJbPowerFlag" resultType="java.lang.String">
|
||||
select
|
||||
t1.id
|
||||
from
|
||||
pq_line t1 ,
|
||||
pq_line_detail t2
|
||||
where
|
||||
t1.id = t2.id
|
||||
and
|
||||
t1.id in
|
||||
<foreach collection="lineIds" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test=" powerFlag ==0 || powerFlag ==1">
|
||||
AND t2.Power_Flag = #{powerFlag}
|
||||
</if>
|
||||
<if test="powerFlag ==2 ">
|
||||
AND t2.Monitor_Flag = 1
|
||||
</if>
|
||||
<if test="powerFlag ==3">
|
||||
AND t2.Monitor_Flag = 0
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -528,6 +528,9 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
//获取终端等级
|
||||
List<DictData> gradeType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_GRADE.getCode()).getData();
|
||||
Map<String, Integer> gradeMap = gradeType.stream().collect(Collectors.toMap(DictData::getId, DictData::getAlgoDescribe));
|
||||
//获取厂家
|
||||
List<DictData> manufacturerType = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_MANUFACTURER.getCode()).getData();
|
||||
Map<String, String> manufacturerMap = manufacturerType.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
for (LineDetailVO.Detail detail : details) {
|
||||
//获取行政区域名称
|
||||
@@ -549,6 +552,10 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
detail.setStatisValue(flowVo.getStatisValue());
|
||||
detail.setFlowProportion(flowVo.getFlowProportion() * 100);
|
||||
}
|
||||
//厂家
|
||||
if (manufacturerMap.containsKey(detail.getManufacturer())) {
|
||||
detail.setManufacturer(manufacturerMap.get(detail.getManufacturer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return details;
|
||||
@@ -799,6 +806,11 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
Optional<DictData> temp4 = voltageList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getLineVoltage())).findAny();
|
||||
pollutionLineInfoDTO.setLineVoltage(temp4.map(DictData::getName).orElse(null));
|
||||
|
||||
// 变电站电压等级
|
||||
Optional<DictData> temp5 = voltageList.stream().filter(item -> item.getId().equals(pollutionLineInfoDTO.getSubVoltage())).findAny();
|
||||
pollutionLineInfoDTO.setSubVoltage(temp5.map(DictData::getName).orElse(null));
|
||||
|
||||
|
||||
// 电网侧
|
||||
pollutionLineInfoDTO.setPowerFlag(pollutionLineInfoDTO.getPowerFlag().equals("0") ? "电网侧" : "非电网侧");
|
||||
}
|
||||
|
||||
@@ -48,4 +48,12 @@ public interface RStatIntegrityDMapper extends MppBaseMapper<RStatIntegrityD> {
|
||||
* @Date: 2024/1/8 14:01
|
||||
*/
|
||||
Float selectTotalIntegrityByLineIds(@Param("param") LineBaseQueryParam param);
|
||||
|
||||
/**
|
||||
* 获取监测点数据完整性
|
||||
* @author xy
|
||||
* @date 2025/11/25
|
||||
*/
|
||||
List<RStatIntegrityVO> getLineIntegrityRateInfo(@Param("lineIds")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
}
|
||||
|
||||
@@ -86,4 +86,28 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getLineIntegrityRateInfo" resultType="RStatIntegrityVO">
|
||||
select line_index lineIndex,
|
||||
ROUND(sum( real_time )*1.0 / sum( due_time ) * 100,2) AS integrityRate,
|
||||
sum(real_time) realTime,
|
||||
sum(due_time) dueTime
|
||||
from r_stat_integrity_d
|
||||
<where>
|
||||
<if test="lineIds!=null and lineIds.size > 0">
|
||||
line_index in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" startTime != null and startTime !=''">
|
||||
AND time_id >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
AND time_id <= #{endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_index
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.harmonic.pojo.excel.pollution;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -13,46 +14,51 @@ public class LineItemPollution implements Serializable {
|
||||
* 终端名称
|
||||
*/
|
||||
@Excel(name = "终端名称", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
* 终端厂家
|
||||
*/
|
||||
@Excel(name = "终端厂家", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
@Excel(name = "终端型号", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端型号")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 终端投运时间
|
||||
*/
|
||||
@Excel(name = "投运时间", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("投运时间")
|
||||
private String loginTime;
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
@Excel(name = "监测点名称", width = 35, replace = "/_null")
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 统计间隔
|
||||
*/
|
||||
@Excel(name = "统计间隔", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("统计间隔")
|
||||
private Integer interval;
|
||||
|
||||
/**
|
||||
* 谐波电压污染值
|
||||
*/
|
||||
@Excel(name = "谐波电压污染值", width = 35, replace = "/_null")
|
||||
@Excel(name = "谐波污染值", width = 35, replace = "/_null")
|
||||
@ApiModelProperty("谐波污染值")
|
||||
private Double vHarmonicValue;
|
||||
|
||||
@Excel(name = "谐波电压污染值", width = 35, replace = "/_null")
|
||||
private Double iHarmonicValue;
|
||||
|
||||
/**
|
||||
* 暂升次数 1.1~1.8
|
||||
@@ -79,6 +85,7 @@ public class LineItemPollution implements Serializable {
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,14 @@ public class LinePollution implements Serializable {
|
||||
@ApiModelProperty("监测点电压等级")
|
||||
private String lineVoltage;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* 监测点电压等级
|
||||
*/
|
||||
@Excel(name = "变电站电压等级", width = 30)
|
||||
@ApiModelProperty("变电站电压等级")
|
||||
private String subVoltage;
|
||||
|
||||
/**
|
||||
* 干扰源类型
|
||||
*/
|
||||
|
||||
@@ -1,35 +1,69 @@
|
||||
package com.njcn.harmonic.pojo.excel.pollution;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PowerFlagPollution implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 监测点名称
|
||||
*/
|
||||
@Excel(name = "监测点名称", width = 35, replace = "/_null")
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
|
||||
/**
|
||||
* 终端名称
|
||||
*/
|
||||
@Excel(name = "终端名称", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端名称")
|
||||
private String devName;
|
||||
|
||||
/**
|
||||
* 终端厂家
|
||||
*/
|
||||
@Excel(name = "终端厂家", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
@Excel(name = "终端型号", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("终端型号")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 终端投运时间
|
||||
*/
|
||||
@Excel(name = "投运时间", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("投运时间")
|
||||
private String loginTime;
|
||||
/**
|
||||
* 统计间隔
|
||||
*/
|
||||
@Excel(name = "统计间隔", width = 30, replace = "/_null")
|
||||
@ApiModelProperty("统计间隔")
|
||||
private Integer interval;
|
||||
|
||||
/**
|
||||
* 监测位置
|
||||
*/
|
||||
@Excel(name = "监测位置", width = 30, needMerge = true)
|
||||
@ApiModelProperty("监测位置")
|
||||
private String powerFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 监测污染值
|
||||
* 谐波电压污染值
|
||||
*/
|
||||
@Excel(name = "监测谐波电压污染值", width = 40, needMerge = true, replace = "/_null")
|
||||
private String powerVValue;
|
||||
|
||||
@Excel(name = "监测谐波电流污染值", width = 40, needMerge = true, replace = "/_null")
|
||||
private String powerIValue;
|
||||
/**
|
||||
* 当前位置下,各测点的污染数据
|
||||
*/
|
||||
@ExcelCollection(name = "")
|
||||
private List<LineItemPollution> lineItemPollutionList;
|
||||
|
||||
@Excel(name = "谐波污染值", width = 35, replace = "/_null")
|
||||
@ApiModelProperty("谐波污染值")
|
||||
private Double vHarmonicValue;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.harmonic.pojo.excel.pollution;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -10,26 +11,34 @@ import java.util.List;
|
||||
@Data
|
||||
public class SubstationPollution implements Serializable {
|
||||
|
||||
/**
|
||||
* 供电公司名称
|
||||
*/
|
||||
@Excel(name = "供电公司", width = 30, needMerge = true)
|
||||
@ApiModelProperty("供电公司")
|
||||
private String gdName;
|
||||
|
||||
/**
|
||||
* 供电公司名称
|
||||
*/
|
||||
@Excel(name = "供电公司", width = 30, needMerge = true)
|
||||
@ApiModelProperty("供电公司")
|
||||
private String subVoltage;
|
||||
/**
|
||||
* 所属变电站
|
||||
*/
|
||||
@Excel(name = "变电站", width = 30, needMerge = true)
|
||||
@Excel(name = "变电站电压等级", width = 30, needMerge = true)
|
||||
@ApiModelProperty("变电站电压等级")
|
||||
private String subStationName;
|
||||
|
||||
/**
|
||||
* 电站污染值
|
||||
*/
|
||||
@Excel(name = "电站谐波电压污染值", width = 25, needMerge = true)
|
||||
@Excel(name = "电站谐波污染值", width = 25, needMerge = true)
|
||||
@ApiModelProperty("电站谐波污染值")
|
||||
private String subVStationValue;
|
||||
|
||||
|
||||
/**
|
||||
* 电站污染值
|
||||
*/
|
||||
@Excel(name = "电站谐波电流污染值", width = 25, needMerge = true)
|
||||
private String subIStationValue;
|
||||
|
||||
/**
|
||||
* 电网侧&非电网侧
|
||||
* name不要赋值
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class LimitCalendarQueryParam extends TotalLimitStatisticsParam {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class LimitExtentDayQueryParam {
|
||||
|
||||
@ApiModelProperty(value = "发生时间")
|
||||
@NotBlank(message = "发生日期不能为空")
|
||||
@DateTimeStrValid(message = "发生日期格式出错")
|
||||
private String time;
|
||||
|
||||
@ApiModelProperty(value = "监测点id")
|
||||
@NotBlank(message = "监测点id不能为空")
|
||||
private String lineId;
|
||||
@ApiModelProperty(value = "指标编码")
|
||||
@NotBlank(message = "指标编码不能为空")
|
||||
private String code;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class LimitExtentQueryParam extends TotalLimitStatisticsParam {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class LimitProbabilityQueryParam extends MainLineStatLimitRateDetailsQueryParam {
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MainLineQueryParam {
|
||||
@ApiModelProperty("关键词")
|
||||
private String keywords;
|
||||
|
||||
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||
@NotBlank(message = "起始时间不可为空")
|
||||
@DateTimeStrValid(message = "起始时间格式出错")
|
||||
private String searchBeginTime;
|
||||
|
||||
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||
@NotBlank(message = "结束时间不可为空")
|
||||
private String searchEndTime;
|
||||
|
||||
@ApiModelProperty(value = "页码", example = "1")
|
||||
private int pageNum = 1;
|
||||
|
||||
@ApiModelProperty(value = "每页记录数", example = "10")
|
||||
private int pageSize = 10;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class MainLineStatLimitRateDetailsQueryParam {
|
||||
@NotBlank(message = "监测点ID不可为空")
|
||||
@ApiModelProperty("监测点ID")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||
@NotBlank(message = "起始时间不可为空")
|
||||
@DateTimeStrValid(message = "起始时间格式出错")
|
||||
private String searchBeginTime;
|
||||
|
||||
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||
@NotBlank(message = "结束时间不可为空")
|
||||
private String searchEndTime;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TotalLimitStatisticsDetailsQueryParam extends MainLineStatLimitRateDetailsQueryParam {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.harmonic.pojo.param;
|
||||
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class TotalLimitStatisticsParam {
|
||||
@ApiModelProperty(name = "searchBeginTime", value = "开始时间")
|
||||
@NotBlank(message = "起始时间不可为空")
|
||||
@DateTimeStrValid(message = "起始时间格式出错")
|
||||
private String searchBeginTime;
|
||||
|
||||
@ApiModelProperty(name = "searchEndTime", value = "结束时间")
|
||||
@NotBlank(message = "结束时间不可为空")
|
||||
private String searchEndTime;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.harmonic.annotaion.HarCurrent;
|
||||
import com.njcn.harmonic.annotaion.HarVoltage;
|
||||
import com.njcn.harmonic.annotaion.InterharVoltage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -23,6 +24,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "my_index")
|
||||
@ApiModelProperty(value = "监测点ID合格率的变电站/装置/母线/线路序号")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
@@ -30,6 +32,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "phasic_type")
|
||||
@ApiModelProperty(value = "数据类型,'A'表示A相,'B'表示B相,'C'表示C相,''M'表示ABC三项总和,T'表示总")
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
@@ -37,55 +40,64 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "合格率时间")
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
@TableField(value = "all_time")
|
||||
@ApiModelProperty(value = "总计算次数")
|
||||
private Integer allTime;
|
||||
|
||||
/**
|
||||
* 闪变越限次数
|
||||
*/
|
||||
@TableField(value = "flicker_overtime")
|
||||
@ApiModelProperty(value = "闪变越限次数")
|
||||
private Integer flickerOvertime;
|
||||
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
@TableField(value = "flicker_all_time")
|
||||
@ApiModelProperty(value = "闪变总计算次数")
|
||||
private Integer flickerAllTime;
|
||||
|
||||
/**
|
||||
* 频率偏差越限次数
|
||||
*/
|
||||
@TableField(value = "freq_dev_overtime")
|
||||
@ApiModelProperty(value = "频率偏差越限次数")
|
||||
private Integer freqDevOvertime;
|
||||
|
||||
/**
|
||||
* 电压偏差越限次数
|
||||
*/
|
||||
@TableField(value = "voltage_dev_overtime")
|
||||
@ApiModelProperty(value = "电压偏差越限次数")
|
||||
private Integer voltageDevOvertime;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度越限次数
|
||||
*/
|
||||
@TableField(value = "ubalance_overtime")
|
||||
@ApiModelProperty(value = "三相电压不平衡度越限次数")
|
||||
private Integer ubalanceOvertime;
|
||||
|
||||
/**
|
||||
* 电压谐波畸变率越限次数
|
||||
*/
|
||||
@TableField(value = "uaberrance_overtime")
|
||||
@ApiModelProperty(value = "电压谐波畸变率越限次数")
|
||||
private Integer uaberranceOvertime;
|
||||
|
||||
/**
|
||||
* 负序电流限值次数
|
||||
*/
|
||||
@TableField(value = "i_neg_overtime")
|
||||
@ApiModelProperty(value = "负序电流限值次数")
|
||||
private Integer iNegOvertime;
|
||||
|
||||
/**
|
||||
@@ -93,6 +105,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_2_overtime")
|
||||
@ApiModelProperty(value = "2次电压谐波含有率越限次数")
|
||||
private Integer uharm2Overtime;
|
||||
|
||||
/**
|
||||
@@ -100,6 +113,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_3_overtime")
|
||||
@ApiModelProperty(value = "3次电压谐波含有率越限次数")
|
||||
private Integer uharm3Overtime;
|
||||
|
||||
/**
|
||||
@@ -107,6 +121,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_4_overtime")
|
||||
@ApiModelProperty(value = "4次电压谐波含有率越限次数")
|
||||
private Integer uharm4Overtime;
|
||||
|
||||
/**
|
||||
@@ -114,6 +129,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_5_overtime")
|
||||
@ApiModelProperty(value = "5次电压谐波含有率越限次数")
|
||||
private Integer uharm5Overtime;
|
||||
|
||||
/**
|
||||
@@ -121,6 +137,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_6_overtime")
|
||||
@ApiModelProperty(value = "6次电压谐波含有率越限次数")
|
||||
private Integer uharm6Overtime;
|
||||
|
||||
/**
|
||||
@@ -128,6 +145,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_7_overtime")
|
||||
@ApiModelProperty(value = "7次电压谐波含有率越限次数")
|
||||
private Integer uharm7Overtime;
|
||||
|
||||
/**
|
||||
@@ -135,6 +153,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_8_overtime")
|
||||
@ApiModelProperty(value = "8次电压谐波含有率越限次数")
|
||||
private Integer uharm8Overtime;
|
||||
|
||||
/**
|
||||
@@ -142,6 +161,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_9_overtime")
|
||||
@ApiModelProperty(value = "9次电压谐波含有率越限次数")
|
||||
private Integer uharm9Overtime;
|
||||
|
||||
/**
|
||||
@@ -149,6 +169,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_10_overtime")
|
||||
@ApiModelProperty(value = "10次电压谐波含有率越限次数")
|
||||
private Integer uharm10Overtime;
|
||||
|
||||
/**
|
||||
@@ -156,6 +177,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_11_overtime")
|
||||
@ApiModelProperty(value = "11次电压谐波含有率越限次数")
|
||||
private Integer uharm11Overtime;
|
||||
|
||||
/**
|
||||
@@ -163,6 +185,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_12_overtime")
|
||||
@ApiModelProperty(value = "12次电压谐波含有率越限次数")
|
||||
private Integer uharm12Overtime;
|
||||
|
||||
/**
|
||||
@@ -170,6 +193,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_13_overtime")
|
||||
@ApiModelProperty(value = "13次电压谐波含有率越限次数")
|
||||
private Integer uharm13Overtime;
|
||||
|
||||
/**
|
||||
@@ -177,6 +201,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_14_overtime")
|
||||
@ApiModelProperty(value = "14次电压谐波含有率越限次数")
|
||||
private Integer uharm14Overtime;
|
||||
|
||||
/**
|
||||
@@ -184,6 +209,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_15_overtime")
|
||||
@ApiModelProperty(value = "15次电压谐波含有率越限次数")
|
||||
private Integer uharm15Overtime;
|
||||
|
||||
/**
|
||||
@@ -191,6 +217,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_16_overtime")
|
||||
@ApiModelProperty(value = "16次电压谐波含有率越限次数")
|
||||
private Integer uharm16Overtime;
|
||||
|
||||
/**
|
||||
@@ -198,6 +225,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_17_overtime")
|
||||
@ApiModelProperty(value = "17次电压谐波含有率越限次数")
|
||||
private Integer uharm17Overtime;
|
||||
|
||||
/**
|
||||
@@ -205,6 +233,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_18_overtime")
|
||||
@ApiModelProperty(value = "18次电压谐波含有率越限次数")
|
||||
private Integer uharm18Overtime;
|
||||
|
||||
/**
|
||||
@@ -212,6 +241,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_19_overtime")
|
||||
@ApiModelProperty(value = "19次电压谐波含有率越限次数")
|
||||
private Integer uharm19Overtime;
|
||||
|
||||
/**
|
||||
@@ -219,6 +249,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_20_overtime")
|
||||
@ApiModelProperty(value = "20次电压谐波含有率越限次数")
|
||||
private Integer uharm20Overtime;
|
||||
|
||||
/**
|
||||
@@ -226,6 +257,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_21_overtime")
|
||||
@ApiModelProperty(value = "21次电压谐波含有率越限次数")
|
||||
private Integer uharm21Overtime;
|
||||
|
||||
/**
|
||||
@@ -233,6 +265,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_22_overtime")
|
||||
@ApiModelProperty(value = "22次电压谐波含有率越限次数")
|
||||
private Integer uharm22Overtime;
|
||||
|
||||
/**
|
||||
@@ -240,6 +273,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_23_overtime")
|
||||
@ApiModelProperty(value = "23次电压谐波含有率越限次数")
|
||||
private Integer uharm23Overtime;
|
||||
|
||||
/**
|
||||
@@ -247,6 +281,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_24_overtime")
|
||||
@ApiModelProperty(value = "24次电压谐波含有率越限次数")
|
||||
private Integer uharm24Overtime;
|
||||
|
||||
/**
|
||||
@@ -254,6 +289,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_25_overtime")
|
||||
@ApiModelProperty(value = "25次电压谐波含有率越限次数")
|
||||
private Integer uharm25Overtime;
|
||||
|
||||
/**
|
||||
@@ -261,6 +297,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_2_overtime")
|
||||
@ApiModelProperty(value = "2次电流谐波幅值越限次数")
|
||||
private Integer iharm2Overtime;
|
||||
|
||||
/**
|
||||
@@ -268,6 +305,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_3_overtime")
|
||||
@ApiModelProperty(value = "3次电流谐波幅值越限次数")
|
||||
private Integer iharm3Overtime;
|
||||
|
||||
/**
|
||||
@@ -275,6 +313,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_4_overtime")
|
||||
@ApiModelProperty(value = "4次电流谐波幅值越限次数")
|
||||
private Integer iharm4Overtime;
|
||||
|
||||
/**
|
||||
@@ -282,6 +321,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_5_overtime")
|
||||
@ApiModelProperty(value = "5次电流谐波幅值越限次数")
|
||||
private Integer iharm5Overtime;
|
||||
|
||||
/**
|
||||
@@ -289,6 +329,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_6_overtime")
|
||||
@ApiModelProperty(value = "6次电流谐波幅值越限次数")
|
||||
private Integer iharm6Overtime;
|
||||
|
||||
/**
|
||||
@@ -296,6 +337,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_7_overtime")
|
||||
@ApiModelProperty(value = "7次电流谐波幅值越限次数")
|
||||
private Integer iharm7Overtime;
|
||||
|
||||
/**
|
||||
@@ -303,6 +345,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_8_overtime")
|
||||
@ApiModelProperty(value = "8次电流谐波幅值越限次数")
|
||||
private Integer iharm8Overtime;
|
||||
|
||||
/**
|
||||
@@ -310,6 +353,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_9_overtime")
|
||||
@ApiModelProperty(value = "9次电流谐波幅值越限次数")
|
||||
private Integer iharm9Overtime;
|
||||
|
||||
/**
|
||||
@@ -317,6 +361,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_10_overtime")
|
||||
@ApiModelProperty(value = "10次电流谐波幅值越限次数")
|
||||
private Integer iharm10Overtime;
|
||||
|
||||
/**
|
||||
@@ -324,6 +369,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_11_overtime")
|
||||
@ApiModelProperty(value = "11次电流谐波幅值越限次数")
|
||||
private Integer iharm11Overtime;
|
||||
|
||||
/**
|
||||
@@ -331,6 +377,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_12_overtime")
|
||||
@ApiModelProperty(value = "12次电流谐波幅值越限次数")
|
||||
private Integer iharm12Overtime;
|
||||
|
||||
/**
|
||||
@@ -338,6 +385,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_13_overtime")
|
||||
@ApiModelProperty(value = "13次电流谐波幅值越限次数")
|
||||
private Integer iharm13Overtime;
|
||||
|
||||
/**
|
||||
@@ -345,6 +393,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_14_overtime")
|
||||
@ApiModelProperty(value = "14次电流谐波幅值越限次数")
|
||||
private Integer iharm14Overtime;
|
||||
|
||||
/**
|
||||
@@ -352,6 +401,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_15_overtime")
|
||||
@ApiModelProperty(value = "15次电流谐波幅值越限次数")
|
||||
private Integer iharm15Overtime;
|
||||
|
||||
/**
|
||||
@@ -359,6 +409,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_16_overtime")
|
||||
@ApiModelProperty(value = "16次电流谐波幅值越限次数")
|
||||
private Integer iharm16Overtime;
|
||||
|
||||
/**
|
||||
@@ -366,6 +417,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_17_overtime")
|
||||
@ApiModelProperty(value = "17次电流谐波幅值越限次数")
|
||||
private Integer iharm17Overtime;
|
||||
|
||||
/**
|
||||
@@ -373,6 +425,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_18_overtime")
|
||||
@ApiModelProperty(value = "18次电流谐波幅值越限次数")
|
||||
private Integer iharm18Overtime;
|
||||
|
||||
/**
|
||||
@@ -380,6 +433,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_19_overtime")
|
||||
@ApiModelProperty(value = "19次电流谐波幅值越限次数")
|
||||
private Integer iharm19Overtime;
|
||||
|
||||
/**
|
||||
@@ -387,6 +441,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_20_overtime")
|
||||
@ApiModelProperty(value = "20次电流谐波幅值越限次数")
|
||||
private Integer iharm20Overtime;
|
||||
|
||||
/**
|
||||
@@ -394,6 +449,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_21_overtime")
|
||||
@ApiModelProperty(value = "21次电流谐波幅值越限次数")
|
||||
private Integer iharm21Overtime;
|
||||
|
||||
/**
|
||||
@@ -401,6 +457,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_22_overtime")
|
||||
@ApiModelProperty(value = "22次电流谐波幅值越限次数")
|
||||
private Integer iharm22Overtime;
|
||||
|
||||
/**
|
||||
@@ -408,6 +465,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_23_overtime")
|
||||
@ApiModelProperty(value = "23次电流谐波幅值越限次数")
|
||||
private Integer iharm23Overtime;
|
||||
|
||||
/**
|
||||
@@ -415,6 +473,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_24_overtime")
|
||||
@ApiModelProperty(value = "24次电流谐波幅值越限次数")
|
||||
private Integer iharm24Overtime;
|
||||
|
||||
/**
|
||||
@@ -422,6 +481,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_25_overtime")
|
||||
@ApiModelProperty(value = "25次电流谐波幅值越限次数")
|
||||
private Integer iharm25Overtime;
|
||||
|
||||
/**
|
||||
@@ -429,6 +489,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@TableField(value = "inuharm_1_overtime")
|
||||
@InterharVoltage
|
||||
@ApiModelProperty(value = "0.5次间谐波电压限值次数")
|
||||
private Integer inuharm1Overtime;
|
||||
|
||||
/**
|
||||
@@ -436,6 +497,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_2_overtime")
|
||||
@ApiModelProperty(value = "1.5次间谐波电压限值次数")
|
||||
private Integer inuharm2Overtime;
|
||||
|
||||
/**
|
||||
@@ -443,6 +505,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_3_overtime")
|
||||
@ApiModelProperty(value = "2.5次间谐波电压限值次数")
|
||||
private Integer inuharm3Overtime;
|
||||
|
||||
/**
|
||||
@@ -450,6 +513,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_4_overtime")
|
||||
@ApiModelProperty(value = "3.5次间谐波电压限值次数")
|
||||
private Integer inuharm4Overtime;
|
||||
|
||||
/**
|
||||
@@ -457,6 +521,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_5_overtime")
|
||||
@ApiModelProperty(value = "4.5次间谐波电压限值次数")
|
||||
private Integer inuharm5Overtime;
|
||||
|
||||
/**
|
||||
@@ -464,6 +529,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_6_overtime")
|
||||
@ApiModelProperty(value = "5.5次间谐波电压限值次数")
|
||||
private Integer inuharm6Overtime;
|
||||
|
||||
/**
|
||||
@@ -471,6 +537,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_7_overtime")
|
||||
@ApiModelProperty(value = "6.5次间谐波电压限值次数")
|
||||
private Integer inuharm7Overtime;
|
||||
|
||||
/**
|
||||
@@ -478,6 +545,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_8_overtime")
|
||||
@ApiModelProperty(value = "7.5次间谐波电压限值次数")
|
||||
private Integer inuharm8Overtime;
|
||||
|
||||
/**
|
||||
@@ -485,6 +553,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_9_overtime")
|
||||
@ApiModelProperty(value = "8.5次间谐波电压限值次数")
|
||||
private Integer inuharm9Overtime;
|
||||
|
||||
/**
|
||||
@@ -492,6 +561,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_10_overtime")
|
||||
@ApiModelProperty(value = "9.5次间谐波电压限值次数")
|
||||
private Integer inuharm10Overtime;
|
||||
|
||||
/**
|
||||
@@ -499,6 +569,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_11_overtime")
|
||||
@ApiModelProperty(value = "10.5次间谐波电压限值次数")
|
||||
private Integer inuharm11Overtime;
|
||||
|
||||
/**
|
||||
@@ -506,6 +577,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_12_overtime")
|
||||
@ApiModelProperty(value = "11.5次间谐波电压限值次数")
|
||||
private Integer inuharm12Overtime;
|
||||
|
||||
/**
|
||||
@@ -513,6 +585,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_13_overtime")
|
||||
@ApiModelProperty(value = "12.5次间谐波电压限值次数")
|
||||
private Integer inuharm13Overtime;
|
||||
|
||||
/**
|
||||
@@ -520,6 +593,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_14_overtime")
|
||||
@ApiModelProperty(value = "13.5次间谐波电压限值次数")
|
||||
private Integer inuharm14Overtime;
|
||||
|
||||
/**
|
||||
@@ -527,6 +601,7 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_15_overtime")
|
||||
@ApiModelProperty(value = "14.5次间谐波电压限值次数")
|
||||
private Integer inuharm15Overtime;
|
||||
|
||||
/**
|
||||
@@ -534,5 +609,6 @@ public class RStatLimitRateDPO {
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_16_overtime")
|
||||
@ApiModelProperty(value = "15.5次间谐波电压限值次数")
|
||||
private Integer inuharm16Overtime;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,594 @@
|
||||
package com.njcn.harmonic.pojo.po.day;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.harmonic.annotaion.HarCurrent;
|
||||
import com.njcn.harmonic.annotaion.HarVoltage;
|
||||
import com.njcn.harmonic.annotaion.InterharVoltage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "r_stat_limit_rate_detail_d")
|
||||
public class RStatLimitRateDetailDPO {
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "合格率时间")
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "my_index")
|
||||
@ApiModelProperty(value = "监测点ID合格率的变电站/装置/母线/线路序号")
|
||||
private String lineId;
|
||||
|
||||
|
||||
/**
|
||||
* 频率偏差越限数据
|
||||
*/
|
||||
@TableField(value = "freq_dev_overtime")
|
||||
@ApiModelProperty(value = "频率偏差越限数据")
|
||||
private String freqDevOvertime;
|
||||
|
||||
/**
|
||||
* 电压偏差越限数据
|
||||
*/
|
||||
@TableField(value = "voltage_dev_overtime")
|
||||
@ApiModelProperty(value = "电压偏差越限数据")
|
||||
private String voltageDevOvertime;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度越限数据
|
||||
*/
|
||||
@TableField(value = "ubalance_overtime")
|
||||
@ApiModelProperty(value = "三相电压不平衡度越限数据")
|
||||
private String ubalanceOvertime;
|
||||
/**
|
||||
* 闪变越限数据
|
||||
*/
|
||||
@TableField(value = "flicker_overtime")
|
||||
@ApiModelProperty(value = "闪变越限数据")
|
||||
private String flickerOvertime;
|
||||
|
||||
|
||||
/**
|
||||
* 电压谐波畸变率越限数据
|
||||
*/
|
||||
@TableField(value = "uaberrance_overtime")
|
||||
@ApiModelProperty(value = "电压谐波畸变率越限数据")
|
||||
private String uaberranceOvertime;
|
||||
|
||||
/**
|
||||
* 负序电流限值数据
|
||||
*/
|
||||
@TableField(value = "i_neg_overtime")
|
||||
@ApiModelProperty(value = "负序电流限值数据")
|
||||
private String iNegOvertime;
|
||||
|
||||
/**
|
||||
* 2次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_2_overtime")
|
||||
@ApiModelProperty(value = "2次电压谐波含有率越限数据")
|
||||
private String uharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_3_overtime")
|
||||
@ApiModelProperty(value = "3次电压谐波含有率越限数据")
|
||||
private String uharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_4_overtime")
|
||||
@ApiModelProperty(value = "4次电压谐波含有率越限数据")
|
||||
private String uharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_5_overtime")
|
||||
@ApiModelProperty(value = "5次电压谐波含有率越限数据")
|
||||
private String uharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_6_overtime")
|
||||
@ApiModelProperty(value = "6次电压谐波含有率越限数据")
|
||||
private String uharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_7_overtime")
|
||||
@ApiModelProperty(value = "7次电压谐波含有率越限数据")
|
||||
private String uharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_8_overtime")
|
||||
@ApiModelProperty(value = "8次电压谐波含有率越限数据")
|
||||
private String uharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_9_overtime")
|
||||
@ApiModelProperty(value = "9次电压谐波含有率越限数据")
|
||||
private String uharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_10_overtime")
|
||||
@ApiModelProperty(value = "10次电压谐波含有率越限数据")
|
||||
private String uharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_11_overtime")
|
||||
@ApiModelProperty(value = "11次电压谐波含有率越限数据")
|
||||
private String uharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_12_overtime")
|
||||
@ApiModelProperty(value = "12次电压谐波含有率越限数据")
|
||||
private String uharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_13_overtime")
|
||||
@ApiModelProperty(value = "13次电压谐波含有率越限数据")
|
||||
private String uharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_14_overtime")
|
||||
@ApiModelProperty(value = "14次电压谐波含有率越限数据")
|
||||
private String uharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_15_overtime")
|
||||
@ApiModelProperty(value = "15次电压谐波含有率越限数据")
|
||||
private String uharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_16_overtime")
|
||||
@ApiModelProperty(value = "16次电压谐波含有率越限数据")
|
||||
private String uharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_17_overtime")
|
||||
@ApiModelProperty(value = "17次电压谐波含有率越限数据")
|
||||
private String uharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_18_overtime")
|
||||
@ApiModelProperty(value = "18次电压谐波含有率越限数据")
|
||||
private String uharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_19_overtime")
|
||||
@ApiModelProperty(value = "19次电压谐波含有率越限数据")
|
||||
private String uharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_20_overtime")
|
||||
@ApiModelProperty(value = "20次电压谐波含有率越限数据")
|
||||
private String uharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_21_overtime")
|
||||
@ApiModelProperty(value = "21次电压谐波含有率越限数据")
|
||||
private String uharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_22_overtime")
|
||||
@ApiModelProperty(value = "22次电压谐波含有率越限数据")
|
||||
private String uharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_23_overtime")
|
||||
@ApiModelProperty(value = "23次电压谐波含有率越限数据")
|
||||
private String uharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_24_overtime")
|
||||
@ApiModelProperty(value = "24次电压谐波含有率越限数据")
|
||||
private String uharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电压谐波含有率越限数据
|
||||
*/
|
||||
@HarVoltage
|
||||
@TableField(value = "uharm_25_overtime")
|
||||
@ApiModelProperty(value = "25次电压谐波含有率越限数据")
|
||||
private String uharm25Overtime;
|
||||
|
||||
/**
|
||||
* 2次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_2_overtime")
|
||||
@ApiModelProperty(value = "2次电流谐波幅值越限数据")
|
||||
private String iharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_3_overtime")
|
||||
@ApiModelProperty(value = "3次电流谐波幅值越限数据")
|
||||
private String iharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_4_overtime")
|
||||
@ApiModelProperty(value = "4次电流谐波幅值越限数据")
|
||||
private String iharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_5_overtime")
|
||||
@ApiModelProperty(value = "5次电流谐波幅值越限数据")
|
||||
private String iharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_6_overtime")
|
||||
@ApiModelProperty(value = "6次电流谐波幅值越限数据")
|
||||
private String iharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_7_overtime")
|
||||
@ApiModelProperty(value = "7次电流谐波幅值越限数据")
|
||||
private String iharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_8_overtime")
|
||||
@ApiModelProperty(value = "8次电流谐波幅值越限数据")
|
||||
private String iharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_9_overtime")
|
||||
@ApiModelProperty(value = "9次电流谐波幅值越限数据")
|
||||
private String iharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_10_overtime")
|
||||
@ApiModelProperty(value = "10次电流谐波幅值越限数据")
|
||||
private String iharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_11_overtime")
|
||||
@ApiModelProperty(value = "11次电流谐波幅值越限数据")
|
||||
private String iharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_12_overtime")
|
||||
@ApiModelProperty(value = "12次电流谐波幅值越限数据")
|
||||
private String iharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_13_overtime")
|
||||
@ApiModelProperty(value = "13次电流谐波幅值越限数据")
|
||||
private String iharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_14_overtime")
|
||||
@ApiModelProperty(value = "14次电流谐波幅值越限数据")
|
||||
private String iharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_15_overtime")
|
||||
@ApiModelProperty(value = "15次电流谐波幅值越限数据")
|
||||
private String iharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_16_overtime")
|
||||
@ApiModelProperty(value = "16次电流谐波幅值越限数据")
|
||||
private String iharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_17_overtime")
|
||||
@ApiModelProperty(value = "17次电流谐波幅值越限数据")
|
||||
private String iharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_18_overtime")
|
||||
@ApiModelProperty(value = "18次电流谐波幅值越限数据")
|
||||
private String iharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_19_overtime")
|
||||
@ApiModelProperty(value = "19次电流谐波幅值越限数据")
|
||||
private String iharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_20_overtime")
|
||||
@ApiModelProperty(value = "20次电流谐波幅值越限数据")
|
||||
private String iharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_21_overtime")
|
||||
@ApiModelProperty(value = "21次电流谐波幅值越限数据")
|
||||
private String iharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_22_overtime")
|
||||
@ApiModelProperty(value = "22次电流谐波幅值越限数据")
|
||||
private String iharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_23_overtime")
|
||||
@ApiModelProperty(value = "23次电流谐波幅值越限数据")
|
||||
private String iharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_24_overtime")
|
||||
@ApiModelProperty(value = "24次电流谐波幅值越限数据")
|
||||
private String iharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电流谐波幅值越限数据
|
||||
*/
|
||||
@HarCurrent
|
||||
@TableField(value = "iharm_25_overtime")
|
||||
@ApiModelProperty(value = "25次电流谐波幅值越限数据")
|
||||
private String iharm25Overtime;
|
||||
|
||||
/**
|
||||
* 0.5次间谐波电压限值数据
|
||||
*/
|
||||
@TableField(value = "inuharm_1_overtime")
|
||||
@InterharVoltage
|
||||
@ApiModelProperty(value = "0.5次间谐波电压限值数据")
|
||||
private String inuharm1Overtime;
|
||||
|
||||
/**
|
||||
* 1.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_2_overtime")
|
||||
@ApiModelProperty(value = "1.5次间谐波电压限值数据")
|
||||
private String inuharm2Overtime;
|
||||
|
||||
/**
|
||||
* 2.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_3_overtime")
|
||||
@ApiModelProperty(value = "2.5次间谐波电压限值数据")
|
||||
private String inuharm3Overtime;
|
||||
|
||||
/**
|
||||
* 3.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_4_overtime")
|
||||
@ApiModelProperty(value = "3.5次间谐波电压限值数据")
|
||||
private String inuharm4Overtime;
|
||||
|
||||
/**
|
||||
* 4.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_5_overtime")
|
||||
@ApiModelProperty(value = "4.5次间谐波电压限值数据")
|
||||
private String inuharm5Overtime;
|
||||
|
||||
/**
|
||||
* 5.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_6_overtime")
|
||||
@ApiModelProperty(value = "5.5次间谐波电压限值数据")
|
||||
private String inuharm6Overtime;
|
||||
|
||||
/**
|
||||
* 6.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_7_overtime")
|
||||
@ApiModelProperty(value = "6.5次间谐波电压限值数据")
|
||||
private String inuharm7Overtime;
|
||||
|
||||
/**
|
||||
* 7.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_8_overtime")
|
||||
@ApiModelProperty(value = "7.5次间谐波电压限值数据")
|
||||
private String inuharm8Overtime;
|
||||
|
||||
/**
|
||||
* 8.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_9_overtime")
|
||||
@ApiModelProperty(value = "8.5次间谐波电压限值数据")
|
||||
private String inuharm9Overtime;
|
||||
|
||||
/**
|
||||
* 9.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_10_overtime")
|
||||
@ApiModelProperty(value = "9.5次间谐波电压限值数据")
|
||||
private String inuharm10Overtime;
|
||||
|
||||
/**
|
||||
* 10.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_11_overtime")
|
||||
@ApiModelProperty(value = "10.5次间谐波电压限值数据")
|
||||
private String inuharm11Overtime;
|
||||
|
||||
/**
|
||||
* 11.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_12_overtime")
|
||||
@ApiModelProperty(value = "11.5次间谐波电压限值数据")
|
||||
private String inuharm12Overtime;
|
||||
|
||||
/**
|
||||
* 12.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_13_overtime")
|
||||
@ApiModelProperty(value = "12.5次间谐波电压限值数据")
|
||||
private String inuharm13Overtime;
|
||||
|
||||
/**
|
||||
* 13.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_14_overtime")
|
||||
@ApiModelProperty(value = "13.5次间谐波电压限值数据")
|
||||
private String inuharm14Overtime;
|
||||
|
||||
/**
|
||||
* 14.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_15_overtime")
|
||||
@ApiModelProperty(value = "14.5次间谐波电压限值数据")
|
||||
private String inuharm15Overtime;
|
||||
|
||||
/**
|
||||
* 15.5次间谐波电压限值数据
|
||||
*/
|
||||
@InterharVoltage
|
||||
@TableField(value = "inuharm_16_overtime")
|
||||
@ApiModelProperty(value = "15.5次间谐波电压限值数据")
|
||||
private String inuharm16Overtime;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class LimitCalendarVO {
|
||||
@ApiModelProperty("发生日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate time;
|
||||
|
||||
@ApiModelProperty("越限项")
|
||||
private List<String> items;
|
||||
|
||||
@ApiModelProperty("越限程度, 0:无 1:一般(超过限值80%以下)2:严重(超过限值80%以上)")
|
||||
private int status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class LimitExtentVO {
|
||||
|
||||
@ApiModelProperty("指标编码")
|
||||
private String code;
|
||||
@ApiModelProperty("指标名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("越限最大值")
|
||||
private float maxValue;
|
||||
|
||||
@ApiModelProperty("国际限值")
|
||||
private float internationalValue;
|
||||
|
||||
@ApiModelProperty("越限程度")
|
||||
private float extent;
|
||||
|
||||
@ApiModelProperty("发生日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate time;
|
||||
|
||||
@ApiModelProperty(value = "监测点ID合格率的变电站/装置/母线/线路序号")
|
||||
private String lineId;
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
|
||||
public float getExtent() {
|
||||
if (internationalValue == 0) {
|
||||
return 0.00F;
|
||||
}
|
||||
if (maxValue == 0) {
|
||||
return 0.00F;
|
||||
}
|
||||
if (maxValue < internationalValue) {
|
||||
return 0.00F;
|
||||
}
|
||||
return (maxValue - internationalValue) / internationalValue * 100;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class LimitProbabilityVO {
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
@ApiModelProperty("指标名称")
|
||||
private String indexName;
|
||||
@ApiModelProperty("指标编码")
|
||||
private String indexCode;
|
||||
@ApiModelProperty("越限程度档级对应次数")
|
||||
private List<Map<Integer, Integer>> extentGrades;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class LimitTimeProbabilityVO {
|
||||
|
||||
@ApiModelProperty("时间段")
|
||||
private String timePeriod;
|
||||
@ApiModelProperty("次数")
|
||||
private int times;
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
@ApiModelProperty("指标名称")
|
||||
private String indexName;
|
||||
@ApiModelProperty("指标编码")
|
||||
private String indexCode;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MainLineStatLimitRateDetailsVO extends RStatLimitRateDPO {
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class MainLineVO implements Serializable {
|
||||
@ApiModelProperty("监测点ID")
|
||||
private String lineId;
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
@ApiModelProperty("监测对象类型")
|
||||
private String objType;
|
||||
@ApiModelProperty("是否治理")
|
||||
private String govern;
|
||||
@ApiModelProperty("主要存在的电能质量问题")
|
||||
private String problems;
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
public class TotalLimitStatisticsDetailsVO {
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty(value = "监测点ID合格率的变电站/装置/母线/线路序号")
|
||||
private String lineId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@ApiModelProperty(value = "合格率时间")
|
||||
private LocalDate time;
|
||||
|
||||
@ApiModelProperty(value = "总计算次数")
|
||||
private Integer allTime;
|
||||
|
||||
@ApiModelProperty(value = "闪变越限次数")
|
||||
private Integer flickerOvertime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "频率偏差越限")
|
||||
private double freqDevOvertime;
|
||||
|
||||
@ApiModelProperty(value = "电压偏差越限")
|
||||
private double voltageDevOvertime;
|
||||
|
||||
@ApiModelProperty(value = "三相电压不平衡度越限")
|
||||
private double ubalanceOvertime;
|
||||
|
||||
@ApiModelProperty(value = "电压谐波畸变率越限")
|
||||
private double uaberranceOvertime;
|
||||
|
||||
@ApiModelProperty(value = "负序电流限值")
|
||||
private double iNegOvertime;
|
||||
|
||||
@ApiModelProperty(value = "2次电压谐波含有率越限")
|
||||
private double uharm2Overtime;
|
||||
|
||||
@ApiModelProperty(value = "3次电压谐波含有率越限")
|
||||
private double uharm3Overtime;
|
||||
|
||||
@ApiModelProperty(value = "4次电压谐波含有率越限")
|
||||
private double uharm4Overtime;
|
||||
|
||||
@ApiModelProperty(value = "5次电压谐波含有率越限")
|
||||
private double uharm5Overtime;
|
||||
|
||||
@ApiModelProperty(value = "6次电压谐波含有率越限")
|
||||
private double uharm6Overtime;
|
||||
|
||||
@ApiModelProperty(value = "7次电压谐波含有率越限")
|
||||
private double uharm7Overtime;
|
||||
|
||||
@ApiModelProperty(value = "8次电压谐波含有率越限")
|
||||
private double uharm8Overtime;
|
||||
|
||||
@ApiModelProperty(value = "9次电压谐波含有率越限")
|
||||
private double uharm9Overtime;
|
||||
|
||||
@ApiModelProperty(value = "10次电压谐波含有率越限")
|
||||
private double uharm10Overtime;
|
||||
|
||||
@ApiModelProperty(value = "11次电压谐波含有率越限")
|
||||
private double uharm11Overtime;
|
||||
|
||||
@ApiModelProperty(value = "12次电压谐波含有率越限")
|
||||
private double uharm12Overtime;
|
||||
|
||||
@ApiModelProperty(value = "13次电压谐波含有率越限")
|
||||
private double uharm13Overtime;
|
||||
|
||||
@ApiModelProperty(value = "14次电压谐波含有率越限")
|
||||
private double uharm14Overtime;
|
||||
|
||||
@ApiModelProperty(value = "15次电压谐波含有率越限")
|
||||
private double uharm15Overtime;
|
||||
|
||||
@ApiModelProperty(value = "16次电压谐波含有率越限")
|
||||
private double uharm16Overtime;
|
||||
|
||||
@ApiModelProperty(value = "17次电压谐波含有率越限")
|
||||
private double uharm17Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "18次电压谐波含有率越限")
|
||||
private double uharm18Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "19次电压谐波含有率越限")
|
||||
private double uharm19Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "20次电压谐波含有率越限")
|
||||
private double uharm20Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "21次电压谐波含有率越限")
|
||||
private double uharm21Overtime;
|
||||
|
||||
@ApiModelProperty(value = "22次电压谐波含有率越限")
|
||||
private double uharm22Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "23次电压谐波含有率越限")
|
||||
private double uharm23Overtime;
|
||||
|
||||
@ApiModelProperty(value = "24次电压谐波含有率越限")
|
||||
private double uharm24Overtime;
|
||||
|
||||
@ApiModelProperty(value = "25次电压谐波含有率越限")
|
||||
private double uharm25Overtime;
|
||||
|
||||
@ApiModelProperty(value = "2次电流谐波幅值越限")
|
||||
private double iharm2Overtime;
|
||||
|
||||
@ApiModelProperty(value = "3次电流谐波幅值越限")
|
||||
private double iharm3Overtime;
|
||||
|
||||
@ApiModelProperty(value = "4次电流谐波幅值越限")
|
||||
private double iharm4Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "5次电流谐波幅值越限")
|
||||
private double iharm5Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "6次电流谐波幅值越限")
|
||||
private double iharm6Overtime;
|
||||
|
||||
@ApiModelProperty(value = "7次电流谐波幅值越限")
|
||||
private double iharm7Overtime;
|
||||
|
||||
@ApiModelProperty(value = "8次电流谐波幅值越限")
|
||||
private double iharm8Overtime;
|
||||
|
||||
@ApiModelProperty(value = "9次电流谐波幅值越限")
|
||||
private double iharm9Overtime;
|
||||
|
||||
@ApiModelProperty(value = "10次电流谐波幅值越限")
|
||||
private double iharm10Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "11次电流谐波幅值越限")
|
||||
private double iharm11Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "12次电流谐波幅值越限")
|
||||
private double iharm12Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "13次电流谐波幅值越限")
|
||||
private double iharm13Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "14次电流谐波幅值越限")
|
||||
private double iharm14Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "15次电流谐波幅值越限")
|
||||
private double iharm15Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "16次电流谐波幅值越限")
|
||||
private double iharm16Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "17次电流谐波幅值越限")
|
||||
private double iharm17Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "18次电流谐波幅值越限")
|
||||
private double iharm18Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "19次电流谐波幅值越限")
|
||||
private double iharm19Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "20次电流谐波幅值越限")
|
||||
private double iharm20Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "21次电流谐波幅值越限")
|
||||
private double iharm21Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "22次电流谐波幅值越限")
|
||||
private double iharm22Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "23次电流谐波幅值越限")
|
||||
private double iharm23Overtime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "24次电流谐波幅值越限")
|
||||
private double iharm24Overtime;
|
||||
|
||||
@ApiModelProperty(value = "25次电流谐波幅值越限")
|
||||
private double iharm25Overtime;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TotalLimitStatisticsVO extends TotalLimitTotalStatisticsVO {
|
||||
|
||||
@ApiModelProperty("监测点ID")
|
||||
private String lineId;
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.harmonic.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TotalLimitTotalStatisticsVO {
|
||||
|
||||
@ApiModelProperty("闪变越限占比")
|
||||
private double flicker;
|
||||
@ApiModelProperty("谐波电压越限占比")
|
||||
private double uharm;
|
||||
@ApiModelProperty("谐波电流越限占比")
|
||||
private double iharm;
|
||||
@ApiModelProperty("电压偏差越限占比")
|
||||
private double voltageDev;
|
||||
@ApiModelProperty("三相不平衡越限占比")
|
||||
private double ubalance;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.harmonic.pojo.excel.pollution.LinePollution;
|
||||
import com.njcn.harmonic.pojo.excel.pollution.SubstationPollution;
|
||||
import com.njcn.harmonic.pojo.param.HarmonicPublicParam;
|
||||
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
@@ -146,15 +147,14 @@ public class PollutionSubstationController extends BaseController {
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation(value ="导出变电站谐波电压污染值",produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@GetMapping(value ="/downPollutionSubCalc",produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void downPollutionSubCalc(@RequestParam(value = "startTime") String startTime,
|
||||
@RequestParam(value = "endTime") String endTime) {
|
||||
StatSubstationBizBaseParam param=new StatSubstationBizBaseParam();
|
||||
param.setStartTime(startTime);
|
||||
param.setEndTime(endTime);
|
||||
pollutionSubstationService.downPollutionSubCalc(param);
|
||||
@ApiOperation(value ="变电站谐波污染值列表")
|
||||
@PostMapping(value ="/downPollutionSubCalc")
|
||||
public HttpResult<List<SubstationPollution>> downPollutionSubCalc(@RequestBody StatSubstationBizBaseParam param) {
|
||||
String methodDescribe = getMethodDescribe("downPollutionSubCalc");
|
||||
param.setStartTime(DateUtil.beginOfDay(DateUtil.parse(param.getStartTime())).toString());
|
||||
param.setEndTime(DateUtil.endOfDay(DateUtil.parse(param.getEndTime())).toString());
|
||||
List<SubstationPollution> gdPollutions = pollutionSubstationService.downPollutionSubCalc(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gdPollutions, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
import com.njcn.device.pq.pojo.param.GridDiagramParam;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||
import com.njcn.harmonic.pojo.excel.pollution.LinePollution;
|
||||
import com.njcn.harmonic.pojo.excel.pollution.SubstationPollution;
|
||||
import com.njcn.harmonic.pojo.param.HarmonicPublicParam;
|
||||
import com.njcn.harmonic.pojo.param.PollutionSubstationQuryParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
@@ -108,5 +109,5 @@ public interface PollutionSubstationService extends IService<RStatPollutionSubst
|
||||
* 变电站谐波电压污染值
|
||||
* @param param
|
||||
*/
|
||||
void downPollutionSubCalc(StatSubstationBizBaseParam param);
|
||||
List<SubstationPollution> downPollutionSubCalc(StatSubstationBizBaseParam param);
|
||||
}
|
||||
|
||||
@@ -890,6 +890,10 @@ public class GridServiceImpl implements IGridService {
|
||||
int allTime = list33.stream()
|
||||
.mapToInt(RStatLimitRateDPO::getAllTime)
|
||||
.sum();
|
||||
//总闪变次数
|
||||
int allFlickerTime = list33.stream()
|
||||
.mapToInt(RStatLimitRateDPO::getFlickerAllTime)
|
||||
.sum();
|
||||
//电压偏差
|
||||
int devTime = list33.stream()
|
||||
.mapToInt(RStatLimitRateDPO::getVoltageDevOvertime)
|
||||
@@ -910,11 +914,14 @@ public class GridServiceImpl implements IGridService {
|
||||
int ubalanceTime = list33.stream()
|
||||
.mapToInt(RStatLimitRateDPO::getUbalanceOvertime)
|
||||
.sum();
|
||||
comAssess.setQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - (devTime + freqTime + thdTime + pltTime + ubalanceTime) * 100.0 / (allTime * 5)));
|
||||
//计算总稳态合格率
|
||||
double all1 = 100 - (devTime + freqTime + thdTime + ubalanceTime) * 100.0 / (allTime * 4);
|
||||
double all2 = 100 - pltTime * 100.0 / allFlickerTime;
|
||||
comAssess.setQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, (all1 + all2) / 2.0));
|
||||
comAssess.setVDevQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - devTime * 100.0 / allTime));
|
||||
comAssess.setFreqQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - freqTime * 100.0 / allTime));
|
||||
comAssess.setHarmQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - thdTime * 100.0 / allTime));
|
||||
comAssess.setFlickerQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - pltTime * 100.0 / allTime));
|
||||
comAssess.setFlickerQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - pltTime * 100.0 / allFlickerTime));
|
||||
comAssess.setUnbalanceQualifyData(allTime <= 0 ? 3.14159 : PubUtils.doubleRound(2, 100 - ubalanceTime * 100.0 / allTime));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pms.api.MonitorClient;
|
||||
import com.njcn.device.pms.api.PmsGeneralDeviceInfoClient;
|
||||
import com.njcn.device.pms.api.StatationStatClient;
|
||||
@@ -64,8 +63,6 @@ import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -909,21 +906,18 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
@Override
|
||||
public List<SubstationVo> getSubstationInfo(String deptIndex, String searchValue, String startTime, String endTime) {
|
||||
List<SubstationVo> result = new ArrayList<>();
|
||||
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(deptIndex);
|
||||
deptGetLineParam.setLineRunFlag(0);
|
||||
List<DeptGetChildrenMoreDTO> list = commTerminalGeneralClient.deptGetLine(deptGetLineParam).getData();
|
||||
//获取所有监测信息
|
||||
List<LineDevGetDTO> lineNameList = list.stream().flatMap(x -> x.getLineBaseList().stream()).distinct().collect(Collectors.toList());
|
||||
Map<String, String> lineOrgName = lineNameList.stream().collect(Collectors.toMap(LineDevGetDTO::getPointId, LineDevGetDTO::getUnitName));
|
||||
deptGetLineParam.setMonitorStateRunning(false);
|
||||
List<DeptGetSubStationDTO.Info> deptGetChildrenMoreDTOS = commTerminalGeneralClient.deptGetSubStationInfo(deptGetLineParam).getData();
|
||||
List<String> lineIds = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).flatMap(x -> x.getUnitChildrenList().stream()).distinct().collect(Collectors.toList());
|
||||
|
||||
//获取监测点集合
|
||||
LineBaseQueryParam param = new LineBaseQueryParam();
|
||||
param.setLineIds(new ArrayList<>(lineOrgName.keySet()));
|
||||
param.setSearchValue(searchValue);
|
||||
param.setLineIds(lineIds);
|
||||
List<LineDetail> data = lineFeignClient.getByName(param).getData();
|
||||
List<String> lineList = data.stream().map(LineDetail::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
if (CollUtil.isNotEmpty(lineList)) {
|
||||
//获取监测点的超标数据
|
||||
List<RStatLimitRateDPO> limitRateList = rStatLimitRateDMapper.getAllOverTimes(lineList, startTime, endTime);
|
||||
@@ -942,31 +936,30 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
String i = dicDataFeignClient.getDicDataByCode(DicDataEnum.I_ALL.getCode()).getData().getId();
|
||||
List<RMpPollutionDPO> harmonicI = lineData.stream().filter(x -> i.equals(x.getPollutionType())).collect(Collectors.toList());
|
||||
|
||||
//获取监测点详细信息
|
||||
Map<String, List<LineDetail>> lineDetailMap = data.stream().filter(x -> StrUtil.isNotBlank(x.getPowerSubstationName())).collect(Collectors.groupingBy(LineDetail::getPowerSubstationName));
|
||||
lineDetailMap.forEach((key, value) -> {
|
||||
List<SubGetBase> subNameMap = deptGetChildrenMoreDTOS.stream().flatMap(x -> x.getStationIds().stream()).distinct().collect(Collectors.toList());
|
||||
for (SubGetBase subGetBase : subNameMap) {
|
||||
AtomicInteger alarmTime = new AtomicInteger();
|
||||
SubstationVo vo = new SubstationVo();
|
||||
vo.setDeptName(lineOrgName.get(value.get(0).getId()));
|
||||
vo.setSubstationName(key);
|
||||
List<String> gridSide = value.stream().filter(t -> Objects.equals(t.getPowerFlag(), 0)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
List<String> notGridSide = value.stream().filter(t -> Objects.equals(t.getPowerFlag(), 1)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
vo.setDwLineList(lineNameList.stream().filter(x -> gridSide.contains(x.getPointId())).map(LineDevGetDTO::getPointName).sorted().collect(Collectors.toList()));
|
||||
vo.setYhLineList(lineNameList.stream().filter(x -> notGridSide.contains(x.getPointId())).map(LineDevGetDTO::getPointName).sorted().collect(Collectors.toList()));
|
||||
value.forEach(item -> {
|
||||
if (monitorMap.containsKey(item.getId())) {
|
||||
alarmTime.set(alarmTime.get() + monitorMap.get(item.getId()).getAllTime());
|
||||
vo.setDeptName(subGetBase.getOrgName());
|
||||
vo.setSubstationName(subGetBase.getName());
|
||||
List<String> unitChildrenList = subGetBase.getUnitChildrenList();
|
||||
List<LineDetail> lineDetails = data.stream().filter((x -> unitChildrenList.contains(x.getId()))).collect(Collectors.toList());
|
||||
List<String> gridSide = lineDetails.stream().filter(t -> Objects.equals(t.getPowerFlag(), 0)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
List<String> notGridSide = lineDetails.stream().filter(t -> Objects.equals(t.getPowerFlag(), 1)).map(LineDetail::getId).collect(Collectors.toList());
|
||||
vo.setDwLineList(lineDetails.stream().filter(x -> gridSide.contains(x.getId())).map(LineDetail::getMonitorName).sorted().collect(Collectors.toList()));
|
||||
vo.setYhLineList(lineDetails.stream().filter(x -> notGridSide.contains(x.getId())).map(LineDetail::getMonitorName).sorted().collect(Collectors.toList()));
|
||||
unitChildrenList.forEach(item -> {
|
||||
if (monitorMap.containsKey(item)) {
|
||||
alarmTime.set(alarmTime.get() + monitorMap.get(item).getAllTime());
|
||||
}
|
||||
});
|
||||
vo.setAlarmFreq(NumberUtil.round(alarmTime.get() * 1.0 / value.size(), 2).doubleValue());
|
||||
//监测点id集合
|
||||
List<String> ids = value.stream().map(LineDetail::getId).collect(Collectors.toList());
|
||||
OptionalDouble maxV = harmonicV.stream().filter(x -> ids.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
vo.setAlarmFreq(NumberUtil.round(alarmTime.get() * 1.0 / unitChildrenList.size(), 2).doubleValue());
|
||||
OptionalDouble maxV = harmonicV.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
vo.setVPollutionData(maxV.isPresent() ? maxV.getAsDouble() : 0.0D);
|
||||
OptionalDouble maxI = harmonicI.stream().filter(x -> ids.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
OptionalDouble maxI = harmonicI.stream().filter(x -> unitChildrenList.contains(x.getLineId())).mapToDouble(RMpPollutionDPO::getValue).max();
|
||||
vo.setIPollutionData(maxI.isPresent() ? maxV.getAsDouble() : 0.0D);
|
||||
result.add(vo);
|
||||
});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -1090,121 +1083,36 @@ public class PollutionSubstationServiceImpl extends ServiceImpl<RStatPollutionSu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downPollutionSubCalc(StatSubstationBizBaseParam param) {
|
||||
public List<SubstationPollution> downPollutionSubCalc(StatSubstationBizBaseParam param) {
|
||||
List<SubstationPollution> substationPollutions = new ArrayList<>();
|
||||
// 处理干扰源用户的报告
|
||||
List<LinePollution> linePollutionList = pollutionCalcList(param);
|
||||
// 整合变电站待导出的数据
|
||||
List<GdPollution> gdPollutionList = new ArrayList<>();
|
||||
// 以供电公司分组
|
||||
Map<String, List<LinePollution>> gdMap = linePollutionList.stream()
|
||||
.collect(Collectors.groupingBy(LinePollution::getGdName));
|
||||
// 同一供电公司以变电站分组
|
||||
Set<String> gdNameSet = gdMap.keySet();
|
||||
for (String gdName : gdNameSet) {
|
||||
// 初始化gd实体
|
||||
GdPollution gdPollution = new GdPollution();
|
||||
gdPollution.setGdName(gdName);
|
||||
List<LinePollution> gdLinePollution = gdMap.get(gdName);
|
||||
// 以变电站分组
|
||||
Map<String, List<LinePollution>> subMap = gdLinePollution.stream()
|
||||
.collect(Collectors.groupingBy(LinePollution::getSubStationName));
|
||||
Set<String> subNameMap = subMap.keySet();
|
||||
List<SubstationPollution> substationPollutions = new ArrayList<>();
|
||||
for (String subName : subNameMap) {
|
||||
// 初始化变电站实体
|
||||
SubstationPollution substationPollution = new SubstationPollution();
|
||||
substationPollution.setSubStationName(subName);
|
||||
List<LinePollution> subLinePollution = subMap.get(subName);
|
||||
// 需要区分电网侧、非电网侧
|
||||
Map<String, List<LinePollution>> powerFlagLinePollution = subLinePollution.stream().collect(Collectors.groupingBy(LinePollution::getPowerFlag));
|
||||
|
||||
List<PowerFlagPollution> powerFlagPollutionList = new ArrayList<>();
|
||||
// 电网侧
|
||||
List<LinePollution> temp = powerFlagLinePollution.get("电网侧");
|
||||
PowerFlagPollution powerFlagPollution1 = new PowerFlagPollution();
|
||||
powerFlagPollution1.setPowerFlag("电网侧");
|
||||
List<LineItemPollution> lineItemPollutionList1 = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(temp)) {
|
||||
// 计算电网侧下所有监测点谐波电压平均污染值
|
||||
double subVValue = temp.stream()
|
||||
.mapToDouble(o -> o.getHarmonicValue())
|
||||
.average()
|
||||
.orElse(0.0);
|
||||
// 电网侧污染值
|
||||
powerFlagPollution1.setPowerVValue(PubUtils.doubleRound(2, subVValue) + "");
|
||||
|
||||
|
||||
|
||||
// 设备信息
|
||||
for (LinePollution linePollution : temp) {
|
||||
LineItemPollution lineItemPollution = new LineItemPollution();
|
||||
BeanUtil.copyProperties(linePollution, lineItemPollution, true);
|
||||
lineItemPollutionList1.add(lineItemPollution);
|
||||
}
|
||||
} else {
|
||||
// 仅有非电网侧时,电网侧赋予空置
|
||||
LineItemPollution lineItemPollution = new LineItemPollution();
|
||||
lineItemPollutionList1.add(lineItemPollution);
|
||||
}
|
||||
// 设备信息注入监测位置对象中
|
||||
powerFlagPollution1.setLineItemPollutionList(lineItemPollutionList1);
|
||||
powerFlagPollutionList.add(powerFlagPollution1);
|
||||
|
||||
|
||||
// 非电网侧
|
||||
List<LinePollution> temp1 = powerFlagLinePollution.get("非电网侧");
|
||||
PowerFlagPollution powerFlagPollution2 = new PowerFlagPollution();
|
||||
powerFlagPollution2.setPowerFlag("非电网侧");
|
||||
List<LineItemPollution> lineItemPollutionList2 = new ArrayList<>();
|
||||
if (CollUtil.isNotEmpty(temp1)) {
|
||||
// 计算电网侧下所有监测点谐波电压平均污染值
|
||||
double subVValue = temp1.stream()
|
||||
.mapToDouble(o -> o.getHarmonicValue())
|
||||
.average()
|
||||
.orElse(0.0);
|
||||
// 电网侧污染值
|
||||
powerFlagPollution2.setPowerVValue(PubUtils.doubleRound(2, subVValue) + "");
|
||||
|
||||
// 电网侧污染值
|
||||
for (LinePollution linePollution : temp1) {
|
||||
LineItemPollution lineItemPollution = new LineItemPollution();
|
||||
BeanUtil.copyProperties(linePollution, lineItemPollution, true);
|
||||
lineItemPollutionList2.add(lineItemPollution);
|
||||
}
|
||||
} else {
|
||||
// 仅有非电网侧时,电网侧赋予空置
|
||||
LineItemPollution lineItemPollution = new LineItemPollution();
|
||||
lineItemPollutionList2.add(lineItemPollution);
|
||||
}
|
||||
// 设备信息注入监测位置对象中
|
||||
powerFlagPollution2.setLineItemPollutionList(lineItemPollutionList2);
|
||||
powerFlagPollutionList.add(powerFlagPollution2);
|
||||
|
||||
substationPollution.setPowerFlagPollutionList(powerFlagPollutionList);
|
||||
// 如果电网侧有污染值,就作为变电站的污染值,否则就用非电网侧的污染值作为该变电站污染值
|
||||
if (Objects.nonNull(powerFlagPollution1.getPowerVValue())) {
|
||||
substationPollution.setSubVStationValue(powerFlagPollution1.getPowerVValue());
|
||||
} else {
|
||||
substationPollution.setSubVStationValue(powerFlagPollution2.getPowerVValue());
|
||||
}
|
||||
if (Objects.nonNull(powerFlagPollution1.getPowerIValue())) {
|
||||
substationPollution.setSubIStationValue(powerFlagPollution1.getPowerIValue());
|
||||
} else {
|
||||
substationPollution.setSubIStationValue(powerFlagPollution2.getPowerIValue());
|
||||
}
|
||||
substationPollutions.add(substationPollution);
|
||||
// 以变电站分组
|
||||
Map<String, List<LinePollution>> subMap = linePollutionList.stream()
|
||||
.collect(Collectors.groupingBy(x->x.getGdName()+"_"+x.getSubStationName()+"_"+x.getSubVoltage()));
|
||||
subMap.forEach((key,value)->{
|
||||
String[] name = key.split("_");
|
||||
SubstationPollution substationPollution = new SubstationPollution();
|
||||
substationPollution.setGdName(name[0]);
|
||||
substationPollution.setSubStationName(name[1]);
|
||||
substationPollution.setSubVoltage(name[2]);
|
||||
double subVValue = value.stream()
|
||||
.mapToDouble(o -> o.getHarmonicValue())
|
||||
.average()
|
||||
.orElse(0.0);
|
||||
substationPollution.setSubVStationValue(PubUtils.doubleRound(2, subVValue) + "");
|
||||
List<PowerFlagPollution> lineItemPollutionList = new ArrayList<>();
|
||||
for (LinePollution linePollution : value) {
|
||||
PowerFlagPollution lineItemPollution = new PowerFlagPollution();
|
||||
BeanUtil.copyProperties(linePollution, lineItemPollution, true);
|
||||
lineItemPollutionList.add(lineItemPollution);
|
||||
}
|
||||
|
||||
// 针对这个供电公司下的变电站污染值排序
|
||||
substationPollutions.sort(Comparator.comparingDouble(o -> Double.parseDouble(o.getSubVStationValue())));
|
||||
Collections.reverse(substationPollutions);
|
||||
// List<SubstationPollution> finalSubstation = substationPollutions.stream().sorted((Comparator.comparingDouble(SubstationPollution::getSubStationValue))
|
||||
// .reversed())
|
||||
// .collect(Collectors.toList());
|
||||
gdPollution.setSubstationPollutionList(substationPollutions);
|
||||
gdPollutionList.add(gdPollution);
|
||||
}
|
||||
ExcelUtil.exportExcel("变电站谐波电压污染值" + param.getEndTime() + ".xlsx", GdPollution.class, gdPollutionList);
|
||||
substationPollution.setPowerFlagPollutionList(lineItemPollutionList);
|
||||
substationPollutions.add(substationPollution);
|
||||
});
|
||||
substationPollutions.sort(Comparator.comparingDouble(o -> Double.parseDouble(o.getSubVStationValue())));
|
||||
Collections.reverse(substationPollutions);
|
||||
return substationPollutions;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,9 +24,17 @@
|
||||
<artifactId>harmonic-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-device-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -1,15 +1,17 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.StatSubstationBizBaseParam;
|
||||
import com.njcn.harmonic.pojo.param.*;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -17,6 +19,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -24,6 +27,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "合格率统计日表(越限次数)")
|
||||
@@ -31,7 +35,6 @@ public class RStatLimitRateDController extends BaseController {
|
||||
|
||||
private final IRStatLimitRateDService limitRateDService;
|
||||
|
||||
|
||||
/**
|
||||
* 来源于RStatLimitController的monitorIdsGetLimitRateInfo
|
||||
*/
|
||||
@@ -40,7 +43,7 @@ public class RStatLimitRateDController extends BaseController {
|
||||
@ApiOperation("获取指定日期超标监测点详细信息")
|
||||
public HttpResult<List<RStatLimitRateDPO>> monitorIdsGetLimitRateInfo(@RequestBody RStatLimitQueryParam rStatLimitQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorIdsGetLimitRateInfo");
|
||||
List<RStatLimitRateDPO> result = limitRateDService.monitorIdsGetLimitRateInfo(rStatLimitQueryParam.getDate(),rStatLimitQueryParam.getIds());
|
||||
List<RStatLimitRateDPO> result = limitRateDService.monitorIdsGetLimitRateInfo(rStatLimitQueryParam.getDate(), rStatLimitQueryParam.getIds());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -58,7 +61,7 @@ public class RStatLimitRateDController extends BaseController {
|
||||
})
|
||||
public HttpResult<List<RStatLimitRateDPO>> getOverData(@RequestParam("lineId") String lineId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime, @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("getOverData");
|
||||
List<RStatLimitRateDPO> result = limitRateDService.getOverData(lineId,startTime,endTime,type);
|
||||
List<RStatLimitRateDPO> result = limitRateDService.getOverData(lineId, startTime, endTime, type);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -81,4 +84,76 @@ public class RStatLimitRateDController extends BaseController {
|
||||
);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/mainLine/list")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取主要监测点列表")
|
||||
public HttpResult<Page<MainLineVO>> mainLineList(@RequestBody MainLineQueryParam mainLineQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("mainLineList");
|
||||
Page<MainLineVO> list = limitRateDService.mainLineList(mainLineQueryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/mainLine/statLimitRateDetails")
|
||||
@ApiOperation("监测点指标越限详情")
|
||||
@ApiImplicitParam(name = "param", value = "获取监测点指标越限详情请求参数", required = true)
|
||||
public HttpResult<List<MainLineStatLimitRateDetailsVO>> mainLineStatLimitRateDetails(@RequestBody MainLineStatLimitRateDetailsQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("mainLineStatLimitRateDetails");
|
||||
List<MainLineStatLimitRateDetailsVO> list = limitRateDService.mainLineStatLimitRateDetails(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/totalLimitStatistics/data")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("总体指标越限统计数据")
|
||||
public HttpResult<TotalLimitTotalStatisticsVO> totalLimitTotalStatisticsData(@RequestBody TotalLimitStatisticsParam mainLineQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("totalLimitStatisticsList");
|
||||
TotalLimitTotalStatisticsVO data = limitRateDService.totalLimitTotalStatisticsData(mainLineQueryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/totalLimitStatistics/list")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("总体指标越限统计列表")
|
||||
public HttpResult<List<TotalLimitStatisticsVO>> totalLimitStatisticsList(@RequestBody TotalLimitStatisticsParam mainLineQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("totalLimitStatisticsList");
|
||||
List<TotalLimitStatisticsVO> list = limitRateDService.totalLimitStatisticsList(mainLineQueryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/totalLimitStatistics/details")
|
||||
@ApiOperation("每日越限占比统计")
|
||||
@ApiImplicitParam(name = "param", value = "每日越限占比统计请求参数", required = true)
|
||||
public HttpResult<List<TotalLimitStatisticsDetailsVO>> totalLimitStatisticsDetails(@RequestBody TotalLimitStatisticsDetailsQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("totalLimitStatisticsDetails");
|
||||
List<TotalLimitStatisticsDetailsVO> list = limitRateDService.totalLimitStatisticsDetails(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/gridSideLimitStatistics/data")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("电网侧指标越限统计数据")
|
||||
public HttpResult<TotalLimitTotalStatisticsVO> gridSideLimitTotalStatisticsData(@RequestBody TotalLimitStatisticsParam mainLineQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("gridSideLimitTotalStatisticsData");
|
||||
TotalLimitTotalStatisticsVO data = limitRateDService.gridSideLimitTotalStatisticsData(mainLineQueryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/gridSideLimitStatistics/list")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("电网侧指标越限统计列表")
|
||||
public HttpResult<List<TotalLimitStatisticsVO>> gridSideLimitStatisticsList(@RequestBody TotalLimitStatisticsParam mainLineQueryParam) {
|
||||
String methodDescribe = getMethodDescribe("gridSideLimitStatisticsList");
|
||||
List<TotalLimitStatisticsVO> list = limitRateDService.gridSideLimitStatisticsList(mainLineQueryParam);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.controller;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
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.utils.HttpResultUtil;
|
||||
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentDayQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitProbabilityQueryParam;
|
||||
import com.njcn.harmonic.pojo.vo.LimitCalendarVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitExtentVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitProbabilityVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitTimeProbabilityVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDetailDService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Validated
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "合格率统计日表详细(越限详情)")
|
||||
public class RStatLimitRateDetailDController extends BaseController {
|
||||
|
||||
private final IRStatLimitRateDetailDService limitRateDetailDService;
|
||||
|
||||
@PostMapping("/limitRateDetailD/limitExtentData")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取指标越限程度数据")
|
||||
public HttpResult<List<LimitExtentVO>> limitExtentData(@RequestBody LimitExtentQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("limitExtentData");
|
||||
List<LimitExtentVO> result = limitRateDetailDService.limitExtentData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/limitRateDetailD/limitExtentDayData")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取指标日趋势图数据")
|
||||
public HttpResult<JSONArray> limitExtentDayData(@RequestBody LimitExtentDayQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("limitExtentDayData");
|
||||
JSONArray result = limitRateDetailDService.limitExtentDayData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/limitRateDetailD/limitCalendarData")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取指标越限明细日历数据")
|
||||
public HttpResult<List<LimitCalendarVO>> limitCalendarData(@RequestBody LimitCalendarQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("limitCalendarData");
|
||||
List<LimitCalendarVO> result = limitRateDetailDService.limitCalendarData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/limitRateDetailD/limitProbabilityData")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取指标越限程度概率分布数据")
|
||||
public HttpResult<List<LimitProbabilityVO>> limitProbabilityData(@RequestBody LimitProbabilityQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("limitProbabilityData");
|
||||
List<LimitProbabilityVO> result = limitRateDetailDService.limitProbabilityData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/limitRateDetailD/limitTimeProbabilityData")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("获取指标越限时间概率分布数据")
|
||||
public HttpResult<List<LimitTimeProbabilityVO>> limitTimeProbabilityData(@RequestBody LimitProbabilityQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("limitTimeProbabilityData");
|
||||
List<LimitTimeProbabilityVO> result = limitRateDetailDService.limitTimeProbabilityData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public interface RStatLimitRateDMapper extends BaseMapper<RStatLimitRateDPO> {
|
||||
* @param list
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
* @return111
|
||||
*/
|
||||
List<RStatLimitRateDPO> getAssessTargetRate( @Param("ids") List<String> list,
|
||||
@Param("statTime") String startTime,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDetailDPO;
|
||||
|
||||
|
||||
public interface RStatLimitRateDetailDMapper extends BaseMapper<RStatLimitRateDetailDPO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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.harmonic.rstatlimitrate.mapper.RStatLimitRateDetailDMapper">
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +1,13 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.MainLineQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.MainLineStatLimitRateDetailsQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsDetailsQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,10 +23,26 @@ public interface IRStatLimitRateDService extends IService<RStatLimitRateDPO> {
|
||||
|
||||
/**
|
||||
* 获取指定日期的监测点超标详情
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2024/2/28
|
||||
*/
|
||||
List<RStatLimitRateDPO> monitorIdsGetLimitRateInfo(String date, List<String> monitorIds);
|
||||
|
||||
List<RStatLimitRateDPO> getOverData(String lineId, String startTime, String endTime, Integer type);
|
||||
|
||||
Page<MainLineVO> mainLineList(MainLineQueryParam param);
|
||||
|
||||
List<MainLineStatLimitRateDetailsVO> mainLineStatLimitRateDetails(MainLineStatLimitRateDetailsQueryParam param);
|
||||
|
||||
TotalLimitTotalStatisticsVO totalLimitTotalStatisticsData(TotalLimitStatisticsParam param);
|
||||
|
||||
List<TotalLimitStatisticsVO> totalLimitStatisticsList(TotalLimitStatisticsParam param);
|
||||
|
||||
List<TotalLimitStatisticsDetailsVO> totalLimitStatisticsDetails(TotalLimitStatisticsDetailsQueryParam param);
|
||||
|
||||
TotalLimitTotalStatisticsVO gridSideLimitTotalStatisticsData(TotalLimitStatisticsParam param);
|
||||
|
||||
List<TotalLimitStatisticsVO> gridSideLimitStatisticsList(TotalLimitStatisticsParam param);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentDayQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitProbabilityQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDetailDPO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitCalendarVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitExtentVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitProbabilityVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitTimeProbabilityVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface IRStatLimitRateDetailDService extends IService<RStatLimitRateDetailDPO> {
|
||||
|
||||
|
||||
List<LimitExtentVO> limitExtentData(LimitExtentQueryParam param);
|
||||
|
||||
JSONArray limitExtentDayData(LimitExtentDayQueryParam param);
|
||||
|
||||
List<LimitCalendarVO> limitCalendarData(LimitCalendarQueryParam param);
|
||||
|
||||
List<LimitProbabilityVO> limitProbabilityData(LimitProbabilityQueryParam param);
|
||||
|
||||
List<LimitTimeProbabilityVO> limitTimeProbabilityData(LimitProbabilityQueryParam param);
|
||||
}
|
||||
@@ -1,14 +1,39 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.harmonic.pojo.param.MainLineQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.MainLineStatLimitRateDetailsQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsDetailsQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.TotalLimitStatisticsParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDPO;
|
||||
import com.njcn.harmonic.pojo.vo.*;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDMapper;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -18,14 +43,21 @@ import java.util.List;
|
||||
* @author wr
|
||||
* @since 2023-04-03
|
||||
*/
|
||||
@DS("sjzx")
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMapper, RStatLimitRateDPO> implements IRStatLimitRateDService {
|
||||
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||
|
||||
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
||||
|
||||
@Override
|
||||
public List<RStatLimitRateDPO> monitorIdsGetLimitRateInfo(String date, List<String> monitorIds) {
|
||||
return this.baseMapper.selectList(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.in(RStatLimitRateDPO::getLineId,monitorIds).eq(RStatLimitRateDPO::getTime,date).eq(RStatLimitRateDPO::getPhasicType,"T"));
|
||||
.in(RStatLimitRateDPO::getLineId, monitorIds).eq(RStatLimitRateDPO::getTime, date).eq(RStatLimitRateDPO::getPhasicType, "T"));
|
||||
}
|
||||
|
||||
|
||||
@@ -33,44 +65,44 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
||||
public List<RStatLimitRateDPO> getOverData(String lineId, String startTime, String endTime, Integer type) {
|
||||
QueryWrapper<RStatLimitRateDPO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda()
|
||||
.eq(RStatLimitRateDPO::getLineId,lineId)
|
||||
.between(RStatLimitRateDPO::getTime,startTime,endTime)
|
||||
.eq(RStatLimitRateDPO::getLineId, lineId)
|
||||
.between(RStatLimitRateDPO::getTime, startTime, endTime)
|
||||
.groupBy(RStatLimitRateDPO::getTime);
|
||||
//频率偏差
|
||||
if (type == 1) {
|
||||
queryWrapper.select("time_id time,max(freq_dev_overtime) freq_dev_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getFreqDevOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getFreqDevOvertime, 0);
|
||||
}
|
||||
//电压偏差
|
||||
else if (type == 2) {
|
||||
queryWrapper.select("time_id time,max(voltage_dev_overtime) voltage_dev_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getVoltageDevOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getVoltageDevOvertime, 0);
|
||||
}
|
||||
//长时闪变
|
||||
else if (type == 3) {
|
||||
queryWrapper.select("time_id time,max(flicker_overtime) flicker_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getFlickerOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getFlickerOvertime, 0);
|
||||
}
|
||||
//电压总谐波畸变率
|
||||
else if (type == 4) {
|
||||
queryWrapper.select("time_id time,max(uaberrance_overtime) uaberrance_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getUaberranceOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getUaberranceOvertime, 0);
|
||||
}
|
||||
//负序电压不平衡度
|
||||
else if (type == 5) {
|
||||
queryWrapper.select("time_id time,max(ubalance_overtime) ubalance_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getUbalanceOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getUbalanceOvertime, 0);
|
||||
}
|
||||
//负序电流
|
||||
else if (type == 6) {
|
||||
queryWrapper.select("time_id time,max(i_neg_overtime) i_neg_overtime");
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getINegOvertime,0);
|
||||
queryWrapper.lambda().gt(RStatLimitRateDPO::getINegOvertime, 0);
|
||||
}
|
||||
//谐波电压含有率
|
||||
else if (type == 7) {
|
||||
StringBuilder selectSql = new StringBuilder();
|
||||
StringBuilder havingSql = new StringBuilder();
|
||||
for (int i = 2; i <=25 ; i++) {
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
selectSql.append("max(uharm_").append(i).append("_overtime) uharm_").append(i).append("_overtime,");
|
||||
if (i == 25) {
|
||||
havingSql.append("uharm_").append(i).append("_overtime");
|
||||
@@ -80,13 +112,13 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
||||
}
|
||||
selectSql.append("time_id time");
|
||||
havingSql = new StringBuilder("sum(" + havingSql + ")");
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(),0);
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(), 0);
|
||||
}
|
||||
//谐波电流
|
||||
else if (type == 8) {
|
||||
StringBuilder selectSql = new StringBuilder();
|
||||
StringBuilder havingSql = new StringBuilder();
|
||||
for (int i = 2; i <=25 ; i++) {
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
selectSql.append("max(iharm_").append(i).append("_overtime) iharm_").append(i).append("_overtime,");
|
||||
if (i == 25) {
|
||||
havingSql.append("iharm_").append(i).append("_overtime");
|
||||
@@ -96,13 +128,13 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
||||
}
|
||||
selectSql.append("time_id time");
|
||||
havingSql = new StringBuilder("sum(" + havingSql + ")");
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(),0);
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(), 0);
|
||||
}
|
||||
//间谐波电压
|
||||
else if (type == 9) {
|
||||
StringBuilder selectSql = new StringBuilder();
|
||||
StringBuilder havingSql = new StringBuilder();
|
||||
for (int i = 1; i <=16 ; i++) {
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
selectSql.append("max(inuharm_").append(i).append("_overtime) inuharm_").append(i).append("_overtime,");
|
||||
if (i == 16) {
|
||||
havingSql.append("inuharm_").append(i).append("_overtime");
|
||||
@@ -112,9 +144,457 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
||||
}
|
||||
selectSql.append("time_id time");
|
||||
havingSql = new StringBuilder("sum(" + havingSql + ")");
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(),0);
|
||||
queryWrapper.select(selectSql.toString()).having(havingSql.toString(), 0);
|
||||
}
|
||||
return this.baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<MainLineVO> mainLineList(MainLineQueryParam param) {
|
||||
Page<MainLineVO> result = new Page<>();
|
||||
result.setCurrent(param.getPageNum());
|
||||
result.setSize(param.getPageSize());
|
||||
String keywords = param.getKeywords();
|
||||
List<String> keywordsLineIds = new ArrayList<>();
|
||||
if (StrUtil.isNotBlank(keywords)) {
|
||||
List<CsLinePO> lineList = csLineFeignClient.getLineByName(keywords).getData();
|
||||
if (CollUtil.isEmpty(lineList)) {
|
||||
return result;
|
||||
}
|
||||
keywordsLineIds = lineList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
}
|
||||
// 根据监测点Id分组,再分页
|
||||
Page<RStatLimitRateDPO> ratePage = this.page(new Page<RStatLimitRateDPO>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.in(CollUtil.isNotEmpty(keywordsLineIds), RStatLimitRateDPO::getLineId, keywordsLineIds)
|
||||
.groupBy(RStatLimitRateDPO::getLineId)
|
||||
.select(RStatLimitRateDPO::getLineId)
|
||||
);
|
||||
BeanUtil.copyProperties(ratePage, result);
|
||||
List<RStatLimitRateDPO> records = ratePage.getRecords();
|
||||
if (CollUtil.isEmpty(records)) {
|
||||
return result;
|
||||
}
|
||||
List<MainLineVO> list = new ArrayList<>();
|
||||
MainLineVO mainLineVO;
|
||||
for (RStatLimitRateDPO record : records) {
|
||||
String lineId = record.getLineId();
|
||||
CsLinePO linePO = csLineFeignClient.getById(lineId).getData();
|
||||
mainLineVO = new MainLineVO();
|
||||
mainLineVO.setLineId(lineId);
|
||||
if (linePO != null) {
|
||||
mainLineVO.setLineName(linePO.getName());
|
||||
if (linePO.getGovern().equals(0)) {
|
||||
mainLineVO.setGovern("未治理");
|
||||
}
|
||||
if (linePO.getGovern().equals(1)) {
|
||||
mainLineVO.setGovern("已治理");
|
||||
}
|
||||
mainLineVO.setObjType(linePO.getMonitorObj());
|
||||
DictData dictData = dicDataFeignClient.getDicDataById(linePO.getMonitorObj()).getData();
|
||||
if (dictData != null) {
|
||||
mainLineVO.setObjType(dictData.getName());
|
||||
}
|
||||
}
|
||||
MainLineStatLimitRateDetailsQueryParam detailsQueryParam = new MainLineStatLimitRateDetailsQueryParam();
|
||||
detailsQueryParam.setLineId(lineId);
|
||||
detailsQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
||||
detailsQueryParam.setSearchEndTime(param.getSearchEndTime());
|
||||
List<MainLineStatLimitRateDetailsVO> detailsList = this.mainLineStatLimitRateDetails(detailsQueryParam);
|
||||
List<String> problemList = new ArrayList<>();
|
||||
for (MainLineStatLimitRateDetailsVO details : detailsList) {
|
||||
JSONObject entries = JSONUtil.parseObj(details);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
String value = entry.getValue().toString();
|
||||
// 值 >0 则表示该电能质量指标有问题
|
||||
Integer intValue = new Integer(value);
|
||||
if (intValue > 0) {
|
||||
String description = getDescription(key);
|
||||
if (StrUtil.isNotBlank(description)) {
|
||||
if (!problemList.contains(description)) {
|
||||
problemList.add(description);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isEmpty(problemList)) {
|
||||
mainLineVO.setProblems("所有指标都合格");
|
||||
} else {
|
||||
mainLineVO.setProblems(CollUtil.join(problemList, "、"));
|
||||
}
|
||||
|
||||
list.add(mainLineVO);
|
||||
}
|
||||
result.setRecords(list);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MainLineStatLimitRateDetailsVO> mainLineStatLimitRateDetails(MainLineStatLimitRateDetailsQueryParam param) {
|
||||
|
||||
HttpResult<CsLinePO> lineResult = csLineFeignClient.getById(param.getLineId());
|
||||
CsLinePO linePO = lineResult.getData();
|
||||
if (linePO == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<RStatLimitRateDPO> list = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.eq(RStatLimitRateDPO::getLineId, param.getLineId())
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
return list.stream().map(item -> {
|
||||
MainLineStatLimitRateDetailsVO vo = BeanUtil.copyProperties(item, MainLineStatLimitRateDetailsVO.class);
|
||||
vo.setLineName(linePO.getName());
|
||||
Integer lineInterval = linePO.getLineInterval();
|
||||
JSONObject entries = JSONUtil.parseObj(vo);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
String value = entry.getValue().toString();
|
||||
Integer intValue = new Integer(value);
|
||||
// 总分钟 = 越限次数 * 间隔时间
|
||||
int minutes = intValue * lineInterval;
|
||||
entries.putOpt(key, minutes);
|
||||
}
|
||||
}
|
||||
return BeanUtil.copyProperties(entries, MainLineStatLimitRateDetailsVO.class);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TotalLimitTotalStatisticsVO totalLimitTotalStatisticsData(TotalLimitStatisticsParam param) {
|
||||
List<RStatLimitRateDPO> rateList = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
|
||||
TotalLimitTotalStatisticsVO statisticsVO = new TotalLimitTotalStatisticsVO();
|
||||
int flickerTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getFlickerOvertime).sum();
|
||||
int voltageDevTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getVoltageDevOvertime).sum();
|
||||
int ubalanceTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getUbalanceOvertime).sum();
|
||||
int iharmTotalTime = 0;
|
||||
int uharmTotalTime = 0;
|
||||
for (RStatLimitRateDPO rate : rateList) {
|
||||
JSONObject entries = JSONUtil.parseObj(rate);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
String value = entry.getValue().toString();
|
||||
int intValue = new Integer(value);
|
||||
if (key.startsWith("uharm")) {
|
||||
uharmTotalTime += intValue;
|
||||
}
|
||||
if (key.startsWith("iharm")) {
|
||||
iharmTotalTime += intValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
int totalTime = flickerTotalTime + voltageDevTotalTime + ubalanceTotalTime + iharmTotalTime + uharmTotalTime;
|
||||
if (totalTime == 0) {
|
||||
return statisticsVO;
|
||||
}
|
||||
statisticsVO.setFlicker(calculatePercentage(flickerTotalTime, totalTime));
|
||||
statisticsVO.setUharm(calculatePercentage(uharmTotalTime, totalTime));
|
||||
statisticsVO.setIharm(calculatePercentage(iharmTotalTime, totalTime));
|
||||
statisticsVO.setVoltageDev(calculatePercentage(voltageDevTotalTime, totalTime));
|
||||
statisticsVO.setUbalance(calculatePercentage(ubalanceTotalTime, totalTime));
|
||||
return statisticsVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TotalLimitStatisticsVO> totalLimitStatisticsList(TotalLimitStatisticsParam param) {
|
||||
List<TotalLimitStatisticsVO> result = new ArrayList<>();
|
||||
|
||||
List<RStatLimitRateDPO> rateList = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
if (CollUtil.isEmpty(rateList)) {
|
||||
return result;
|
||||
}
|
||||
Map<String, List<RStatLimitRateDPO>> lineMap = rateList.stream().collect(Collectors.groupingBy(RStatLimitRateDPO::getLineId));
|
||||
|
||||
List<CsLinePO> linePOList = csLineFeignClient.queryLineById(new ArrayList<>(lineMap.keySet())).getData();
|
||||
if (CollUtil.isEmpty(linePOList)) {
|
||||
return result;
|
||||
}
|
||||
TotalLimitStatisticsVO statisticsVO;
|
||||
for (CsLinePO linePO : linePOList) {
|
||||
statisticsVO = new TotalLimitStatisticsVO();
|
||||
statisticsVO.setLineId(linePO.getLineId());
|
||||
statisticsVO.setLineName(linePO.getName());
|
||||
List<RStatLimitRateDPO> lineRateList = lineMap.get(linePO.getLineId());
|
||||
int totalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getAllTime).sum();
|
||||
int flickerTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getFlickerOvertime).sum();
|
||||
int voltageDevTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getVoltageDevOvertime).sum();
|
||||
int ubalanceTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getUbalanceOvertime).sum();
|
||||
int uharm = 0;
|
||||
int iharm = 0;
|
||||
for (RStatLimitRateDPO item : lineRateList) {
|
||||
JSONObject entries = JSONUtil.parseObj(item);
|
||||
List<Integer> uharmList = new ArrayList<>();
|
||||
List<Integer> iharmList = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
if (key.startsWith("uharm")) {
|
||||
String value = entry.getValue().toString();
|
||||
Integer intValue = new Integer(value);
|
||||
uharmList.add(intValue);
|
||||
}
|
||||
if (key.startsWith("iharm")) {
|
||||
String value = entry.getValue().toString();
|
||||
Integer intValue = new Integer(value);
|
||||
iharmList.add(intValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 取最大值
|
||||
uharm += uharmList.stream().max(Integer::compareTo).orElse(0);
|
||||
iharm += iharmList.stream().max(Integer::compareTo).orElse(0);
|
||||
}
|
||||
if (totalTime == 0) {
|
||||
statisticsVO.setFlicker(0.0);
|
||||
statisticsVO.setVoltageDev(0.0);
|
||||
statisticsVO.setUbalance(0.0);
|
||||
statisticsVO.setUharm(0.0);
|
||||
statisticsVO.setIharm(0.0);
|
||||
} else {
|
||||
statisticsVO.setFlicker(calculatePercentage(flickerTotalTime, totalTime));
|
||||
statisticsVO.setVoltageDev(calculatePercentage(voltageDevTotalTime, totalTime));
|
||||
statisticsVO.setUbalance(calculatePercentage(ubalanceTotalTime, totalTime));
|
||||
statisticsVO.setUharm(calculatePercentage(uharm, totalTime));
|
||||
statisticsVO.setIharm(calculatePercentage(iharm, totalTime));
|
||||
}
|
||||
result.add(statisticsVO);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TotalLimitStatisticsDetailsVO> totalLimitStatisticsDetails(TotalLimitStatisticsDetailsQueryParam param) {
|
||||
|
||||
HttpResult<CsLinePO> lineResult = csLineFeignClient.getById(param.getLineId());
|
||||
CsLinePO linePO = lineResult.getData();
|
||||
if (linePO == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<RStatLimitRateDPO> list = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.eq(RStatLimitRateDPO::getLineId, param.getLineId())
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
return list.stream().map(item -> {
|
||||
MainLineStatLimitRateDetailsVO vo = BeanUtil.copyProperties(item, MainLineStatLimitRateDetailsVO.class);
|
||||
vo.setLineName(linePO.getName());
|
||||
Integer allTime = item.getAllTime();
|
||||
JSONObject entries = JSONUtil.parseObj(vo);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime") && allTime != 0) {
|
||||
String value = entry.getValue().toString();
|
||||
int intValue = new Integer(value);
|
||||
// 占比 = 越限次数 / 总次数 * 100
|
||||
double proportion = calculatePercentage(intValue, allTime);
|
||||
entries.putOpt(key, proportion);
|
||||
}
|
||||
}
|
||||
return BeanUtil.copyProperties(entries, TotalLimitStatisticsDetailsVO.class);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TotalLimitTotalStatisticsVO gridSideLimitTotalStatisticsData(TotalLimitStatisticsParam param) {
|
||||
TotalLimitTotalStatisticsVO statisticsVO = new TotalLimitTotalStatisticsVO();
|
||||
// 获取电网侧监测点
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(GRID_SIDE_DICT_CODE).getData();
|
||||
CsLinePO queryParam = new CsLinePO();
|
||||
queryParam.setPosition(dictData.getId());
|
||||
List<CsLinePO> linePOList = csLineFeignClient.list(queryParam).getData();
|
||||
List<String> lineIds = linePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
return statisticsVO;
|
||||
}
|
||||
List<RStatLimitRateDPO> rateList = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.in(RStatLimitRateDPO::getLineId, lineIds)
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
|
||||
|
||||
int flickerTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getFlickerOvertime).sum();
|
||||
int voltageDevTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getVoltageDevOvertime).sum();
|
||||
int ubalanceTotalTime = rateList.stream().mapToInt(RStatLimitRateDPO::getUbalanceOvertime).sum();
|
||||
int iharmTotalTime = 0;
|
||||
int uharmTotalTime = 0;
|
||||
for (RStatLimitRateDPO rate : rateList) {
|
||||
JSONObject entries = JSONUtil.parseObj(rate);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
String value = entry.getValue().toString();
|
||||
int intValue = new Integer(value);
|
||||
if (key.startsWith("uharm")) {
|
||||
uharmTotalTime += intValue;
|
||||
}
|
||||
if (key.startsWith("iharm")) {
|
||||
iharmTotalTime += intValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
int totalTime = flickerTotalTime + voltageDevTotalTime + ubalanceTotalTime + iharmTotalTime + uharmTotalTime;
|
||||
if (totalTime == 0) {
|
||||
return statisticsVO;
|
||||
}
|
||||
statisticsVO.setFlicker(calculatePercentage(flickerTotalTime, totalTime));
|
||||
statisticsVO.setUharm(calculatePercentage(uharmTotalTime, totalTime));
|
||||
statisticsVO.setIharm(calculatePercentage(iharmTotalTime, totalTime));
|
||||
statisticsVO.setVoltageDev(calculatePercentage(voltageDevTotalTime, totalTime));
|
||||
statisticsVO.setUbalance(calculatePercentage(ubalanceTotalTime, totalTime));
|
||||
return statisticsVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TotalLimitStatisticsVO> gridSideLimitStatisticsList(TotalLimitStatisticsParam param) {
|
||||
List<TotalLimitStatisticsVO> result = new ArrayList<>();
|
||||
// 获取电网侧监测点
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(GRID_SIDE_DICT_CODE).getData();
|
||||
CsLinePO queryParam = new CsLinePO();
|
||||
queryParam.setPosition(dictData.getId());
|
||||
List<CsLinePO> linePOList = csLineFeignClient.list(queryParam).getData();
|
||||
List<String> lineIds = linePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(lineIds)) {
|
||||
return result;
|
||||
}
|
||||
List<RStatLimitRateDPO> rateList = this.list(new LambdaQueryWrapper<RStatLimitRateDPO>()
|
||||
.in(RStatLimitRateDPO::getLineId, lineIds)
|
||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDPO::getTime)
|
||||
);
|
||||
if (CollUtil.isEmpty(rateList)) {
|
||||
return result;
|
||||
}
|
||||
Map<String, List<RStatLimitRateDPO>> lineMap = rateList.stream().collect(Collectors.groupingBy(RStatLimitRateDPO::getLineId));
|
||||
Map<String, CsLinePO> linePOMap = linePOList.stream().collect(Collectors.toMap(CsLinePO::getLineId, csLinePO -> csLinePO));
|
||||
List<CsLinePO> lineList = new ArrayList<>();
|
||||
for (String lineId : lineMap.keySet()) {
|
||||
CsLinePO linePO = linePOMap.getOrDefault(lineId, null);
|
||||
if (linePO != null) {
|
||||
lineList.add(linePO);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isEmpty(lineList)) {
|
||||
return result;
|
||||
}
|
||||
TotalLimitStatisticsVO statisticsVO;
|
||||
for (CsLinePO linePO : lineList) {
|
||||
statisticsVO = new TotalLimitStatisticsVO();
|
||||
statisticsVO.setLineId(linePO.getLineId());
|
||||
statisticsVO.setLineName(linePO.getName());
|
||||
List<RStatLimitRateDPO> lineRateList = lineMap.get(linePO.getLineId());
|
||||
int totalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getAllTime).sum();
|
||||
int flickerTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getFlickerOvertime).sum();
|
||||
int voltageDevTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getVoltageDevOvertime).sum();
|
||||
int ubalanceTotalTime = lineRateList.stream().mapToInt(RStatLimitRateDPO::getUbalanceOvertime).sum();
|
||||
int uharm = 0;
|
||||
int iharm = 0;
|
||||
for (RStatLimitRateDPO item : lineRateList) {
|
||||
JSONObject entries = JSONUtil.parseObj(item);
|
||||
List<Integer> uharmList = new ArrayList<>();
|
||||
List<Integer> iharmList = new ArrayList<>();
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
if (key.startsWith("uharm")) {
|
||||
String value = entry.getValue().toString();
|
||||
Integer intValue = new Integer(value);
|
||||
uharmList.add(intValue);
|
||||
}
|
||||
if (key.startsWith("iharm")) {
|
||||
String value = entry.getValue().toString();
|
||||
Integer intValue = new Integer(value);
|
||||
iharmList.add(intValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 取最大值
|
||||
uharm += uharmList.stream().max(Integer::compareTo).orElse(0);
|
||||
iharm += iharmList.stream().max(Integer::compareTo).orElse(0);
|
||||
}
|
||||
if (totalTime == 0) {
|
||||
statisticsVO.setFlicker(0.0);
|
||||
statisticsVO.setVoltageDev(0.0);
|
||||
statisticsVO.setUbalance(0.0);
|
||||
statisticsVO.setUharm(0.0);
|
||||
statisticsVO.setIharm(0.0);
|
||||
} else {
|
||||
statisticsVO.setFlicker(calculatePercentage(flickerTotalTime, totalTime));
|
||||
statisticsVO.setVoltageDev(calculatePercentage(voltageDevTotalTime, totalTime));
|
||||
statisticsVO.setUbalance(calculatePercentage(ubalanceTotalTime, totalTime));
|
||||
statisticsVO.setUharm(calculatePercentage(uharm, totalTime));
|
||||
statisticsVO.setIharm(calculatePercentage(iharm, totalTime));
|
||||
}
|
||||
result.add(statisticsVO);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private String getDescription(String key) {
|
||||
if (StrUtil.equals(key, "flickerOvertime")) {
|
||||
return "闪变越限超标";
|
||||
}
|
||||
if (StrUtil.equals(key, "freqDevOvertime")) {
|
||||
return "频率偏差超标";
|
||||
}
|
||||
if (StrUtil.equals(key, "voltageDevOvertime")) {
|
||||
return "电压偏差超标";
|
||||
}
|
||||
if (StrUtil.equals(key, "ubalanceOvertime")) {
|
||||
return "三相电压不平衡超标";
|
||||
}
|
||||
// 电压
|
||||
if (StrUtil.startWith(key, "uharm")) {
|
||||
// 从 key 中提取数字 2
|
||||
String number = key.substring(5, key.indexOf("Overtime"));
|
||||
return number + "次谐波电压";
|
||||
}
|
||||
// 电流
|
||||
if (StrUtil.startWith(key, "iharm")) {
|
||||
// 从 key 中提取数字
|
||||
String number = key.substring(5, key.indexOf("Overtime"));
|
||||
return number + "次谐波电流";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private double calculatePercentage(double part, double total) {
|
||||
return Double.parseDouble(df.format(BigDecimal.valueOf(part / total * 100.0)
|
||||
.setScale(2, RoundingMode.HALF_UP).doubleValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,551 @@
|
||||
package com.njcn.harmonic.rstatlimitrate.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.api.OverLimitClient;
|
||||
import com.njcn.harmonic.pojo.param.LimitCalendarQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentDayQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitExtentQueryParam;
|
||||
import com.njcn.harmonic.pojo.param.LimitProbabilityQueryParam;
|
||||
import com.njcn.harmonic.pojo.po.day.RStatLimitRateDetailDPO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitCalendarVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitExtentVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitProbabilityVO;
|
||||
import com.njcn.harmonic.pojo.vo.LimitTimeProbabilityVO;
|
||||
import com.njcn.harmonic.rstatlimitrate.mapper.RStatLimitRateDetailDMapper;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDService;
|
||||
import com.njcn.harmonic.rstatlimitrate.service.IRStatLimitRateDetailDService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@DS("sjzx")
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class RStatLimitRateDetailDServiceImpl extends ServiceImpl<RStatLimitRateDetailDMapper, RStatLimitRateDetailDPO> implements IRStatLimitRateDetailDService {
|
||||
|
||||
private final CsLineFeignClient csLineFeignClient;
|
||||
private final OverLimitClient overLimitClient;
|
||||
private final IRStatLimitRateDService rStatLimitRateDService;
|
||||
|
||||
private final DecimalFormat df = new DecimalFormat("#0.00");
|
||||
|
||||
static Map<String, String> indexMap = new HashMap<>();
|
||||
static List<List<Integer>> timePeriodList = new ArrayList<>();
|
||||
static List<List<Integer>> extentPeriodList = new ArrayList<>();
|
||||
|
||||
static {
|
||||
indexMap.put("flicker", "闪变");
|
||||
indexMap.put("uharm", "谐波电压");
|
||||
indexMap.put("iharm", "谐波电流");
|
||||
indexMap.put("ubalance", "三相电压不平衡度");
|
||||
indexMap.put("voltageDev", "电压偏差");
|
||||
indexMap.put("freqDev", "频率偏差");
|
||||
|
||||
timePeriodList.add(Arrays.asList(0, 8));
|
||||
timePeriodList.add(Arrays.asList(8, 12));
|
||||
timePeriodList.add(Arrays.asList(12, 14));
|
||||
timePeriodList.add(Arrays.asList(14, 18));
|
||||
timePeriodList.add(Arrays.asList(18, 24));
|
||||
|
||||
extentPeriodList.add(Arrays.asList(0, 20));
|
||||
extentPeriodList.add(Arrays.asList(20, 40));
|
||||
extentPeriodList.add(Arrays.asList(40, 60));
|
||||
extentPeriodList.add(Arrays.asList(60, 80));
|
||||
extentPeriodList.add(Arrays.asList(80, 100));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LimitExtentVO> limitExtentData(LimitExtentQueryParam param) {
|
||||
List<LimitExtentVO> result = new ArrayList<>();
|
||||
LimitExtentVO flicker = new LimitExtentVO();
|
||||
flicker.setCode("flicker");
|
||||
flicker.setName(indexMap.get(flicker.getCode()));
|
||||
LimitExtentVO uharm = new LimitExtentVO();
|
||||
uharm.setCode("uharm");
|
||||
uharm.setName(indexMap.get(uharm.getCode()));
|
||||
LimitExtentVO iharm = new LimitExtentVO();
|
||||
iharm.setCode("iharm");
|
||||
iharm.setName(indexMap.get(iharm.getCode()));
|
||||
LimitExtentVO voltageDev = new LimitExtentVO();
|
||||
voltageDev.setCode("voltageDev");
|
||||
voltageDev.setName(indexMap.get(voltageDev.getCode()));
|
||||
LimitExtentVO ubalance = new LimitExtentVO();
|
||||
ubalance.setCode("ubalance");
|
||||
ubalance.setName(indexMap.get(ubalance.getCode()));
|
||||
List<RStatLimitRateDetailDPO> detailList = this.list(new LambdaQueryWrapper<RStatLimitRateDetailDPO>()
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDetailDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDetailDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDetailDPO::getTime)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(detailList)) {
|
||||
List<String> lineIds = detailList.stream().map(RStatLimitRateDetailDPO::getLineId).distinct().collect(Collectors.toList());
|
||||
List<Overlimit> overlimitList = overLimitClient.getOverLimitByLineIds(lineIds).getData();
|
||||
|
||||
Map<String, Pair<Float, RStatLimitRateDetailDPO>> findResult = findMaxValueHandle(detailList);
|
||||
// 闪变
|
||||
Pair<Float, RStatLimitRateDetailDPO> flickerResult = findResult.get(flicker.getCode());
|
||||
setLimitExtentInfo(flicker, flickerResult);
|
||||
// 电压偏差
|
||||
Pair<Float, RStatLimitRateDetailDPO> voltageDevResult = findResult.get(voltageDev.getCode());
|
||||
setLimitExtentInfo(voltageDev, voltageDevResult);
|
||||
// 谐波电压
|
||||
String uharmKey = findResult.keySet().stream().filter(code -> code.startsWith("uharm")).findFirst().orElse("uharm");
|
||||
Pair<Float, RStatLimitRateDetailDPO> uharmResult = findResult.get(uharmKey);
|
||||
setLimitExtentInfo(uharm, uharmResult);
|
||||
uharm.setCode(uharmKey);
|
||||
String iharmKey = findResult.keySet().stream().filter(code -> code.startsWith("iharm")).findFirst().orElse("iharm");
|
||||
// 谐波电流
|
||||
Pair<Float, RStatLimitRateDetailDPO> iharmResult = findResult.get(iharmKey);
|
||||
setLimitExtentInfo(iharm, iharmResult);
|
||||
iharm.setCode(iharmKey);
|
||||
// 电压三相不平衡
|
||||
Pair<Float, RStatLimitRateDetailDPO> ubalanceResult = findResult.get(ubalance.getCode());
|
||||
setLimitExtentInfo(ubalance, ubalanceResult);
|
||||
|
||||
if (CollUtil.isNotEmpty(overlimitList)) {
|
||||
// 取所有监测点中的最大闪变限值,作为闪变国际限值
|
||||
float flickerMaxOverlimit = (float) overlimitList.stream().mapToDouble(Overlimit::getFlicker).max().orElse(0.0F);
|
||||
float voltageDevMaxOverlimit = (float) overlimitList.stream().mapToDouble(Overlimit::getVoltageDev).max().orElse(0.0F);
|
||||
float ubalanceMaxOverlimit = (float) overlimitList.stream().mapToDouble(Overlimit::getUbalance).max().orElse(0.0F);
|
||||
float iharmMaxOverlimit = 0.0F;
|
||||
float uharmMaxOverlimit = 0.0F;
|
||||
for (Overlimit overlimit : overlimitList) {
|
||||
JSONObject entries = JSONUtil.parseObj(overlimit);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.startsWith("uharm")) {
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof Number) {
|
||||
uharmMaxOverlimit = Math.max(uharmMaxOverlimit, ((Number) value).floatValue());
|
||||
}
|
||||
} else if (key.startsWith("iharm")) {
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof Number) {
|
||||
iharmMaxOverlimit = Math.max(iharmMaxOverlimit, ((Number) value).floatValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
flicker.setInternationalValue(flickerMaxOverlimit);
|
||||
voltageDev.setInternationalValue(voltageDevMaxOverlimit);
|
||||
ubalance.setInternationalValue(ubalanceMaxOverlimit);
|
||||
iharm.setInternationalValue(iharmMaxOverlimit);
|
||||
uharm.setInternationalValue(uharmMaxOverlimit);
|
||||
}
|
||||
}
|
||||
result.add(flicker);
|
||||
result.add(uharm);
|
||||
result.add(iharm);
|
||||
result.add(voltageDev);
|
||||
result.add(ubalance);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray limitExtentDayData(LimitExtentDayQueryParam param) {
|
||||
List<RStatLimitRateDetailDPO> records = this.page(new Page<>(1, 1),
|
||||
new LambdaQueryWrapper<RStatLimitRateDetailDPO>()
|
||||
.eq(RStatLimitRateDetailDPO::getLineId, param.getLineId())
|
||||
.eq(RStatLimitRateDetailDPO::getTime, param.getTime())
|
||||
|
||||
).getRecords();
|
||||
String code = param.getCode();
|
||||
if (CollUtil.isNotEmpty(records)) {
|
||||
RStatLimitRateDetailDPO detail = records.get(0);
|
||||
JSONObject entries = JSONUtil.parseObj(detail);
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
Object value = entry.getValue();
|
||||
if (StrUtil.equals(code, key)) {
|
||||
return JSONUtil.parseArray(value);
|
||||
} else if (key.startsWith(code)) {
|
||||
return JSONUtil.parseArray(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return JSONUtil.createArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LimitCalendarVO> limitCalendarData(LimitCalendarQueryParam param) {
|
||||
List<LimitCalendarVO> result = new ArrayList<>();
|
||||
List<RStatLimitRateDetailDPO> detailList = this.list(new LambdaQueryWrapper<RStatLimitRateDetailDPO>()
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDetailDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDetailDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDetailDPO::getTime)
|
||||
);
|
||||
if (CollUtil.isEmpty(detailList)) {
|
||||
return result;
|
||||
}
|
||||
Map<LocalDate, List<RStatLimitRateDetailDPO>> detailMap = detailList.stream().collect(Collectors.groupingBy(RStatLimitRateDetailDPO::getTime));
|
||||
LimitCalendarVO calendarVO;
|
||||
for (Map.Entry<LocalDate, List<RStatLimitRateDetailDPO>> entry : detailMap.entrySet()) {
|
||||
calendarVO = new LimitCalendarVO();
|
||||
LocalDate time = entry.getKey();
|
||||
calendarVO.setTime(time);
|
||||
int status = 0;
|
||||
List<String> items = new ArrayList<>();
|
||||
List<RStatLimitRateDetailDPO> dayDetailList = entry.getValue();
|
||||
for (RStatLimitRateDetailDPO detail : dayDetailList) {
|
||||
String lineId = detail.getLineId();
|
||||
List<Overlimit> overlimitList = overLimitClient.getOverLimitByLineIds(Collections.singletonList(lineId)).getData();
|
||||
Overlimit overlimit = overlimitList.stream().findFirst().orElse(null);
|
||||
JSONObject entries = JSONUtil.parseObj(detail);
|
||||
for (Map.Entry<String, Object> dayEntry : entries.entrySet()) {
|
||||
String key = dayEntry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
Object data = dayEntry.getValue();
|
||||
// 有数据有越限
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
status = 1;
|
||||
String description = getDescription(key);
|
||||
if (StrUtil.isNotBlank(description) && !items.contains(description)) {
|
||||
items.add(description);
|
||||
}
|
||||
float maxValue = parseMaxValueFromJsonArray(data);
|
||||
if (overlimit != null) {
|
||||
JSONObject overlimitJSON = JSONUtil.parseObj(overlimit);
|
||||
String itemKey = StrUtil.sub(key, 0, key.length() - 8);
|
||||
float limitValue = overlimitJSON.getFloat(itemKey);
|
||||
if (limitValue != 0) {
|
||||
double overlimitPercent = calculatePercentage(maxValue - limitValue, limitValue);
|
||||
if (overlimitPercent >= 80) {
|
||||
status = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
calendarVO.setItems(items);
|
||||
calendarVO.setStatus(status);
|
||||
result.add(calendarVO);
|
||||
}
|
||||
result.sort(Comparator.comparing(LimitCalendarVO::getTime));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LimitProbabilityVO> limitProbabilityData(LimitProbabilityQueryParam param) {
|
||||
List<LimitProbabilityVO> result = new ArrayList<>();
|
||||
List<RStatLimitRateDetailDPO> detailList = this.list(new LambdaQueryWrapper<RStatLimitRateDetailDPO>()
|
||||
.eq(RStatLimitRateDetailDPO::getLineId, param.getLineId())
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDetailDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDetailDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDetailDPO::getTime)
|
||||
);
|
||||
CsLinePO linePO = csLineFeignClient.getById(param.getLineId()).getData();
|
||||
List<Overlimit> overlimitList = overLimitClient.getOverLimitByLineIds(Collections.singletonList(linePO.getLineId())).getData();
|
||||
JSONObject overlimitJSON = null;
|
||||
if (CollUtil.isNotEmpty(overlimitList)) {
|
||||
overlimitJSON = JSONUtil.parseObj(overlimitList.get(0));
|
||||
}
|
||||
LimitProbabilityVO probabilityVO;
|
||||
for (Map.Entry<String, String> indexEntry : indexMap.entrySet()) {
|
||||
String indexCode = indexEntry.getKey();
|
||||
probabilityVO = new LimitProbabilityVO();
|
||||
probabilityVO.setIndexName(indexEntry.getValue());
|
||||
probabilityVO.setIndexCode(indexCode);
|
||||
probabilityVO.setLineId(linePO.getLineId());
|
||||
probabilityVO.setLineName(linePO.getName());
|
||||
// 计算越限程度
|
||||
List<Double> extentValuesList = new ArrayList<>();
|
||||
for (RStatLimitRateDetailDPO detail : detailList) {
|
||||
JSONObject entries = JSONUtil.parseObj(detail);
|
||||
for (Map.Entry<String, Object> dayEntry : entries.entrySet()) {
|
||||
String key = dayEntry.getKey();
|
||||
if (key.endsWith("Overtime") && key.startsWith(indexCode)) {
|
||||
double extentValue = 0;
|
||||
Object data = dayEntry.getValue();
|
||||
// 有数据有越限
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
float maxValue = parseMaxValueFromJsonArray(data);
|
||||
if (overlimitJSON != null) {
|
||||
String itemKey = StrUtil.sub(key, 0, key.length() - 8);
|
||||
double limitValue = overlimitJSON.getDouble(itemKey);
|
||||
if (limitValue != 0) {
|
||||
extentValue = calculatePercentage(maxValue - limitValue, limitValue);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
extentValuesList.add(extentValue);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
List<Map<Integer, Integer>> extentGrades = new ArrayList<>();
|
||||
for (int i = 0; i < extentPeriodList.size(); i++) {
|
||||
Map<Integer, Integer> grade = new HashMap<>();
|
||||
int times = 0;
|
||||
for (Double extentValue : extentValuesList) {
|
||||
List<Integer> period = extentPeriodList.get(i);
|
||||
Integer start = period.get(0);
|
||||
Integer end = period.get(1);
|
||||
if (extentValue > start && extentValue <= end) {
|
||||
times++;
|
||||
}
|
||||
}
|
||||
grade.put(i, times);
|
||||
extentGrades.add(grade);
|
||||
}
|
||||
probabilityVO.setExtentGrades(extentGrades);
|
||||
result.add(probabilityVO);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LimitTimeProbabilityVO> limitTimeProbabilityData(LimitProbabilityQueryParam param) {
|
||||
|
||||
List<LimitTimeProbabilityVO> result = new ArrayList<>();
|
||||
List<RStatLimitRateDetailDPO> detailList = this.list(new LambdaQueryWrapper<RStatLimitRateDetailDPO>()
|
||||
.eq(RStatLimitRateDetailDPO::getLineId, param.getLineId())
|
||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDetailDPO::getTime, param.getSearchBeginTime())
|
||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDetailDPO::getTime, param.getSearchEndTime())
|
||||
.orderByAsc(RStatLimitRateDetailDPO::getTime)
|
||||
);
|
||||
CsLinePO linePO = csLineFeignClient.getById(param.getLineId()).getData();
|
||||
|
||||
LimitTimeProbabilityVO timeProbabilityVO;
|
||||
JSONArray detailJSONArray = null;
|
||||
if (CollUtil.isNotEmpty(detailList)) {
|
||||
detailJSONArray = JSONUtil.parseArray(detailList);
|
||||
}
|
||||
for (Map.Entry<String, String> entry : indexMap.entrySet()) {
|
||||
String indexCode = entry.getKey();
|
||||
for (List<Integer> period : timePeriodList) {
|
||||
timeProbabilityVO = new LimitTimeProbabilityVO();
|
||||
timeProbabilityVO.setLineId(linePO.getLineId());
|
||||
timeProbabilityVO.setLineName(linePO.getName());
|
||||
timeProbabilityVO.setIndexName(entry.getValue());
|
||||
timeProbabilityVO.setIndexCode(indexCode);
|
||||
int start = period.get(0);
|
||||
int end = period.get(1);
|
||||
timeProbabilityVO.setTimePeriod(start + "时-" + end + "时");
|
||||
int times = 0;
|
||||
if (CollUtil.isNotEmpty(detailJSONArray)) {
|
||||
for (int i = 0; i < detailJSONArray.size(); i++) {
|
||||
JSONObject detail = detailJSONArray.getJSONObject(i);
|
||||
// 获取包含的指标key
|
||||
List<String> includeKeys = detail.keySet().stream().filter(f -> f.startsWith(indexCode)).collect(Collectors.toList());
|
||||
for (String key : includeKeys) {
|
||||
// 获取指标越限数据
|
||||
// [{"time": "17:10:00,17:20:00,17:30:00", "value": "7.1092,7.1092,7.1093", "phasic": "A", "valueType": "CP95"}, {"time": "17:10:00,17:20:00,17:30:00", "value": "7.8081,7.808,7.8081", "phasic": "C", "valueType": "CP95"}, {"time": "17:10:00,17:20:00,17:30:00", "value": "7.5095,7.5095,7.5095", "phasic": "B", "valueType": "CP95"}]
|
||||
JSONArray values = detail.getJSONArray(key);
|
||||
if (CollUtil.isNotEmpty(values)) {
|
||||
// 取出第一个数据
|
||||
JSONObject value = values.getJSONObject(0);
|
||||
// 获取时间
|
||||
String time = value.getStr("time");
|
||||
for (String t : StrUtil.split(time, StrUtil.COMMA)) {
|
||||
// 判断在时间段内,次数加一
|
||||
int hour = Integer.parseInt(t.substring(0, 2));
|
||||
if (hour >= start && hour < end) {
|
||||
times++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
timeProbabilityVO.setTimes(times);
|
||||
result.add(timeProbabilityVO);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置LimitExtentVO的最大值和相关信息
|
||||
*/
|
||||
private void setLimitExtentInfo(LimitExtentVO limitExtentVO, Pair<Float, RStatLimitRateDetailDPO> result) {
|
||||
float maxValue = result.getKey();
|
||||
limitExtentVO.setMaxValue(maxValue);
|
||||
RStatLimitRateDetailDPO maxDetail = result.getValue();
|
||||
if (maxDetail != null) {
|
||||
limitExtentVO.setTime(maxDetail.getTime());
|
||||
CsLinePO maxLinePO = csLineFeignClient.getById(maxDetail.getLineId()).getData();
|
||||
if (maxLinePO != null) {
|
||||
limitExtentVO.setLineName(maxLinePO.getName());
|
||||
limitExtentVO.setLineId(maxLinePO.getLineId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找数据中的最大值及其对应的记录
|
||||
*
|
||||
* @param detailList 数据列表
|
||||
* @return 包含最大值和对应记录的Pair对象
|
||||
*/
|
||||
private Map<String, Pair<Float, RStatLimitRateDetailDPO>> findMaxValueHandle(List<RStatLimitRateDetailDPO> detailList) {
|
||||
|
||||
Map<String, Pair<Float, RStatLimitRateDetailDPO>> result = new HashMap<>();
|
||||
|
||||
RStatLimitRateDetailDPO flickerMaxDetail = null;
|
||||
float flickerMaxValue = 0.0000F;
|
||||
|
||||
RStatLimitRateDetailDPO voltageDevMaxDetail = null;
|
||||
float voltageDevMaxValue = 0.0000F;
|
||||
RStatLimitRateDetailDPO ubalanceMaxDetail = null;
|
||||
float ubalanceMaxValue = 0.0000F;
|
||||
|
||||
RStatLimitRateDetailDPO uharmMaxDetail = null;
|
||||
float uharmMaxValue = 0.0000F;
|
||||
String uharmMaxKey = ""; // 记录uharm最大值对应的key
|
||||
RStatLimitRateDetailDPO iharmMaxDetail = null;
|
||||
float iharmMaxValue = 0.0000F;
|
||||
String iharmMaxKey = ""; // 记录iharm最大值对应的key
|
||||
|
||||
for (RStatLimitRateDetailDPO po : detailList) {
|
||||
String flickerOvertime = po.getFlickerOvertime();
|
||||
String voltageDevOvertime = po.getVoltageDevOvertime();
|
||||
String ubalanceOvertime = po.getUbalanceOvertime();
|
||||
if (StrUtil.isNotBlank(flickerOvertime)) {
|
||||
float dayFlickerMaxValue = parseMaxValueFromJsonArray(flickerOvertime);
|
||||
if (dayFlickerMaxValue > flickerMaxValue) {
|
||||
flickerMaxValue = dayFlickerMaxValue;
|
||||
flickerMaxDetail = po;
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(voltageDevOvertime)) {
|
||||
float dayVoltageDevMaxValue = parseMaxValueFromJsonArray(voltageDevOvertime);
|
||||
if (dayVoltageDevMaxValue > voltageDevMaxValue) {
|
||||
voltageDevMaxValue = dayVoltageDevMaxValue;
|
||||
voltageDevMaxDetail = po;
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(ubalanceOvertime)) {
|
||||
float dayUbalanceMaxValue = parseMaxValueFromJsonArray(ubalanceOvertime);
|
||||
if (dayUbalanceMaxValue > ubalanceMaxValue) {
|
||||
ubalanceMaxValue = dayUbalanceMaxValue;
|
||||
ubalanceMaxDetail = po;
|
||||
}
|
||||
}
|
||||
JSONObject entries = JSONUtil.parseObj(po);
|
||||
float dayUharmMaxValue = 0.0000F;
|
||||
String dayUharmMaxKey = ""; // 当前记录中uharm的最大值key
|
||||
float dayIharmMaxValue = 0.0000F;
|
||||
String dayIharmMaxKey = ""; // 当前记录中iharm的最大值key
|
||||
|
||||
for (Map.Entry<String, Object> entry : entries.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (key.endsWith("Overtime")) {
|
||||
if (key.startsWith("uharm")) {
|
||||
Object value = entry.getValue();
|
||||
if (ObjectUtil.isNotEmpty(value)) {
|
||||
float timeMaxValue = parseMaxValueFromJsonArray(value);
|
||||
// 取次数最大的未当天的最大值
|
||||
dayUharmMaxValue = Math.max(dayUharmMaxValue, timeMaxValue);
|
||||
dayUharmMaxKey = key;
|
||||
}
|
||||
}
|
||||
if (key.startsWith("iharm")) {
|
||||
Object value = entry.getValue();
|
||||
if (ObjectUtil.isNotEmpty(value)) {
|
||||
float timeMaxValue = parseMaxValueFromJsonArray(value);
|
||||
// 取次数最大的为当天的最大值
|
||||
dayIharmMaxValue = Math.max(dayIharmMaxValue, timeMaxValue);
|
||||
dayIharmMaxKey = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dayUharmMaxValue > uharmMaxValue) {
|
||||
uharmMaxValue = dayUharmMaxValue;
|
||||
uharmMaxDetail = po;
|
||||
uharmMaxKey = dayUharmMaxKey; // 记录产生最大值的key
|
||||
}
|
||||
if (dayIharmMaxValue > iharmMaxValue) {
|
||||
iharmMaxValue = dayIharmMaxValue;
|
||||
iharmMaxDetail = po;
|
||||
iharmMaxKey = dayIharmMaxKey; // 记录产生最大值的key
|
||||
}
|
||||
}
|
||||
result.put("flicker", Pair.of(flickerMaxValue, flickerMaxDetail));
|
||||
result.put("voltageDev", Pair.of(voltageDevMaxValue, voltageDevMaxDetail));
|
||||
result.put("ubalance", Pair.of(ubalanceMaxValue, ubalanceMaxDetail));
|
||||
result.put(uharmMaxKey.isEmpty() ? "uharm" : uharmMaxKey, Pair.of(uharmMaxValue, uharmMaxDetail));
|
||||
result.put(iharmMaxKey.isEmpty() ? "iharm" : iharmMaxKey, Pair.of(iharmMaxValue, iharmMaxDetail));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从JSON数组字符串中解析出最大值
|
||||
*
|
||||
* @param value JSON数组字符串
|
||||
* @return 解析出的最大值
|
||||
*/
|
||||
private float parseMaxValueFromJsonArray(Object value) {
|
||||
JSONArray overtimeArray = JSONUtil.parseArray(value);
|
||||
float maxValue = 0.0000F;
|
||||
for (Object data : overtimeArray) {
|
||||
JSONObject entries = JSONUtil.parseObj(data);
|
||||
String values = entries.getStr("value");
|
||||
float currentValue = (float) StrUtil.split(values, StrUtil.COMMA)
|
||||
.stream()
|
||||
.mapToDouble(Float::parseFloat)
|
||||
.max()
|
||||
.orElse(0.0000F);
|
||||
maxValue = Math.max(maxValue, currentValue);
|
||||
}
|
||||
|
||||
return maxValue;
|
||||
}
|
||||
|
||||
private String getDescription(String key) {
|
||||
if (StrUtil.equals(key, "flickerOvertime")) {
|
||||
return "闪变越限";
|
||||
}
|
||||
if (StrUtil.equals(key, "freqDevOvertime")) {
|
||||
return "频率偏差越限";
|
||||
}
|
||||
if (StrUtil.equals(key, "voltageDevOvertime")) {
|
||||
return "电压偏差越限";
|
||||
}
|
||||
if (StrUtil.equals(key, "ubalanceOvertime")) {
|
||||
return "三相电压不平衡越限";
|
||||
}
|
||||
// 电压
|
||||
if (StrUtil.startWith(key, "uharm")) {
|
||||
return "谐波电压越限";
|
||||
}
|
||||
// 电流
|
||||
if (StrUtil.startWith(key, "iharm")) {
|
||||
return "谐波电流越限";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private double calculatePercentage(double part, double total) {
|
||||
return Double.parseDouble(df.format(BigDecimal.valueOf(part / total * 100.0)
|
||||
.setScale(2, RoundingMode.HALF_UP).doubleValue()));
|
||||
}
|
||||
}
|
||||
@@ -147,6 +147,8 @@ public enum DicDataTypeEnum {
|
||||
Major_Nonlinear_Device("主要非线性设备类型","Major_Nonlinear_Device"),
|
||||
EVALUATION_DEPT("主要非线性设备类型","evaluation_dept"),
|
||||
EVALUATION_TYPE("评估类型","Evaluation_Type"),
|
||||
|
||||
DATA_DAY("日表表名","Data_Day")
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@ public enum StatisticsEnum {
|
||||
LOAD_TYPE("干扰源类型", "Load_Type"),
|
||||
MANUFACTURER("终端厂家", "Manufacturer"),
|
||||
POWER_FLAG("监测点性质", "Power_Flag"),
|
||||
REPORT_TYPE("上报类型", "Report_Type");
|
||||
REPORT_TYPE("上报类型", "Report_Type"),
|
||||
JB_POWER_FLAG("电网性质", "Jb_Power_Flag"),
|
||||
|
||||
;
|
||||
|
||||
private final String name;
|
||||
|
||||
|
||||
@@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.system.pojo.param.PqDashboardPageParam;
|
||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||
import com.njcn.system.pojo.vo.PqDashboardPageVO;
|
||||
import com.njcn.system.service.PqDashboardPageService;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -21,6 +23,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -94,6 +97,9 @@ public class PqDashboardPageController extends BaseController {
|
||||
String methodDescribe = getMethodDescribe("queryActivatePage");
|
||||
PqDashboardPageVO vo = new PqDashboardPageVO();
|
||||
PqDashboardPage result = pqDashboardPageService.lambdaQuery().eq(PqDashboardPage::getState,1).one();
|
||||
if(Objects.isNull(result)){
|
||||
throw new BusinessException("暂无激活的驾驶舱页面");
|
||||
}
|
||||
BeanUtils.copyProperties(result,vo);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ public class SysDicTreePOServiceImpl extends ServiceImpl<SysDicTreePOMapper, Sys
|
||||
LambdaQueryWrapper<SysDicTreePO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysDicTreePO::getPid,vo.getId())
|
||||
.eq(SysDicTreePO::getStatus,0)
|
||||
.orderByDesc(SysDicTreePO::getSort);
|
||||
.orderByAsc(SysDicTreePO::getSort);
|
||||
char lastChar = lineId.charAt(lineId.length() - 1);
|
||||
//治理APF指标
|
||||
if (Objects.equals(lastChar,'0')) {
|
||||
|
||||
@@ -16,6 +16,7 @@ public enum AppRoleEnum {
|
||||
APP_VIP_USER("app_vip_user","移动端正式用户"),
|
||||
MARKET_USER("market_user","营销角色"),
|
||||
ENGINEERING_USER("engineering_user","工程角色"),
|
||||
BXS_USER("bxs_user","便携式正式用户"),
|
||||
ROOT("root","超级管理员"),
|
||||
OPERATION_MANAGER("operation_manager","运维管理员"),
|
||||
;
|
||||
|
||||
@@ -511,6 +511,15 @@ public class UserController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getFormalUserList")
|
||||
@ApiOperation("获取移动端、便携式正式用户列表")
|
||||
public HttpResult<List<UserVO>> getFormalUserList() {
|
||||
String methodDescribe = getMethodDescribe("getFormalUserList");
|
||||
List<UserVO> users = userService.getFormalUserList();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, users, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取同级部门用户,以及下级部门所有用户
|
||||
|
||||
@@ -175,13 +175,12 @@ public interface IUserService extends IService<User> {
|
||||
|
||||
boolean activateUser(String id);
|
||||
|
||||
|
||||
List<User> getMarketList();
|
||||
|
||||
List<UserVO> getFormalUserList();
|
||||
|
||||
List<User> getUserListByDeptId(String deptId);
|
||||
|
||||
|
||||
boolean updateAppUser(UserInfoParm userInfoParm);
|
||||
|
||||
String uploadImage(MultipartFile issuesFile);
|
||||
|
||||
@@ -15,12 +15,10 @@ import com.njcn.common.pojo.constant.LogInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.common.utils.sm.DesUtils;
|
||||
import com.njcn.common.utils.sm.Sm4Utils;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
@@ -28,8 +26,6 @@ import com.njcn.redis.pojo.enums.RedisKeyEnum;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.user.enums.AppRoleEnum;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.enums.UserStatusEnum;
|
||||
@@ -489,6 +485,25 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
|
||||
return this.listByIds(collect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserVO> getFormalUserList() {
|
||||
List<UserVO> users = new ArrayList<>();
|
||||
Role roleByCode1 = roleService.getRoleByCode(AppRoleEnum.APP_VIP_USER.getCode());
|
||||
Role roleByCode2 = roleService.getRoleByCode(AppRoleEnum.BXS_USER.getCode());
|
||||
List<UserRole> userRoles = userRoleMapper.selectUserRole(Stream.of(roleByCode1.getId(),roleByCode2.getId()).collect(Collectors.toList()));
|
||||
List<String> collect = userRoles.stream().map(UserRole::getUserId).distinct().collect(Collectors.toList());
|
||||
List<User> users1 = this.listByIds(collect);
|
||||
if (CollectionUtil.isNotEmpty(users1)) {
|
||||
users1.forEach(item->{
|
||||
UserVO userVO = new UserVO();
|
||||
userVO.setId(item.getId());
|
||||
userVO.setName(item.getName());
|
||||
users.add(userVO);
|
||||
});
|
||||
}
|
||||
return users;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> getUserListByDeptId(String deptId) {
|
||||
LambdaQueryWrapper<Dept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
Reference in New Issue
Block a user