Compare commits
80 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eeb27c519b | |||
|
|
670eaf7d38 | ||
| 2b79cefad6 | |||
| 212db18835 | |||
|
|
e9a1c34160 | ||
|
|
fb7a2b7084 | ||
|
|
4b3ec39a11 | ||
|
|
2d255a5dd3 | ||
|
|
614647d36d | ||
|
|
a899614c89 | ||
|
|
2543f87dd2 | ||
|
|
c5074df93d | ||
| 24e4c4de37 | |||
|
|
4f70566c65 | ||
|
|
dc11d34add | ||
| 9f3bb52d9a | |||
|
|
567ba2f56e | ||
|
|
371d4efb29 | ||
|
|
47b08d4797 | ||
| 65805e4f50 | |||
| 41d555121c | |||
|
|
4d48b42c98 | ||
|
|
f5e1fac55d | ||
|
|
cebda9323e | ||
| d09f1472a9 | |||
| b9696e957d | |||
| 12cfecac7e | |||
| 3a97f01383 | |||
|
|
10273dd2b0 | ||
|
|
5e8e03cbb1 | ||
|
|
b103141a54 | ||
|
|
a6d2d6ed47 | ||
| 601a78246e | |||
| 5e7b973d5f | |||
|
|
e89c6a2888 | ||
| 2166529b4d | |||
| 2117e16b61 | |||
|
|
054d5534a8 | ||
|
|
c03a516931 | ||
|
|
0fdc3edb89 | ||
| a730ad61b1 | |||
| 9b758dc7c9 | |||
| a74dd460d1 | |||
| 2708aa8b81 | |||
|
|
6d833678a6 | ||
| be264acd79 | |||
|
|
186d46752c | ||
|
|
e03478eeec | ||
|
|
0c1bb606d6 | ||
|
|
42b619fa56 | ||
|
|
f0894ca0ed | ||
|
|
8a958fa34c | ||
|
|
770fb09223 | ||
|
|
b4e5d0c638 | ||
|
|
eb334cc7c7 | ||
|
|
404d11526a | ||
| 7bac805988 | |||
|
|
e4e04fc5db | ||
| f588a0ffc8 | |||
| f8ffe767dc | |||
|
|
68cbad2fdb | ||
|
|
9b9d75e463 | ||
|
|
62c3c09a6b | ||
|
|
b523a24e5b | ||
|
|
075dfc19d6 | ||
|
|
279c5c7642 | ||
|
|
ff1351b107 | ||
|
|
2dd67f9e3a | ||
|
|
b0ef851479 | ||
|
|
be899a262b | ||
| 4339a37268 | |||
|
|
9659aa257a | ||
| 9d32ca05df | |||
|
|
d48cf09119 | ||
|
|
c38b07ec07 | ||
|
|
87f05c6278 | ||
| e9ac024f73 | |||
| b7e3bb9796 | |||
| 4bebf28b76 | |||
|
|
20ec9bc0b4 |
6
pom.xml
6
pom.xml
@@ -41,9 +41,9 @@
|
||||
<properties>
|
||||
<!--中间件目标地址-->
|
||||
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
||||
<middle.server.url>192.168.1.22</middle.server.url>
|
||||
<middle.server.url>192.168.1.103</middle.server.url>
|
||||
<!--微服务模块发布地址-->
|
||||
<service.server.url>192.168.1.127</service.server.url>
|
||||
<service.server.url>127.0.0.1</service.server.url>
|
||||
<!--docker仓库地址-->
|
||||
<docker.server.url>192.168.1.22</docker.server.url>
|
||||
<!--nacos的ip:port-->
|
||||
@@ -55,7 +55,7 @@
|
||||
<!--服务器发布内容为空-->
|
||||
<!-- <nacos.namespace></nacos.namespace>-->
|
||||
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
||||
<nacos.namespace>78588706-e06f-4580-b612-b26d72493fcb</nacos.namespace>
|
||||
<nacos.namespace>6fd2d036-f390-46ee-9c9d-d5a5c00e3314</nacos.namespace>
|
||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||
<!-- sentinel:port-->
|
||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
|
||||
unblance.add(evaluationResult);
|
||||
|
||||
evaluationResult = new AssessResultVO.EvaluationResult();
|
||||
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200)));
|
||||
evaluationResult.setData(result.getApproUnblance());
|
||||
evaluationResult.setLimitData(overLimit.getUnblance());
|
||||
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
||||
unblance.add(evaluationResult);
|
||||
|
||||
@@ -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.
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.DependsOn;
|
||||
* @date 2022/11/10
|
||||
*/
|
||||
@Slf4j
|
||||
@DependsOn("proxyMapperRegister")
|
||||
@MapperScan("com.njcn.**.mapper")
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -45,6 +45,9 @@ public class Knife4jSwaggerConfig {
|
||||
@Value("${microservice.gateway.url}")
|
||||
private String gatewayUrl;
|
||||
|
||||
@Value("${swagger.enable:true}")
|
||||
private Boolean swaggerEnable;
|
||||
|
||||
/**
|
||||
* swagger通用配置
|
||||
*/
|
||||
@@ -81,7 +84,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<>();
|
||||
@@ -94,7 +99,7 @@ public class Knife4jSwaggerConfig {
|
||||
//securyContext
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.enable(true)
|
||||
.enable(swaggerEnable)
|
||||
.select()
|
||||
// 指定添加swagger注解的方法
|
||||
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
|
||||
@@ -51,6 +51,9 @@ public interface CommTerminalGeneralClient {
|
||||
@PostMapping("deptGetLine")
|
||||
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||
|
||||
@PostMapping("deptGetAllLine")
|
||||
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
|
||||
@@ -50,6 +50,12 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(DeptGetLineParam deptGetLineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据单位获取all监测点信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString());
|
||||
|
||||
@@ -32,6 +32,7 @@ public enum DeviceResponseEnum {
|
||||
|
||||
DEVICE_SAME_NAME("A0290","设备名称已存在"),
|
||||
DEVICE_REPETITION("A0291","设备名称重复"),
|
||||
MODEL_NAME_REPEAT("A00350","名称不可重复"),
|
||||
DEVICE_IP_REPETITION("A0292","设备ip端口号重复"),
|
||||
DEVICE_SAME_IP("A0293","当前设备ip端口号已存在"),
|
||||
DEVICE_EMPTY("A0294","设备为空"),
|
||||
|
||||
@@ -28,6 +28,8 @@ public class LineDevGetDTO {
|
||||
|
||||
private String pointName;
|
||||
|
||||
private Integer lineRunFlag;
|
||||
|
||||
/**
|
||||
* 装置监测点索引集合
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ public class PollutionLineInfoDTO {
|
||||
/**
|
||||
* 所属变电站
|
||||
*/
|
||||
private String subStationId;
|
||||
|
||||
private String subStationName;
|
||||
|
||||
/**
|
||||
@@ -74,7 +76,10 @@ public class PollutionLineInfoDTO {
|
||||
* 电压等级
|
||||
*/
|
||||
private String lineVoltage;
|
||||
|
||||
/**
|
||||
* 变电站电压等级
|
||||
*/
|
||||
private String subVoltage;
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
@@ -94,4 +99,9 @@ public class PollutionLineInfoDTO {
|
||||
* 监测点名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 实际安装位置
|
||||
*/
|
||||
private String actualArea;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class DeptGetLineParam {
|
||||
private Boolean monitorStateRunning=true;
|
||||
|
||||
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
|
||||
|
||||
private Integer isUpToGrid;
|
||||
/**
|
||||
* 0-电网侧
|
||||
@@ -48,4 +47,7 @@ public class DeptGetLineParam {
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer lineRunFlag;
|
||||
|
||||
@ApiModelProperty("搜索值")
|
||||
private String searchValue;
|
||||
}
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.`Powerr_Id` AS powerId,
|
||||
monitor.`Powerr_Name` AS powerName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.`Name` AS monitorName,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
@@ -29,8 +29,8 @@
|
||||
(
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.`Name`,
|
||||
pm.`Status`,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
@@ -51,8 +51,8 @@
|
||||
) AS monitor
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.`Status` = 1
|
||||
AND pdm.`Status` = 1
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
@@ -85,7 +85,7 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<modules>
|
||||
<module>pq-device-api</module>
|
||||
<module>pq-device-boot</module>
|
||||
<module>pq-device-com</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -70,6 +70,16 @@ public interface GeneralDeviceInfoClient {
|
||||
HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站分类的所有终端综合信息
|
||||
*
|
||||
* @param deviceInfoParam 查询终端条件
|
||||
* @return 获取变电站分类的所有终端综合信息
|
||||
*/
|
||||
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
|
||||
HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取实际运行终端综合信息
|
||||
*
|
||||
@@ -111,7 +121,7 @@ public interface GeneralDeviceInfoClient {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
|
||||
/**
|
||||
*根据单位获取投运监测点(双系统)
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.api;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.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.pq.api.fallback.DeviceTreeClientFallbackFactory;
|
||||
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
@@ -11,6 +13,8 @@ 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.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -51,4 +55,7 @@ public interface LineIntegrityClient {
|
||||
|
||||
@PostMapping("/lineDataQuality")
|
||||
HttpResult<List<LineDataQualityDTO>> getLineDataQuality(@RequestBody LineDataQualityParam lineDataQualityParam);
|
||||
|
||||
@PostMapping("/noData")
|
||||
HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.dataVerifyCountFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/dataVerifyCount", fallbackFactory = dataVerifyCountFallbackFactory.class, contextId = "dataVerifyCount")
|
||||
public interface PqDataVerifyCountClient {
|
||||
|
||||
/**
|
||||
* 获取有异常数据的监测点相关信息
|
||||
*/
|
||||
@PostMapping("/getAnomalousData")
|
||||
HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param);
|
||||
|
||||
}
|
||||
@@ -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) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -59,6 +59,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(DeviceInfoParam deviceInfoParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取变电站分类的所有终端综合信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString());
|
||||
@@ -84,7 +90,7 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ 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.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -54,6 +55,12 @@ public class LineIntegrityClientFallbackFactory implements FallbackFactory<LineI
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<OnlineMonitorVo>> getNoData(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完成性为0的数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
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.PqDataVerifyCountClient;
|
||||
import com.njcn.device.pq.api.PqDevTypeClient;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class dataVerifyCountFallbackFactory implements FallbackFactory<PqDataVerifyCountClient> {
|
||||
@Override
|
||||
public PqDataVerifyCountClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PqDataVerifyCountClient()
|
||||
{
|
||||
|
||||
@Override
|
||||
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取有异常数据的监测点相关信息异常", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -105,6 +105,14 @@ public class DeviceInfoParam implements Serializable {
|
||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer lineRunFlag;
|
||||
|
||||
@ApiModelProperty("0:按照监测点搜索 1:按照装置搜索")
|
||||
private Integer lineOrDevice;
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ApiModelProperty("搜索值")
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 默认全部监测点
|
||||
*
|
||||
@@ -207,6 +215,12 @@ public class DeviceInfoParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("是否是冀北电网一张图树 0:否 1:是")
|
||||
private Integer type = 0;
|
||||
|
||||
@ApiModelProperty("指标")
|
||||
private List<String> dicData;
|
||||
|
||||
@ApiModelProperty("是否展示污染值 0:否 1:是")
|
||||
private Integer isPollution;
|
||||
}
|
||||
|
||||
public Boolean isUserLedger() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.util.List;
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class OnlineRateParam {
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "设备id")
|
||||
@@ -27,4 +26,10 @@ public class OnlineRateParam {
|
||||
|
||||
@ApiModelProperty(name = "type", value = "区分类型0:topid搜索 1:devid搜索")
|
||||
private Integer type;
|
||||
|
||||
@Data
|
||||
public static class Info extends OnlineRateParam {
|
||||
@ApiModelProperty(name = "dicData", value = "字典id")
|
||||
private List<String> dicData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,7 @@ public class RunManageParam extends BaseParam implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "evaluate", value = "评价")
|
||||
private String evaluate;
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "监测点id集合")
|
||||
private List<String> ids;
|
||||
}
|
||||
|
||||
@@ -38,4 +38,9 @@ public class MonitorBaseParam extends BaseParam {
|
||||
@ApiModelProperty(value = "终端厂家")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(value = "监测点运行状态")
|
||||
private Integer lineRunFlag;
|
||||
|
||||
@ApiModelProperty(value = "异常天数时间")
|
||||
private List<String> time;
|
||||
}
|
||||
|
||||
@@ -137,6 +137,16 @@ public class PqDataVerifyBak {
|
||||
*/
|
||||
private Integer pst;
|
||||
|
||||
/**
|
||||
* 电压暂降(0:正常 1:异常)
|
||||
*/
|
||||
private Integer dip;
|
||||
|
||||
/**
|
||||
* 电压暂升(0:正常 1:异常)
|
||||
*/
|
||||
private Integer rise;
|
||||
|
||||
/**
|
||||
* 判断所有指标 0:无异常 1:有异常
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.njcn.device.pq.pojo.po;
|
||||
|
||||
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 lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-02-17
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("pq_data_verify_count")
|
||||
public class PqDataVerifyCount implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 异常指标数量
|
||||
*/
|
||||
@TableField(value = "total")
|
||||
private Integer total ;
|
||||
|
||||
/**
|
||||
* 总指标数量
|
||||
*/
|
||||
@TableField(value = "total_all")
|
||||
private Integer totalAll ;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.njcn.device.pq.pojo.po.jb;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("fbs_distribution_area")
|
||||
public class DistributionArea extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 台区编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 台区名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 运维单位名称
|
||||
*/
|
||||
private String operationName;
|
||||
|
||||
/**
|
||||
* 运维单位ID(外键)
|
||||
*/
|
||||
private String operationId;
|
||||
|
||||
/**
|
||||
* 变电站名称
|
||||
*/
|
||||
private String powerrName;
|
||||
|
||||
/**
|
||||
* 电站ID(外键)
|
||||
*/
|
||||
private String powerStationId;
|
||||
|
||||
/**
|
||||
* 监测线路名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 所属线路ID(外键)
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 电压等级
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 配变容量
|
||||
*/
|
||||
private Float pCapacity;
|
||||
|
||||
/**
|
||||
* 地区特征(字典)
|
||||
*/
|
||||
private String regionalism;
|
||||
|
||||
|
||||
/**
|
||||
* 设备地区特征(字典)
|
||||
*/
|
||||
private String devRegionalism;
|
||||
|
||||
/**
|
||||
* 是否农网:0-否;1:是;
|
||||
*/
|
||||
private Integer ifRuralPowerGrid;
|
||||
|
||||
/**
|
||||
* 使用性质
|
||||
*/
|
||||
private String natureOfUse;
|
||||
|
||||
/**
|
||||
* 供电半径
|
||||
*/
|
||||
private Float powerSupplyRadius;
|
||||
|
||||
/**
|
||||
* 供电线路总长度
|
||||
*/
|
||||
private Float lineLength;
|
||||
|
||||
/**
|
||||
* 运行状态(字典)
|
||||
*/
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 分布式光伏用户数
|
||||
*/
|
||||
private Integer distributedPhotovoltaicNum;
|
||||
|
||||
/**
|
||||
* 分布式光伏总装机容量
|
||||
*/
|
||||
private Float photovoltaicCapacity;
|
||||
|
||||
/**
|
||||
* 是否有电动汽车接入:0-否;1:是;
|
||||
*/
|
||||
private Integer ifBevAp;
|
||||
|
||||
/**
|
||||
* 接入负荷类型(字典)
|
||||
*/
|
||||
private String apLoadType;
|
||||
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
private Integer isUpToGrid;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private Double longitude;
|
||||
|
||||
/**
|
||||
* 维度
|
||||
*/
|
||||
private Double latitude;
|
||||
|
||||
/**
|
||||
* 数据状态:0-删除;1-正常;
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 数据状态:0-手动录入;1-gw台账录入
|
||||
*/
|
||||
private Integer inputStatus;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.njcn.device.pq.pojo.po.jb;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 发电用户
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("fbs_power_generation_user")
|
||||
public class GenerationUser extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 组织机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 组织机构ID(外键)
|
||||
*/
|
||||
private String orgId;
|
||||
|
||||
/**
|
||||
* 运维单位名称
|
||||
*/
|
||||
private String operationName;
|
||||
|
||||
/**
|
||||
* 运维单位ID(外键)
|
||||
*/
|
||||
private String operationId;
|
||||
|
||||
/**
|
||||
* 电源类别(字典)
|
||||
*/
|
||||
private String powerCategory;
|
||||
|
||||
/**
|
||||
* 电站类型(字典)
|
||||
*/
|
||||
private String powerStationType;
|
||||
|
||||
/**
|
||||
* 发电方式(字典)
|
||||
*/
|
||||
private String powerGenerationMode;
|
||||
|
||||
/**
|
||||
* 并网电压等级(字典)
|
||||
*/
|
||||
private String voltageLevel;
|
||||
|
||||
/**
|
||||
* 总装机容量
|
||||
*/
|
||||
private Float sourceCapacity;
|
||||
|
||||
/**
|
||||
* 并网日期
|
||||
*/
|
||||
private LocalDate connectionDate;
|
||||
|
||||
/**
|
||||
* 能源消纳方式(字典)
|
||||
*/
|
||||
private String connectionMode;
|
||||
|
||||
/**
|
||||
* 客户状态(字典)
|
||||
*/
|
||||
private String gcStat;
|
||||
|
||||
/**
|
||||
* 供电变电站(外键)
|
||||
*/
|
||||
private String powerStationId;
|
||||
|
||||
/**
|
||||
* 供电线路(外键)
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 供电台区(外键)
|
||||
*/
|
||||
private String platformId;
|
||||
|
||||
/**
|
||||
* 用户标签
|
||||
*/
|
||||
private String userTag;
|
||||
|
||||
/**
|
||||
* 是否是上送国网监测点,0-否 1-是
|
||||
*/
|
||||
private Integer isUpToGrid;
|
||||
|
||||
/**
|
||||
* 数据状态:0-删除;1-正常;
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测点详细信息
|
||||
@@ -129,6 +130,24 @@ public class AreaLineInfoVO implements Serializable {
|
||||
@ApiModelProperty(name = "smallObjType",value = "检测对象小类")
|
||||
private String smallObjType;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||
private Integer powerFlag;
|
||||
|
||||
@ApiModelProperty(name = "objId",value = "对象id")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "vHarmonicValue",value = "污染值")
|
||||
private Double vHarmonicValue;
|
||||
|
||||
@ApiModelProperty(name = "userList",value = "敏感用户信息")
|
||||
private List<User> userList;
|
||||
|
||||
@Data
|
||||
public static class User{
|
||||
private String id;
|
||||
private String projectName;
|
||||
private String stationId;
|
||||
private String lineId;
|
||||
private String city;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ public class GridDiagramProVO {
|
||||
|
||||
@ApiModelProperty(name = "integrityRate", value = "数据完整率")
|
||||
private Float integrityRate;
|
||||
|
||||
@ApiModelProperty(name = "onLineRate", value = "数据在线率")
|
||||
private Float onLineRate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Data
|
||||
public class OnlineMonitorVo implements Serializable {
|
||||
|
||||
@ApiModelProperty("负责单位")
|
||||
private String gdName;
|
||||
|
||||
@ApiModelProperty("变电站名称")
|
||||
private String subName;
|
||||
|
||||
@ApiModelProperty("终端名称")
|
||||
private String deviceName;
|
||||
|
||||
@ApiModelProperty("监测点id")
|
||||
private String lineId;
|
||||
|
||||
@ApiModelProperty("监测点名称")
|
||||
private String lineName;
|
||||
|
||||
@ApiModelProperty("监测对象类型")
|
||||
private String monitorObjType;
|
||||
|
||||
@ApiModelProperty("监测对象名称")
|
||||
private String monitorObj;
|
||||
|
||||
@ApiModelProperty("指标类型 ")
|
||||
private String target;
|
||||
|
||||
@ApiModelProperty("累计天数")
|
||||
private Integer lastDay;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -26,6 +26,6 @@ public class RStatIntegrityVO {
|
||||
|
||||
private Integer realTime;
|
||||
|
||||
private Double integrityRate;
|
||||
private BigDecimal integrityRate;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ import java.time.LocalDateTime;
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
public class RStatOnlinerateVO {
|
||||
public class RStatOnlineRateVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private LocalDateTime timeId;
|
||||
@@ -23,5 +23,5 @@ public class RStatOnlinerateVO {
|
||||
|
||||
private Integer offlineMin;
|
||||
|
||||
private Float onlineRate;
|
||||
private BigDecimal onlineRate;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.njcn.device.pq.pojo.vo.common;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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 BigDecimal 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 BigDecimal 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 BigDecimal 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 BigDecimal integrity;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-03-31
|
||||
@@ -14,6 +17,8 @@ public class DetailAbnormalVO {
|
||||
|
||||
private String date;
|
||||
|
||||
private List<String> dateList;
|
||||
|
||||
private String monitorName;
|
||||
|
||||
private String bdName;
|
||||
@@ -50,9 +55,20 @@ public class DetailAbnormalVO {
|
||||
private String avg;
|
||||
//CP95
|
||||
private String cp95;
|
||||
//幅值
|
||||
private String featureAmplitude;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DetailAbnormalCountVO {
|
||||
|
||||
private Integer timeSum;
|
||||
private Integer errCount;
|
||||
private List<DetailAbnormalInnerVO> time;
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class DetailLimitInnerVO{
|
||||
|
||||
@@ -73,6 +89,99 @@ public class DetailAbnormalVO {
|
||||
//最大
|
||||
private String val;
|
||||
|
||||
//限值
|
||||
private float overLimitValue;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Assess {
|
||||
|
||||
/**
|
||||
* 频率偏差
|
||||
*/
|
||||
@ApiModelProperty("频率偏差")
|
||||
private Double freqData = 3.14159;
|
||||
@ApiModelProperty("频率偏差限值")
|
||||
private Float freqLimit = 3.14159F;
|
||||
|
||||
/**
|
||||
* 电压闪变
|
||||
*/
|
||||
@ApiModelProperty("电压闪变")
|
||||
private Double flickerData = 3.14159;
|
||||
@ApiModelProperty("电压闪变限值")
|
||||
private Float flickerLimit = 3.14159F;
|
||||
|
||||
|
||||
/**
|
||||
* 电压偏差上
|
||||
*/
|
||||
@ApiModelProperty("电压上偏差")
|
||||
private Double vDevData = 3.14159;
|
||||
@ApiModelProperty("电压上偏差限值")
|
||||
private Float vDevLimit = 3.14159F;
|
||||
|
||||
|
||||
/**
|
||||
* 电压偏差下
|
||||
*/
|
||||
@ApiModelProperty("电压下偏差")
|
||||
private Double uDevData = 3.14159;
|
||||
@ApiModelProperty("电压下偏差限值")
|
||||
private Float uDevLimit = 3.14159F;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度
|
||||
*/
|
||||
@ApiModelProperty("三相电压不平衡度")
|
||||
private Double unbalanceData = 3.14159;
|
||||
@ApiModelProperty("三相电压不平衡度限值")
|
||||
private Float unbalanceLimit = 3.14159F;
|
||||
|
||||
|
||||
/**
|
||||
* 总谐波畸变率
|
||||
*/
|
||||
@ApiModelProperty("总谐波畸变率")
|
||||
private Double uaberranceData = 3.14159;
|
||||
@ApiModelProperty("总谐波畸变率限值")
|
||||
private Float uaberranceLimit = 3.14159F;
|
||||
|
||||
|
||||
/**
|
||||
* 负序电流限值天数
|
||||
*/
|
||||
@ApiModelProperty("负序电流")
|
||||
private Double iNegData= 3.14159;
|
||||
@ApiModelProperty("负序电流限值")
|
||||
private Float iNegLimit= 3.14159F;
|
||||
|
||||
|
||||
/**
|
||||
* 谐波电压越限天数
|
||||
*/
|
||||
@ApiModelProperty("谐波电压")
|
||||
private Double uharmData = 3.14159;
|
||||
@ApiModelProperty("谐波电压限值")
|
||||
private Float uharmLimit= 3.14159F;
|
||||
/**
|
||||
* 谐波电流越限天数
|
||||
*/
|
||||
@ApiModelProperty("谐波电流")
|
||||
private Double iharmData = 3.14159;
|
||||
@ApiModelProperty("谐波电流限值")
|
||||
private Float iharmLimit= 3.14159F;
|
||||
/**
|
||||
* 间谐波限值天数
|
||||
*/
|
||||
@ApiModelProperty("间谐波电压")
|
||||
private Double inuharmData = 3.14159;
|
||||
@ApiModelProperty("间谐波电压限值")
|
||||
private Float inuharmLimit= 3.14159F;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
|
||||
|
||||
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
||||
private String monitorId;
|
||||
//监测点名称
|
||||
|
||||
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
||||
private String monitorName;
|
||||
//所属终端名称
|
||||
|
||||
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
||||
private String devName;
|
||||
|
||||
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
|
||||
|
||||
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
||||
private String manufacturer;
|
||||
//所属电站
|
||||
|
||||
@ApiModelProperty(name = "stationName",value = "所属电站")
|
||||
private String stationName;
|
||||
//监测对象类型
|
||||
|
||||
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
||||
private String objType;
|
||||
//监测对象名称
|
||||
|
||||
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
||||
private String objName;
|
||||
//电压等级
|
||||
|
||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||
private String voltageLevel;
|
||||
//异常天数
|
||||
|
||||
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
||||
private Integer abnormalDay;
|
||||
//严重度
|
||||
|
||||
@ApiModelProperty(name = "severity",value = "严重度")
|
||||
private Integer severity;
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String city;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>pq-device-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<artifactId>pq-device-com</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
@@ -39,26 +38,10 @@
|
||||
<artifactId>common-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-oss</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
<artifactId>message-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>supervision-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.njcn.platform</groupId>
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
@@ -11,14 +11,12 @@ import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IOverLimitService;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -57,9 +55,6 @@ public class CommTerminalController extends BaseController {
|
||||
|
||||
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
||||
|
||||
private final IOverLimitService iOverLimitService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 通过部门获取所有子集部门所拥有的监测点基本信息
|
||||
@@ -113,8 +108,17 @@ public class CommTerminalController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("deptGetAllLine")
|
||||
@ApiOperation("根据单位获取监测点信息(all line)")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetLine");
|
||||
List<DeptGetChildrenMoreDTO> result = commTerminalService.deptGetAllLine(deptGetLineParam);
|
||||
log.info("运行时长" + timer.intervalSecond());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
@@ -241,34 +245,6 @@ public class CommTerminalController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitData")
|
||||
@ApiOperation("根据监测点id获取越限数值")
|
||||
@ApiImplicitParam(name = "id", value = "监测点id", required = true)
|
||||
public HttpResult<Overlimit> getOverLimitData(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitData");
|
||||
Overlimit result = lineService.getOverLimitData(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAllLineOverLimit")
|
||||
@ApiOperation("获取投运在线的监测点的限值")
|
||||
public HttpResult<List<Overlimit>> getAllLineOverLimit() {
|
||||
String methodDescribe = getMethodDescribe("getAllLineOverLimit");
|
||||
List<Overlimit> result = lineService.getAllLineOverLimit("harmonic-boot", null);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitDataByIds")
|
||||
@ApiOperation("根据监测点id集合获取越限数值")
|
||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||
public HttpResult<List<Overlimit>> getOverLimitDataByIds(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("getOverLimitDataByIds");
|
||||
List<Overlimit> result = iOverLimitService.listByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/getLineBySubstationRelation")
|
||||
@ApiOperation("获取变电站和监测点的关系")
|
||||
|
||||
@@ -86,9 +86,9 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorAbnormalTableDetail")
|
||||
@ApiOperation("弹框-获取异常监测点列表详情")
|
||||
public HttpResult<List<DetailAbnormalVO.DetailAbnormalInnerVO>> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<DetailAbnormalVO.DetailAbnormalCountVO> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
|
||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
||||
DetailAbnormalVO.DetailAbnormalCountVO list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -141,5 +141,14 @@ public class DataVerifyController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/limitTableDetail")
|
||||
@ApiOperation("监测点评价")
|
||||
public HttpResult<DetailAbnormalVO.Assess> limitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("limitTableDetail");
|
||||
DetailAbnormalVO.Assess list = iDataVerifyService.limitTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pq.mapper.DeptLineMapper;
|
||||
import com.njcn.device.line.mapper.DeptLineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.LineDeviceStateVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.DeptLineParam;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
@@ -76,4 +76,15 @@ 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");
|
||||
businessParam.setLineOrDevice(1);
|
||||
List<DeviceRunEvaluateVO.Detail> runEvaluate = deviceRunEvaluateService.getRunEvaluate(businessParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runEvaluate, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ 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.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.common.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -13,8 +15,6 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
@@ -136,6 +136,22 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
|
||||
@ApiOperation("获取按变电站分类的所有终端综合信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalAllDeviceInfoAsSubstation");
|
||||
List<GeneralDeviceDTO> substationDeviceInfos = generalDeviceService.getDeviceInfoAsSubstation(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||
if (CollectionUtil.isEmpty(substationDeviceInfos)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new ArrayList<>(), methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, substationDeviceInfos, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实际运行终端综合信息
|
||||
*/
|
||||
@@ -269,9 +285,9 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("终端在线率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ public class GridDiagramController extends BaseController {
|
||||
@ApiOperation("变电站趋势分析")
|
||||
public HttpResult<Map<String, Long>> getGridDiagramSubTendency(@RequestBody GridDiagramParam param){
|
||||
String methodDescribe = getMethodDescribe("getGridDiagramSubTendency");
|
||||
param.getDeviceInfoParam().setPowerFlag(0);
|
||||
Map<String, Long> gridDiagramDevTendency = gridDiagramService.getGridDiagramDevTendency(param,3);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevTendency, methodDescribe);
|
||||
}
|
||||
@@ -91,6 +90,7 @@ public class GridDiagramController extends BaseController {
|
||||
@ApiOperation("监测点趋势分析")
|
||||
public HttpResult<Map<String, Long>> getGridDiagramLineTendency(@RequestBody GridDiagramParam param){
|
||||
String methodDescribe = getMethodDescribe("getGridDiagramLineTendency");
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
Map<String, Long> gridDiagramDevTendency = gridDiagramService.getGridDiagramDevTendency(param,6);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevTendency, 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,8 @@ 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.OnlineMonitorVo;
|
||||
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 +149,25 @@ 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) {
|
||||
param.setLineOrDevice(0);
|
||||
String methodDescribe = getMethodDescribe("getData");
|
||||
DeviceOnlineRate rate = irStatIntegrityDService.getData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/noData")
|
||||
@ApiOperation("监测点数据完整性为0的数据(冀北)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getNoData");
|
||||
List<OnlineMonitorVo> rate = irStatIntegrityDService.getNoData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,20 +7,18 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.PqsParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.param.AlarmStrategyParam;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.service.AlarmStrategyService;
|
||||
import com.njcn.device.pq.service.IOverLimitService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 监测点限值
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/overLimit")
|
||||
@Api(tags = "监测点限值")
|
||||
@RequiredArgsConstructor
|
||||
public class OverLimitController extends BaseController {
|
||||
|
||||
private final IOverLimitService iOverLimitService;
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getOverLimitByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Overlimit>> getOverLimitByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getOverLimitByLineIds");
|
||||
List<Overlimit> overLimitList= iOverLimitService.list(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLimitMapsByLineIds")
|
||||
@ApiOperation("监测点集合获取限值")
|
||||
@ApiImplicitParam(name = "lineIds", value = "监测点ids", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<List<Map<String, Object>>> getLimitMapsByLineIds(@RequestBody List<String> lineIds){
|
||||
String methodDescribe = getMethodDescribe("getLimitMapsByLineIds");
|
||||
List<Map<String, Object>> overLimitList= iOverLimitService.listMaps(new LambdaQueryWrapper<Overlimit>().in(Overlimit::getId,lineIds));
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, overLimitList, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.device.pq.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.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyCountService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 异常数据功能
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-12-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataVerifyCount")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "异常数据数量统计")
|
||||
public class PqDataVerifyCountController extends BaseController {
|
||||
|
||||
private final IPqDataVerifyCountService pqDataVerifyCountService;
|
||||
|
||||
/**
|
||||
* 获取有异常数据的监测点相关信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAnomalousData")
|
||||
@ApiOperation("异常-获取异常数据主页面")
|
||||
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyData");
|
||||
List<OnlineMonitorVo> list = pqDataVerifyCountService.getAnomalousData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.common.service.TerminalBaseService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.pojo.bo.DeviceType;
|
||||
import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -20,10 +23,6 @@ import com.njcn.device.pq.pojo.dto.PushResultDTO;
|
||||
import com.njcn.device.pq.pojo.param.*;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.service.TerminalBaseService;
|
||||
import com.njcn.device.pq.service.impl.GeneralDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.poi.util.PoiUtil;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.*;
|
||||
|
||||
@@ -6,13 +6,11 @@ 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.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalOnlineRateDataParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineRateCensusVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalOnlineRateDataVO;
|
||||
import com.njcn.device.pq.service.TerminalOnlineRateDataService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -80,9 +78,9 @@ public class TerminalOnlineRateDataController extends BaseController {
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("终端在线率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,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();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.njcn.device.pq.controller.jb;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
import com.njcn.device.pq.service.IPowerDistributionAreaService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 台区信息增删改查
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/distributionArea")
|
||||
@Api(tags = "台账-台区信息")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class PmsPowerDistributionAreaController extends BaseController {
|
||||
|
||||
private final IPowerDistributionAreaService powerDistributionAreaService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("getPowerDistributionAreaList")
|
||||
@ApiOperation("分页查询台区所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
|
||||
public HttpResult<Page<DistributionArea>> getList(@RequestBody TaiZhangParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<DistributionArea> res = powerDistributionAreaService.getList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/addPowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType=OperateType.ADD)
|
||||
@ApiOperation("新增台区信息")
|
||||
@ApiImplicitParam(name = "newParam", value = "模板实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "新增台区信息",module = 3)
|
||||
public HttpResult<Object> add(@RequestBody @Validated PowerDistributionareaParam newParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = powerDistributionAreaService.add(newParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/updatePowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@ApiOperation("修改台区信息")
|
||||
@ApiImplicitParam(name = "UpdateParam", value = "更新实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "修改台区信息",module = 3)
|
||||
public HttpResult<Object> update(@RequestBody @Validated PowerDistributionareaParam UpdateParam){
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
boolean result = powerDistributionAreaService.update(UpdateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除台区信息
|
||||
* @param ids id
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/deletePowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@ApiOperation("删除台区信息")
|
||||
@ApiImplicitParam(name = "ids", value = "ID索引", required = true)
|
||||
@TerminalOperationLogDesc(value = "删除台区信息",module = 3)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
boolean result = powerDistributionAreaService.delete(ids);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.njcn.device.pq.controller.jb;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
import com.njcn.device.pq.service.IPowerGenerationUserService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/generationUser")
|
||||
@Api(tags = "台账-发电用户")
|
||||
@RequiredArgsConstructor
|
||||
public class PmsPowerGenerationUserController extends BaseController {
|
||||
|
||||
private final IPowerGenerationUserService iPowerGenerationUserService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addPowerGenerationUser")
|
||||
@ApiOperation("新增发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "新增发电用户",module = 4)
|
||||
public HttpResult<Boolean> addPowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
|
||||
String methodDescribe = getMethodDescribe("addPowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.addPowerGenerationUser(powerGenerationUserParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updatePowerGenerationUser")
|
||||
@ApiOperation("修改发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "修改发电用户",module = 4)
|
||||
public HttpResult<Boolean> updatePowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
|
||||
String methodDescribe = getMethodDescribe("updatePowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.updatePowerGenerationUser(powerGenerationUserParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delPowerGenerationUser")
|
||||
@ApiOperation("删除发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserIds", value = "发电用户ids", required = true)
|
||||
@TerminalOperationLogDesc(value = "删除发电用户",module = 4)
|
||||
public HttpResult<Boolean> delPowerGenerationUser(@RequestBody @NotEmpty(message = "发电用户id不可为空") List<String> powerGenerationUserIds) {
|
||||
String methodDescribe = getMethodDescribe("delPowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.delPowerGenerationUser(powerGenerationUserIds);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPowerGenerationUserPageList")
|
||||
@ApiOperation("分页获取发电用户列表")
|
||||
@ApiImplicitParam(name = "baseParam", value = "基本查询体", required = true)
|
||||
public HttpResult<Page<GenerationUser>> getPowerGenerationUserPageList(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("getPowerGenerationUserPageList");
|
||||
Page<GenerationUser> result = iPowerGenerationUserService.getPowerGenerationUserPageList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,21 +4,13 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.dataProcess.api.PqsCommunicateFeignClient;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.mapper.PqsTerminalLogsMapper;
|
||||
import com.njcn.device.pq.pojo.dto.DeviceInfo;
|
||||
import com.njcn.device.pq.pojo.dto.NodeProcessDeviceTree;
|
||||
import com.njcn.device.device.service.DeviceProcessService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.node.mapper.NodeMapper;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.device.pq.pojo.po.PqsTerminalLogs;
|
||||
import com.njcn.device.pq.service.DeviceProcessService;
|
||||
import com.njcn.device.pq.service.IDeviceService;
|
||||
import com.njcn.message.constant.DeviceRebootType;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@@ -26,12 +18,9 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.pq.pojo.po.Device;
|
||||
import com.njcn.device.pq.pojo.po.DeviceProcess;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.LineInfluxDbOnlineVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunManageVO;
|
||||
import com.njcn.device.pq.pojo.vo.RunTimeVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface DeviceProcessMapper extends BaseMapper<DeviceProcess> {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2022-01-04
|
||||
*/
|
||||
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 台区
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface PowerDistributionAreaMapper extends BaseMapper<DistributionArea> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 台区
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface PowerGenerationUserMapper extends BaseMapper<GenerationUser> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2025-06-10
|
||||
*/
|
||||
public interface PqDataVerifyCountMapper extends BaseMapper<PqDataVerifyCount> {
|
||||
|
||||
|
||||
List<PqDataVerifyCount> selectSumVerify(@Param("param") OnlineRateParam param);
|
||||
|
||||
List<OnlineMonitorVo> getAnomalousData(@Param("lineIds")List<String> lineIds, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package com.njcn.device.pq.mapper;
|
||||
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 com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,7 +26,7 @@ public interface RStatOnlinerateDMapper extends BaseMapper<RStatOnlinerateD> {
|
||||
* @param param
|
||||
* @return List<OnlineRate>
|
||||
*/
|
||||
List<RStatOnlinerateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
|
||||
List<RStatOnlineRateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
/**
|
||||
* @Description: 根据终端id集合获取总终端在线lv
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.DevMealMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.OverlimitMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqDataVerifyCountMapper">
|
||||
|
||||
|
||||
<select id="selectSumVerify" resultType="com.njcn.device.pq.pojo.po.PqDataVerifyCount">
|
||||
SELECT
|
||||
line_id AS lineId,
|
||||
SUM(total) AS total,
|
||||
SUM(total_all) AS totalAll
|
||||
FROM
|
||||
pq_data_verify_count
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND line_id 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 line_id ;
|
||||
</select>
|
||||
|
||||
<select id="getAnomalousData" resultType="OnlineMonitorVo">
|
||||
SELECT DISTINCT
|
||||
t6.Name gdName,
|
||||
t5.Name subName,
|
||||
t4.Name deviceName,
|
||||
t1.Line_Id lineId,
|
||||
t2.Name lineName,
|
||||
t8.Name monitorObjType,
|
||||
t7.Obj_Name monitorObj,
|
||||
"异常数据" as target,
|
||||
count(t1.time_id) lastDay
|
||||
FROM
|
||||
pq_data_verify_count t1
|
||||
left join pq_line t2 on t1.Line_Id = t2.Id
|
||||
left join pq_line t3 on t2.Pid = t3.Id
|
||||
left join pq_line t4 on t3.Pid = t4.Id
|
||||
left join pq_line t5 on t4.Pid = t5.Id
|
||||
left join pq_line t6 on t5.Pid = t6.Id
|
||||
left join pq_line_detail t7 on t1.Line_Id = t7.Id
|
||||
left join sys_dict_data t8 on t7.Load_Type = t8.Id
|
||||
WHERE
|
||||
t1.total > 0
|
||||
<if test="lineIds!=null and lineIds.size > 0">
|
||||
and Line_Id 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>
|
||||
GROUP BY
|
||||
Line_Id
|
||||
order by lastDay desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.RStatOnlinerateDMapper">
|
||||
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlinerateVO">
|
||||
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlineRateVO">
|
||||
select
|
||||
dev_index,
|
||||
sum(online_min) as onlineMin,
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
line.LEVEL,
|
||||
line.sort,
|
||||
line.pids,
|
||||
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name,
|
||||
CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
|
||||
comFlag.Com_Flag,
|
||||
detail.pt_type,
|
||||
detail.obj_id
|
||||
|
||||
@@ -40,11 +40,10 @@ public interface CommTerminalService {
|
||||
*/
|
||||
List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<DeptGetChildrenMoreDTO> deptGetAllLine(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<LineDevGetDTO> deptGetLineByIdList(List<String> monitorIds);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
* @author cdf
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -44,4 +44,5 @@ public interface IDataVerifyService extends IService<DataVerify> {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 越限表实体
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2023-03-28
|
||||
*/
|
||||
public interface IOverLimitService extends IService<Overlimit> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface IPowerDistributionAreaService extends IService<DistributionArea> {
|
||||
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @return
|
||||
*/
|
||||
Page<DistributionArea> getList(TaiZhangParam baseParam);
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
boolean add(PowerDistributionareaParam newParam);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param
|
||||
*/
|
||||
boolean update(PowerDistributionareaParam updateParam);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ids
|
||||
*/
|
||||
boolean delete(List<String> ids);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
import com.njcn.device.pms.pojo.vo.PowerGenerationUserVO;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface IPowerGenerationUserService extends IService<GenerationUser> {
|
||||
|
||||
/**
|
||||
* 新增发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserParam 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean addPowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
|
||||
|
||||
/**
|
||||
* 修改发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserParam 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updatePowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
|
||||
|
||||
/**
|
||||
* 删除发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserIds 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean delPowerGenerationUser(List<String> powerGenerationUserIds);
|
||||
|
||||
/**
|
||||
* 分页查询发电用户列表
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param baseParam 基础参数
|
||||
* @return boolean
|
||||
*/
|
||||
Page<GenerationUser> getPowerGenerationUserPageList(BaseParam baseParam);
|
||||
|
||||
|
||||
}
|
||||
@@ -27,8 +27,7 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
|
||||
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
|
||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2025-06-10
|
||||
*/
|
||||
public interface IPqDataVerifyCountService extends IService<PqDataVerifyCount> {
|
||||
|
||||
List<PqDataVerifyCount> getSumVerify( OnlineRateParam param);
|
||||
|
||||
List<OnlineMonitorVo> getAnomalousData(LineBaseQueryParam par);
|
||||
|
||||
}
|
||||
@@ -5,9 +5,12 @@ 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.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,4 +36,8 @@ public interface IRStatIntegrityDService extends IMppService<RStatIntegrityD> {
|
||||
List<LineDataQualityDTO> getLineDataQuality(LineDataQualityParam lineDataQualityParam);
|
||||
|
||||
Boolean saveOrUpdateData(List<MonitorIntegrityDTO> monitorIntegrityDTOList);
|
||||
|
||||
DeviceOnlineRate getData(DeviceInfoParam.BusinessParam param);
|
||||
|
||||
List<OnlineMonitorVo> getNoData(LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -49,4 +49,7 @@ public interface TerminalTreeService {
|
||||
* @return
|
||||
*/
|
||||
List<TerminalTree> getJbTerminalTree();
|
||||
|
||||
|
||||
List<TerminalTree> getJbNewTerminalTree();
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -10,11 +11,11 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
@@ -50,12 +51,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 基础获取单位信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -77,7 +75,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptGetBase.setUnitChildrenList(deptChildren);
|
||||
result.add(deptGetBase);
|
||||
});
|
||||
redisUtil.saveByKey(commTerminal + deptGetLineParam.getDeptId(),result);
|
||||
redisUtil.saveByKey(commTerminal + deptGetLineParam.getDeptId(), result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -87,8 +85,8 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<DeptGetChildrenMoreDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, String> deptMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetChildrenMoreDTO deptGetChildrenMoreDTO = new DeptGetChildrenMoreDTO();
|
||||
deptGetChildrenMoreDTO.setUnitId(item.getUnitId());
|
||||
@@ -100,8 +98,47 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<LineDevGetDTO> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(x->{
|
||||
if(deptMap.containsKey(x.getUnitId())){
|
||||
map.get(i).forEach(x -> {
|
||||
if (deptMap.containsKey(x.getUnitId())) {
|
||||
x.setUnitName(deptMap.get(x.getUnitId()));
|
||||
}
|
||||
});
|
||||
lineList.addAll(map.get(i));
|
||||
}
|
||||
});
|
||||
|
||||
//去重
|
||||
ArrayList<LineDevGetDTO> collect = lineList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
|
||||
Comparator.comparing(LineDevGetDTO::getPointId)
|
||||
)), ArrayList::new));
|
||||
|
||||
deptGetChildrenMoreDTO.setLineBaseList(collect);
|
||||
}
|
||||
result.add(deptGetChildrenMoreDTO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetChildrenMoreDTO> deptGetAllLine(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetChildrenMoreDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, String> deptMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevAllGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1, deptGetLineParam.getLineRunFlag(), deptGetLineParam.getIsUpToGrid());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetChildrenMoreDTO deptGetChildrenMoreDTO = new DeptGetChildrenMoreDTO();
|
||||
deptGetChildrenMoreDTO.setUnitId(item.getUnitId());
|
||||
deptGetChildrenMoreDTO.setUnitName(item.getUnitName());
|
||||
deptGetChildrenMoreDTO.setUnitChildrenList(item.getUnitChildrenList());
|
||||
deptGetChildrenMoreDTO.setDeptLevel(item.getDeptLevel());
|
||||
List<String> deptIds = item.getUnitChildrenList();
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<LineDevGetDTO> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(x -> {
|
||||
if (deptMap.containsKey(x.getUnitId())) {
|
||||
x.setUnitName(deptMap.get(x.getUnitId()));
|
||||
}
|
||||
});
|
||||
@@ -145,7 +182,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
subList.addAll(map.get(i).stream().map(TerminalGetBase::getLedgerId).distinct().collect(Collectors.toList()));
|
||||
subList.addAll(map.get(i).stream().filter(x-> StrUtil.isNotBlank(x.getObjId())).map(TerminalGetBase::getObjId).distinct().collect(Collectors.toList()));
|
||||
subList.addAll(map.get(i).stream().filter(x -> StrUtil.isNotBlank(x.getObjId())).map(TerminalGetBase::getObjId).distinct().collect(Collectors.toList()));
|
||||
lineList.addAll(map.get(i).stream().map(TerminalGetBase::getLineId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
@@ -161,7 +198,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetBusBarDTO> deptBusBar(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetBusBarDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),2,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()), 2, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetBusBarDTO deptGetBusBarDTO = new DeptGetBusBarDTO();
|
||||
deptGetBusBarDTO.setUnitId(item.getUnitId());
|
||||
@@ -186,10 +223,10 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type) {
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam, Integer type) {
|
||||
List<DeptGetDeviceDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),type,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()), type, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetDeviceDTO deptGetDeviceDTO = new DeptGetDeviceDTO();
|
||||
deptGetDeviceDTO.setUnitId(item.getUnitId());
|
||||
@@ -227,7 +264,11 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),deptGetLineParam.getPowerFlag(),deptGetLineParam.getLineRunFlag());
|
||||
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
deptGetLineParam.getPowerFlag(),
|
||||
deptGetLineParam.getLineRunFlag(),
|
||||
deptGetLineParam.getIsUpToGrid(),
|
||||
deptGetLineParam.getSearchValue());
|
||||
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
temDept.forEach(item -> {
|
||||
@@ -245,15 +286,15 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
//获取部门下变电信息
|
||||
List<TerminalGetBase.Extend> sub = orgSub.get(deptId);
|
||||
Map<String, List<TerminalGetBase.Extend>> subMap = sub.stream()
|
||||
.collect(Collectors.groupingBy(x->x.getLedgerId()+"_"+x.getSubName()+"_"+x.getVoltageLevel()));
|
||||
.collect(Collectors.groupingBy(x -> x.getLedgerId() + "_" + x.getSubName() + "_" + x.getVoltageLevel()));
|
||||
for (Map.Entry<String, List<TerminalGetBase.Extend>> stringListEntry : subMap.entrySet()) {
|
||||
String[] split = stringListEntry.getKey().split("_");
|
||||
subGetBase=new SubGetBase();
|
||||
subGetBase = new SubGetBase();
|
||||
subGetBase.setId(split[0]);
|
||||
subGetBase.setName(split[1]);
|
||||
subGetBase.setVoltageLevel(split[2]);
|
||||
subGetBase.setOrgId(deptId);
|
||||
if(deptNameMap.containsKey(deptId)){
|
||||
if (deptNameMap.containsKey(deptId)) {
|
||||
subGetBase.setOrgName(deptNameMap.get(deptId));
|
||||
}
|
||||
//国网监测点
|
||||
@@ -279,12 +320,12 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
@Override
|
||||
public List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam) {
|
||||
List<SubGetBase> subStationList = deptLineService.getSubStationList(substationParam);
|
||||
if(CollUtil.isNotEmpty(subStationList)){
|
||||
if (CollUtil.isNotEmpty(subStationList)) {
|
||||
List<String> ids = subStationList.stream().map(SubGetBase::getOrgId).collect(Collectors.toList());
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(ids).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
subStationList.stream().forEach(x->{
|
||||
if(deptMap.containsKey(x.getOrgId())){
|
||||
subStationList.stream().forEach(x -> {
|
||||
if (deptMap.containsKey(x.getOrgId())) {
|
||||
x.setOrgName(deptMap.get(x.getOrgId()));
|
||||
}
|
||||
});
|
||||
@@ -295,7 +336,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
@Override
|
||||
public List<String> getRunMonitorByDept(MonitorBaseParam monitorBaseParam) {
|
||||
List<String> ids = deptFeignClient.getDepSonIdtByDeptId(monitorBaseParam.getDeptId()).getData();
|
||||
List<String> monitorIds = deptLineService.getLineByDeptIds(ids,monitorBaseParam.getManufacturer(),Stream.of(RunFlagEnum.RUNNING.getStatus()).collect(Collectors.toList()),Stream.of(0,1,2).collect(Collectors.toList()),monitorBaseParam.getObjType());
|
||||
List<String> monitorIds = deptLineService.getLineByDeptIds(ids, monitorBaseParam.getManufacturer(),
|
||||
ObjectUtil.isNotNull(monitorBaseParam.getLineRunFlag())? Arrays.asList(monitorBaseParam.getLineRunFlag()):null,
|
||||
Stream.of(0, 1, 2).collect(Collectors.toList()), monitorBaseParam.getObjType());
|
||||
return monitorIds;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.device.pq.mapper.OnlineRateMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.param.PulicTimeParam;
|
||||
@@ -12,23 +11,17 @@ import com.njcn.device.pq.pojo.param.PulicTimeStatisParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.CommunicateService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.device.pq.utils.PublicDateUtil;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.web.enums.DateFlagEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
/**
|
||||
@@ -135,7 +128,7 @@ public class CommunicateServiceImpl implements CommunicateService {
|
||||
param.setEndTime(DateUtil.endOfDay(DateUtil.parse(endTime)).toString());
|
||||
if (state == 1) {
|
||||
//在线率
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlinerateDMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlinerateDMapper.getOnlineRateByDevIds(param);
|
||||
if (CollUtil.isNotEmpty(onlineRateByDevIds)) {
|
||||
onlineRateByDevIds.forEach(po -> {
|
||||
//数据完整性 保留四位小数
|
||||
|
||||
@@ -4,13 +4,10 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.C;
|
||||
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.common.pojo.exception.BusinessException;
|
||||
import com.njcn.dataProcess.api.DataLimitRateDetailFeignClient;
|
||||
@@ -21,53 +18,42 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.overlimit.service.IOverLimitService;
|
||||
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IDataVerifyService;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.harmonic.pojo.vo.RStatLimitTargetVO;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.supervision.pojo.vo.user.UserLedgerVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.DateFormat;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -83,28 +69,20 @@ import java.util.stream.Stream;
|
||||
public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class);
|
||||
|
||||
private static final String SEPARATOR = "&";
|
||||
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||
|
||||
private final CommTerminalService commTerminalService;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
||||
|
||||
private final DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
||||
|
||||
private final DataLimitRateFeignClient dataLimitRateFeignClient;
|
||||
|
||||
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final IOverLimitService overLimitService;
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
private final PqDataVerifyBakMapper pqDataVerifyBakMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -230,7 +208,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitTargetDto> limitTarget = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> it.getAllTime() > 0).collect(Collectors.toList());
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.toList());
|
||||
long abnormalCount = limitList.stream().map(DataLimitTargetDto::getLineId).distinct().count();
|
||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||
@@ -251,7 +229,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitTargetDto> limitTarget = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> it.getAllTime() > 0).collect(Collectors.toList());
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.toList());
|
||||
return getLimitTable(limitList, monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -365,7 +343,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(StrUtil.isNotBlank(jonsStr)){
|
||||
if (StrUtil.isNotBlank(jonsStr)) {
|
||||
JSONArray jsonArray = new JSONArray(jonsStr);
|
||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
||||
jsonBaseVOList.forEach(it -> {
|
||||
@@ -374,13 +352,13 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
}
|
||||
}
|
||||
|
||||
if(timeSet.size()>0){
|
||||
if (timeSet.size() > 0) {
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setMonitorId(lineId);
|
||||
detailAbnormalVO.setDate(date.format(DATE_FORMAT));
|
||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||
detailAbnormalVO.setTimeSum(String.valueOf(timeInterval*timeSet.size()));
|
||||
detailAbnormalVO.setTimeSum(String.valueOf(timeInterval * timeSet.size()));
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
}
|
||||
@@ -411,6 +389,213 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
DetailAbnormalVO.Assess assess = new DetailAbnormalVO.Assess();
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Overlimit overLimitDataById = overLimitService.getOverLimitDataById(monitorBaseParam.getMonitorIds().get(0));
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> freq = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> voltage = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> uaberrance = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> ubalance = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> flicker = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> iNeg = new ArrayList<>();
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> uharm = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> iharm = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> inuharm = new ArrayList<>();
|
||||
|
||||
for (DataLimitRateDetailDto dto : dtoList) {
|
||||
dealJsonArr(new JSONArray(dto.getFreqDevOvertime()), freq, DicDataEnum.FREQUENCY_DEV.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getVoltageDevOvertime()), voltage, DicDataEnum.VOLTAGE_DEV.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getUaberranceOvertime()), uaberrance, DicDataEnum.THD_V.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getUbalanceOvertime()), ubalance, DicDataEnum.phase_Voltage.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getFlickerOvertime()), flicker, DicDataEnum.FLICKER.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getINegOvertime()), iNeg, DicDataEnum.NEG_CURRENT.getName(), null);
|
||||
// 处理谐波类指标
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.HARMONIC_VOLTAGE.getName(), "uharm", 2, 25, uharm);
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.HARMONIC_CURRENT.getName(), "iharm", 2, 25, iharm);
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.INTERHARMONIC_VOLTAGE.getName(), "inuharm", 1, 16, inuharm);
|
||||
}
|
||||
assess.setFreqLimit(overLimitDataById.getFreqDev());
|
||||
assess.setVDevLimit(overLimitDataById.getVoltageDev());
|
||||
assess.setUDevLimit(overLimitDataById.getUvoltageDev());
|
||||
assess.setUaberranceLimit(overLimitDataById.getUaberrance());
|
||||
assess.setUnbalanceLimit(overLimitDataById.getUbalance());
|
||||
assess.setFlickerLimit(overLimitDataById.getFlicker());
|
||||
assess.setINegLimit(overLimitDataById.getINeg());
|
||||
Map<String, List<PqReasonableRangeDto>> map = new HashMap<>();
|
||||
DataCleanParam param = new DataCleanParam();
|
||||
param.setSystemType(DataCleanEnum.Pqs.getCode());
|
||||
List<PqReasonableRangeDto> list = pqReasonableRangeFeignClient.getData(param).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
map = list.stream().collect(Collectors.groupingBy(PqReasonableRangeDto::getInfluxdbTableName));
|
||||
}
|
||||
|
||||
List<PqReasonableRangeDto> dataV = map.get(DataCleanEnum.DataV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataVCode = dataV.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
//频率偏差
|
||||
if (CollUtil.isNotEmpty(freq)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.FreqDev.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(freq, dto);
|
||||
assess.setFreqData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
|
||||
//电压偏差
|
||||
if (CollUtil.isNotEmpty(voltage)) {
|
||||
//上偏差
|
||||
PqReasonableRangeDto dto1 = dataVCode.get(DataCleanEnum.VuDev.getCode());
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) > 0)
|
||||
.filter(x -> Double.valueOf(x.getVal()) < dto1.getMaxValue())
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed()).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
DetailAbnormalVO.DetailLimitInnerVO val;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) > 0)
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val = collect2.get(0);
|
||||
val.setVal(dto1.getMaxValue().toString());
|
||||
}
|
||||
assess.setVDevData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//下偏差
|
||||
PqReasonableRangeDto dto2 = dataVCode.get(DataCleanEnum.VlDev.getCode());
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) < 0)
|
||||
.filter(x -> dto2.getMinValue() < Double.valueOf(x.getVal()))
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect2)) {
|
||||
DetailAbnormalVO.DetailLimitInnerVO val2;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val2 = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect3 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) < 0)
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val2 = collect3.get(0);
|
||||
val2.setVal(dto2.getMaxValue().toString());
|
||||
}
|
||||
assess.setUDevData(NumberUtil.round(val2.getVal(), 2).doubleValue());
|
||||
}
|
||||
}
|
||||
//负序电流
|
||||
if (CollUtil.isNotEmpty(iNeg)) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = iNeg.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = collect.get(0);
|
||||
assess.setINegData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//电压总谐波
|
||||
if (CollUtil.isNotEmpty(uaberrance)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||
assess.setUaberranceData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//三相不平衡度
|
||||
if (CollUtil.isNotEmpty(ubalance)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VUnbalance.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(ubalance, dto);
|
||||
assess.setUnbalanceData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//闪变
|
||||
List<PqReasonableRangeDto> dataPlt = map.get(DataCleanEnum.DataPlt.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataPltCode = dataPlt.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(flicker)) {
|
||||
PqReasonableRangeDto dto = dataPltCode.get(DataCleanEnum.Plt.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(flicker, dto);
|
||||
assess.setFlickerData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//谐波电压
|
||||
List<PqReasonableRangeDto> dataHarmRate = map.get(DataCleanEnum.DataHarmRateV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataHarmRateCode = dataHarmRate.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(uharm)) {
|
||||
PqReasonableRangeDto dto = dataHarmRateCode.get(DataCleanEnum.V_Rate.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uharm, dto);
|
||||
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getUharm" + split[0];
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setUharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else{
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//谐波电流
|
||||
if (CollUtil.isNotEmpty(iharm)) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = iharm.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = collect.get(0);
|
||||
assess.setIharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getIharm" + split[0];
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setIharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
//间谐波电压
|
||||
List<PqReasonableRangeDto> dataInHarm = map.get(DataCleanEnum.DataInHarmV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataInHarmCode = dataInHarm.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(inuharm)) {
|
||||
PqReasonableRangeDto dto = dataInHarmCode.get(DataCleanEnum.V_InHarm.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(inuharm, dto);
|
||||
assess.setInuharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getInuharm" + split[0];
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setInuharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return assess;
|
||||
}
|
||||
|
||||
private DetailAbnormalVO.DetailLimitInnerVO reasonAble(List<DetailAbnormalVO.DetailLimitInnerVO> limit, PqReasonableRangeDto dto) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = limit.stream()
|
||||
.filter(x -> dto.getMinValue() < Double.valueOf(x.getVal()) && Double.valueOf(x.getVal()) < dto.getMaxValue())
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed()).collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = limit.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val = collect2.get(0);
|
||||
val.setVal(dto.getMaxValue().toString());
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
private Map<String, DictData> getTargetMap() {
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.STEADY_STATIS.getCode()).getData();
|
||||
return dictDataList.stream().collect(Collectors.toMap(DictData::getCode, Function.identity()));
|
||||
@@ -479,6 +664,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result);
|
||||
processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result);
|
||||
}
|
||||
|
||||
private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap,
|
||||
String targetCode, String data,
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
||||
@@ -498,6 +684,13 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
processSpecialTargets(tempList, result, targetName);
|
||||
}
|
||||
|
||||
private void processHarmonicTargetHarm(DataLimitRateDetailDto dto, String targetCode, String prefix, int start, int end,
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
||||
List<String> tempList = new ArrayList<>();
|
||||
collectHarmonicData(dto, prefix, start, end, tempList);
|
||||
processSpecialTargets(tempList, result, targetCode);
|
||||
}
|
||||
|
||||
private void processSpecialTargets(List<String> specialTargetList, List<DetailAbnormalVO.DetailLimitInnerVO> result, String targetName) {
|
||||
for (String strJson : specialTargetList) {
|
||||
String[] temStr = strJson.split(SEPARATOR);
|
||||
@@ -525,6 +718,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);
|
||||
}
|
||||
});
|
||||
@@ -574,13 +768,15 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "uharm" + i + "Overtime";
|
||||
String iHarmKey = "iharm" + i + "Overtime";
|
||||
String inuHarmKey = "inuharm" + i + "Overtime";
|
||||
if (getFieldValue(it, uHarmKey) != null && getFieldValue(it, uHarmKey) == 1) {
|
||||
HARMONIC_VOLTAGE.add(it.getLineId());
|
||||
}
|
||||
if (getFieldValue(it, iHarmKey) != null && getFieldValue(it, iHarmKey) == 1) {
|
||||
HARMONIC_CURRENT.add(it.getLineId());
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
String inuHarmKey = "inuharm" + i + "Overtime";
|
||||
if (getFieldValue(it, inuHarmKey) != null && getFieldValue(it, inuHarmKey) == 1) {
|
||||
INTERHARMONIC_VOLTAGE.add(it.getLineId());
|
||||
}
|
||||
@@ -773,7 +969,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||
processTable(monitorBaseParam, dateList, result, key);
|
||||
});
|
||||
dealTableResult(result);
|
||||
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -785,7 +981,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||
processTable(monitorBaseParam, dateList, result, key);
|
||||
});
|
||||
dealTableResult(result);
|
||||
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -812,34 +1008,44 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
}
|
||||
}
|
||||
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result) {
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
|
||||
if (CollUtil.isNotEmpty(result)) {
|
||||
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
// List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
// Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
||||
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
|
||||
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
result.forEach(it -> {
|
||||
if (areaMap.containsKey(it.getMonitorId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId());
|
||||
it.setMonitorName(areaLineInfoVO.getLineName());
|
||||
it.setStationName(areaLineInfoVO.getSubName());
|
||||
it.setDevName(areaLineInfoVO.getDeviceName());
|
||||
it.setVoltageLevel(areaLineInfoVO.getVoltageScale());
|
||||
it.setIp(Base64.encode(areaLineInfoVO.getIp()));
|
||||
it.setManufacturer(areaLineInfoVO.getManufacturer());
|
||||
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
}
|
||||
if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
|
||||
Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
|
||||
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
|
||||
Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
|
||||
// List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
// List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
// Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
List<PowerQualityIndicatorsVO> info = new ArrayList<>();
|
||||
for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
|
||||
if (areaMap.containsKey(lineDetail.getLineId())) {
|
||||
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||
it.setMonitorName(lineDetail.getLineName());
|
||||
it.setStationName(lineDetail.getSubName());
|
||||
if(deptName.containsKey(lineDetail.getLineId())){
|
||||
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||
}
|
||||
it.setDevName(lineDetail.getDeviceName());
|
||||
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||
it.setIp(Base64.encode(lineDetail.getIp()));
|
||||
it.setManufacturer(lineDetail.getManufacturer());
|
||||
it.setObjType(lineDetail.getLoadType());
|
||||
it.setObjName(lineDetail.getObjName());
|
||||
info.add(it);
|
||||
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
// }
|
||||
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
result.clear();
|
||||
result.addAll(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +1,44 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.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.pq.mapper.RStatIntegrityDMapper;
|
||||
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.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 cn.hutool.core.collection.CollectionUtil;
|
||||
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.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfoDTO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalEvaluateAreaVO;
|
||||
import com.njcn.device.pq.service.DeptLineService;
|
||||
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.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.DeviceRunEvaluateService;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyCountService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||
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;
|
||||
|
||||
@@ -40,9 +46,8 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
@@ -61,7 +66,11 @@ 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;
|
||||
private final IPqDataVerifyCountService pqDataVerifyCountService;
|
||||
/**
|
||||
* 数据完整性:50%
|
||||
*/
|
||||
@@ -106,7 +115,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) {
|
||||
@@ -115,7 +124,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));
|
||||
}
|
||||
@@ -124,7 +133,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));
|
||||
}
|
||||
@@ -142,7 +151,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));
|
||||
@@ -212,7 +221,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());
|
||||
@@ -245,7 +254,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<>();
|
||||
@@ -333,6 +342,181 @@ 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<Integer> devRun=ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
|
||||
param.setLineRunFlag(null);
|
||||
//获取终端台账类信息
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, 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<RStatOnlineRateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
//异常信息
|
||||
onlineRateParam.setIds(lineIds);
|
||||
List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(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(verifyDev(sumVerify, dto.getLineIndexes(), dto.getDeviceIndexes()));
|
||||
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
|
||||
.add(ONLINERATE.multiply(detail.getOnline())
|
||||
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
||||
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());
|
||||
evaluateVO.setCompany(value.get(0).getCompany());
|
||||
evaluateVO.setRunFlag(RunFlagEnum.getRunFlagRemarkByStatus(value.get(0).getRunFlag()));
|
||||
//部门
|
||||
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(verify(sumVerify, ids));
|
||||
evaluateVO.setEvaluate(ONINTEGRITY.multiply(evaluateVO.getIntegrityRate())
|
||||
.add(ONLINERATE.multiply(evaluateVO.getOnLineRate())
|
||||
.add(LIMITRATE.multiply(evaluateVO.getPassRate()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
||||
deviceDetail.add(evaluateVO);
|
||||
});
|
||||
}
|
||||
detail.setList(deviceDetail);
|
||||
info.add(detail);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
private BigDecimal verifyDev(List<PqDataVerifyCount> sumVerify, List<String> lineIds, List<String> devIds) {
|
||||
//异常率
|
||||
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x->x.getTotal()>0).filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
List<String> verifyLine = verifyList.stream().map(PqDataVerifyCount::getLineId).distinct().collect(Collectors.toList());
|
||||
List<String> devIdsLine = lineMapper.getDevIdsLine(verifyLine);
|
||||
if (CollUtil.isNotEmpty(devIdsLine)) {
|
||||
return NumberUtil.round(Math.min(devIdsLine.size() * 100.0 / devIds.size(), 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) {
|
||||
//异常率
|
||||
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(verifyList)) {
|
||||
double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum();
|
||||
double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum();
|
||||
if (totalAll == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return NumberUtil.round(Math.min(total * 100.0 / totalAll, 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
if (dueTime == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return NumberUtil.round(Math.min(realTime * 100.0 / 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();
|
||||
if ((onlineTime + offlineTime) == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
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) {
|
||||
if (CollUtil.isEmpty(limitRatePOList)) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
//超标信息
|
||||
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()));
|
||||
|
||||
@@ -5,7 +5,6 @@ import cn.hutool.core.date.DateField;
|
||||
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;
|
||||
@@ -14,8 +13,12 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.common.mapper.onlinerate.OnLineRateMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
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.GridDiagramParam;
|
||||
@@ -24,13 +27,14 @@ import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.pq.service.*;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
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.dto.DeptDTO;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
|
||||
import java.time.ZoneId;
|
||||
@@ -39,7 +43,6 @@ import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -65,6 +68,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
private final LineService lineService;
|
||||
private final DeptLineService deptLineService;
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
private final OnLineRateMapper onLineRateMapper;
|
||||
|
||||
@Override
|
||||
public GridDiagramVO getGridDiagramMonitor(GridDiagramParam param) {
|
||||
@@ -73,15 +77,14 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<DictData> v = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PANORAMIC_VOLTAGE.getCode()).getData();
|
||||
List<String> voltageIds;
|
||||
//获取电压等级550 220 110 35
|
||||
if(CollUtil.isNotEmpty(v)){
|
||||
if (CollUtil.isNotEmpty(v)) {
|
||||
List<String> vName = v.stream().map(DictData::getName).collect(Collectors.toList());
|
||||
voltageIds = dictDataList.stream().filter(item -> vName.contains(item.getName())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList());
|
||||
}else{
|
||||
} else {
|
||||
voltageIds = dictDataList.stream().filter(item -> Objects.equals(DicDataEnum.DY_500KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_220KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_110KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_35KV.getCode(), item.getCode())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
GridDiagramVO gridDiagramVO = new GridDiagramVO();
|
||||
List<GridDiagramVO.LineStatistics> info = new ArrayList<>();
|
||||
List<GridDiagramVO.LineStatistics> gwInfo = new ArrayList<>();
|
||||
@@ -243,7 +246,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
|
||||
@@ -263,7 +265,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);
|
||||
|
||||
|
||||
@@ -296,11 +297,11 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public Map<String, Long> getGridDiagramDevTendency(GridDiagramParam param, Integer type) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
if (type == 3) {
|
||||
param.getDeviceInfoParam().setPowerFlag(0);
|
||||
List<Integer> runFlag = new ArrayList<>();
|
||||
if (3 != type) {
|
||||
runFlag.add(0);
|
||||
}
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), runFlag, Stream.of(1).collect(Collectors.toList()));
|
||||
Map<String, Long> map = new LinkedHashMap<>();
|
||||
DateField dateField;
|
||||
DateTime parse;
|
||||
@@ -360,7 +361,6 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public List<GridDiagramVO.DeviceData> getGridDiagramDevData(GridDiagramParam param) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
// 获取所有数据
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
|
||||
@@ -400,9 +400,8 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public List<GridDiagramVO.DevData> getGridDiagramDevDataList(GridDiagramParam param) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
List<GridDiagramVO.DevData> info = new ArrayList<>();
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfoAsDept(param.getDeviceInfoParam(), null, Stream.of(1).collect(Collectors.toList()));
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfoAsDept(param.getDeviceInfoParam(), Arrays.asList(0), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> devIds = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||
//终端信息
|
||||
List<Device> devList = new ArrayList<>();
|
||||
@@ -476,13 +475,16 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
GridDiagramProVO.Details details = new GridDiagramProVO.Details();
|
||||
Stream<LineDetail> stream = lines.stream();
|
||||
Stream<LineDetail> stream2 = lines.stream();
|
||||
Stream<LineDetail> stream3 = lines.stream();
|
||||
if (gwType != null) {
|
||||
stream = stream.filter(x -> x.getMonitorFlag() == gwType);
|
||||
stream2 = stream2.filter(x -> x.getMonitorFlag() == gwType);
|
||||
stream3 = stream3.filter(x -> x.getMonitorFlag() == gwType);
|
||||
}
|
||||
if (powerFlag != null) {
|
||||
stream = stream.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
stream2 = stream2.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
stream3 = stream3.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
}
|
||||
//总监测点
|
||||
List<String> ids = stream.map(LineDetail::getId).collect(Collectors.toList());
|
||||
@@ -500,6 +502,23 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
} else {
|
||||
details.setIntegrityRate(0.0f);
|
||||
}
|
||||
|
||||
List<String> devIds = stream3.map(LineDetail::getMonitorName).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(devIds)) {
|
||||
OnlineRateParam onlineRateParam = new OnlineRateParam();
|
||||
onlineRateParam.setIds(devIds);
|
||||
onlineRateParam.setStartTime(baseQueryParam.getStartTime());
|
||||
onlineRateParam.setEndTime(baseQueryParam.getEndTime());
|
||||
//获取所有终端在线率
|
||||
List<RStatOnlineRateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
if(CollUtil.isNotEmpty(onlineRateByDev)){
|
||||
details.setOnLineRate(onlineRateByDev.get(0).getOnlineRate().floatValue());
|
||||
}else{
|
||||
details.setOnLineRate(0.0f);
|
||||
}
|
||||
} else {
|
||||
details.setOnLineRate(0.0f);
|
||||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.pq.mapper.LargeScreenMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.pq.api.AlarmClient;
|
||||
import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
@@ -15,7 +16,6 @@ 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.mapper.LineIntegrityDataMapper;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PublicDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
@@ -27,6 +27,7 @@ import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatIntegrityVO;
|
||||
import com.njcn.device.pq.service.LineIntegrityDataService;
|
||||
import com.njcn.device.pq.utils.DataStatisticsUtil;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.pojo.vo.IntegrityIconVO;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.LineMarkMapper;
|
||||
import com.njcn.device.pq.pojo.bo.excel.LineMark;
|
||||
import com.njcn.device.pq.pojo.param.TerminalMainQueryParam;
|
||||
|
||||
@@ -7,30 +7,20 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.EventPushLogsMapper;
|
||||
import com.njcn.device.pq.mapper.LineMapper;
|
||||
import com.njcn.device.pq.mapper.LogManageMapper;
|
||||
import com.njcn.device.pq.pojo.constant.DeviceValidMessage;
|
||||
import com.njcn.device.pq.pojo.param.DeviceLogParam;
|
||||
import com.njcn.device.pq.pojo.param.EventLogParam;
|
||||
import com.njcn.device.pq.pojo.po.EventPushLogs;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.DeviceLogVO;
|
||||
import com.njcn.device.pq.pojo.vo.EventLogVO;
|
||||
import com.njcn.device.pq.service.LogManageService;
|
||||
import com.njcn.event.api.EventDetailFeignClient;
|
||||
import com.njcn.event.pojo.po.EventDetail;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.influxdb.dto.QueryResult;
|
||||
import org.influxdb.impl.InfluxDBResultMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,8 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.NewStationMapper;
|
||||
import com.njcn.device.pq.pojo.param.NewStationQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.NewStation;
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.mapper.OverlimitMapper;
|
||||
import com.njcn.device.pq.service.IOverLimitService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/6/7
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class OverLimitServiceImpl extends ServiceImpl<OverlimitMapper, Overlimit> implements IOverLimitService {
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user