Compare commits
183 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94037d588b | ||
| 01a77fa92d | |||
| 9d9150e418 | |||
| ee1ca85a5d | |||
|
|
2c3c716607 | ||
|
|
e1d17c63a2 | ||
|
|
6234ac8ce9 | ||
| 6c91774200 | |||
| fc951e913c | |||
| d138d4353f | |||
| aecee4de49 | |||
|
|
fd04c21997 | ||
| 08d8b5b488 | |||
| 82457bc9c2 | |||
|
|
63330a04a6 | ||
|
|
ad45661c3c | ||
|
|
23de6313a6 | ||
|
|
7a5ef040bb | ||
| 140ed85108 | |||
|
|
99ab77dcf0 | ||
|
|
c772c9cd81 | ||
| 996ec87ea8 | |||
|
|
b6eaff3b1e | ||
|
|
56bf5bb7c9 | ||
|
|
7410d32241 | ||
|
|
41ba37b723 | ||
|
|
3f77d30cfd | ||
| f71f87ced4 | |||
| 32295f60c0 | |||
|
|
d2945b0fb2 | ||
|
|
133766a2c7 | ||
| 2a5a5087ad | |||
| 4edb27d20b | |||
| 71d6636be0 | |||
|
|
8ccdb84ea9 | ||
|
|
5389903ed7 | ||
|
|
0684bdf503 | ||
|
|
d0b4a1ec71 | ||
| 764ca4a12a | |||
|
|
ca992cadbc | ||
|
|
ed166cf1e0 | ||
| 598fa803a1 | |||
| 10050ce418 | |||
| cb688ad7ad | |||
| f6c4d050da | |||
|
|
fd6ec7bdf2 | ||
|
|
ca7f1010b0 | ||
| 97ddd133f0 | |||
| 735c99e8ac | |||
| 9a53399ec9 | |||
| f27276624a | |||
| df149a3cc2 | |||
| 7ca23b9431 | |||
| b27f049c9f | |||
| 23c4a78383 | |||
|
|
c9301d1f8f | ||
|
|
977a0e7a35 | ||
|
|
9143ff5b80 | ||
| 0502dc7508 | |||
| eb689c9852 | |||
|
|
c576bd3bf7 | ||
| 27bac7288c | |||
| a7c69f7c43 | |||
| 33ab825497 | |||
| 22c8ff3b22 | |||
|
|
875d114733 | ||
|
|
bd1fe68060 | ||
| c1d933467e | |||
|
|
e7daf05670 | ||
|
|
e251fc6a1a | ||
| 0e7cc360f7 | |||
| e2d3394669 | |||
| b3ab5d2587 | |||
|
|
ed029139d3 | ||
| 02578546f2 | |||
|
|
09e2f329b7 | ||
|
|
ee2fae105b | ||
| 82efce189a | |||
|
|
be8c14625f | ||
| 95a571d3c3 | |||
| 322001150a | |||
|
|
b805bda25b | ||
| f592f2b580 | |||
|
|
184b2b8fad | ||
|
|
fe029fcb95 | ||
|
|
9143466ce7 | ||
|
|
9409d57243 | ||
| 63603dee08 | |||
|
|
e35bbd9b34 | ||
|
|
ea2173fff4 | ||
| faac7953d3 | |||
| c3cc39973e | |||
| 6d8bfacd0a | |||
|
|
ab5d28e3cb | ||
|
|
2dccb22cf8 | ||
| 6b0bad6047 | |||
| 9ffbdbdf57 | |||
|
|
778f689b3e | ||
|
|
917e3fb2d5 | ||
| e0f1e314a4 | |||
| 2f2ed06a35 | |||
| 277400670d | |||
| a1031109c4 | |||
| 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 |
14
pom.xml
14
pom.xml
@@ -41,9 +41,9 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<!--中间件目标地址-->
|
<!--中间件目标地址-->
|
||||||
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
<!-- <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>192.168.2.130</service.server.url>
|
||||||
<!--docker仓库地址-->
|
<!--docker仓库地址-->
|
||||||
<docker.server.url>192.168.1.22</docker.server.url>
|
<docker.server.url>192.168.1.22</docker.server.url>
|
||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
@@ -53,9 +53,9 @@
|
|||||||
<!--nacos的ip:port-->
|
<!--nacos的ip:port-->
|
||||||
<nacos.password>nacos</nacos.password>
|
<nacos.password>nacos</nacos.password>
|
||||||
<!--服务器发布内容为空-->
|
<!--服务器发布内容为空-->
|
||||||
<!-- <nacos.namespace></nacos.namespace>-->
|
<nacos.namespace>hswbpm</nacos.namespace>
|
||||||
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
<!-- <nacos.namespace>30c701c4-2a94-49d9-82e1-76aa9456573f</nacos.namespace>-->
|
||||||
<nacos.namespace>78588706-e06f-4580-b612-b26d72493fcb</nacos.namespace>
|
<!-- <nacos.namespace>12b467cc-a7e6-411d-8944-090cbfa09dde</nacos.namespace>-->
|
||||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||||
<!-- sentinel:port-->
|
<!-- sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
@@ -81,6 +81,7 @@
|
|||||||
<springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version>
|
<springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version>
|
||||||
<hutool.version>5.8.11</hutool.version>
|
<hutool.version>5.8.11</hutool.version>
|
||||||
<knife4j.version>3.0.2</knife4j.version>
|
<knife4j.version>3.0.2</knife4j.version>
|
||||||
|
<postgresql.version>42.3.8</postgresql.version>
|
||||||
<knife4j.aggregation.version>2.0.8</knife4j.aggregation.version>
|
<knife4j.aggregation.version>2.0.8</knife4j.aggregation.version>
|
||||||
<lombok.version>1.18.18</lombok.version>
|
<lombok.version>1.18.18</lombok.version>
|
||||||
<mybatis.version>2.1.3</mybatis.version>
|
<mybatis.version>2.1.3</mybatis.version>
|
||||||
@@ -171,6 +172,11 @@
|
|||||||
<artifactId>knife4j-spring-ui</artifactId>
|
<artifactId>knife4j-spring-ui</artifactId>
|
||||||
<version>${knife4j.version}</version>
|
<version>${knife4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
<version>${postgresql.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.xiaoymin</groupId>
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
<artifactId>knife4j-aggregation-spring-boot-starter</artifactId>
|
<artifactId>knife4j-aggregation-spring-boot-starter</artifactId>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ import java.util.List;
|
|||||||
* angle_diff_cn C相相位负跳变
|
* angle_diff_cn C相相位负跳变
|
||||||
* bph_max_value 不平衡度(单位%)
|
* bph_max_value 不平衡度(单位%)
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true,value = {"pointer"})
|
||||||
public class BackData extends Structure {
|
public class BackData extends Structure {
|
||||||
public int qvvr_cata_cause[] = new int[256];
|
public int qvvr_cata_cause[] = new int[256];
|
||||||
public int qvvr_phasetype[] = new int[256];
|
public int qvvr_phasetype[] = new int[256];
|
||||||
|
|||||||
@@ -83,10 +83,10 @@ public class EventRelevantAnalysisController extends BaseController {
|
|||||||
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
||||||
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
||||||
String searchValue = baseParam.getSearchValue();
|
String searchValue = baseParam.getSearchValue();
|
||||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
// Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||||
if(pattern.matcher(searchValue).find()){
|
// if(pattern.matcher(searchValue).find()){
|
||||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
// throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||||
}
|
// }
|
||||||
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ public interface QvvrCauseDLL extends Library {
|
|||||||
|
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
String tempDir = System.getProperty("java.io.tmpdir");
|
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)) {
|
try (FileOutputStream out = new FileOutputStream(tempLibFile)) {
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package com.njcn.advance.event.service.impl;
|
package com.njcn.advance.event.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
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.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.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.pojo.dto.EventAnalysisDTO;
|
||||||
import com.njcn.advance.event.service.IEventAdvanceService;
|
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.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.event.file.component.WaveFileComponent;
|
import com.njcn.event.file.component.WaveFileComponent;
|
||||||
@@ -89,8 +86,55 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<List<Float>> listWaveData = waveDataDTO.getListWaveData();
|
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的方式
|
// 暂降原因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_rate = waveDataDTO.getComtradeCfgDTO().getFinalSampleRate();
|
||||||
causeDataStruct.smp_len = listWaveData.size();
|
causeDataStruct.smp_len = listWaveData.size();
|
||||||
// 获取ABC三相的瞬时数据
|
// 获取ABC三相的瞬时数据
|
||||||
@@ -112,45 +156,6 @@ public class EventAdvanceServiceImpl implements IEventAdvanceService {
|
|||||||
}
|
}
|
||||||
System.out.println("暂降原因分析完毕===============");
|
System.out.println("暂降原因分析完毕===============");
|
||||||
System.out.println("cause:" + eventAnalysis);
|
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;
|
return eventAnalysis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ public interface QvvrDLL extends Library {
|
|||||||
|
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
String tempDir = System.getProperty("java.io.tmpdir");
|
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)) {
|
try (FileOutputStream out = new FileOutputStream(tempLibFile)) {
|
||||||
@@ -95,6 +97,8 @@ public interface QvvrDLL extends Library {
|
|||||||
*/
|
*/
|
||||||
void qvvr_fun(QvvrDataStruct data);
|
void qvvr_fun(QvvrDataStruct data);
|
||||||
|
|
||||||
|
void ping();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对应C语言的qvvr_data_struct结构体
|
* 对应C语言的qvvr_data_struct结构体
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
|
|||||||
unblance.add(evaluationResult);
|
unblance.add(evaluationResult);
|
||||||
|
|
||||||
evaluationResult = new AssessResultVO.EvaluationResult();
|
evaluationResult = new AssessResultVO.EvaluationResult();
|
||||||
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200)));
|
evaluationResult.setData(result.getApproUnblance());
|
||||||
evaluationResult.setLimitData(overLimit.getUnblance());
|
evaluationResult.setLimitData(overLimit.getUnblance());
|
||||||
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
||||||
unblance.add(evaluationResult);
|
unblance.add(evaluationResult);
|
||||||
|
|||||||
@@ -322,10 +322,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean deleteEventData(List<String> ids) {
|
public boolean deleteEventData(List<String> ids) {
|
||||||
return this.lambdaUpdate()
|
return this.removeByIds(ids);
|
||||||
.set(SgEvent::getState, DataStateEnum.DELETED.getCode())
|
|
||||||
.in(SgEvent::getId, ids)
|
|
||||||
.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
|
import com.njcn.advance.mapper.govern.voltage.SgMachineMapper;
|
||||||
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgUserParam;
|
||||||
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgUser;
|
||||||
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
import com.njcn.advance.pojo.vo.govern.voltage.SgMachineVO;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
import com.njcn.advance.service.govern.voltage.ISgMachineService;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
@@ -56,12 +58,34 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
|
|||||||
@Override
|
@Override
|
||||||
public String addMachine(SgMachineParam sgMachineParam) {
|
public String addMachine(SgMachineParam sgMachineParam) {
|
||||||
SgMachine sgMachine = new SgMachine();
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
checkMachineName(sgMachineParam, false);
|
||||||
|
|
||||||
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
BeanUtil.copyProperties(sgMachineParam, sgMachine);
|
||||||
//默认为正常状态
|
//默认为正常状态
|
||||||
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
sgMachine.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.save(sgMachine);
|
this.save(sgMachine);
|
||||||
return sgMachine.getId();
|
return sgMachine.getId();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 校验参数,检查是否存在相同名称的业务用户
|
||||||
|
*/
|
||||||
|
private void checkMachineName(SgMachineParam sgMachineParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SgMachine> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(SgMachine::getName, sgMachineParam.getName())
|
||||||
|
.eq(SgMachine::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (sgMachineParam instanceof SgMachineParam.SgMachineUpdateParam) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(SgMachine::getId, ((SgMachineParam.SgMachineUpdateParam) sgMachineParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新设备
|
* 更新设备
|
||||||
@@ -70,6 +94,8 @@ public class SgMachineServiceImpl extends ServiceImpl<SgMachineMapper, SgMachine
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
public boolean updateSgMachine(SgMachineParam.SgMachineUpdateParam updateParam) {
|
||||||
SgMachine sgMachine = new SgMachine();
|
SgMachine sgMachine = new SgMachine();
|
||||||
|
checkMachineName(updateParam, true);
|
||||||
|
|
||||||
BeanUtil.copyProperties(updateParam, sgMachine);
|
BeanUtil.copyProperties(updateParam, sgMachine);
|
||||||
return this.updateById(sgMachine);
|
return this.updateById(sgMachine);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,15 @@ package com.njcn.advance.service.govern.voltage.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.advance.enums.AdvanceResponseEnum;
|
import com.njcn.advance.enums.AdvanceResponseEnum;
|
||||||
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
|
import com.njcn.advance.mapper.govern.voltage.SgSensitiveUnitMapper;
|
||||||
|
import com.njcn.advance.pojo.param.govern.voltage.SgMachineParam;
|
||||||
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
import com.njcn.advance.pojo.param.govern.voltage.SgSensitiveUnitParam;
|
||||||
|
import com.njcn.advance.pojo.po.govern.voltage.SgMachine;
|
||||||
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
import com.njcn.advance.pojo.po.govern.voltage.SgSensitiveUnit;
|
||||||
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
import com.njcn.advance.pojo.vo.govern.voltage.SgSensitiveUnitVO;
|
||||||
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
import com.njcn.advance.service.govern.voltage.ISgSensitiveUnitService;
|
||||||
@@ -54,12 +57,34 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
|
|||||||
@Override
|
@Override
|
||||||
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
public String addSensitiveUnit(SgSensitiveUnitParam sgSensitiveUnitParam) {
|
||||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
checkSensitiveUnitName(sgSensitiveUnitParam, false);
|
||||||
|
|
||||||
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
BeanUtil.copyProperties(sgSensitiveUnitParam, sgSensitiveUnit);
|
||||||
//默认为正常状态
|
//默认为正常状态
|
||||||
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
sgSensitiveUnit.setState(DataStateEnum.ENABLE.getCode());
|
||||||
this.save(sgSensitiveUnit);
|
this.save(sgSensitiveUnit);
|
||||||
return sgSensitiveUnit.getId();
|
return sgSensitiveUnit.getId();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 校验参数,检查是否存在相同名称的业务用户
|
||||||
|
*/
|
||||||
|
private void checkSensitiveUnitName(SgSensitiveUnitParam sgSensitiveUnitParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SgSensitiveUnit> sgUserLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
sgUserLambdaQueryWrapper
|
||||||
|
.eq(SgSensitiveUnit::getName, sgSensitiveUnitParam.getName())
|
||||||
|
.eq(SgSensitiveUnit::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if (sgSensitiveUnitParam instanceof SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) {
|
||||||
|
sgUserLambdaQueryWrapper.ne(SgSensitiveUnit::getId, ((SgSensitiveUnitParam.SgSensitiveUnitUpdateParam) sgSensitiveUnitParam).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int countByAccount = this.count(sgUserLambdaQueryWrapper);
|
||||||
|
//大于等于1个则表示重复
|
||||||
|
if (countByAccount >= 1) {
|
||||||
|
throw new BusinessException(AdvanceResponseEnum.SG_USER_NAME_REPEAT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新元器件
|
* 更新元器件
|
||||||
@@ -69,6 +94,8 @@ public class SgSensitiveUnitServiceImpl extends ServiceImpl<SgSensitiveUnitMappe
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
public boolean updateSgSensitiveUnit(SgSensitiveUnitParam.SgSensitiveUnitUpdateParam updateParam) {
|
||||||
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
SgSensitiveUnit sgSensitiveUnit = new SgSensitiveUnit();
|
||||||
|
checkSensitiveUnitName(updateParam, true);
|
||||||
|
|
||||||
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
BeanUtil.copyProperties(updateParam, sgSensitiveUnit);
|
||||||
return this.updateById(sgSensitiveUnit);
|
return this.updateById(sgSensitiveUnit);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ import io.swagger.models.auth.In;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -471,6 +473,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||||
|
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
||||||
|
|
||||||
if (map.containsKey(item.getLineId())) {
|
if (map.containsKey(item.getLineId())) {
|
||||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||||
item.setGdName(areaLineInfoVO.getGdName());
|
item.setGdName(areaLineInfoVO.getGdName());
|
||||||
@@ -489,7 +493,17 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 四舍五入保留两位小数
|
||||||
|
*/
|
||||||
|
private Double roundHalfUp(double num) {
|
||||||
|
if (num == 3.14159) {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
BigDecimal b = new BigDecimal(num);
|
||||||
|
//保留2位小数
|
||||||
|
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||||
@@ -498,7 +512,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
lambdaQueryWrapper.like(RmpEventDetailAssPO::getContentDes, baseParam.getSearchValue());
|
||||||
}
|
}
|
||||||
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
lambdaQueryWrapper.between(RmpEventDetailAssPO::getTimeId, timeV.get(0), timeV.get(1))
|
||||||
.orderByAsc(RmpEventDetailAssPO::getTimeId);
|
.orderByDesc(RmpEventDetailAssPO::getTimeId);
|
||||||
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
return rmpEventDetailAssMapper.selectPage(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -720,7 +734,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
|||||||
|
|
||||||
List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime);
|
List<AdvanceEventDetailVO> advanceEventDetailVOLsit = querySagEventsAll(startTime, endTime);
|
||||||
|
|
||||||
|
advanceEventDetailVOLsit = advanceEventDetailVOLsit.stream().filter(temp-> StringUtils.isNotEmpty(temp.getAdvanceType())).collect(Collectors.toList());
|
||||||
for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号
|
for (AdvanceEventDetailVO advanceEventDetailVO : advanceEventDetailVOLsit) { // 获取监测点线路序号
|
||||||
//母线id
|
//母线id
|
||||||
String nodePhysics = advanceEventDetailVO.getVoltageId();
|
String nodePhysics = advanceEventDetailVO.getVoltageId();
|
||||||
@@ -854,6 +868,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( ) {
|
public Map<String, EntityMtrans> getNodeInfo( ) {
|
||||||
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
Map<String, EntityMtrans> entityMtranMap = new HashMap<>(32);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,13 @@ public class EventWaveAnalysisServiceImpl implements EventWaveAnalysisService {
|
|||||||
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG);
|
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG);
|
||||||
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT);
|
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
|
try {
|
||||||
|
inputStreamCfg = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.CFG.toLowerCase());
|
||||||
|
inputStreamDat = fileStorageUtil.getFileStream(OssPath.WAVE_DIR + lineDetailDataVO.getIp() + StrUtil.SLASH + rmpEventDetailPO.getWavePath() + GeneralConstant.DAT.toLowerCase());
|
||||||
|
} catch (Exception e1) {
|
||||||
|
|
||||||
|
throw new BusinessException("暂降cfg,dat文件缺失,请联系管理员");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//读取
|
//读取
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -88,7 +88,7 @@ public class BpmSignParam extends BaseEntity implements Serializable {
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty("标识key")
|
@ApiModelProperty("标识key")
|
||||||
private String key;
|
private String signKey;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.DependsOn;
|
|||||||
* @date 2022/11/10
|
* @date 2022/11/10
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@DependsOn("proxyMapperRegister")
|
|
||||||
@MapperScan("com.njcn.**.mapper")
|
@MapperScan("com.njcn.**.mapper")
|
||||||
@EnableFeignClients(basePackages = "com.njcn")
|
@EnableFeignClients(basePackages = "com.njcn")
|
||||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ public class BpmCategoryServiceImpl extends ServiceImpl<BpmCategoryMapper, BpmCa
|
|||||||
@Override
|
@Override
|
||||||
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
|
public Page<BpmCategoryVO> getCategoryPage(BpmCategoryParam.BpmCategoryQueryParam bpmCategoryQueryParam) {
|
||||||
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BpmCategoryVO> categoryVOQueryWrapper = new QueryWrapper<>();
|
||||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getName())) {
|
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getSearchValue())) {
|
||||||
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getName());
|
categoryVOQueryWrapper.like("bpm_category.name", bpmCategoryQueryParam.getSearchValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {
|
if (StrUtil.isNotBlank(bpmCategoryQueryParam.getCode())) {
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ public class BpmSignServiceImpl extends ServiceImpl<BpmSignMapper, BpmSign> impl
|
|||||||
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
|
bpmSignVOQueryWrapper.like("bpm_sign.name", bpmSignQueryParam.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(bpmSignQueryParam.getKey())) {
|
if (StrUtil.isNotBlank(bpmSignQueryParam.getSignKey())) {
|
||||||
bpmSignVOQueryWrapper.like("bpm_sign.signKey", bpmSignQueryParam.getKey());
|
bpmSignVOQueryWrapper.like("bpm_sign.sign_key", bpmSignQueryParam.getSignKey());
|
||||||
}
|
}
|
||||||
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
bpmSignVOQueryWrapper.eq("bpm_sign.state", DataStateEnum.ENABLE.getCode());
|
||||||
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
bpmSignVOQueryWrapper.orderByAsc("bpm_sign.sort");
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ public interface PatternRegex {
|
|||||||
String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";
|
String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称由汉字组成,长度为0-20
|
* 部门名称由汉字组成,长度为0-32 (前端统一32了这边改下长度)
|
||||||
*/
|
*/
|
||||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$";
|
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,32}$";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号
|
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号
|
||||||
@@ -258,7 +258,7 @@ public interface PatternRegex {
|
|||||||
/**
|
/**
|
||||||
* 任意字符,长度在1-20位,常用于名称、编码等常规录入
|
* 任意字符,长度在1-20位,常用于名称、编码等常规录入
|
||||||
*/
|
*/
|
||||||
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,20}$";
|
String ALL_CHAR_1_20 = "^[-_A-Za-z0-9\\u4e00-\\u9fa5]{1,32}$";
|
||||||
|
|
||||||
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
|
String SPECIALCHARACTER ="[<>%'%;()&+/\\\\-\\\\\\\\_|@*?#$!,.]|html";
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,12 @@ public class SimpleDTO implements Serializable {
|
|||||||
@ApiModelProperty(name = "value", value = "数值")
|
@ApiModelProperty(name = "value", value = "数值")
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对云南曲靖特殊处理的五层树标识符
|
||||||
|
* 特殊在不显示供电公司,显示(变电站、线路)这两个是部门的名称+母线_监测点的名称
|
||||||
|
*/
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
private Integer algoDescribe;
|
private Integer algoDescribe;
|
||||||
|
|||||||
@@ -57,6 +57,11 @@
|
|||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--vastbase驱动用postgresql-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.postgresql</groupId>
|
||||||
|
<artifactId>postgresql</artifactId>
|
||||||
|
</dependency>
|
||||||
<!--达梦驱动-->
|
<!--达梦驱动-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.dameng</groupId>
|
<groupId>com.dameng</groupId>
|
||||||
@@ -69,6 +74,12 @@
|
|||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||||
|
<version>3.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--数据库相关********end-->
|
<!--数据库相关********end-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ public class PieGenerator {
|
|||||||
Option reasonOption = new Option();
|
Option reasonOption = new Option();
|
||||||
//取消渲染动画
|
//取消渲染动画
|
||||||
reasonOption.setAnimation(false);
|
reasonOption.setAnimation(false);
|
||||||
|
String[] colorArr = {"#526ADE", "#00BFF5","#FFBF00","#77DA63","#D5FF6B"};
|
||||||
|
reasonOption.setColor(colorArr);
|
||||||
//背景色
|
//背景色
|
||||||
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
reasonOption.setBackgroundColor(PicCommonData.PIC_BACK_COLOR);
|
||||||
//标题
|
//标题
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class BusinessDataUtil {
|
|||||||
List<List<Double>> unTolerateData = new ArrayList<>();
|
List<List<Double>> unTolerateData = new ArrayList<>();
|
||||||
for (List<Double> list : originData) {
|
for (List<Double> list : originData) {
|
||||||
//是否超过上限
|
//是否超过上限
|
||||||
if (list.get(0) <= 0.03) {
|
if (list.get(0) <= 0.003) {
|
||||||
int line = 230 - 30000 * list.get(0).intValue();
|
int line = 230 - 30000 * list.get(0).intValue();
|
||||||
if (list.get(1) > line) {
|
if (list.get(1) > line) {
|
||||||
unTolerateData.add(list);
|
unTolerateData.add(list);
|
||||||
|
|||||||
@@ -34,24 +34,24 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void environmentPrepared(ConfigurableEnvironment environment) {
|
public void environmentPrepared(ConfigurableEnvironment environment) {
|
||||||
// String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
/* String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
||||||
// String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
||||||
// String projectName = environment.getProperty("microservice.ename");
|
String projectName = environment.getProperty("microservice.ename");
|
||||||
// String logLevel = environment.getProperty("logging.level.root");
|
String logLevel = environment.getProperty("logging.level.root");
|
||||||
// String url = String.format("http://%s/nacos/v1/cs/configs?tenant=%s&group=DEFAULT_GROUP&dataId=logback.xml", serverAddr, namespace);
|
String url = String.format("http://%s/nacos/v1/cs/configs?tenant=%s&group=DEFAULT_GROUP&dataId=logback.xml", serverAddr, namespace);
|
||||||
// HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
// headers.set("cndl408125hawen", "lanxia201");
|
headers.set("cndl408125hawen", "lanxia201");
|
||||||
// HttpEntity<String> entity = new HttpEntity<>(headers);
|
HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||||
// RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
// ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
|
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
|
||||||
// if (response.getStatusCode().is2xxSuccessful()) {
|
if (response.getStatusCode().is2xxSuccessful()) {
|
||||||
// String logbackConfigContent = response.getBody();
|
String logbackConfigContent = response.getBody();
|
||||||
// //替换项目名称
|
//替换项目名称
|
||||||
// logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
||||||
// logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
||||||
// // 应用获取到的Logback配置
|
// 应用获取到的Logback配置
|
||||||
// applyLogbackConfig(logbackConfigContent);
|
applyLogbackConfig(logbackConfigContent);
|
||||||
// }
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyLogbackConfig(String logbackConfigContent) {
|
private void applyLogbackConfig(String logbackConfigContent) {
|
||||||
|
|||||||
@@ -48,6 +48,28 @@
|
|||||||
<artifactId>minioss-springboot-starter</artifactId>
|
<artifactId>minioss-springboot-starter</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>aliyun-oss-springboot-starter</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.18.0</version>
|
||||||
|
<optional>false</optional>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -13,6 +13,7 @@ public interface GeneralConstant {
|
|||||||
Integer LOCAL_DISK = 1;
|
Integer LOCAL_DISK = 1;
|
||||||
Integer HUAWEI_OBS = 2;
|
Integer HUAWEI_OBS = 2;
|
||||||
Integer MINIO_OSS = 3;
|
Integer MINIO_OSS = 3;
|
||||||
|
Integer AliYUN_OSS = 4;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 波形文件的3种后缀
|
* 波形文件的3种后缀
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ public interface OssPath {
|
|||||||
*/
|
*/
|
||||||
String WAVE_DIR="comtrade/";
|
String WAVE_DIR="comtrade/";
|
||||||
|
|
||||||
|
String WAVE_FILE="wave/";
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 下载文件
|
* 下载文件
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.njcn.oss.utils;
|
package com.njcn.oss.utils;
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.lang.UUID;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.njcn.ali.oss.util.AliYunOssUtils;
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.huawei.obs.util.OBSUtil;
|
import com.njcn.huawei.obs.util.OBSUtil;
|
||||||
@@ -13,7 +13,6 @@ import com.njcn.oss.constant.GeneralConstant;
|
|||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
import com.njcn.oss.enums.OssResponseEnum;
|
import com.njcn.oss.enums.OssResponseEnum;
|
||||||
import io.minio.*;
|
import io.minio.*;
|
||||||
import io.minio.errors.*;
|
|
||||||
import io.minio.messages.Item;
|
import io.minio.messages.Item;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -66,6 +65,11 @@ public class FileStorageUtil {
|
|||||||
|
|
||||||
private final MinIossProperties minIossProperties;
|
private final MinIossProperties minIossProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阿里云文件服务器
|
||||||
|
*/
|
||||||
|
private final AliYunOssUtils aliYunOssUtils;
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 上传MultipartFile文件,
|
* 上传MultipartFile文件,
|
||||||
@@ -79,7 +83,7 @@ public class FileStorageUtil {
|
|||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||||
obsUtil.uploadMultipart(multipartFile, filePath);
|
obsUtil.uploadMultipart(multipartFile, filePath);
|
||||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir);
|
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir);
|
||||||
@@ -87,11 +91,15 @@ public class FileStorageUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||||
}
|
}
|
||||||
}else {
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
filePath = dir;
|
||||||
|
aliYunOssUtils.uploadFile(dir, multipartFile);
|
||||||
|
} else {
|
||||||
try {
|
try {
|
||||||
// 构建完整目录:基准目录 + dir子目录
|
// 构建完整目录:基准目录 + dir子目录
|
||||||
Path basePath = Paths.get(generalInfo.getLocalStorePath());
|
Path basePath = Paths.get(generalInfo.getLocalStorePath());
|
||||||
Path uploadPath = basePath.resolve(dir); // 将dir作为子目录添加
|
// 将dir作为子目录添加
|
||||||
|
Path uploadPath = basePath.resolve(dir);
|
||||||
|
|
||||||
// 确保完整目录存在(包括dir子目录)
|
// 确保完整目录存在(包括dir子目录)
|
||||||
if (!Files.exists(uploadPath)) {
|
if (!Files.exists(uploadPath)) {
|
||||||
@@ -135,6 +143,9 @@ public class FileStorageUtil {
|
|||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||||
obsUtil.uploadMultipart(multipartFile, filePath);
|
obsUtil.uploadMultipart(multipartFile, filePath);
|
||||||
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
filePath = dir;
|
||||||
|
aliYunOssUtils.uploadFile(dir, multipartFile);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
@@ -160,7 +171,7 @@ public class FileStorageUtil {
|
|||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
filePath = dir + minIoUtils.minFileName(fileName);
|
filePath = dir + minIoUtils.minFileName(fileName);
|
||||||
obsUtil.uploadStream(inputStream, filePath);
|
obsUtil.uploadStream(inputStream, filePath);
|
||||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.uploadStream(inputStream, minIossProperties.getBucket(), dir, minIoUtils.minFileName(fileName));
|
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.uploadStream(inputStream, minIossProperties.getBucket(), dir, minIoUtils.minFileName(fileName));
|
||||||
@@ -168,14 +179,17 @@ public class FileStorageUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||||
}
|
}
|
||||||
}else {
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
filePath = dir + fileName;
|
||||||
|
aliYunOssUtils.uploadFile(filePath, inputStream);
|
||||||
|
} else {
|
||||||
// 本地存储逻辑
|
// 本地存储逻辑
|
||||||
try {
|
try {
|
||||||
// 1. 获取本地存储路径
|
// 1. 获取本地存储路径
|
||||||
String localStoragePath = generalInfo.getLocalStorePath();
|
String localStoragePath = generalInfo.getLocalStorePath();
|
||||||
|
|
||||||
// 2. 确保目录存在(如果不存在则创建)
|
// 2. 确保目录存在(如果不存在则创建)
|
||||||
File targetDir = new File(localStoragePath +File.separator+ dir);
|
File targetDir = new File(localStoragePath + File.separator + dir);
|
||||||
if (!targetDir.exists()) {
|
if (!targetDir.exists()) {
|
||||||
boolean created = targetDir.mkdirs();
|
boolean created = targetDir.mkdirs();
|
||||||
if (!created) {
|
if (!created) {
|
||||||
@@ -193,7 +207,7 @@ public class FileStorageUtil {
|
|||||||
// 5. 返回相对路径
|
// 5. 返回相对路径
|
||||||
filePath = dir + finalFileName;
|
filePath = dir + finalFileName;
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR,e.getMessage());
|
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return filePath;
|
return filePath;
|
||||||
@@ -209,6 +223,9 @@ public class FileStorageUtil {
|
|||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
filePath = dir + minIoUtils.minFileName(fileName);
|
filePath = dir + minIoUtils.minFileName(fileName);
|
||||||
obsUtil.uploadStream(inputStream, filePath);
|
obsUtil.uploadStream(inputStream, filePath);
|
||||||
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
filePath = dir + fileName;
|
||||||
|
aliYunOssUtils.uploadFile(filePath, inputStream);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
//把名称存入数据
|
//把名称存入数据
|
||||||
@@ -232,6 +249,8 @@ public class FileStorageUtil {
|
|||||||
String url;
|
String url;
|
||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
url = obsUtil.getFileUrl(filePath);
|
url = obsUtil.getFileUrl(filePath);
|
||||||
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
url = aliYunOssUtils.generatePresignedUrl(filePath, 3600);
|
||||||
} else {
|
} else {
|
||||||
url = minIoUtils.getObjectUrl(minIossProperties.getBucket(), filePath, 7 * 24 * 60 * 60);
|
url = minIoUtils.getObjectUrl(minIossProperties.getBucket(), filePath, 7 * 24 * 60 * 60);
|
||||||
}
|
}
|
||||||
@@ -250,10 +269,12 @@ public class FileStorageUtil {
|
|||||||
try {
|
try {
|
||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
inputStream = obsUtil.downloadStream(filePath);
|
inputStream = obsUtil.downloadStream(filePath);
|
||||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||||
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
||||||
}else {
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+filePath);
|
inputStream = aliYunOssUtils.downloadStream(filePath);
|
||||||
|
} else {
|
||||||
|
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + filePath);
|
||||||
inputStream = Files.newInputStream(path);
|
inputStream = Files.newInputStream(path);
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
@@ -274,11 +295,13 @@ public class FileStorageUtil {
|
|||||||
try {
|
try {
|
||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
inputStream = obsUtil.downloadStream(filePath);
|
inputStream = obsUtil.downloadStream(filePath);
|
||||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||||
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
||||||
}else {
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
inputStream = aliYunOssUtils.downloadStream(filePath);
|
||||||
|
} else {
|
||||||
// 本地存储处理
|
// 本地存储处理
|
||||||
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+filePath);
|
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + filePath);
|
||||||
inputStream = Files.newInputStream(path);
|
inputStream = Files.newInputStream(path);
|
||||||
|
|
||||||
// 设置下载文件名(从路径中提取)
|
// 设置下载文件名(从路径中提取)
|
||||||
@@ -331,14 +354,16 @@ public class FileStorageUtil {
|
|||||||
public void deleteFile(String fileName) {
|
public void deleteFile(String fileName) {
|
||||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
obsUtil.delete(fileName);
|
obsUtil.delete(fileName);
|
||||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||||
minIoUtils.removeObject(minIossProperties.getBucket(), fileName);
|
minIoUtils.removeObject(minIossProperties.getBucket(), fileName);
|
||||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+fileName);
|
aliYunOssUtils.deleteFile(fileName);
|
||||||
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||||
|
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + fileName);
|
||||||
try {
|
try {
|
||||||
Files.delete(path);
|
Files.delete(path);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
log.info("删除本地文件{}失败失败原因{}", path,e.getMessage());
|
log.info("删除本地文件{}失败失败原因{}", path, e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,9 +434,10 @@ public class FileStorageUtil {
|
|||||||
|
|
||||||
file = File.createTempFile(lastItem.objectName(), "xlsx");
|
file = File.createTempFile(lastItem.objectName(), "xlsx");
|
||||||
FileUtil.writeFromStream(stream, file);
|
FileUtil.writeFromStream(stream, file);
|
||||||
}else if(generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS){
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||||
file = obsUtil.getLastFile(OssPath.LOGBAK);
|
file = obsUtil.getLastFile(OssPath.LOGBAK);
|
||||||
|
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||||
|
file = aliYunOssUtils.getLastFile(directory);
|
||||||
}
|
}
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,22 @@ public enum RedisKeyEnum {
|
|||||||
/**
|
/**
|
||||||
* 云前置心跳
|
* 云前置心跳
|
||||||
*/
|
*/
|
||||||
CLD_HEART_BEAT_KEY("CLD_HEART_BEAT:", 180L);
|
CLD_HEART_BEAT_KEY("CLD_HEART_BEAT:", 180L),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户日志队列
|
||||||
|
*/
|
||||||
|
USER_LOG_QUEUE("USER_LOG_QUEUE", -1L),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户日志邮件推送队列
|
||||||
|
*/
|
||||||
|
USER_LOG_EMAIL_QUEUE("USER_LOG_EMAIL_QUEUE", -1L),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终端日志
|
||||||
|
*/
|
||||||
|
DEVICE_LOG_QUEUE("DEVICE_LOG_QUEUE", -1L);
|
||||||
|
|
||||||
|
|
||||||
private final String key;
|
private final String key;
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.njcn.redis.utils;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redis 消息队列工具类
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RedisMessageQueueUtil {
|
||||||
|
|
||||||
|
private final RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送消息到队列(左推)
|
||||||
|
*
|
||||||
|
* @param queueKey 队列Key
|
||||||
|
* @param message 消息内容(JSON字符串)
|
||||||
|
*/
|
||||||
|
public void pushMessage(String queueKey, String message) {
|
||||||
|
try {
|
||||||
|
redisTemplate.opsForList().leftPush(queueKey, message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("推送消息到队列失败,queueKey={}", queueKey, e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 阻塞式弹出消息(右弹)
|
||||||
|
*
|
||||||
|
* @param queueKey 队列Key
|
||||||
|
* @param timeout 超时时间(秒)
|
||||||
|
* @return 消息内容,超时返回null
|
||||||
|
*/
|
||||||
|
public String popMessage(String queueKey, long timeout) {
|
||||||
|
try {
|
||||||
|
Object result = redisTemplate.opsForList().rightPop(queueKey, timeout, TimeUnit.SECONDS);
|
||||||
|
return result != null ? result.toString() : null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("弹出消息失败,queueKey={}", queueKey, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取队列长度(用于监控)
|
||||||
|
*
|
||||||
|
* @param queueKey 队列Key
|
||||||
|
* @return 队列长度
|
||||||
|
*/
|
||||||
|
public Long getQueueSize(String queueKey) {
|
||||||
|
try {
|
||||||
|
return redisTemplate.opsForList().size(queueKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("获取队列长度失败,queueKey={}", queueKey, e);
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,9 @@ public class Knife4jSwaggerConfig {
|
|||||||
@Value("${microservice.gateway.url}")
|
@Value("${microservice.gateway.url}")
|
||||||
private String gatewayUrl;
|
private String gatewayUrl;
|
||||||
|
|
||||||
|
@Value("${swagger.enable:true}")
|
||||||
|
private Boolean swaggerEnable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* swagger通用配置
|
* swagger通用配置
|
||||||
*/
|
*/
|
||||||
@@ -81,7 +84,9 @@ public class Knife4jSwaggerConfig {
|
|||||||
"com.njcn.supervision.controller",
|
"com.njcn.supervision.controller",
|
||||||
"com.njcn.algorithm",
|
"com.njcn.algorithm",
|
||||||
"com.njcn.dataProcess",
|
"com.njcn.dataProcess",
|
||||||
"com.njcn.migration"
|
"com.njcn.migration",
|
||||||
|
"com.njcn.harmonic.rstatlimitrate.controller",
|
||||||
|
"com.njcn.device.device.controller"
|
||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<GrantType> grantTypes = new ArrayList<>();
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
@@ -94,7 +99,7 @@ public class Knife4jSwaggerConfig {
|
|||||||
//securyContext
|
//securyContext
|
||||||
return new Docket(DocumentationType.SWAGGER_2)
|
return new Docket(DocumentationType.SWAGGER_2)
|
||||||
.apiInfo(apiInfo())
|
.apiInfo(apiInfo())
|
||||||
.enable(true)
|
.enable(swaggerEnable)
|
||||||
.select()
|
.select()
|
||||||
// 指定添加swagger注解的方法
|
// 指定添加swagger注解的方法
|
||||||
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public class FeignConfig {
|
|||||||
@Bean
|
@Bean
|
||||||
public Decoder feignDecoder() {
|
public Decoder feignDecoder() {
|
||||||
return (response, type) -> {
|
return (response, type) -> {
|
||||||
|
|
||||||
String bodyStr = Util.toString(response.body().asReader(Util.UTF_8));
|
String bodyStr = Util.toString(response.body().asReader(Util.UTF_8));
|
||||||
//对结果进行转换
|
//对结果进行转换
|
||||||
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
|
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
|
||||||
@@ -60,6 +61,8 @@ public class FeignConfig {
|
|||||||
}
|
}
|
||||||
switch (commonResponseEnum) {
|
switch (commonResponseEnum) {
|
||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
|
// case NO_DATA:
|
||||||
|
// case FAIL:
|
||||||
return result;
|
return result;
|
||||||
default:
|
default:
|
||||||
throw new BusinessException(result);
|
throw new BusinessException(result);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public interface ValidMessage {
|
|||||||
|
|
||||||
String NAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
String NAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
||||||
|
|
||||||
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过20字符,请检查name参数";
|
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过32字符,请检查name参数";
|
||||||
|
|
||||||
String INDUSTRY_NOT_BLANK = "行业不能为空,请检查industry参数";
|
String INDUSTRY_NOT_BLANK = "行业不能为空,请检查industry参数";
|
||||||
String INDUSTRY_FORMAT_ERROR = "行业格式错误,请检查industry参数";
|
String INDUSTRY_FORMAT_ERROR = "行业格式错误,请检查industry参数";
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.njcn.web.service.impl;
|
package com.njcn.web.service.impl;
|
||||||
|
|
||||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
|
||||||
import com.njcn.common.config.GeneralInfo;
|
import com.njcn.common.config.GeneralInfo;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
|
||||||
import com.njcn.common.pojo.constant.LogInfo;
|
import com.njcn.common.pojo.constant.LogInfo;
|
||||||
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
import com.njcn.common.pojo.dto.DeviceLogDTO;
|
||||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||||
@@ -10,6 +8,8 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.common.utils.ReflectCommonUtil;
|
import com.njcn.common.utils.ReflectCommonUtil;
|
||||||
|
import com.njcn.redis.pojo.enums.RedisKeyEnum;
|
||||||
|
import com.njcn.redis.utils.RedisMessageQueueUtil;
|
||||||
import com.njcn.web.advice.DeviceLog;
|
import com.njcn.web.advice.DeviceLog;
|
||||||
import com.njcn.web.service.ILogService;
|
import com.njcn.web.service.ILogService;
|
||||||
import com.njcn.web.utils.RequestUtil;
|
import com.njcn.web.utils.RequestUtil;
|
||||||
@@ -46,8 +46,15 @@ public class LogServiceImpl implements ILogService {
|
|||||||
|
|
||||||
|
|
||||||
private final GeneralInfo generalInfo;
|
private final GeneralInfo generalInfo;
|
||||||
|
/**
|
||||||
|
* mqtt处理日志异步发布
|
||||||
|
*/
|
||||||
|
// private final MqttPublisher publisher;
|
||||||
|
|
||||||
private final MqttPublisher publisher;
|
/**
|
||||||
|
* redis队列处理日志异步发布
|
||||||
|
*/
|
||||||
|
private final RedisMessageQueueUtil redisMessageQueueUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,14 +89,27 @@ public class LogServiceImpl implements ILogService {
|
|||||||
String operateType = ReflectCommonUtil.getOperateTypeByMethod(returnType.getMethod());
|
String operateType = ReflectCommonUtil.getOperateTypeByMethod(returnType.getMethod());
|
||||||
Integer severity = levelStringToNumber(level);
|
Integer severity = levelStringToNumber(level);
|
||||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, userName, ip, methodDescribe, operateType, result.equalsIgnoreCase("失败") ? 0 : 1, "", severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
// publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
|
||||||
|
redisMessageQueueUtil.pushMessage(
|
||||||
|
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
|
||||||
|
PubUtils.obj2json(logInfoDTO)
|
||||||
|
);
|
||||||
|
|
||||||
//推送审计消息功能
|
//推送审计消息功能
|
||||||
if (severity != 0) {
|
if (severity != 0) {
|
||||||
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
|
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
|
||||||
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
/**注意,此处是给前端推送的,如果没有了mqtt协议,此处前端就无消息可消费了*/
|
||||||
|
// publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
|
||||||
//发送邮箱功能
|
//发送邮箱功能
|
||||||
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
||||||
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
|
||||||
|
// redisMessageQueueUtil.pushMessage(
|
||||||
|
// RedisKeyEnum.USER_LOG_EMAIL_QUEUE.getKey(),
|
||||||
|
// PubUtils.obj2json(logInfoDTO)
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,8 +117,11 @@ public class LogServiceImpl implements ILogService {
|
|||||||
if (Objects.nonNull((returnType.getMethod())) && (returnType.getMethod()).isAnnotationPresent(DeviceLog.class)) {
|
if (Objects.nonNull((returnType.getMethod())) && (returnType.getMethod()).isAnnotationPresent(DeviceLog.class)) {
|
||||||
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
|
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
|
||||||
DeviceLogDTO deviceLogDTO = new DeviceLogDTO(userName, deviceOperate, result.equalsIgnoreCase("失败") ? 0 : 1, "", loginName, userIndex);
|
DeviceLogDTO deviceLogDTO = new DeviceLogDTO(userName, deviceOperate, result.equalsIgnoreCase("失败") ? 0 : 1, "", loginName, userIndex);
|
||||||
publisher.send("/deviceLog", PubUtils.obj2json(deviceLogDTO), 2, false);
|
// publisher.send("/deviceLog", PubUtils.obj2json(deviceLogDTO), 2, false);
|
||||||
|
redisMessageQueueUtil.pushMessage(
|
||||||
|
RedisKeyEnum.DEVICE_LOG_QUEUE.getKey(),
|
||||||
|
PubUtils.obj2json(deviceLogDTO)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +158,11 @@ public class LogServiceImpl implements ILogService {
|
|||||||
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
|
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
|
||||||
Integer severity = levelStringToNumber(level);
|
Integer severity = levelStringToNumber(level);
|
||||||
LogInfoDTO logInfoDTO = new LogInfoDTO(tempLogInfo.getLoginName(), tempLogInfo.getUserName(), tempLogInfo.getIp(), ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
LogInfoDTO logInfoDTO = new LogInfoDTO(tempLogInfo.getLoginName(), tempLogInfo.getUserName(), tempLogInfo.getIp(), ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), userIndex, LocalDateTime.now());
|
||||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
|
// publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
|
||||||
|
redisMessageQueueUtil.pushMessage(
|
||||||
|
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
|
||||||
|
PubUtils.obj2json(logInfoDTO)
|
||||||
|
);
|
||||||
auditPush(severity, logInfoDTO);
|
auditPush(severity, logInfoDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +190,11 @@ public class LogServiceImpl implements ILogService {
|
|||||||
Integer severity = levelStringToNumber(level);
|
Integer severity = levelStringToNumber(level);
|
||||||
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
|
String operateType = ReflectCommonUtil.getOperateTypeByMethod(method);
|
||||||
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, "", ip, ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), loginName, LocalDateTime.now());
|
LogInfoDTO logInfoDTO = new LogInfoDTO(loginName, "", ip, ReflectCommonUtil.getMethodDescribeByMethod(method), operateType, result.equalsIgnoreCase("失败") ? 0 : 1, message, severity, type.equalsIgnoreCase("业务事件") ? 0 : 1, generalInfo.getMicroServiceName(), loginName, LocalDateTime.now());
|
||||||
publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
|
// publisher.send("/userLog", PubUtils.obj2json(logInfoDTO), 1, false);
|
||||||
|
redisMessageQueueUtil.pushMessage(
|
||||||
|
RedisKeyEnum.USER_LOG_QUEUE.getKey(),
|
||||||
|
PubUtils.obj2json(logInfoDTO)
|
||||||
|
);
|
||||||
auditPush(severity, logInfoDTO);
|
auditPush(severity, logInfoDTO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +202,12 @@ public class LogServiceImpl implements ILogService {
|
|||||||
//推送审计消息功能
|
//推送审计消息功能
|
||||||
if (severity != 0) {
|
if (severity != 0) {
|
||||||
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
|
if (!logInfoDTO.getLoginName().equals(LogInfo.UNKNOWN_USER)) {
|
||||||
publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
/**注意,此处是给前端推送的,如果没有了mqtt协议,此处前端就无消息可消费了*/
|
||||||
|
// publisher.send("/userLogPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
// redisMessageQueueUtil.pushMessage(
|
||||||
|
// RedisKeyEnum.USER_LOG_QUEUE.getKey(),
|
||||||
|
// PubUtils.obj2json(logInfoDTO)
|
||||||
|
// );
|
||||||
//发送邮箱功能
|
//发送邮箱功能
|
||||||
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
if (severity == 2 && logInfoDTO.getResult() == 0) {
|
||||||
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.njcn.web.utils;
|
package com.njcn.web.utils;
|
||||||
|
|
||||||
import org.springframework.http.HttpEntity;
|
import org.slf4j.Logger;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.*;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
@@ -15,8 +15,11 @@ import java.util.Map;
|
|||||||
* @createDate 2019-02-08
|
* @createDate 2019-02-08
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class RestTemplateUtil {
|
public class RestTemplateUtil {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RestTemplateUtil.class);
|
||||||
|
|
||||||
private static final RestTemplate restTemplate = new RestTemplate();
|
private static final RestTemplate restTemplate = new RestTemplate();
|
||||||
|
|
||||||
// ----------------------------------GET-------------------------------------------------------
|
// ----------------------------------GET-------------------------------------------------------
|
||||||
@@ -263,6 +266,24 @@ public class RestTemplateUtil {
|
|||||||
return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
|
return restTemplate.exchange(url, HttpMethod.POST, requestEntity, responseType, uriVariables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public <T> ResponseEntity<T> post(String url, Object requestBody, HttpHeaders headers, Class<T> responseType) {
|
||||||
|
try {
|
||||||
|
if (headers == null) {
|
||||||
|
headers = new HttpHeaders();
|
||||||
|
}
|
||||||
|
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||||
|
|
||||||
|
HttpEntity<Object> entity = new HttpEntity<>(requestBody, headers);
|
||||||
|
log.info("发送POST请求到: {}", url);
|
||||||
|
ResponseEntity<T> response = restTemplate.postForEntity(url, entity, responseType);
|
||||||
|
log.info("POST请求响应状态: {}", response.getStatusCode());
|
||||||
|
return response;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("POST请求异常: {}", e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------PUT-------------------------------------------------------
|
// ----------------------------------PUT-------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
<artifactId>pqs-influx</artifactId>
|
<artifactId>pqs-influx</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ public interface CommTerminalGeneralClient {
|
|||||||
@PostMapping("deptGetLine")
|
@PostMapping("deptGetLine")
|
||||||
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||||
|
|
||||||
|
@PostMapping("deptGetLineInfo")
|
||||||
|
HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("deptGetAllLine")
|
||||||
|
HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(@RequestBody @Validated DeptGetLineParam deptGetLineParam);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位获取所有变电站
|
* 根据单位获取所有变电站
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import com.njcn.device.biz.utils.DeviceEnumUtil;
|
|||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -50,6 +51,19 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(DeptGetLineParam deptGetLineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据部门获取监测点信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DeptGetChildrenMoreDTO>> deptGetAllLine(DeptGetLineParam deptGetLineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "根据单位获取all监测点信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString());
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public enum DeviceResponseEnum {
|
|||||||
|
|
||||||
DEVICE_SAME_NAME("A0290","设备名称已存在"),
|
DEVICE_SAME_NAME("A0290","设备名称已存在"),
|
||||||
DEVICE_REPETITION("A0291","设备名称重复"),
|
DEVICE_REPETITION("A0291","设备名称重复"),
|
||||||
|
MODEL_NAME_REPEAT("A00350","名称不可重复"),
|
||||||
DEVICE_IP_REPETITION("A0292","设备ip端口号重复"),
|
DEVICE_IP_REPETITION("A0292","设备ip端口号重复"),
|
||||||
DEVICE_SAME_IP("A0293","当前设备ip端口号已存在"),
|
DEVICE_SAME_IP("A0293","当前设备ip端口号已存在"),
|
||||||
DEVICE_EMPTY("A0294","设备为空"),
|
DEVICE_EMPTY("A0294","设备为空"),
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.njcn.device.biz.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
@DS("sjzx")
|
||||||
|
@Mapper
|
||||||
|
public interface OverLimitWlMapper extends BaseMapper<Overlimit> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.device.biz.mapper;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @since 2022-01-04
|
||||||
|
*/
|
||||||
|
public interface OverlimitMapper extends BaseMapper<Overlimit> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有在线投运的监测点限值
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2022/3/23
|
||||||
|
*/
|
||||||
|
List<Overlimit> getAllLineOverLimit(@Param("list") List<Integer> list);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.biz.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.device.biz.pojo.po.PqSensitiveUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-11-17
|
||||||
|
*/
|
||||||
|
public interface PqSensitiveUserMapper extends BaseMapper<PqSensitiveUser> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?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.biz.mapper.OverlimitMapper">
|
||||||
|
|
||||||
|
<select id="getAllLineOverLimit" resultType="com.njcn.device.biz.pojo.po.Overlimit">
|
||||||
|
select f.* from pq_line a
|
||||||
|
inner join pq_line_detail b on a.id = b.id
|
||||||
|
inner join pq_line c on a.pid = c.id
|
||||||
|
inner join pq_line d on c.pid = d.id
|
||||||
|
inner join pq_device e on d.id = e.id
|
||||||
|
inner join pq_overlimit f on a.id=f.id
|
||||||
|
where e.dev_data_type in
|
||||||
|
<foreach collection="list" item="item" open="(" close=")" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
and e.run_flag = 0
|
||||||
|
and e.dev_model = 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -28,6 +28,8 @@ public class LineDevGetDTO {
|
|||||||
|
|
||||||
private String pointName;
|
private String pointName;
|
||||||
|
|
||||||
|
private Integer lineRunFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装置监测点索引集合
|
* 装置监测点索引集合
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.device.biz.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-01-06
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MonitorCommLedgerInfoDTO implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
private String monitorName;
|
||||||
|
|
||||||
|
private String gdName;
|
||||||
|
|
||||||
|
private String bdName;
|
||||||
|
|
||||||
|
private String busBarName;
|
||||||
|
|
||||||
|
private String voltageLevel;
|
||||||
|
|
||||||
|
private String shortCapacity;
|
||||||
|
|
||||||
|
private String devCapacity;
|
||||||
|
|
||||||
|
private String dealCapacity;
|
||||||
|
|
||||||
|
private String standardCapacity;
|
||||||
|
|
||||||
|
private Integer timeInterval;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,6 +13,8 @@ public class PollutionLineInfoDTO {
|
|||||||
/**
|
/**
|
||||||
* 所属变电站
|
* 所属变电站
|
||||||
*/
|
*/
|
||||||
|
private String subStationId;
|
||||||
|
|
||||||
private String subStationName;
|
private String subStationName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +76,10 @@ public class PollutionLineInfoDTO {
|
|||||||
* 电压等级
|
* 电压等级
|
||||||
*/
|
*/
|
||||||
private String lineVoltage;
|
private String lineVoltage;
|
||||||
|
/**
|
||||||
|
* 变电站电压等级
|
||||||
|
*/
|
||||||
|
private String subVoltage;
|
||||||
/**
|
/**
|
||||||
* 装置id
|
* 装置id
|
||||||
*/
|
*/
|
||||||
@@ -94,4 +99,9 @@ public class PollutionLineInfoDTO {
|
|||||||
* 监测点名称
|
* 监测点名称
|
||||||
*/
|
*/
|
||||||
private String lineName;
|
private String lineName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际安装位置
|
||||||
|
*/
|
||||||
|
private String actualArea;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ public class DeptGetLineParam {
|
|||||||
private Boolean monitorStateRunning=true;
|
private Boolean monitorStateRunning=true;
|
||||||
|
|
||||||
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
|
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
|
||||||
|
|
||||||
private Integer isUpToGrid;
|
private Integer isUpToGrid;
|
||||||
/**
|
/**
|
||||||
* 0-电网侧
|
* 0-电网侧
|
||||||
@@ -48,4 +47,7 @@ public class DeptGetLineParam {
|
|||||||
@ApiModelProperty("监测点运行状态")
|
@ApiModelProperty("监测点运行状态")
|
||||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private Integer lineRunFlag;
|
private Integer lineRunFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("搜索值")
|
||||||
|
private String searchValue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -762,81 +762,6 @@ public class Overlimit implements Serializable {
|
|||||||
public Overlimit(){}
|
public Overlimit(){}
|
||||||
|
|
||||||
|
|
||||||
public Overlimit(String lineId, String scaTmp, float fDLRL, float fJZRL, float fXYRL, float fSBRL){
|
|
||||||
float[] fLimit = COverlimit.GetOverLimit(scaTmp, fDLRL, fJZRL, fXYRL, fSBRL);
|
|
||||||
this.id=lineId;
|
|
||||||
this.freqDev=fLimit[0];
|
|
||||||
this.voltageDev=fLimit[1];
|
|
||||||
this.ubalance=fLimit[2];
|
|
||||||
this.flicker=fLimit[3];
|
|
||||||
this.uaberrance=fLimit[4];
|
|
||||||
this.uharm2=fLimit[5];
|
|
||||||
this.uharm3=fLimit[6];
|
|
||||||
this.uharm4=fLimit[7];
|
|
||||||
this.uharm5=fLimit[8];
|
|
||||||
this.uharm6=fLimit[9];
|
|
||||||
this.uharm7=fLimit[10];
|
|
||||||
this.uharm8=fLimit[11];
|
|
||||||
this.uharm9=fLimit[12];
|
|
||||||
this.uharm10=fLimit[13];
|
|
||||||
this.uharm11=fLimit[14];
|
|
||||||
this.uharm12=fLimit[15];
|
|
||||||
this.uharm13=fLimit[16];
|
|
||||||
this.uharm14=fLimit[17];
|
|
||||||
this.uharm15=fLimit[18];
|
|
||||||
this.uharm16=fLimit[19];
|
|
||||||
this.uharm17=fLimit[20];
|
|
||||||
this.uharm18=fLimit[21];
|
|
||||||
this.uharm19=fLimit[22];
|
|
||||||
this.uharm20=fLimit[23];
|
|
||||||
this.uharm21=fLimit[24];
|
|
||||||
this.uharm22=fLimit[25];
|
|
||||||
this.uharm23=fLimit[26];
|
|
||||||
this.uharm24=fLimit[27];
|
|
||||||
this.uharm25=fLimit[28];
|
|
||||||
this.iharm2=fLimit[29];
|
|
||||||
this.iharm3=fLimit[30];
|
|
||||||
this.iharm4=fLimit[31];
|
|
||||||
this.iharm5=fLimit[32];
|
|
||||||
this.iharm6=fLimit[33];
|
|
||||||
this.iharm7=fLimit[34];
|
|
||||||
this.iharm8=fLimit[35];
|
|
||||||
this.iharm9=fLimit[36];
|
|
||||||
this.iharm10=fLimit[37];
|
|
||||||
this.iharm11=fLimit[38];
|
|
||||||
this.iharm12=fLimit[39];
|
|
||||||
this.iharm13=fLimit[40];
|
|
||||||
this.iharm14=fLimit[41];
|
|
||||||
this.iharm15=fLimit[42];
|
|
||||||
this.iharm16=fLimit[43];
|
|
||||||
this.iharm17=fLimit[44];
|
|
||||||
this.iharm18=fLimit[45];
|
|
||||||
this.iharm19=fLimit[46];
|
|
||||||
this.iharm20=fLimit[47];
|
|
||||||
this.iharm21=fLimit[48];
|
|
||||||
this.iharm22=fLimit[49];
|
|
||||||
this.iharm23=fLimit[50];
|
|
||||||
this.iharm24=fLimit[51];
|
|
||||||
this.iharm25=fLimit[52];
|
|
||||||
this.uvoltageDev=fLimit[53];
|
|
||||||
this.iNeg=fLimit[54];
|
|
||||||
this.inuharm1=fLimit[55];
|
|
||||||
this.inuharm2=fLimit[56];
|
|
||||||
this.inuharm3=fLimit[57];
|
|
||||||
this.inuharm4=fLimit[58];
|
|
||||||
this.inuharm5=fLimit[59];
|
|
||||||
this.inuharm6=fLimit[60];
|
|
||||||
this.inuharm7=fLimit[61];
|
|
||||||
this.inuharm8=fLimit[62];
|
|
||||||
this.inuharm9=fLimit[63];
|
|
||||||
this.inuharm10=fLimit[64];
|
|
||||||
this.inuharm11=fLimit[65];
|
|
||||||
this.inuharm12=fLimit[66];
|
|
||||||
this.inuharm13=fLimit[67];
|
|
||||||
this.inuharm14=fLimit[68];
|
|
||||||
this.inuharm15=fLimit[69];
|
|
||||||
this.inuharm16=fLimit[70];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void buildIHarm(Float[] iHarmTem){
|
public void buildIHarm(Float[] iHarmTem){
|
||||||
this.iharm2= iHarmTem[0];
|
this.iharm2= iHarmTem[0];
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.device.biz.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import static com.baomidou.mybatisplus.annotation.IdType.ASSIGN_ID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2026-02-10
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@TableName("pq_sensitive_user")
|
||||||
|
public class PqSensitiveUser extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = ASSIGN_ID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -57,8 +57,8 @@ public class COverlimitUtil {
|
|||||||
//配网
|
//配网
|
||||||
Float[] iHarmTem = new Float[49];
|
Float[] iHarmTem = new Float[49];
|
||||||
for (int i = 0; i <= 48; i++) {
|
for (int i = 0; i <= 48; i++) {
|
||||||
|
//目前只处理了配网II类测点,III类测点暂未处理,III类测点参考主网
|
||||||
iHarmTem[i] = -3.14159f;
|
iHarmTem[i] = getHarmTag(i+2,voltageLevel).floatValue();
|
||||||
}
|
}
|
||||||
overlimit.buildIHarm(iHarmTem);
|
overlimit.buildIHarm(iHarmTem);
|
||||||
overlimit.setINeg(-3.14159f);
|
overlimit.setINeg(-3.14159f);
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
monitor.Org_Id AS orgId,
|
monitor.Org_Id AS orgId,
|
||||||
monitor.Org_Name AS orgName,
|
monitor.Org_Name AS orgName,
|
||||||
monitor.`Powerr_Id` AS powerId,
|
monitor.Powerr_Id AS powerId,
|
||||||
monitor.`Powerr_Name` AS powerName,
|
monitor.Powerr_Name AS powerName,
|
||||||
monitor.id AS monitorId,
|
monitor.id AS monitorId,
|
||||||
monitor.`Name` AS monitorName,
|
monitor.Name AS monitorName,
|
||||||
monitor.Line_Id,
|
monitor.Line_Id,
|
||||||
monitor.Line_Name,
|
monitor.Line_Name,
|
||||||
pdm.Monitor_Sort AS monitorSort,
|
pdm.Monitor_Sort AS monitorSort,
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
pm.id,
|
pm.id,
|
||||||
pm.`Name`,
|
pm.Name,
|
||||||
pm.`Status`,
|
pm.Status,
|
||||||
pm.Org_Id,
|
pm.Org_Id,
|
||||||
pm.Org_Name,
|
pm.Org_Name,
|
||||||
pm.Powerr_Id,
|
pm.Powerr_Id,
|
||||||
@@ -51,8 +51,8 @@
|
|||||||
) AS monitor
|
) AS monitor
|
||||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||||
WHERE
|
WHERE
|
||||||
monitor.`Status` = 1
|
monitor.Status = 1
|
||||||
AND pdm.`Status` = 1
|
AND pdm.Status = 1
|
||||||
AND monitor.Org_Id IN
|
AND monitor.Org_Id IN
|
||||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||||
#{orgId}
|
#{orgId}
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||||
</if>
|
</if>
|
||||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>pq-device-api</module>
|
<module>pq-device-api</module>
|
||||||
<module>pq-device-boot</module>
|
<module>pq-device-boot</module>
|
||||||
|
<module>pq-device-com</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<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.param.OnlineRateParam;
|
||||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
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.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -70,6 +70,16 @@ public interface GeneralDeviceInfoClient {
|
|||||||
HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getOnlineRateByDevIds")
|
@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.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.device.pq.api.fallback.DeviceTreeClientFallbackFactory;
|
import com.njcn.device.pq.api.fallback.DeviceTreeClientFallbackFactory;
|
||||||
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
|
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
|
||||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
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.param.LineDataQualityParam;
|
||||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
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 io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@@ -51,4 +55,7 @@ public interface LineIntegrityClient {
|
|||||||
|
|
||||||
@PostMapping("/lineDataQuality")
|
@PostMapping("/lineDataQuality")
|
||||||
HttpResult<List<LineDataQualityDTO>> getLineDataQuality(@RequestBody LineDataQualityParam lineDataQualityParam);
|
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.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
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.api.AlarmClient;
|
||||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -14,11 +14,12 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 告警管理熔断降级
|
* 告警管理熔断降级
|
||||||
|
*
|
||||||
* @author yzh
|
* @author yzh
|
||||||
* @date 2022/9/19
|
* @date 2022/9/19
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component("deviceAlarmClientFallbackFactory")
|
||||||
public class AlarmClientFallbackFactory implements FallbackFactory<AlarmClient> {
|
public class AlarmClientFallbackFactory implements FallbackFactory<AlarmClient> {
|
||||||
@Override
|
@Override
|
||||||
public AlarmClient create(Throwable throwable) {
|
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.param.OnlineRateParam;
|
||||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
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 com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -59,6 +59,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(DeviceInfoParam deviceInfoParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取变电站分类的所有终端综合信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) {
|
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString());
|
||||||
@@ -84,7 +90,7 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
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.param.LineDataQualityParam;
|
||||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||||
import feign.hystrix.FallbackFactory;
|
import feign.hystrix.FallbackFactory;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -54,6 +55,12 @@ public class LineIntegrityClientFallbackFactory implements FallbackFactory<LineI
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
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 pst = "DataFlicker-pst";
|
||||||
|
|
||||||
|
//电压暂降
|
||||||
|
String Voltage_Dip = "r_mp_event_detail-Voltage_Dip";
|
||||||
|
//电压暂升
|
||||||
String Voltage_Rise = "r_mp_event_detail-Voltage_Rise";
|
String Voltage_Rise = "r_mp_event_detail-Voltage_Rise";
|
||||||
|
|
||||||
String pf = "DataHarmPowerP-pf";
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,6 +42,13 @@ public enum LineBaseEnum {
|
|||||||
POWER_FLAG_NOT(1,"非电网侧"),
|
POWER_FLAG_NOT(1,"非电网侧"),
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置系统类型
|
||||||
|
*/
|
||||||
|
DEV_DATA_TYPE_ZT(0,"暂态系统装置"),
|
||||||
|
DEV_DATA_TYPE_WT(1,"稳态系统装置"),
|
||||||
|
DEV_DATA_TYPE_ALL(2,"全部系统装置")
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -8,4 +8,8 @@ public class PublicDTO {
|
|||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
private Double data;
|
private Double data;
|
||||||
|
|
||||||
|
private Integer onlineMin;
|
||||||
|
|
||||||
|
private Integer offlineMin;
|
||||||
}
|
}
|
||||||
@@ -105,6 +105,14 @@ public class DeviceInfoParam implements Serializable {
|
|||||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||||
private Integer lineRunFlag;
|
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:是")
|
@ApiModelProperty("是否是冀北电网一张图树 0:否 1:是")
|
||||||
private Integer type = 0;
|
private Integer type = 0;
|
||||||
|
|
||||||
|
@ApiModelProperty("指标")
|
||||||
|
private List<String> dicData;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否展示污染值 0:否 1:是")
|
||||||
|
private Integer isPollution;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isUserLedger() {
|
public Boolean isUserLedger() {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class DeviceParam {
|
|||||||
@NotBlank(message = "设备制造商不能为空")
|
@NotBlank(message = "设备制造商不能为空")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty(name = "electroplate",value = "电镀功能",required = true)
|
@ApiModelProperty(name = "electroplate",value = "电度功能",required = true)
|
||||||
@NotNull(message = "电镀标识不能为空")
|
@NotNull(message = "电镀标识不能为空")
|
||||||
private Integer electroplate;
|
private Integer electroplate;
|
||||||
|
|
||||||
|
|||||||
@@ -124,11 +124,11 @@ public class LineParam {
|
|||||||
private String objId;
|
private String objId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "bigObjType",value = "对象大类")
|
@ApiModelProperty(name = "bigObjType",value = "对象大类")
|
||||||
@NotBlank(message = "对象大类不可为空")
|
// @NotBlank(message = "对象大类不可为空")
|
||||||
private String bigObjType;
|
private String bigObjType;
|
||||||
|
|
||||||
@ApiModelProperty(name = "smallObjType",value = "对象小类")
|
@ApiModelProperty(name = "smallObjType",value = "对象小类")
|
||||||
@NotBlank(message = "对象小类不可为空")
|
// @NotBlank(message = "对象小类不可为空")
|
||||||
private String smallObjType;
|
private String smallObjType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import java.util.List;
|
|||||||
* @createTime: 2023-04-03
|
* @createTime: 2023-04-03
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel
|
|
||||||
public class OnlineRateParam {
|
public class OnlineRateParam {
|
||||||
|
|
||||||
@ApiModelProperty(name = "ids", value = "设备id")
|
@ApiModelProperty(name = "ids", value = "设备id")
|
||||||
@@ -27,4 +26,10 @@ public class OnlineRateParam {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "type", value = "区分类型0:topid搜索 1:devid搜索")
|
@ApiModelProperty(name = "type", value = "区分类型0:topid搜索 1:devid搜索")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Info extends OnlineRateParam {
|
||||||
|
@ApiModelProperty(name = "dicData", value = "字典id")
|
||||||
|
private List<String> dicData;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.njcn.device.pq.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.hibernate.validator.constraints.Range;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: cdf
|
||||||
|
* @CreateTime: 2025-12-02
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqSensitiveUserParam {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "用户名称不可为空")
|
||||||
|
@ApiModelProperty(name = "name",value = "用户名称不可为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "敏感负荷类型不可为空")
|
||||||
|
@ApiModelProperty(name = "loadType",value = "敏感负荷类型")
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
@Range(min = 0,max = 10000000 )
|
||||||
|
@ApiModelProperty(name = "userAgreementCapacity",value = "用户协议容量")
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
@Range(min = 0,max = 10000000 )
|
||||||
|
@ApiModelProperty(name = "installedCapacity",value = "装机容量")
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "所属厂站名称不可为空")
|
||||||
|
@ApiModelProperty(name = "substationName",value = "所属厂站名称")
|
||||||
|
private String substationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@NotNull(message = "排序不可为空")
|
||||||
|
@ApiModelProperty(name = "sort",value = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class UpdatePqSensitiveUserParam extends PqSensitiveUserParam{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "id不可为空")
|
||||||
|
@ApiModelProperty(name = "id",value = "id")
|
||||||
|
private String id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -77,4 +77,7 @@ public class RunManageParam extends BaseParam implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "evaluate", value = "评价")
|
@ApiModelProperty(name = "evaluate", value = "评价")
|
||||||
private String evaluate;
|
private String evaluate;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "ids", value = "监测点id集合")
|
||||||
|
private List<String> ids;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,12 @@ public class MonitorBaseParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "终端厂家")
|
@ApiModelProperty(value = "终端厂家")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "监测点运行状态")
|
||||||
|
private Integer lineRunFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "异常天数时间")
|
||||||
|
private List<String> time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "过滤异常时间次数")
|
||||||
|
private Integer errorTimeCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package com.njcn.device.pq.pojo.po;
|
package com.njcn.device.pq.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import java.io.Serializable;
|
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -25,126 +26,306 @@ public class PqDataVerifyBak {
|
|||||||
/**
|
/**
|
||||||
* 监测点id
|
* 监测点id
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常数据时间
|
* 异常数据时间
|
||||||
*/
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time_id")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private LocalDate timeId;
|
private LocalDate timeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 频率(0:正常 1:异常)
|
* 监测点状态
|
||||||
|
* 判断所有指标 0:无异常 1:异常
|
||||||
*/
|
*/
|
||||||
private Integer freq;
|
@TableField(value = "state")
|
||||||
|
private Integer state ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 频率偏差(0:正常 1:异常)
|
* 频率指标
|
||||||
*/
|
*/
|
||||||
private Integer freqDev;
|
@TableField(value = "freq")
|
||||||
|
private Integer freq ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相电压有效值(0:正常 1:异常)
|
* 频率异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vRms;
|
@TableField(value = "freq_time")
|
||||||
|
private Integer freqTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 正序电压(0:正常 1:异常)
|
* 频率偏差指标
|
||||||
*/
|
*/
|
||||||
private Integer vPos;
|
@TableField(value = "freq_dev")
|
||||||
|
private Integer freqDev ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负序电压(0:正常 1:异常)
|
* 频率偏差异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vNeg;
|
@TableField(value = "freq_dev_time")
|
||||||
|
private Integer freqDevTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 零序电压(0:正常 1:异常)
|
* 相电压有效值
|
||||||
*/
|
*/
|
||||||
private Integer vZero;
|
@TableField(value = "v_rms")
|
||||||
|
private Integer vRms ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压不平衡度(0:正常 1:异常)
|
* 相电压有效值异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vUnbalance;
|
@TableField(value = "v_rms_time")
|
||||||
|
private Integer vRmsTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线电压有效值(0:正常 1:异常)
|
* 正序电压
|
||||||
*/
|
*/
|
||||||
private Integer rmsLvr;
|
@TableField(value = "v_pos")
|
||||||
|
private Integer vPos ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压正偏差(0:正常 1:异常)
|
* 正序电压异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vuDev;
|
@TableField(value = "v_pos_time")
|
||||||
|
private Integer vPosTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压负偏差(0:正常 1:异常)
|
* 负序电压
|
||||||
*/
|
*/
|
||||||
private Integer vlDev;
|
@TableField(value = "v_neg")
|
||||||
|
private Integer vNeg ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压总谐波畸变率(0:正常 1:异常)
|
* 负序电压异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vThd;
|
@TableField(value = "v_neg_time")
|
||||||
|
private Integer vNegTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相电压基波有效值(0:正常 1:异常)
|
* 零序电压
|
||||||
*/
|
*/
|
||||||
private Integer v;
|
@TableField(value = "v_zero")
|
||||||
|
private Integer vZero ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电流有效值(0:正常 1:异常)
|
* 零序电压异常时间
|
||||||
*/
|
*/
|
||||||
private Integer iRms;
|
@TableField(value = "v_zero_time")
|
||||||
|
private Integer vZeroTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长时闪变(0:正常 1:异常)
|
* 电压不平衡度
|
||||||
*/
|
*/
|
||||||
private Integer plt;
|
@TableField(value = "v_unbalance")
|
||||||
|
private Integer vUnbalance ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 间谐波电压含有率(0:正常 1:异常)
|
* 电压不平衡度异常时间
|
||||||
*/
|
*/
|
||||||
private Integer vInharm;
|
@TableField(value = "v_unbalance_time")
|
||||||
|
private Integer vUnbalanceTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压含有率(0:正常 1:异常)
|
* 线电压有效值
|
||||||
*/
|
*/
|
||||||
private Integer vHarm;
|
@TableField(value = "rms_lvr")
|
||||||
|
private Integer rmsLvr ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功率因数(0:正常 1:异常)
|
* 线电压有效值异常时间
|
||||||
*/
|
*/
|
||||||
private Integer pf;
|
@TableField(value = "rms_lvr_time")
|
||||||
|
private Integer rmsLvrTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压相角(0:正常 1:异常)
|
* 电压正偏差
|
||||||
*/
|
*/
|
||||||
private Integer vPhasic;
|
@TableField(value = "vu_dev")
|
||||||
|
private Integer vuDev ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压基波相角(0:正常 1:异常)
|
* 电压正偏差异常时间
|
||||||
*/
|
*/
|
||||||
private Integer v1Phasic;
|
@TableField(value = "vu_dev_time")
|
||||||
|
private Integer vuDevTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压波动(0:正常 1:异常)
|
* 电压负偏差
|
||||||
*/
|
*/
|
||||||
private Integer fluc;
|
@TableField(value = "vl_Dev")
|
||||||
|
private Integer vlDev ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短时闪变(0:正常 1:异常)
|
* 电压负偏差异常时间
|
||||||
*/
|
*/
|
||||||
private Integer pst;
|
@TableField(value = "vl_Dev_time")
|
||||||
|
private Integer vlDevTime ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断所有指标 0:无异常 1:有异常
|
* 电压总谐波畸变率
|
||||||
*/
|
*/
|
||||||
private Integer state;
|
@TableField(value = "v_thd")
|
||||||
|
private Integer vThd ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压总谐波畸变率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_thd_time")
|
||||||
|
private Integer vThdTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相电压基波有效值
|
||||||
|
*/
|
||||||
|
@TableField(value = "v")
|
||||||
|
private Integer v ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相电压基波有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_time")
|
||||||
|
private Integer vTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电流有效值
|
||||||
|
*/
|
||||||
|
@TableField(value = "i_rms")
|
||||||
|
private Integer iRms ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电流有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "i_rms_time")
|
||||||
|
private Integer iRmsTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长时闪变
|
||||||
|
*/
|
||||||
|
@TableField(value = "plt")
|
||||||
|
private Integer plt ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长时闪变异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plt_time")
|
||||||
|
private Integer pltTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 间谐波电压含有率
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_inharm")
|
||||||
|
private Integer vInharm ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 间谐波电压含有率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_Inharm_time")
|
||||||
|
private Integer vInharmTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压含有率
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_harm")
|
||||||
|
private Integer vHarm ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压含有率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_harm_time")
|
||||||
|
private Integer vHarmTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率因数
|
||||||
|
*/
|
||||||
|
@TableField(value = "pf")
|
||||||
|
private Integer pf ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率因数异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "pf_time")
|
||||||
|
private Integer pfTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压相角
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_phasic")
|
||||||
|
private Integer vPhasic ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压相角异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_phasic_time")
|
||||||
|
private Integer vPhasicTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压基波相角
|
||||||
|
*/
|
||||||
|
@TableField(value = "v1_phasic")
|
||||||
|
private Integer v1Phasic ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压基波相角异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v1_phasic_time")
|
||||||
|
private Integer v1PhasicTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压波动
|
||||||
|
*/
|
||||||
|
@TableField(value = "fluc")
|
||||||
|
private Integer fluc ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压波动异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "fluc_time")
|
||||||
|
private Integer flucTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短时闪变
|
||||||
|
*/
|
||||||
|
@TableField(value = "pst")
|
||||||
|
private Integer pst ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短时闪变异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "pst_time")
|
||||||
|
private Integer pstTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂降(0:正常 1:异常)
|
||||||
|
*/
|
||||||
|
@TableField(value = "dip")
|
||||||
|
private Integer dip ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂降异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "dip_time")
|
||||||
|
private Integer dipTime ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂升(0:正常 1:异常)
|
||||||
|
*/
|
||||||
|
@TableField(value = "rise")
|
||||||
|
private Integer rise ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂升异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "rise_time")
|
||||||
|
private Integer riseTime ;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件路径
|
* 文件路径
|
||||||
*/
|
*/
|
||||||
|
@TableField(value = "path")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点详细信息
|
* 监测点详细信息
|
||||||
@@ -62,6 +63,9 @@ public class AreaLineInfoVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "pt2",value = "pt2")
|
@ApiModelProperty(name = "pt2",value = "pt2")
|
||||||
private Integer pt2;
|
private Integer pt2;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "ptType",value = "接线类型(0:星型接法;1:三角型接法;2:开口三角型接法)")
|
||||||
|
private Integer ptType;
|
||||||
|
|
||||||
@ApiModelProperty(name = "objName",value = "对象名称")
|
@ApiModelProperty(name = "objName",value = "对象名称")
|
||||||
private String objName;
|
private String objName;
|
||||||
|
|
||||||
@@ -129,6 +133,27 @@ public class AreaLineInfoVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "smallObjType",value = "检测对象小类")
|
@ApiModelProperty(name = "smallObjType",value = "检测对象小类")
|
||||||
private String smallObjType;
|
private String smallObjType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
@ApiModelProperty(name = "objId",value = "对象id")
|
@ApiModelProperty(name = "objId",value = "对象id")
|
||||||
private String objId;
|
private String objId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerSubstationName", value = "电网侧变电站")
|
||||||
|
private String powerSubstationName;
|
||||||
|
|
||||||
|
@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("供电公司")
|
@ApiModelProperty("供电公司")
|
||||||
private String gdName;
|
private String gdName;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属部门")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
@ApiModelProperty("变电站名称")
|
@ApiModelProperty("变电站名称")
|
||||||
private String bdzName;
|
private String bdzName;
|
||||||
|
|
||||||
@@ -37,9 +40,15 @@ public class DevDetail {
|
|||||||
@ApiModelProperty("终端等级")
|
@ApiModelProperty("终端等级")
|
||||||
private String lineGrade;
|
private String lineGrade;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty("通讯状态(0:中断;1:正常)")
|
@ApiModelProperty("通讯状态(0:中断;1:正常)")
|
||||||
private Integer comFlag;
|
private Integer comFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||||
|
private Integer runFlag;
|
||||||
|
|
||||||
@ApiModelProperty("定检时间")
|
@ApiModelProperty("定检时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private LocalDate nextTimeCheck;
|
private LocalDate nextTimeCheck;
|
||||||
|
|||||||
@@ -11,6 +11,15 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class DevDetailVO {
|
public class DevDetailVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("地市")
|
||||||
|
private String cit;
|
||||||
|
|
||||||
|
@ApiModelProperty("供电公司")
|
||||||
|
private String company;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端厂家")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty(name = "lineId",value = "监测点索引")
|
@ApiModelProperty(name = "lineId",value = "监测点索引")
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
@@ -32,4 +41,6 @@ public class DevDetailVO {
|
|||||||
@ApiModelProperty(name = "subName",value = "对象id(新能源用户)")
|
@ApiModelProperty(name = "subName",value = "对象id(新能源用户)")
|
||||||
private String ObjId;
|
private String ObjId;
|
||||||
|
|
||||||
|
@ApiModelProperty("终端运行状态(0:运行;1:检修;2:停运;3:调试;4:退运)")
|
||||||
|
private Integer runFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class DeviceRunEvaluateVO {
|
public class DeviceRunEvaluateVO {
|
||||||
|
|
||||||
|
@ApiModelProperty("终端id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty("名称")
|
@ApiModelProperty("名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@@ -26,6 +29,18 @@ public class DeviceRunEvaluateVO {
|
|||||||
@ApiModelProperty("评价")
|
@ApiModelProperty("评价")
|
||||||
private BigDecimal evaluate;
|
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("完整率")
|
@ApiModelProperty("完整率")
|
||||||
private BigDecimal integrityRate;
|
private BigDecimal integrityRate;
|
||||||
|
|
||||||
@@ -40,4 +55,29 @@ public class DeviceRunEvaluateVO {
|
|||||||
@ApiModelProperty("终端id集合")
|
@ApiModelProperty("终端id集合")
|
||||||
private List<String> devIds;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class DeviceVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
|
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
@ApiModelProperty(name = "electroplate",value = "电镀功能")
|
@ApiModelProperty(name = "electroplate",value = "电度功能")
|
||||||
private Integer electroplate;
|
private Integer electroplate;
|
||||||
|
|
||||||
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
|
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class GridDiagramProVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "integrityRate", value = "数据完整率")
|
@ApiModelProperty(name = "integrityRate", value = "数据完整率")
|
||||||
private Float integrityRate;
|
private Float integrityRate;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "onLineRate", value = "数据在线率")
|
||||||
|
private Float onLineRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import java.time.LocalDateTime;
|
|||||||
@Data
|
@Data
|
||||||
public class LineDetailVO implements Serializable {
|
public class LineDetailVO implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
@ApiModelProperty("供电公司名称")
|
@ApiModelProperty("供电公司名称")
|
||||||
private String gdName;
|
private String gdName;
|
||||||
|
|
||||||
@@ -92,6 +95,16 @@ public class LineDetailVO implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty("已用流量占比")
|
@ApiModelProperty("已用流量占比")
|
||||||
private Float flowProportion;
|
private Float flowProportion;
|
||||||
|
|
||||||
|
@ApiModelProperty("电网标志 0-电网侧;1-非电网侧")
|
||||||
|
private Integer powerFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "监测点运行状态")
|
||||||
|
private String lineRunType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "终端厂家")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2026/2/2 15:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class LineInfoMonitorIdVO {
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lineId",value = "监测点id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "gdName",value = "供电公司名称")
|
||||||
|
private String gdName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "lineName",value = "监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "loadType",value = "干扰源类型")
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "objName",value = "对象名称")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "subName",value = "变电站名称")
|
||||||
|
private String subName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerSubstationName", value = "电网侧变电站")
|
||||||
|
private String powerSubstationName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deviceId",value = "装置Id")
|
||||||
|
private String deviceId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "deviceName",value = "装置名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "ip",value = "装置ip")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "manufacturer",value = "供应商名称")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "monitorId",value = "国网ID")
|
||||||
|
private String monitorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||||
|
private Integer powerFlag;
|
||||||
|
}
|
||||||
@@ -136,6 +136,18 @@ public class LineIntegrityDataVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
||||||
private Double integrityData;
|
private Double integrityData;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "realTime",value = "实际时间")
|
||||||
|
private Integer realTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 期望时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "dueTime",value = "期望时间")
|
||||||
|
private Integer dueTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点合格率
|
* 监测点合格率
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-11-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PqSensitiveUserVo implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感用户名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 敏感负荷类型
|
||||||
|
*/
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否监测
|
||||||
|
*/
|
||||||
|
private String isMonitor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否治理
|
||||||
|
*/
|
||||||
|
private String isGovern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户协议容量
|
||||||
|
*/
|
||||||
|
private Double userAgreementCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装机容量
|
||||||
|
*/
|
||||||
|
private Double installedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 所属厂站名称
|
||||||
|
*/
|
||||||
|
private String substationName;
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.njcn.device.pq.pojo.vo;
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -26,6 +26,6 @@ public class RStatIntegrityVO {
|
|||||||
|
|
||||||
private Integer realTime;
|
private Integer realTime;
|
||||||
|
|
||||||
private Double integrityRate;
|
private BigDecimal integrityRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.njcn.device.pq.pojo.vo;
|
package com.njcn.device.pq.pojo.vo;
|
||||||
|
|
||||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,7 +12,7 @@ import java.time.LocalDateTime;
|
|||||||
* @createTime: 2023-04-03
|
* @createTime: 2023-04-03
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class RStatOnlinerateVO {
|
public class RStatOnlineRateVO {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private LocalDateTime timeId;
|
private LocalDateTime timeId;
|
||||||
@@ -23,5 +23,5 @@ public class RStatOnlinerateVO {
|
|||||||
|
|
||||||
private Integer offlineMin;
|
private Integer offlineMin;
|
||||||
|
|
||||||
private Float onlineRate;
|
private BigDecimal onlineRate;
|
||||||
}
|
}
|
||||||
@@ -77,6 +77,18 @@ public class TerminalOnlineRateDataVO implements Serializable {
|
|||||||
@ApiModelProperty(name = "onlineRate",value = "在线率")
|
@ApiModelProperty(name = "onlineRate",value = "在线率")
|
||||||
private Double onlineRate;
|
private Double onlineRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 在线分钟数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "onlineMin",value = "在线分钟数")
|
||||||
|
private Integer onlineMin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离线分钟数
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(name = "offlineMin",value = "离线分钟数")
|
||||||
|
private Integer offlineMin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 最新数据时间
|
* 最新数据时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0.0
|
||||||
|
* @author: chenchao
|
||||||
|
* @date: 2022/07/18 11:04
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class CityDataExcel implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty(value = "单位")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "监测终端数量")
|
||||||
|
private BigDecimal deviceNum;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "监测点个数")
|
||||||
|
private BigDecimal lineNum;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "在线率(%)")
|
||||||
|
private BigDecimal onlineRate;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "完整率(%)")
|
||||||
|
private BigDecimal integrity;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "问题监测点")
|
||||||
|
private BigDecimal abnormalNum;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "问题监测点")
|
||||||
|
private List<String> abnormalList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,225 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0.0
|
||||||
|
* @author: chenchao
|
||||||
|
* @date: 2022/07/18 11:04
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class DataVerifyExcel implements Serializable {
|
||||||
|
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "供电公司")
|
||||||
|
@Excel(name = "供电公司")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "所属变电站")
|
||||||
|
@Excel(name = "所属变电站")
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "终端名称")
|
||||||
|
@Excel(name = "终端名称")
|
||||||
|
private String devName;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "监测点名称")
|
||||||
|
@Excel(name = "监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "IP")
|
||||||
|
@Excel(name = "IP")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "干扰源类型")
|
||||||
|
@Excel(name = "干扰源类型")
|
||||||
|
private String loadType;
|
||||||
|
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "监测对象名称")
|
||||||
|
@Excel(name = "监测对象名称")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电网侧变电站")
|
||||||
|
@Excel(name = "电网侧变电站")
|
||||||
|
private String powerSubstationName;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "厂商")
|
||||||
|
@Excel(name = "厂商")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "总指标异常时间")
|
||||||
|
@Excel(name = "总指标异常时间")
|
||||||
|
private Integer allTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "频率")
|
||||||
|
@Excel(name = "频率")
|
||||||
|
private Integer freqTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "频率偏差")
|
||||||
|
@Excel(name = "频率偏差")
|
||||||
|
private Integer freqDevTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "相电压有效值")
|
||||||
|
@Excel(name = "相电压有效值")
|
||||||
|
private Integer vRmsTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "正序电压")
|
||||||
|
@Excel(name = "正序电压")
|
||||||
|
private Integer vPosTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "负序电压")
|
||||||
|
@Excel(name = "负序电压")
|
||||||
|
private Integer vNegTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "零序电压")
|
||||||
|
@Excel(name = "零序电压")
|
||||||
|
private Integer vZeroTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压不平衡度")
|
||||||
|
@Excel(name = "电压不平衡度")
|
||||||
|
private Integer vUnbalanceTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "线电压有效值")
|
||||||
|
@Excel(name = "线电压有效值")
|
||||||
|
private Integer rmsLvrTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压正偏差")
|
||||||
|
@Excel(name = "电压正偏差")
|
||||||
|
private Integer vuDevTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压负偏差")
|
||||||
|
@Excel(name = "电压负偏差")
|
||||||
|
private Integer vlDevTime;
|
||||||
|
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty(value = "电压总谐波畸变率")
|
||||||
|
@Excel(name = "电压总谐波畸变率")
|
||||||
|
private Integer vThdTime;
|
||||||
|
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty(value = "相电压基波有效值")
|
||||||
|
@Excel(name = "相电压基波有效值")
|
||||||
|
private Integer vTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电流有效值")
|
||||||
|
@Excel(name = "电流有效值")
|
||||||
|
private Integer iRmsTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "长时闪变")
|
||||||
|
@Excel(name = "长时闪变")
|
||||||
|
private Integer pltTime;
|
||||||
|
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty(value = "间谐波电压含有率")
|
||||||
|
@Excel(name = "间谐波电压含有率")
|
||||||
|
private Integer vInharmTime;
|
||||||
|
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ExcelProperty(value = "谐波电压含有率")
|
||||||
|
@Excel(name = "谐波电压含有率")
|
||||||
|
private Integer vHarmTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "功率因数")
|
||||||
|
@Excel(name = "功率因数")
|
||||||
|
private Integer pfTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "谐波电压相角")
|
||||||
|
@Excel(name = "谐波电压相角")
|
||||||
|
private Integer vPhasicTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "谐波电压基波相角")
|
||||||
|
@Excel(name = "谐波电压基波相角")
|
||||||
|
private Integer v1PhasicTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压波动")
|
||||||
|
@Excel(name = "电压波动")
|
||||||
|
private Integer flucTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "短时闪变")
|
||||||
|
@Excel(name = "短时闪变")
|
||||||
|
private Integer pstTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压暂降")
|
||||||
|
@Excel(name = "电压暂降")
|
||||||
|
private Integer dipTime;
|
||||||
|
|
||||||
|
@ColumnWidth(20)
|
||||||
|
@ExcelProperty(value = "电压暂升")
|
||||||
|
@Excel(name = "电压暂升")
|
||||||
|
private Integer riseTime;
|
||||||
|
|
||||||
|
|
||||||
|
// 字段名 ↔ Excel列名 映射
|
||||||
|
public static final Map<String, String> FIELD_COLUMN_MAP = new HashMap<>();
|
||||||
|
static {
|
||||||
|
// 按代码中字段顺序整理,确保一一对应
|
||||||
|
FIELD_COLUMN_MAP.put("freqTime", "频率");
|
||||||
|
FIELD_COLUMN_MAP.put("freqDevTime", "频率偏差");
|
||||||
|
FIELD_COLUMN_MAP.put("vRmsTime", "相电压有效值");
|
||||||
|
FIELD_COLUMN_MAP.put("vPosTime", "正序电压");
|
||||||
|
FIELD_COLUMN_MAP.put("vNegTime", "负序电压");
|
||||||
|
FIELD_COLUMN_MAP.put("vZeroTime", "零序电压");
|
||||||
|
FIELD_COLUMN_MAP.put("vUnbalanceTime", "电压不平衡度");
|
||||||
|
FIELD_COLUMN_MAP.put("rmsLvrTime", "线电压有效值");
|
||||||
|
FIELD_COLUMN_MAP.put("vuDevTime", "电压正偏差");
|
||||||
|
FIELD_COLUMN_MAP.put("vlDevTime", "电压负偏差");
|
||||||
|
FIELD_COLUMN_MAP.put("vThdTime", "电压总谐波畸变率");
|
||||||
|
FIELD_COLUMN_MAP.put("vTime", "相电压基波有效值");
|
||||||
|
FIELD_COLUMN_MAP.put("iRmsTime", "电流有效值");
|
||||||
|
FIELD_COLUMN_MAP.put("pltTime", "长时闪变");
|
||||||
|
FIELD_COLUMN_MAP.put("vInharmTime", "间谐波电压含有率");
|
||||||
|
FIELD_COLUMN_MAP.put("vHarmTime", "谐波电压含有率");
|
||||||
|
FIELD_COLUMN_MAP.put("pfTime", "功率因数");
|
||||||
|
FIELD_COLUMN_MAP.put("vPhasicTime", "谐波电压相角");
|
||||||
|
FIELD_COLUMN_MAP.put("v1PhasicTime", "谐波电压基波相角");
|
||||||
|
FIELD_COLUMN_MAP.put("flucTime", "电压波动");
|
||||||
|
FIELD_COLUMN_MAP.put("pstTime", "短时闪变");
|
||||||
|
FIELD_COLUMN_MAP.put("dipTime", "电压暂降");
|
||||||
|
FIELD_COLUMN_MAP.put("riseTime", "电压暂升");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: cdf
|
* @Author: cdf
|
||||||
* @CreateTime: 2025-03-31
|
* @CreateTime: 2025-03-31
|
||||||
@@ -14,6 +17,8 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
private String date;
|
private String date;
|
||||||
|
|
||||||
|
private List<TimeAndTargetKey> dateTargetList;
|
||||||
|
|
||||||
private String monitorName;
|
private String monitorName;
|
||||||
|
|
||||||
private String bdName;
|
private String bdName;
|
||||||
@@ -24,7 +29,13 @@ public class DetailAbnormalVO {
|
|||||||
|
|
||||||
private String targetKey;
|
private String targetKey;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class TimeAndTargetKey {
|
||||||
|
|
||||||
|
private String date;
|
||||||
|
|
||||||
|
private List<VerifyTargetVO> targetKeys;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 异常实体
|
* 异常实体
|
||||||
*/
|
*/
|
||||||
@@ -50,9 +61,28 @@ public class DetailAbnormalVO {
|
|||||||
private String avg;
|
private String avg;
|
||||||
//CP95
|
//CP95
|
||||||
private String 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 DetailLimitCountVO {
|
||||||
|
|
||||||
|
private Integer timeSum;
|
||||||
|
private Integer errCount;
|
||||||
|
private List<DetailLimitInnerVO> time;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class DetailLimitInnerVO{
|
public static class DetailLimitInnerVO{
|
||||||
|
|
||||||
@@ -73,6 +103,99 @@ public class DetailAbnormalVO {
|
|||||||
//最大
|
//最大
|
||||||
private String val;
|
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
|
@Data
|
||||||
public class JsonBaseVO {
|
public class JsonBaseVO {
|
||||||
|
/**
|
||||||
|
* 超标时间
|
||||||
|
*/
|
||||||
private String time;
|
private String time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常值
|
||||||
|
*/
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相别
|
||||||
|
*/
|
||||||
private String phasic;
|
private String phasic;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||||
|
*/
|
||||||
private String valueType;
|
private String valueType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限值
|
||||||
|
*/
|
||||||
|
private float overLimitValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0.0
|
||||||
|
* @author: chenchao
|
||||||
|
* @date: 2022/07/18 11:04
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@EqualsAndHashCode
|
||||||
|
public class LineDataExcel implements Serializable {
|
||||||
|
|
||||||
|
@ExcelProperty(value = "序号")
|
||||||
|
private BigDecimal lineNum;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "监测点名称")
|
||||||
|
private String lineName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "所属部门")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "接入电网侧变电站名")
|
||||||
|
private String powerSubstationName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "监测点对象名称")
|
||||||
|
private String objName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "装置编号")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "IP地址")
|
||||||
|
private String ip;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "终端厂家")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "在线率")
|
||||||
|
private BigDecimal onlineRate;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "数据完整性")
|
||||||
|
private BigDecimal integrity;
|
||||||
|
|
||||||
|
@ExcelProperty(value = "国网ID")
|
||||||
|
private BigDecimal monitorId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
||||||
private String monitorId;
|
private String monitorId;
|
||||||
//监测点名称
|
|
||||||
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
||||||
private String monitorName;
|
private String monitorName;
|
||||||
//所属终端名称
|
|
||||||
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
||||||
private String devName;
|
private String devName;
|
||||||
|
|
||||||
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
|
|||||||
|
|
||||||
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
//所属电站
|
|
||||||
@ApiModelProperty(name = "stationName",value = "所属电站")
|
@ApiModelProperty(name = "stationName",value = "所属电站")
|
||||||
private String stationName;
|
private String stationName;
|
||||||
//监测对象类型
|
|
||||||
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
||||||
private String objType;
|
private String objType;
|
||||||
//监测对象名称
|
|
||||||
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
||||||
private String objName;
|
private String objName;
|
||||||
//电压等级
|
|
||||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||||
private String voltageLevel;
|
private String voltageLevel;
|
||||||
//异常天数
|
|
||||||
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
||||||
private Integer abnormalDay;
|
private Integer abnormalDay;
|
||||||
//严重度
|
|
||||||
@ApiModelProperty(name = "severity",value = "严重度")
|
@ApiModelProperty(name = "severity",value = "严重度")
|
||||||
private Integer severity;
|
private Integer severity;
|
||||||
|
|
||||||
|
@ApiModelProperty("地市")
|
||||||
|
private String city;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.njcn.device.pq.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.CityDataExcel;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.LineDataExcel;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2026/2/2 10:13
|
||||||
|
*/
|
||||||
|
public class DataLineExcelUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建监测点信息表头
|
||||||
|
* @param FlyMonitorId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<List<String>> lineHeader(Boolean FlyMonitorId) {
|
||||||
|
List<List<String>> header = new ArrayList<>();
|
||||||
|
header.add(Collections.singletonList("序号"));
|
||||||
|
header.add(Collections.singletonList("监测点名称"));
|
||||||
|
header.add(Collections.singletonList("所属部门"));
|
||||||
|
header.add(Collections.singletonList("接入电网侧变电站名"));
|
||||||
|
header.add(Collections.singletonList("监测点对象名称"));
|
||||||
|
header.add(Collections.singletonList("装置编号"));
|
||||||
|
header.add(Collections.singletonList("IP地址"));
|
||||||
|
header.add(Collections.singletonList("终端厂家"));
|
||||||
|
header.add(Collections.singletonList("在线率"));
|
||||||
|
header.add(Collections.singletonList("数据完整性"));
|
||||||
|
if(FlyMonitorId){
|
||||||
|
header.add(Collections.singletonList("国网ID"));
|
||||||
|
}
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点信息表头数据写入
|
||||||
|
* @param data
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<List<Object>> lineBody(List<LineDataExcel> data) {
|
||||||
|
List<List<Object>> result = new ArrayList<>();
|
||||||
|
if(CollUtil.isNotEmpty(data)){
|
||||||
|
for (LineDataExcel datum : data) {
|
||||||
|
ArrayList<Object> row = Lists.newArrayList(datum.getLineNum(),
|
||||||
|
datum.getLineName(),
|
||||||
|
datum.getDeptName(),
|
||||||
|
datum.getPowerSubstationName(),
|
||||||
|
datum.getObjName(),
|
||||||
|
datum.getDeviceName(),
|
||||||
|
datum.getIp(),
|
||||||
|
datum.getManufacturer(),
|
||||||
|
datum.getOnlineRate(),
|
||||||
|
datum.getIntegrity());
|
||||||
|
if(ObjUtil.isNotNull(datum.getMonitorId())){
|
||||||
|
row.add(datum.getMonitorId());
|
||||||
|
}
|
||||||
|
result.add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 插入一个空行
|
||||||
|
result.add(Collections.emptyList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建地市信息表头
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<List<String>> cityHeader() {
|
||||||
|
List<List<String>> header = new ArrayList<>();
|
||||||
|
header.add(Collections.singletonList("单位"));
|
||||||
|
header.add(Collections.singletonList("监测终端数量"));
|
||||||
|
header.add(Collections.singletonList("监测点个数"));
|
||||||
|
header.add(Collections.singletonList("在线率(%)"));
|
||||||
|
header.add(Collections.singletonList("完整率(%)"));
|
||||||
|
header.add(Collections.singletonList("问题监测点"));
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<List<Object>> cityBody(List<CityDataExcel> data) {
|
||||||
|
List<List<Object>> result = new ArrayList<>();
|
||||||
|
if(CollUtil.isNotEmpty(data)){
|
||||||
|
for (CityDataExcel datum : data) {
|
||||||
|
ArrayList<Object> row = Lists.newArrayList(datum.getDeptName(),
|
||||||
|
datum.getDeviceNum(),
|
||||||
|
datum.getLineNum(),
|
||||||
|
datum.getOnlineRate(),
|
||||||
|
datum.getIntegrity(),
|
||||||
|
datum.getAbnormalNum());
|
||||||
|
result.add(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 插入一个空行
|
||||||
|
result.add(Collections.emptyList());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
package com.njcn.device.pq.utils;
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.write.handler.SheetWriteHandler;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
|
||||||
|
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
|
||||||
|
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
|
||||||
|
import com.alibaba.excel.write.metadata.style.WriteFont;
|
||||||
|
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
|
||||||
|
import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
|
||||||
|
import com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel;
|
||||||
|
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||||
|
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修复版:按数据量动态排序Excel列,解决列挤在一行的问题
|
||||||
|
* 关键改动:表头构建方式 + 列宽匹配逻辑
|
||||||
|
*/
|
||||||
|
public class FixedDynamicExcelExport {
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
// 1. 模拟测试数据(相电压数据量最多,频率次之,频率偏差最少)
|
||||||
|
List<DataVerifyExcel> dataList = EasyExcel.read("F:\\usr\\response.xlsx")
|
||||||
|
.head(DataVerifyExcel.class)
|
||||||
|
.doReadAllSync();
|
||||||
|
// 2. 导出Excel(替换为你的本地路径,比如桌面)
|
||||||
|
dataList.sort(Comparator.comparing((DataVerifyExcel item) -> item.getCity() + "_" + item.getStationName()+"_"+item.getDevName())
|
||||||
|
.thenComparing(DataVerifyExcel::getAllTime, Comparator.reverseOrder())
|
||||||
|
);
|
||||||
|
exportExcelByDataSize(dataList, "D:/dynamic_excel_fixed.xlsx");
|
||||||
|
System.out.println("导出完成!打开桌面的「测试导出.xlsx」查看效果");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 核心方法:按数据量排序导出Excel
|
||||||
|
*/
|
||||||
|
public static void exportExcelByDataSize(List<DataVerifyExcel> dataList, String outputPath) throws Exception {
|
||||||
|
// 步骤1:统计每个字段的有效数据量
|
||||||
|
Map<String, Integer> fieldCount = countValidData(dataList);
|
||||||
|
// 步骤2:按数据量降序排序字段名
|
||||||
|
List<String> sortedFields = sortFields(fieldCount);
|
||||||
|
// 步骤3:构建正确的动态表头
|
||||||
|
List<List<String>> head = buildCorrectHead(sortedFields);
|
||||||
|
// 步骤4:构建对应顺序的行数据
|
||||||
|
List<List<Object>> data = buildRowData(dataList, sortedFields);
|
||||||
|
|
||||||
|
// 步骤5:导出Excel(含列宽设置)
|
||||||
|
try (FileOutputStream out = new FileOutputStream(outputPath)) {
|
||||||
|
EasyExcel.write(out)
|
||||||
|
.head(head)
|
||||||
|
.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
|
||||||
|
.registerWriteHandler(new FreezeHeaderHandler()) // 用修复后的表头
|
||||||
|
.sheet("数据统计")
|
||||||
|
.doWrite(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, List> exportExcelByDataSize(List<DataVerifyExcel> dataList) {
|
||||||
|
Map<String, List> map = new HashMap<>(2);
|
||||||
|
Map<String, Integer> fieldCount = countValidData(dataList);
|
||||||
|
List<String> sortedFields = sortFields(fieldCount);
|
||||||
|
map.put("head", buildCorrectHead(sortedFields));
|
||||||
|
map.put("data", buildRowData(dataList, sortedFields));
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class FreezeHeaderHandler implements SheetWriteHandler {
|
||||||
|
@Override
|
||||||
|
public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
|
||||||
|
// 表格创建前无需操作
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
|
||||||
|
Sheet sheet = writeSheetHolder.getSheet();
|
||||||
|
// freezePane(c, r):c=冻结列数,r=冻结行数;这里r=1表示冻结第1行(表头),c=0表示不冻结列
|
||||||
|
// 比如 freezePane(1, 1) 表示冻结第一列+第一行
|
||||||
|
sheet.createFreezePane(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HorizontalCellStyleStrategy writeCenterStyle() {
|
||||||
|
// 内容的策略
|
||||||
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
|
||||||
|
//设置 自动换行
|
||||||
|
contentWriteCellStyle.setWrapped(true);
|
||||||
|
//设置 垂直居中
|
||||||
|
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
//设置 水平居中
|
||||||
|
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||||
|
//设置边框样式
|
||||||
|
contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
|
||||||
|
contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
|
||||||
|
contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
|
||||||
|
contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
|
||||||
|
|
||||||
|
WriteFont bodyWriteFont = new WriteFont();
|
||||||
|
bodyWriteFont.setFontHeightInPoints((short) 11);
|
||||||
|
bodyWriteFont.setBold(false);
|
||||||
|
bodyWriteFont.setFontName("宋体");
|
||||||
|
contentWriteCellStyle.setWriteFont(bodyWriteFont);
|
||||||
|
|
||||||
|
// 头部
|
||||||
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
|
||||||
|
// 设置字体居中
|
||||||
|
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
|
||||||
|
WriteFont headWriteFont = new WriteFont();
|
||||||
|
// 设置字体大小为20
|
||||||
|
headWriteFont.setFontHeightInPoints((short) 11);
|
||||||
|
headWriteFont.setBold(false);
|
||||||
|
headWriteFont.setFontName("宋体");
|
||||||
|
headWriteCellStyle.setWriteFont(headWriteFont);
|
||||||
|
|
||||||
|
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
|
||||||
|
}
|
||||||
|
// ★ 修复点1:构建正确的表头(每个列名独立成List)
|
||||||
|
private static List<List<String>> buildCorrectHead(List<String> allFields) {
|
||||||
|
List<List<String>> head = new ArrayList<>();
|
||||||
|
head.add(Collections.singletonList("供电公司"));
|
||||||
|
head.add(Collections.singletonList("所属变电站"));
|
||||||
|
head.add(Collections.singletonList("终端名称"));
|
||||||
|
head.add(Collections.singletonList("监测点名称"));
|
||||||
|
head.add(Collections.singletonList("IP"));
|
||||||
|
head.add(Collections.singletonList("干扰源类型"));
|
||||||
|
head.add(Collections.singletonList("监测对象名称"));
|
||||||
|
head.add(Collections.singletonList("电网侧变电站"));
|
||||||
|
head.add(Collections.singletonList("厂商"));
|
||||||
|
head.add(Collections.singletonList("总指标异常时间"));
|
||||||
|
List<String> sortedFields = allFields.subList(10, allFields.size());
|
||||||
|
for (String field : sortedFields) {
|
||||||
|
// 每个列名单独封装成List,EasyExcel才能识别为不同列
|
||||||
|
head.add(Collections.singletonList(DataVerifyExcel.FIELD_COLUMN_MAP.get(field)));
|
||||||
|
}
|
||||||
|
return head;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 统计有效数据量(无改动,保留)
|
||||||
|
private static Map<String, Integer> countValidData(List<DataVerifyExcel> dataList) {
|
||||||
|
// 1. 初始化计数字典(反射自动提取所有Time结尾的Integer字段,初始值0)
|
||||||
|
Map<String, Integer> countMap = initCountMap();
|
||||||
|
// 2. 判空,避免空指针异常
|
||||||
|
if (dataList == null || dataList.isEmpty()) {
|
||||||
|
return countMap;
|
||||||
|
}
|
||||||
|
// 3. 获取DataStatistic类的所有字段
|
||||||
|
Field[] fields = DataVerifyExcel.class.getDeclaredFields();
|
||||||
|
try {
|
||||||
|
// 4. 遍历每个数据对象
|
||||||
|
for (DataVerifyExcel data : dataList) {
|
||||||
|
// 5. 遍历每个字段,累加数值
|
||||||
|
for (Field field : fields) {
|
||||||
|
// 过滤条件:Integer类型 + 以Time结尾
|
||||||
|
if (field.getType() == Integer.class && field.getName().endsWith("Time") ) {
|
||||||
|
if(!field.getName().equals("allTime")){
|
||||||
|
// 设置可访问私有字段
|
||||||
|
field.setAccessible(true);
|
||||||
|
// 获取当前对象的该字段值
|
||||||
|
Integer value = (Integer) field.get(data);
|
||||||
|
// 非空则累加
|
||||||
|
if (value != null) {
|
||||||
|
String fieldName = field.getName();
|
||||||
|
countMap.put(fieldName, countMap.get(fieldName) + value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
// 捕获反射访问异常,便于排查问题
|
||||||
|
throw new RuntimeException("统计字段时反射访问失败", e);
|
||||||
|
}
|
||||||
|
return countMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 反射初始化计数字典(复用之前的逻辑)
|
||||||
|
private static Map<String, Integer> initCountMap() {
|
||||||
|
Map<String, Integer> countMap = new HashMap<>();
|
||||||
|
Field[] fields = DataVerifyExcel.class.getDeclaredFields();
|
||||||
|
for (Field field : fields) {
|
||||||
|
if (field.getType() == Integer.class && field.getName().endsWith("Time")) {
|
||||||
|
if(!field.getName().equals("allTime")){
|
||||||
|
countMap.put(field.getName(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return countMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 按数据量排序字段(无改动,保留)
|
||||||
|
private static List<String> sortFields(Map<String, Integer> fieldCount) {
|
||||||
|
List<String> fields = new ArrayList<>(fieldCount.keySet());
|
||||||
|
fields.sort((f1, f2) -> fieldCount.get(f2) - fieldCount.get(f1)); // 降序
|
||||||
|
List<String> fieldAlls=new ArrayList<>();
|
||||||
|
fieldAlls.add("city");
|
||||||
|
fieldAlls.add("stationName");
|
||||||
|
fieldAlls.add("devName");
|
||||||
|
fieldAlls.add("lineName");
|
||||||
|
fieldAlls.add("ip");
|
||||||
|
fieldAlls.add("loadType");
|
||||||
|
fieldAlls.add("objName");
|
||||||
|
fieldAlls.add("powerSubstationName");
|
||||||
|
fieldAlls.add("manufacturer");
|
||||||
|
fieldAlls.add("allTime");
|
||||||
|
fieldAlls.addAll(fields);
|
||||||
|
return fieldAlls;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构建行数据(无改动,保留)
|
||||||
|
private static List<List<Object>> buildRowData(List<DataVerifyExcel> dataList, List<String> sortedFields) {
|
||||||
|
List<List<Object>> rows = new ArrayList<>();
|
||||||
|
for (DataVerifyExcel data : dataList) {
|
||||||
|
List<Object> row = new ArrayList<>();
|
||||||
|
for (String field : sortedFields) {
|
||||||
|
try {
|
||||||
|
Field f = DataVerifyExcel.class.getDeclaredField(field);
|
||||||
|
f.setAccessible(true);
|
||||||
|
row.add(f.get(data));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("导出异常数据转换异常:"+e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rows.add(row);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,10 +20,9 @@
|
|||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>pq-device-api</artifactId>
|
<artifactId>pq-device-com</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
<artifactId>system-api</artifactId>
|
<artifactId>system-api</artifactId>
|
||||||
@@ -39,26 +38,10 @@
|
|||||||
<artifactId>common-web</artifactId>
|
<artifactId>common-web</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</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>
|
<dependency>
|
||||||
<groupId>com.njcn.platform</groupId>
|
<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.LineDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||||
import com.njcn.device.biz.pojo.dto.PollutionLineInfoDTO;
|
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 com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|||||||
@@ -11,14 +11,13 @@ import com.njcn.common.utils.HttpResultUtil;
|
|||||||
import com.njcn.device.biz.pojo.dto.*;
|
import com.njcn.device.biz.pojo.dto.*;
|
||||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
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.biz.pojo.po.PqsDeviceUnit;
|
||||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
import com.njcn.device.line.mapper.LineMapper;
|
||||||
import com.njcn.device.pq.mapper.LineMapper;
|
import com.njcn.device.line.service.LineService;
|
||||||
|
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||||
|
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
|
||||||
import com.njcn.device.pq.service.CommTerminalService;
|
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.IPqsDeviceUnitService;
|
||||||
import com.njcn.device.pq.service.LineService;
|
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
@@ -57,9 +56,6 @@ public class CommTerminalController extends BaseController {
|
|||||||
|
|
||||||
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
private final IPqsDeviceUnitService iPqsDeviceUnitService;
|
||||||
|
|
||||||
private final IOverLimitService iOverLimitService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过部门获取所有子集部门所拥有的监测点基本信息
|
* 通过部门获取所有子集部门所拥有的监测点基本信息
|
||||||
@@ -114,8 +110,34 @@ public class CommTerminalController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据部门id获取部门监测点台账信息
|
||||||
|
* @param deptGetLineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("deptGetLineInfo")
|
||||||
|
@ApiOperation("根据部门id获取部门监测点台账信息")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiImplicitParam(name = "deptGetLineParam", value = "请求体", required = true)
|
||||||
|
public HttpResult<List<MonitorCommLedgerInfoDTO>> deptGetLineInfo(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("deptGetLineInfo");
|
||||||
|
List<MonitorCommLedgerInfoDTO> result = commTerminalService.deptGetLineInfo(deptGetLineParam);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据单位获取所有变电站
|
* 根据单位获取所有变电站
|
||||||
* @author cdf
|
* @author cdf
|
||||||
@@ -241,34 +263,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")
|
@PostMapping("/getLineBySubstationRelation")
|
||||||
@ApiOperation("获取变电站和监测点的关系")
|
@ApiOperation("获取变电站和监测点的关系")
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user