Compare commits
122 Commits
2025-11
...
8ccdb84ea9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
b4e5d0c638 |
12
pom.xml
12
pom.xml
@@ -43,7 +43,7 @@
|
||||
<!-- <middle.server.url>10.95.53.49</middle.server.url>-->
|
||||
<middle.server.url>192.168.1.103</middle.server.url>
|
||||
<!--微服务模块发布地址-->
|
||||
<service.server.url>127.0.0.1</service.server.url>
|
||||
<service.server.url>192.168.2.130</service.server.url>
|
||||
<!--docker仓库地址-->
|
||||
<docker.server.url>192.168.1.22</docker.server.url>
|
||||
<!--nacos的ip:port-->
|
||||
@@ -53,9 +53,9 @@
|
||||
<!--nacos的ip:port-->
|
||||
<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>6fd2d036-f390-46ee-9c9d-d5a5c00e3314</nacos.namespace>
|
||||
<!-- <nacos.namespace>12b467cc-a7e6-411d-8944-090cbfa09dde</nacos.namespace>-->
|
||||
<!-- <nacos.namespace>910d0d69-2254-481b-b9f7-7ecf9cb881b0</nacos.namespace>-->
|
||||
<!-- sentinel:port-->
|
||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||
@@ -81,6 +81,7 @@
|
||||
<springcloud.alibaba.version>2.2.7.RELEASE</springcloud.alibaba.version>
|
||||
<hutool.version>5.8.11</hutool.version>
|
||||
<knife4j.version>3.0.2</knife4j.version>
|
||||
<postgresql.version>42.3.8</postgresql.version>
|
||||
<knife4j.aggregation.version>2.0.8</knife4j.aggregation.version>
|
||||
<lombok.version>1.18.18</lombok.version>
|
||||
<mybatis.version>2.1.3</mybatis.version>
|
||||
@@ -171,6 +172,11 @@
|
||||
<artifactId>knife4j-spring-ui</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>${postgresql.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-aggregation-spring-boot-starter</artifactId>
|
||||
|
||||
@@ -83,10 +83,10 @@ public class EventRelevantAnalysisController extends BaseController {
|
||||
public HttpResult<Page<RmpEventDetailAssPO>> queryEventsAssPage(@RequestBody BaseParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("queryEventsAssPage");
|
||||
String searchValue = baseParam.getSearchValue();
|
||||
Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||
if(pattern.matcher(searchValue).find()){
|
||||
throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||
}
|
||||
// Pattern pattern = Pattern.compile(PatternRegex.SPECIAL_REGEX);
|
||||
// if(pattern.matcher(searchValue).find()){
|
||||
// throw new BusinessException(ValidMessage.SPECIAL_REGEX);
|
||||
// }
|
||||
Page<RmpEventDetailAssPO> page = eventRelevantAnalysisService.queryEventsAssPage(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ public class SecondaryEvaluationServiceImpl implements SecondaryEvaluationServic
|
||||
unblance.add(evaluationResult);
|
||||
|
||||
evaluationResult = new AssessResultVO.EvaluationResult();
|
||||
evaluationResult.setData(result.getApproUnblance().multiply(BigDecimal.valueOf(200)));
|
||||
evaluationResult.setData(result.getApproUnblance());
|
||||
evaluationResult.setLimitData(overLimit.getUnblance());
|
||||
evaluationResult.setIsQualified(NumberUtil.isLess(evaluationResult.getData(), evaluationResult.getLimitData()));
|
||||
unblance.add(evaluationResult);
|
||||
|
||||
@@ -322,10 +322,7 @@ public class SgEventServiceImpl extends ServiceImpl<SgEventMapper, SgEvent> impl
|
||||
|
||||
@Override
|
||||
public boolean deleteEventData(List<String> ids) {
|
||||
return this.lambdaUpdate()
|
||||
.set(SgEvent::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(SgEvent::getId, ids)
|
||||
.update();
|
||||
return this.removeByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,6 +51,7 @@ import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -471,6 +472,8 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
||||
|
||||
if (map.containsKey(item.getLineId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||
item.setGdName(areaLineInfoVO.getGdName());
|
||||
@@ -489,7 +492,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
|
||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||
|
||||
@@ -14,7 +14,6 @@ import org.springframework.context.annotation.DependsOn;
|
||||
* @date 2022/11/10
|
||||
*/
|
||||
@Slf4j
|
||||
@DependsOn("proxyMapperRegister")
|
||||
@MapperScan("com.njcn.**.mapper")
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
|
||||
@@ -75,9 +75,9 @@ public interface PatternRegex {
|
||||
String ROLE_REGEX = "^[a-zA-Z][a-zA-Z0-9]{2,50}$";
|
||||
|
||||
/**
|
||||
* 部门名称由汉字组成,长度为0-20
|
||||
* 部门名称由汉字组成,长度为0-32 (前端统一32了这边改下长度)
|
||||
*/
|
||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,20}$";
|
||||
String DEPT_NAME_REGEX = "^[\\u4e00-\\u9fa5]{1,32}$";
|
||||
|
||||
/**
|
||||
* 字典名称包括中文、数字、字母、罗马数字、括号以及点号
|
||||
|
||||
@@ -25,6 +25,12 @@ public class SimpleDTO implements Serializable {
|
||||
@ApiModelProperty(name = "value", value = "数值")
|
||||
private String value;
|
||||
|
||||
/**
|
||||
* 针对云南曲靖特殊处理的五层树标识符
|
||||
* 特殊在不显示供电公司,显示(变电站、线路)这两个是部门的名称+母线_监测点的名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer algoDescribe;
|
||||
|
||||
@@ -74,6 +74,12 @@
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--数据库相关********end-->
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class BusinessDataUtil {
|
||||
List<List<Double>> unTolerateData = new ArrayList<>();
|
||||
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();
|
||||
if (list.get(1) > line) {
|
||||
unTolerateData.add(list);
|
||||
|
||||
@@ -34,24 +34,24 @@ public class NacosLogbackConfigLoader implements SpringApplicationRunListener, A
|
||||
|
||||
@Override
|
||||
public void environmentPrepared(ConfigurableEnvironment environment) {
|
||||
// String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
||||
// String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
||||
// String projectName = environment.getProperty("microservice.ename");
|
||||
// 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);
|
||||
// HttpHeaders headers = new HttpHeaders();
|
||||
// headers.set("cndl408125hawen", "lanxia201");
|
||||
// HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||
// RestTemplate restTemplate = new RestTemplate();
|
||||
// ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
|
||||
// if (response.getStatusCode().is2xxSuccessful()) {
|
||||
// String logbackConfigContent = response.getBody();
|
||||
// //替换项目名称
|
||||
// logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
||||
// logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
||||
// // 应用获取到的Logback配置
|
||||
// applyLogbackConfig(logbackConfigContent);
|
||||
// }
|
||||
/* String serverAddr = environment.getProperty("spring.cloud.nacos.config.server-addr");
|
||||
String namespace = environment.getProperty("spring.cloud.nacos.config.namespace");
|
||||
String projectName = environment.getProperty("microservice.ename");
|
||||
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);
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("cndl408125hawen", "lanxia201");
|
||||
HttpEntity<String> entity = new HttpEntity<>(headers);
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
|
||||
if (response.getStatusCode().is2xxSuccessful()) {
|
||||
String logbackConfigContent = response.getBody();
|
||||
//替换项目名称
|
||||
logbackConfigContent = logbackConfigContent.replace("projectDefaultName",projectName);
|
||||
logbackConfigContent = logbackConfigContent.replace("logDefaultLevel",logLevel);
|
||||
// 应用获取到的Logback配置
|
||||
applyLogbackConfig(logbackConfigContent);
|
||||
}*/
|
||||
}
|
||||
|
||||
private void applyLogbackConfig(String logbackConfigContent) {
|
||||
|
||||
@@ -48,6 +48,28 @@
|
||||
<artifactId>minioss-springboot-starter</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</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>
|
||||
|
||||
</project>
|
||||
@@ -13,6 +13,7 @@ public interface GeneralConstant {
|
||||
Integer LOCAL_DISK = 1;
|
||||
Integer HUAWEI_OBS = 2;
|
||||
Integer MINIO_OSS = 3;
|
||||
Integer AliYUN_OSS = 4;
|
||||
|
||||
/***
|
||||
* 波形文件的3种后缀
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.njcn.oss.utils;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.njcn.ali.oss.util.AliYunOssUtils;
|
||||
import com.njcn.common.config.GeneralInfo;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
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.enums.OssResponseEnum;
|
||||
import io.minio.*;
|
||||
import io.minio.errors.*;
|
||||
import io.minio.messages.Item;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -66,6 +65,11 @@ public class FileStorageUtil {
|
||||
|
||||
private final MinIossProperties minIossProperties;
|
||||
|
||||
/**
|
||||
* 阿里云文件服务器
|
||||
*/
|
||||
private final AliYunOssUtils aliYunOssUtils;
|
||||
|
||||
|
||||
/***
|
||||
* 上传MultipartFile文件,
|
||||
@@ -79,7 +83,7 @@ public class FileStorageUtil {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||
obsUtil.uploadMultipart(multipartFile, filePath);
|
||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
try {
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.upload(multipartFile, minIossProperties.getBucket(), dir);
|
||||
@@ -87,11 +91,15 @@ public class FileStorageUtil {
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||
}
|
||||
}else {
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
filePath = dir;
|
||||
aliYunOssUtils.uploadFile(dir, multipartFile);
|
||||
} else {
|
||||
try {
|
||||
// 构建完整目录:基准目录 + dir子目录
|
||||
Path basePath = Paths.get(generalInfo.getLocalStorePath());
|
||||
Path uploadPath = basePath.resolve(dir); // 将dir作为子目录添加
|
||||
// 将dir作为子目录添加
|
||||
Path uploadPath = basePath.resolve(dir);
|
||||
|
||||
// 确保完整目录存在(包括dir子目录)
|
||||
if (!Files.exists(uploadPath)) {
|
||||
@@ -135,6 +143,9 @@ public class FileStorageUtil {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(multipartFile.getOriginalFilename());
|
||||
obsUtil.uploadMultipart(multipartFile, filePath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
filePath = dir;
|
||||
aliYunOssUtils.uploadFile(dir, multipartFile);
|
||||
} else {
|
||||
try {
|
||||
//把名称存入数据
|
||||
@@ -160,7 +171,7 @@ public class FileStorageUtil {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(fileName);
|
||||
obsUtil.uploadStream(inputStream, filePath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
try {
|
||||
//把名称存入数据
|
||||
MinIoUploadResDTO minIoUploadResDTO = minIoUtils.uploadStream(inputStream, minIossProperties.getBucket(), dir, minIoUtils.minFileName(fileName));
|
||||
@@ -168,14 +179,17 @@ public class FileStorageUtil {
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR);
|
||||
}
|
||||
}else {
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
filePath = dir + fileName;
|
||||
aliYunOssUtils.uploadFile(filePath, inputStream);
|
||||
} else {
|
||||
// 本地存储逻辑
|
||||
try {
|
||||
// 1. 获取本地存储路径
|
||||
String localStoragePath = generalInfo.getLocalStorePath();
|
||||
|
||||
// 2. 确保目录存在(如果不存在则创建)
|
||||
File targetDir = new File(localStoragePath +File.separator+ dir);
|
||||
File targetDir = new File(localStoragePath + File.separator + dir);
|
||||
if (!targetDir.exists()) {
|
||||
boolean created = targetDir.mkdirs();
|
||||
if (!created) {
|
||||
@@ -193,7 +207,7 @@ public class FileStorageUtil {
|
||||
// 5. 返回相对路径
|
||||
filePath = dir + finalFileName;
|
||||
} catch (IOException e) {
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR,e.getMessage());
|
||||
throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
return filePath;
|
||||
@@ -209,6 +223,9 @@ public class FileStorageUtil {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
filePath = dir + minIoUtils.minFileName(fileName);
|
||||
obsUtil.uploadStream(inputStream, filePath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
filePath = dir + fileName;
|
||||
aliYunOssUtils.uploadFile(filePath, inputStream);
|
||||
} else {
|
||||
try {
|
||||
//把名称存入数据
|
||||
@@ -232,6 +249,8 @@ public class FileStorageUtil {
|
||||
String url;
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
url = obsUtil.getFileUrl(filePath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
url = aliYunOssUtils.generatePresignedUrl(filePath, 3600);
|
||||
} else {
|
||||
url = minIoUtils.getObjectUrl(minIossProperties.getBucket(), filePath, 7 * 24 * 60 * 60);
|
||||
}
|
||||
@@ -250,10 +269,12 @@ public class FileStorageUtil {
|
||||
try {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
inputStream = obsUtil.downloadStream(filePath);
|
||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
inputStream = minIoUtils.downloadStream(minIossProperties.getBucket(), filePath);
|
||||
}else {
|
||||
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+filePath);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
inputStream = aliYunOssUtils.downloadStream(filePath);
|
||||
} else {
|
||||
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + filePath);
|
||||
inputStream = Files.newInputStream(path);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
@@ -274,11 +295,13 @@ public class FileStorageUtil {
|
||||
try {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
inputStream = obsUtil.downloadStream(filePath);
|
||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
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);
|
||||
|
||||
// 设置下载文件名(从路径中提取)
|
||||
@@ -331,14 +354,16 @@ public class FileStorageUtil {
|
||||
public void deleteFile(String fileName) {
|
||||
if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
obsUtil.delete(fileName);
|
||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS){
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.MINIO_OSS) {
|
||||
minIoUtils.removeObject(minIossProperties.getBucket(), fileName);
|
||||
} else if(generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK){
|
||||
Path path = Paths.get(generalInfo.getLocalStorePath()+File.separator+fileName);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
aliYunOssUtils.deleteFile(fileName);
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.LOCAL_DISK) {
|
||||
Path path = Paths.get(generalInfo.getLocalStorePath() + File.separator + fileName);
|
||||
try {
|
||||
Files.delete(path);
|
||||
} 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");
|
||||
FileUtil.writeFromStream(stream, file);
|
||||
}else if(generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS){
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) {
|
||||
file = obsUtil.getLastFile(OssPath.LOGBAK);
|
||||
|
||||
} else if (generalInfo.getBusinessFileStorage() == GeneralConstant.AliYUN_OSS) {
|
||||
file = aliYunOssUtils.getLastFile(directory);
|
||||
}
|
||||
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;
|
||||
|
||||
@@ -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}")
|
||||
private String gatewayUrl;
|
||||
|
||||
@Value("${swagger.enable:true}")
|
||||
private Boolean swaggerEnable;
|
||||
|
||||
/**
|
||||
* swagger通用配置
|
||||
*/
|
||||
@@ -96,7 +99,7 @@ public class Knife4jSwaggerConfig {
|
||||
//securyContext
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.apiInfo(apiInfo())
|
||||
.enable(true)
|
||||
.enable(swaggerEnable)
|
||||
.select()
|
||||
// 指定添加swagger注解的方法
|
||||
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
|
||||
@@ -47,6 +47,7 @@ public class FeignConfig {
|
||||
@Bean
|
||||
public Decoder feignDecoder() {
|
||||
return (response, type) -> {
|
||||
|
||||
String bodyStr = Util.toString(response.body().asReader(Util.UTF_8));
|
||||
//对结果进行转换
|
||||
HttpResult<Object> result = PubUtils.json2obj(bodyStr, type);
|
||||
@@ -60,6 +61,8 @@ public class FeignConfig {
|
||||
}
|
||||
switch (commonResponseEnum) {
|
||||
case SUCCESS:
|
||||
// case NO_DATA:
|
||||
// case FAIL:
|
||||
return result;
|
||||
default:
|
||||
throw new BusinessException(result);
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface ValidMessage {
|
||||
|
||||
String NAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
||||
|
||||
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过20字符,请检查name参数";
|
||||
String NAME_FORMAT_ERROR = "名称格式错误,存在特殊符号或超过32字符,请检查name参数";
|
||||
|
||||
String INDUSTRY_NOT_BLANK = "行业不能为空,请检查industry参数";
|
||||
String INDUSTRY_FORMAT_ERROR = "行业格式错误,请检查industry参数";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.njcn.web.service.impl;
|
||||
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
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.dto.DeviceLogDTO;
|
||||
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.utils.PubUtils;
|
||||
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.service.ILogService;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
@@ -46,8 +46,15 @@ public class LogServiceImpl implements ILogService {
|
||||
|
||||
|
||||
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());
|
||||
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());
|
||||
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 (!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) {
|
||||
//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)) {
|
||||
String deviceOperate = returnType.getMethod().getAnnotation(DeviceLog.class).operateType();
|
||||
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);
|
||||
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());
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -163,7 +190,11 @@ public class LogServiceImpl implements ILogService {
|
||||
Integer severity = levelStringToNumber(level);
|
||||
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());
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -171,7 +202,12 @@ public class LogServiceImpl implements ILogService {
|
||||
//推送审计消息功能
|
||||
if (severity != 0) {
|
||||
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) {
|
||||
//publisher.send("/userLogEmailPush", PubUtils.obj2json(logInfoDTO), 2, false);
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<artifactId>pqs-influx</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -51,6 +51,13 @@ public interface CommTerminalGeneralClient {
|
||||
@PostMapping("deptGetLine")
|
||||
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 lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
@@ -50,6 +51,19 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
||||
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
|
||||
public HttpResult<List<DeptGetSubStationDTO>> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据单位获取所有变电站", throwable.toString());
|
||||
|
||||
@@ -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> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.njcn.device.overlimit.mapper;
|
||||
package com.njcn.device.biz.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.overlimit.mapper.OverlimitMapper">
|
||||
<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
|
||||
@@ -28,6 +28,8 @@ public class LineDevGetDTO {
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -97,4 +99,9 @@ public class PollutionLineInfoDTO {
|
||||
* 监测点名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 实际安装位置
|
||||
*/
|
||||
private String actualArea;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class DeptGetLineParam {
|
||||
private Boolean monitorStateRunning=true;
|
||||
|
||||
@ApiModelProperty(name = "isUpToGrid",value = "0.非送国网 1.需要送国网的")
|
||||
|
||||
private Integer isUpToGrid;
|
||||
/**
|
||||
* 0-电网侧
|
||||
@@ -48,4 +47,7 @@ public class DeptGetLineParam {
|
||||
@ApiModelProperty("监测点运行状态")
|
||||
@Range(min = 0, max = 2, message = "监测点运行状态" + ValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer lineRunFlag;
|
||||
|
||||
@ApiModelProperty("搜索值")
|
||||
private String searchValue;
|
||||
}
|
||||
|
||||
@@ -762,81 +762,6 @@ public class Overlimit implements Serializable {
|
||||
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){
|
||||
this.iharm2= iHarmTem[0];
|
||||
|
||||
@@ -57,8 +57,8 @@ public class COverlimitUtil {
|
||||
//配网
|
||||
Float[] iHarmTem = new Float[49];
|
||||
for (int i = 0; i <= 48; i++) {
|
||||
|
||||
iHarmTem[i] = -3.14159f;
|
||||
//目前只处理了配网II类测点,III类测点暂未处理,III类测点参考主网
|
||||
iHarmTem[i] = getHarmTag(i+2,voltageLevel).floatValue();
|
||||
}
|
||||
overlimit.buildIHarm(iHarmTem);
|
||||
overlimit.setINeg(-3.14159f);
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
SELECT DISTINCT
|
||||
monitor.Org_Id AS orgId,
|
||||
monitor.Org_Name AS orgName,
|
||||
monitor.`Powerr_Id` AS powerId,
|
||||
monitor.`Powerr_Name` AS powerName,
|
||||
monitor.Powerr_Id AS powerId,
|
||||
monitor.Powerr_Name AS powerName,
|
||||
monitor.id AS monitorId,
|
||||
monitor.`Name` AS monitorName,
|
||||
monitor.Name AS monitorName,
|
||||
monitor.Line_Id,
|
||||
monitor.Line_Name,
|
||||
pdm.Monitor_Sort AS monitorSort,
|
||||
@@ -29,8 +29,8 @@
|
||||
(
|
||||
SELECT
|
||||
pm.id,
|
||||
pm.`Name`,
|
||||
pm.`Status`,
|
||||
pm.Name,
|
||||
pm.Status,
|
||||
pm.Org_Id,
|
||||
pm.Org_Name,
|
||||
pm.Powerr_Id,
|
||||
@@ -51,8 +51,8 @@
|
||||
) AS monitor
|
||||
INNER JOIN pms_distribution_monitor AS pdm ON monitor.id = pdm.Monitor_Id
|
||||
WHERE
|
||||
monitor.`Status` = 1
|
||||
AND pdm.`Status` = 1
|
||||
monitor.Status = 1
|
||||
AND pdm.Status = 1
|
||||
AND monitor.Org_Id IN
|
||||
<foreach collection="deptIdList" item="orgId" open="(" close=")" separator=",">
|
||||
#{orgId}
|
||||
@@ -85,7 +85,7 @@
|
||||
AND pdm.If_Power_User = #{pwPmsMonitorParam.ifPowerUser}
|
||||
</if>
|
||||
<if test="pwPmsMonitorParam.monitorName !=null and pwPmsMonitorParam.monitorName != ''">
|
||||
AND monitor.`Name` LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
AND monitor.Name LIKE CONCAT('%',#{pwPmsMonitorParam.monitorName},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -70,6 +70,16 @@ public interface GeneralDeviceInfoClient {
|
||||
HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取变电站分类的所有终端综合信息
|
||||
*
|
||||
* @param deviceInfoParam 查询终端条件
|
||||
* @return 获取变电站分类的所有终端综合信息
|
||||
*/
|
||||
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
|
||||
HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody DeviceInfoParam deviceInfoParam);
|
||||
|
||||
|
||||
/**
|
||||
* 获取实际运行终端综合信息
|
||||
*
|
||||
@@ -111,7 +121,7 @@ public interface GeneralDeviceInfoClient {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
|
||||
/**
|
||||
*根据单位获取投运监测点(双系统)
|
||||
|
||||
@@ -3,7 +3,9 @@ package com.njcn.device.pq.api;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.api.fallback.DeviceTreeClientFallbackFactory;
|
||||
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
@@ -11,6 +13,8 @@ import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@@ -51,4 +55,7 @@ public interface LineIntegrityClient {
|
||||
|
||||
@PostMapping("/lineDataQuality")
|
||||
HttpResult<List<LineDataQualityDTO>> getLineDataQuality(@RequestBody LineDataQualityParam lineDataQualityParam);
|
||||
|
||||
@PostMapping("/noData")
|
||||
HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.dataVerifyCountFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.DEVICE, path = "/dataVerifyCount", fallbackFactory = dataVerifyCountFallbackFactory.class, contextId = "dataVerifyCount")
|
||||
public interface PqDataVerifyCountClient {
|
||||
|
||||
/**
|
||||
* 获取有异常数据的监测点相关信息
|
||||
*/
|
||||
@PostMapping("/getAnomalousData")
|
||||
HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param);
|
||||
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.TopMsgPO;
|
||||
import com.njcn.device.pq.pojo.vo.DevDetail;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -59,6 +59,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(DeviceInfoParam deviceInfoParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取变电站分类的所有终端综合信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalRunDeviceInfo(DeviceInfoParam deviceInfoParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取实际运行终端综合信息", throwable.toString());
|
||||
@@ -84,7 +90,7 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -54,6 +55,12 @@ public class LineIntegrityClientFallbackFactory implements FallbackFactory<LineI
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<OnlineMonitorVo>> getNoData(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完成性为0的数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.device.pq.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.PqDataVerifyCountClient;
|
||||
import com.njcn.device.pq.api.PqDevTypeClient;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDevType;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class dataVerifyCountFallbackFactory implements FallbackFactory<PqDataVerifyCountClient> {
|
||||
@Override
|
||||
public PqDataVerifyCountClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = DeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new PqDataVerifyCountClient()
|
||||
{
|
||||
|
||||
@Override
|
||||
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取有异常数据的监测点相关信息异常", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,13 @@ public enum LineBaseEnum {
|
||||
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 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)
|
||||
private Integer lineRunFlag;
|
||||
|
||||
@ApiModelProperty("0:按照监测点搜索 1:按照装置搜索")
|
||||
private Integer lineOrDevice;
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@ApiModelProperty("搜索值")
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 默认全部监测点
|
||||
*
|
||||
@@ -207,6 +215,12 @@ public class DeviceInfoParam implements Serializable {
|
||||
|
||||
@ApiModelProperty("是否是冀北电网一张图树 0:否 1:是")
|
||||
private Integer type = 0;
|
||||
|
||||
@ApiModelProperty("指标")
|
||||
private List<String> dicData;
|
||||
|
||||
@ApiModelProperty("是否展示污染值 0:否 1:是")
|
||||
private Integer isPollution;
|
||||
}
|
||||
|
||||
public Boolean isUserLedger() {
|
||||
|
||||
@@ -93,7 +93,7 @@ public class DeviceParam {
|
||||
@NotBlank(message = "设备制造商不能为空")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "electroplate",value = "电镀功能",required = true)
|
||||
@ApiModelProperty(name = "electroplate",value = "电度功能",required = true)
|
||||
@NotNull(message = "电镀标识不能为空")
|
||||
private Integer electroplate;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.util.List;
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class OnlineRateParam {
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "设备id")
|
||||
@@ -27,4 +26,10 @@ public class OnlineRateParam {
|
||||
|
||||
@ApiModelProperty(name = "type", value = "区分类型0:topid搜索 1:devid搜索")
|
||||
private Integer type;
|
||||
|
||||
@Data
|
||||
public static class Info extends OnlineRateParam {
|
||||
@ApiModelProperty(name = "dicData", value = "字典id")
|
||||
private List<String> dicData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,4 +77,7 @@ public class RunManageParam extends BaseParam implements Serializable {
|
||||
|
||||
@ApiModelProperty(name = "evaluate", value = "评价")
|
||||
private String evaluate;
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "监测点id集合")
|
||||
private List<String> ids;
|
||||
}
|
||||
|
||||
@@ -38,4 +38,12 @@ public class MonitorBaseParam extends BaseParam {
|
||||
@ApiModelProperty(value = "终端厂家")
|
||||
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;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -25,136 +26,306 @@ public class PqDataVerifyBak {
|
||||
/**
|
||||
* 监测点id
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 异常数据时间
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
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 ;
|
||||
|
||||
/**
|
||||
* 电压总谐波畸变率
|
||||
*/
|
||||
@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:异常)
|
||||
*/
|
||||
private Integer dip;
|
||||
@TableField(value = "dip")
|
||||
private Integer dip ;
|
||||
|
||||
/**
|
||||
* 电压暂降异常时间
|
||||
*/
|
||||
@TableField(value = "dip_time")
|
||||
private Integer dipTime ;
|
||||
|
||||
/**
|
||||
* 电压暂升(0:正常 1:异常)
|
||||
*/
|
||||
private Integer rise;
|
||||
@TableField(value = "rise")
|
||||
private Integer rise ;
|
||||
|
||||
/**
|
||||
* 判断所有指标 0:无异常 1:有异常
|
||||
* 电压暂升异常时间
|
||||
*/
|
||||
private Integer state;
|
||||
@TableField(value = "rise_time")
|
||||
private Integer riseTime ;
|
||||
|
||||
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
@TableField(value = "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.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 监测点详细信息
|
||||
@@ -129,6 +130,27 @@ public class AreaLineInfoVO implements Serializable {
|
||||
@ApiModelProperty(name = "smallObjType",value = "检测对象小类")
|
||||
private String smallObjType;
|
||||
|
||||
@ApiModelProperty(name = "powerFlag",value = "电网标志(0-电网侧;1-非电网侧)")
|
||||
private Integer powerFlag;
|
||||
|
||||
@ApiModelProperty(name = "objId",value = "对象id")
|
||||
private String objId;
|
||||
|
||||
@ApiModelProperty(name = "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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class DeviceVO implements Serializable {
|
||||
@ApiModelProperty(name = "manufacturer",value = "设备制造商Guid")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty(name = "electroplate",value = "电镀功能")
|
||||
@ApiModelProperty(name = "electroplate",value = "电度功能")
|
||||
private Integer electroplate;
|
||||
|
||||
@ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
|
||||
|
||||
@@ -36,6 +36,9 @@ public class GridDiagramProVO {
|
||||
|
||||
@ApiModelProperty(name = "integrityRate", value = "数据完整率")
|
||||
private Float integrityRate;
|
||||
|
||||
@ApiModelProperty(name = "onLineRate", value = "数据在线率")
|
||||
private Float onLineRate;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -136,6 +136,18 @@ public class LineIntegrityDataVO implements Serializable {
|
||||
@ApiModelProperty(name = "integrityData",value = "数据完整性")
|
||||
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;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -26,6 +26,6 @@ public class RStatIntegrityVO {
|
||||
|
||||
private Integer realTime;
|
||||
|
||||
private Double integrityRate;
|
||||
private BigDecimal integrityRate;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -11,7 +12,7 @@ import java.time.LocalDateTime;
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
public class RStatOnlinerateVO {
|
||||
public class RStatOnlineRateVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private LocalDateTime timeId;
|
||||
@@ -22,5 +23,5 @@ public class RStatOnlinerateVO {
|
||||
|
||||
private Integer offlineMin;
|
||||
|
||||
private Float onlineRate;
|
||||
private BigDecimal onlineRate;
|
||||
}
|
||||
@@ -77,6 +77,18 @@ public class TerminalOnlineRateDataVO implements Serializable {
|
||||
@ApiModelProperty(name = "onlineRate",value = "在线率")
|
||||
private Double onlineRate;
|
||||
|
||||
/**
|
||||
* 在线分钟数
|
||||
*/
|
||||
@ApiModelProperty(name = "onlineMin",value = "在线分钟数")
|
||||
private Integer onlineMin;
|
||||
|
||||
/**
|
||||
* 离线分钟数
|
||||
*/
|
||||
@ApiModelProperty(name = "offlineMin",value = "离线分钟数")
|
||||
private Integer offlineMin;
|
||||
|
||||
/**
|
||||
* 最新数据时间
|
||||
*/
|
||||
|
||||
@@ -4,6 +4,7 @@ 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;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class DeviceOnlineRate {
|
||||
private Integer belowNum;
|
||||
|
||||
@ApiModelProperty("总终端在线率")
|
||||
private String totalOnlineRate;
|
||||
private BigDecimal totalOnlineRate;
|
||||
|
||||
@ApiModelProperty("统计信息")
|
||||
List<CitDetail> citDetailList;
|
||||
@@ -41,7 +42,7 @@ public class DeviceOnlineRate {
|
||||
private Integer citBelowNum;
|
||||
|
||||
@ApiModelProperty("总终端在线率")
|
||||
private String citTotalOnlineRate;
|
||||
private BigDecimal citTotalOnlineRate;
|
||||
|
||||
@ApiModelProperty("统计信息")
|
||||
List<?> detailList;
|
||||
@@ -82,7 +83,7 @@ public class DeviceOnlineRate {
|
||||
private LocalDateTime timeID;
|
||||
|
||||
@ApiModelProperty("在线率")
|
||||
private String onlineRate;
|
||||
private BigDecimal onlineRate;
|
||||
}
|
||||
|
||||
@Data
|
||||
@@ -123,7 +124,7 @@ public class DeviceOnlineRate {
|
||||
private LocalDateTime latestTime;
|
||||
|
||||
@ApiModelProperty("数据完整性")
|
||||
private Double integrity;
|
||||
private BigDecimal integrity;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @version 1.0.0
|
||||
* @author: chenchao
|
||||
* @date: 2022/07/18 11:04
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class DataVerifyExcel implements Serializable {
|
||||
|
||||
private String lineId;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "供电公司")
|
||||
@Excel(name = "供电公司")
|
||||
private String city;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "所属变电站")
|
||||
@Excel(name = "所属变电站")
|
||||
private String stationName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "终端名称")
|
||||
@Excel(name = "终端名称")
|
||||
private String devName;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "监测点名称")
|
||||
@Excel(name = "监测点名称")
|
||||
private String lineName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "IP")
|
||||
@Excel(name = "IP")
|
||||
private String ip;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "干扰源类型")
|
||||
@Excel(name = "干扰源类型")
|
||||
private String loadType;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "监测对象名称")
|
||||
@Excel(name = "监测对象名称")
|
||||
private String objName;
|
||||
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电网侧变电站")
|
||||
@Excel(name = "电网侧变电站")
|
||||
private String powerSubstationName;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "厂商")
|
||||
@Excel(name = "厂商")
|
||||
private String manufacturer;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "总指标异常时间")
|
||||
@Excel(name = "总")
|
||||
private Integer allTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "频率")
|
||||
@Excel(name = "频率")
|
||||
private Integer freqTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "频率偏差")
|
||||
@Excel(name = "频率偏差")
|
||||
private Integer freqDevTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "相电压有效值")
|
||||
@Excel(name = "相电压有效值")
|
||||
private Integer vRmsTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "正序电压")
|
||||
@Excel(name = "正序电压")
|
||||
private Integer vPosTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "负序电压")
|
||||
@Excel(name = "负序电压")
|
||||
private Integer vNegTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "零序电压")
|
||||
@Excel(name = "零序电压")
|
||||
private Integer vZeroTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压不平衡度")
|
||||
@Excel(name = "电压不平衡度")
|
||||
private Integer vUnbalanceTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "线电压有效值")
|
||||
@Excel(name = "线电压有效值")
|
||||
private Integer rmsLvrTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压正偏差")
|
||||
@Excel(name = "电压正偏差")
|
||||
private Integer vuDevTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压负偏差")
|
||||
@Excel(name = "电压负偏差")
|
||||
private Integer vlDevTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "电压总谐波畸变率")
|
||||
@Excel(name = "电压总谐波畸变率")
|
||||
private Integer vThdTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "相电压基波有效值")
|
||||
@Excel(name = "相电压基波有效值")
|
||||
private Integer vTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电流有效值")
|
||||
@Excel(name = "电流有效值")
|
||||
private Integer iRmsTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "长时闪变")
|
||||
@Excel(name = "长时闪变")
|
||||
private Integer pltTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "间谐波电压含有率")
|
||||
@Excel(name = "间谐波电压含有率")
|
||||
private Integer vInharmTime;
|
||||
|
||||
@ColumnWidth(25)
|
||||
@ExcelProperty(value = "谐波电压含有率")
|
||||
@Excel(name = "谐波电压含有率")
|
||||
private Integer vHarmTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "功率因数")
|
||||
@Excel(name = "功率因数")
|
||||
private Integer pfTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "谐波电压相角")
|
||||
@Excel(name = "谐波电压相角")
|
||||
private Integer vPhasicTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "谐波电压基波相角")
|
||||
@Excel(name = "谐波电压基波相角")
|
||||
private Integer v1PhasicTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压波动")
|
||||
@Excel(name = "电压波动")
|
||||
private Integer flucTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "短时闪变")
|
||||
@Excel(name = "短时闪变")
|
||||
private Integer pstTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压暂降")
|
||||
@Excel(name = "电压暂降")
|
||||
private Integer dipTime;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "电压暂升")
|
||||
@Excel(name = "电压暂升")
|
||||
private Integer riseTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.njcn.device.pq.pojo.vo.dataClean;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-03-31
|
||||
@@ -14,6 +17,8 @@ public class DetailAbnormalVO {
|
||||
|
||||
private String date;
|
||||
|
||||
private List<TimeAndTargetKey> dateTargetList;
|
||||
|
||||
private String monitorName;
|
||||
|
||||
private String bdName;
|
||||
@@ -24,7 +29,13 @@ public class DetailAbnormalVO {
|
||||
|
||||
private String targetKey;
|
||||
|
||||
@Data
|
||||
public static class TimeAndTargetKey {
|
||||
|
||||
private String date;
|
||||
|
||||
private List<VerifyTargetVO> targetKeys;
|
||||
}
|
||||
/**
|
||||
* 异常实体
|
||||
*/
|
||||
@@ -55,6 +66,23 @@ public class DetailAbnormalVO {
|
||||
|
||||
}
|
||||
|
||||
@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
|
||||
public static class DetailLimitInnerVO{
|
||||
|
||||
@@ -78,4 +106,96 @@ public class DetailAbnormalVO {
|
||||
//限值
|
||||
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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,10 +13,10 @@ public class PowerQualityIndicatorsVO {
|
||||
|
||||
@ApiModelProperty(name = "monitorId",value = "监测点id")
|
||||
private String monitorId;
|
||||
//监测点名称
|
||||
|
||||
@ApiModelProperty(name = "monitorName",value = "监测点名称")
|
||||
private String monitorName;
|
||||
//所属终端名称
|
||||
|
||||
@ApiModelProperty(name = "devName",value = "所属终端名称")
|
||||
private String devName;
|
||||
|
||||
@@ -25,23 +25,25 @@ public class PowerQualityIndicatorsVO {
|
||||
|
||||
@ApiModelProperty(name = "manufacturer",value = "所属厂商")
|
||||
private String manufacturer;
|
||||
//所属电站
|
||||
|
||||
@ApiModelProperty(name = "stationName",value = "所属电站")
|
||||
private String stationName;
|
||||
//监测对象类型
|
||||
|
||||
@ApiModelProperty(name = "objType",value = "监测对象类型")
|
||||
private String objType;
|
||||
//监测对象名称
|
||||
|
||||
@ApiModelProperty(name = "objName",value = "监测对象名称")
|
||||
private String objName;
|
||||
//电压等级
|
||||
|
||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||
private String voltageLevel;
|
||||
//异常天数
|
||||
|
||||
@ApiModelProperty(name = "abnormalDay",value = "异常天数")
|
||||
private Integer abnormalDay;
|
||||
//严重度
|
||||
|
||||
@ApiModelProperty(name = "severity",value = "严重度")
|
||||
private Integer severity;
|
||||
|
||||
@ApiModelProperty("地市")
|
||||
private String city;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IPqsDeviceUnitService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -109,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
|
||||
|
||||
@@ -16,18 +16,18 @@ import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 异常数据功能
|
||||
* 异常数据功能
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
@@ -50,7 +50,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorVerifyData")
|
||||
@ApiOperation("异常-获取异常数据主页面")
|
||||
public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<VerifyMonitorVO> getMonitorVerifyData(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyData");
|
||||
VerifyMonitorVO verifyMonitorVO = iPqDataVerifyBakService.getMonitorVerifyData(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -59,7 +59,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorVerifyDay")
|
||||
@ApiOperation("异常-更新按钮-获取异常数据列表")
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorVerifyDay(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyDay");
|
||||
List<PowerQualityIndicatorsVO> list = iPqDataVerifyBakService.getMonitorVerifyDay(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
@@ -72,35 +72,33 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorAbnormalTable")
|
||||
@ApiOperation("异常-弹框-获取异常监测点列表")
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorAbnormalTable(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorAbnormalDetail");
|
||||
List<DetailAbnormalVO> page = iPqDataVerifyBakService.monitorAbnormalTable(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取稳态告警监测点相关信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorAbnormalTableDetail")
|
||||
@ApiOperation("弹框-获取异常监测点列表详情")
|
||||
public HttpResult<List<DetailAbnormalVO.DetailAbnormalInnerVO>> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<DetailAbnormalVO.DetailAbnormalCountVO> monitorAbnormalTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorAbnormalTableDetail");
|
||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
||||
DetailAbnormalVO.DetailAbnormalCountVO list = iPqDataVerifyBakService.monitorAbnormalTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取稳态告警数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorLimitData")
|
||||
@ApiOperation("获取稳态告警数据")
|
||||
public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<VerifyMonitorVO> getMonitorLimitData(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorLimitData");
|
||||
VerifyMonitorVO verifyMonitorVO = iDataVerifyService.getMonitorLimitData(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -109,7 +107,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getMonitorLimitDataDay")
|
||||
@ApiOperation("更新按钮-获取稳态告警数据")
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<PowerQualityIndicatorsVO>> getMonitorLimitDataDay(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorLimitDataDay");
|
||||
List<PowerQualityIndicatorsVO> verifyMonitorVO = iDataVerifyService.getMonitorLimitDataDay(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, verifyMonitorVO, methodDescribe);
|
||||
@@ -121,7 +119,7 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorLimitTable")
|
||||
@ApiOperation("弹框-获取稳态告警监测点列表")
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<List<DetailAbnormalVO>> monitorLimitTable(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorLimitTable");
|
||||
List<DetailAbnormalVO> list = iDataVerifyService.monitorLimitTable(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
@@ -134,12 +132,32 @@ public class DataVerifyController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/monitorLimitTableDetail")
|
||||
@ApiOperation("弹框-获取稳态告警监测点列表详情")
|
||||
public HttpResult<List<DetailAbnormalVO.DetailLimitInnerVO>> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam){
|
||||
public HttpResult<DetailAbnormalVO.DetailLimitCountVO> monitorLimitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("monitorLimitTableDetail");
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||
DetailAbnormalVO.DetailLimitCountVO list = iDataVerifyService.monitorLimitTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/limitTableDetail")
|
||||
@ApiOperation("监测点评价")
|
||||
public HttpResult<DetailAbnormalVO.Assess> limitTableDetail(@RequestBody MonitorBaseParam monitorBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("limitTableDetail");
|
||||
DetailAbnormalVO.Assess list = iDataVerifyService.limitTableDetail(monitorBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/dataVerifyExcel")
|
||||
@ApiOperation(value = "导出异常监测点列表", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
iPqDataVerifyBakService.dataVerifyExcel(response, monitorBaseParam);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -168,10 +168,10 @@ public class DeptLineController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getAllData")
|
||||
@ApiOperation("获取部门监测点表所有数据")
|
||||
@ApiOperation("获取部门监测点表数据(仅查询在运监测点)")
|
||||
public HttpResult<List<DeptLine>> getAllData() {
|
||||
String methodDescribe = getMethodDescribe("getAllData");
|
||||
List<DeptLine> list = deptLineMapper.selectList(null);
|
||||
List<DeptLine> list = deptLineMapper.getOnlineMonitor();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ public class DeviceRunEvaluateController extends BaseController {
|
||||
@ApiOperation("终端评价列表(冀北)")
|
||||
public HttpResult<List<DeviceRunEvaluateVO.Detail>> getRunEvaluateInfo(@RequestBody DeviceInfoParam.BusinessParam businessParam) {
|
||||
String methodDescribe = getMethodDescribe("getRunEvaluateInfo");
|
||||
businessParam.setLineOrDevice(1);
|
||||
List<DeviceRunEvaluateVO.Detail> runEvaluate = deviceRunEvaluateService.getRunEvaluate(businessParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, runEvaluate, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -136,6 +136,22 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPracticalAllDeviceInfoAsSubstation")
|
||||
@ApiOperation("获取按变电站分类的所有终端综合信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "deviceInfoParam", value = "查询终端条件", required = true)
|
||||
})
|
||||
public HttpResult<List<GeneralDeviceDTO>> getPracticalAllDeviceInfoAsSubstation(@RequestBody @Validated DeviceInfoParam deviceInfoParam) {
|
||||
String methodDescribe = getMethodDescribe("getPracticalAllDeviceInfoAsSubstation");
|
||||
List<GeneralDeviceDTO> substationDeviceInfos = generalDeviceService.getDeviceInfoAsSubstation(deviceInfoParam, null, Stream.of(1).collect(Collectors.toList()));
|
||||
if (CollectionUtil.isEmpty(substationDeviceInfos)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, new ArrayList<>(), methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, substationDeviceInfos, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取实际运行终端综合信息
|
||||
*/
|
||||
@@ -269,9 +285,9 @@ public class GeneralDeviceInfoController extends BaseController {
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("终端在线率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ public class GridDiagramController extends BaseController {
|
||||
@ApiOperation("变电站趋势分析")
|
||||
public HttpResult<Map<String, Long>> getGridDiagramSubTendency(@RequestBody GridDiagramParam param){
|
||||
String methodDescribe = getMethodDescribe("getGridDiagramSubTendency");
|
||||
param.getDeviceInfoParam().setPowerFlag(0);
|
||||
Map<String, Long> gridDiagramDevTendency = gridDiagramService.getGridDiagramDevTendency(param,3);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevTendency, methodDescribe);
|
||||
}
|
||||
@@ -91,6 +90,7 @@ public class GridDiagramController extends BaseController {
|
||||
@ApiOperation("监测点趋势分析")
|
||||
public HttpResult<Map<String, Long>> getGridDiagramLineTendency(@RequestBody GridDiagramParam param){
|
||||
String methodDescribe = getMethodDescribe("getGridDiagramLineTendency");
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
Map<String, Long> gridDiagramDevTendency = gridDiagramService.getGridDiagramDevTendency(param,6);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, gridDiagramDevTendency, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.param.LineIntegrityDataParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import com.njcn.device.pq.service.LineIntegrityDataService;
|
||||
@@ -153,9 +154,20 @@ public class LineIntegrityDataController extends BaseController {
|
||||
@ApiOperation("监测点数据完整性(冀北)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<DeviceOnlineRate> getData(@RequestBody DeviceInfoParam.BusinessParam param) {
|
||||
param.setLineOrDevice(0);
|
||||
String methodDescribe = getMethodDescribe("getData");
|
||||
DeviceOnlineRate rate = irStatIntegrityDService.getData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/noData")
|
||||
@ApiOperation("监测点数据完整性为0的数据(冀北)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<OnlineMonitorVo>> getNoData(@RequestBody LineBaseQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getNoData");
|
||||
List<OnlineMonitorVo> rate = irStatIntegrityDService.getNoData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rate, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.device.pq.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyCountService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 异常数据功能
|
||||
* </p>
|
||||
*
|
||||
* @author xy
|
||||
* @since 2025-12-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dataVerifyCount")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "异常数据数量统计")
|
||||
public class PqDataVerifyCountController extends BaseController {
|
||||
|
||||
private final IPqDataVerifyCountService pqDataVerifyCountService;
|
||||
|
||||
/**
|
||||
* 获取有异常数据的监测点相关信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getAnomalousData")
|
||||
@ApiOperation("异常-获取异常数据主页面")
|
||||
public HttpResult<List<OnlineMonitorVo>> getAnomalousData(@RequestBody LineBaseQueryParam param){
|
||||
String methodDescribe = getMethodDescribe("getMonitorVerifyData");
|
||||
List<OnlineMonitorVo> list = pqDataVerifyCountService.getAnomalousData(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,13 +6,11 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.LineDataQualityDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.param.TerminalOnlineRateDataParam;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineRateCensusVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.pq.pojo.vo.TerminalOnlineRateDataVO;
|
||||
import com.njcn.device.pq.service.TerminalOnlineRateDataService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -80,9 +78,9 @@ public class TerminalOnlineRateDataController extends BaseController {
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
@ApiOperation("终端在线率(谐波专用)")
|
||||
@ApiImplicitParam(name = "param", value = "参数实体", required = true)
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
public HttpResult<List<RStatOnlineRateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getOnlineRateByDevIds");
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlineRateMapper.getOnlineRateByDevIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,onlineRateByDevIds,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.njcn.device.pq.controller.jb;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.common.utils.LogUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
import com.njcn.device.pq.service.IPowerDistributionAreaService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 台区信息增删改查
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/distributionArea")
|
||||
@Api(tags = "台账-台区信息")
|
||||
@RequiredArgsConstructor
|
||||
@Validated
|
||||
public class PmsPowerDistributionAreaController extends BaseController {
|
||||
|
||||
private final IPowerDistributionAreaService powerDistributionAreaService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("getPowerDistributionAreaList")
|
||||
@ApiOperation("分页查询台区所有信息")
|
||||
@ApiImplicitParam(name = "baseParam",value = "查询台区信息",required = true)
|
||||
public HttpResult<Page<DistributionArea>> getList(@RequestBody TaiZhangParam baseParam){
|
||||
String methodDescribe = getMethodDescribe("getList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, baseParam);
|
||||
Page<DistributionArea> res = powerDistributionAreaService.getList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/addPowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType=OperateType.ADD)
|
||||
@ApiOperation("新增台区信息")
|
||||
@ApiImplicitParam(name = "newParam", value = "模板实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "新增台区信息",module = 3)
|
||||
public HttpResult<Object> add(@RequestBody @Validated PowerDistributionareaParam newParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
boolean result = powerDistributionAreaService.add(newParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/updatePowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@ApiOperation("修改台区信息")
|
||||
@ApiImplicitParam(name = "UpdateParam", value = "更新实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "修改台区信息",module = 3)
|
||||
public HttpResult<Object> update(@RequestBody @Validated PowerDistributionareaParam UpdateParam){
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
boolean result = powerDistributionAreaService.update(UpdateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除台区信息
|
||||
* @param ids id
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@PostMapping("/deletePowerDistributionArea")
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@ApiOperation("删除台区信息")
|
||||
@ApiImplicitParam(name = "ids", value = "ID索引", required = true)
|
||||
@TerminalOperationLogDesc(value = "删除台区信息",module = 3)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
boolean result = powerDistributionAreaService.delete(ids);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.njcn.device.pq.controller.jb;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.annotation.TerminalOperationLogDesc;
|
||||
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
import com.njcn.device.pq.service.IPowerGenerationUserService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/generationUser")
|
||||
@Api(tags = "台账-发电用户")
|
||||
@RequiredArgsConstructor
|
||||
public class PmsPowerGenerationUserController extends BaseController {
|
||||
|
||||
private final IPowerGenerationUserService iPowerGenerationUserService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addPowerGenerationUser")
|
||||
@ApiOperation("新增发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "新增发电用户",module = 4)
|
||||
public HttpResult<Boolean> addPowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
|
||||
String methodDescribe = getMethodDescribe("addPowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.addPowerGenerationUser(powerGenerationUserParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.UPDATE)
|
||||
@PostMapping("/updatePowerGenerationUser")
|
||||
@ApiOperation("修改发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserParam", value = "发电用户实体", required = true)
|
||||
@TerminalOperationLogDesc(value = "修改发电用户",module = 4)
|
||||
public HttpResult<Boolean> updatePowerGenerationUser(@RequestBody @Validated PowerGenerationUserParam powerGenerationUserParam) {
|
||||
String methodDescribe = getMethodDescribe("updatePowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.updatePowerGenerationUser(powerGenerationUserParam);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/delPowerGenerationUser")
|
||||
@ApiOperation("删除发电用户")
|
||||
@ApiImplicitParam(name = "powerGenerationUserIds", value = "发电用户ids", required = true)
|
||||
@TerminalOperationLogDesc(value = "删除发电用户",module = 4)
|
||||
public HttpResult<Boolean> delPowerGenerationUser(@RequestBody @NotEmpty(message = "发电用户id不可为空") List<String> powerGenerationUserIds) {
|
||||
String methodDescribe = getMethodDescribe("delPowerGenerationUser");
|
||||
boolean result = iPowerGenerationUserService.delPowerGenerationUser(powerGenerationUserIds);
|
||||
if(result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getPowerGenerationUserPageList")
|
||||
@ApiOperation("分页获取发电用户列表")
|
||||
@ApiImplicitParam(name = "baseParam", value = "基本查询体", required = true)
|
||||
public HttpResult<Page<GenerationUser>> getPowerGenerationUserPageList(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("getPowerGenerationUserPageList");
|
||||
Page<GenerationUser> result = iPowerGenerationUserService.getPowerGenerationUserPageList(baseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 台区
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface PowerDistributionAreaMapper extends BaseMapper<DistributionArea> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 台区
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface PowerGenerationUserMapper extends BaseMapper<GenerationUser> {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,5 @@ import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
*/
|
||||
public interface PqDataVerifyBakMapper extends BaseMapper<PqDataVerifyBak> {
|
||||
|
||||
List<DataVerifyExcel> selectDataVerifySum(@Param("param") MonitorBaseParam monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.device.pq.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2025-06-10
|
||||
*/
|
||||
public interface PqDataVerifyCountMapper extends BaseMapper<PqDataVerifyCount> {
|
||||
|
||||
|
||||
List<PqDataVerifyCount> selectSumVerify(@Param("param") OnlineRateParam param);
|
||||
|
||||
List<OnlineMonitorVo> getAnomalousData(@Param("lineIds")List<String> lineIds, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package com.njcn.device.pq.mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -26,7 +26,7 @@ public interface RStatOnlinerateDMapper extends BaseMapper<RStatOnlinerateD> {
|
||||
* @param param
|
||||
* @return List<OnlineRate>
|
||||
*/
|
||||
List<RStatOnlinerateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
|
||||
List<RStatOnlineRateVO> getOnlineRateByDevIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
/**
|
||||
* @Description: 根据终端id集合获取总终端在线lv
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqDataVerifyBakMapper">
|
||||
|
||||
<select id="selectDataVerifySum" resultType="com.njcn.device.pq.pojo.vo.dataClean.DataVerifyExcel">
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(select
|
||||
line_id AS lineId,
|
||||
(
|
||||
sum( freq_time ) +
|
||||
sum( freq_Dev_time ) +
|
||||
sum( v_Rms_time )+
|
||||
sum( v_Pos_time ) +
|
||||
sum( v_Neg_time )+
|
||||
sum( v_Zero_time )+
|
||||
sum( v_Unbalance_time )+
|
||||
sum( rms_Lvr_time ) +
|
||||
sum( vu_Dev_time ) +
|
||||
sum( vl_Dev_time ) +
|
||||
sum( v_Thd_time ) +
|
||||
sum( v_time ) +
|
||||
sum( i_Rms_time ) +
|
||||
sum( plt_time ) +
|
||||
sum( v_Inharm_time ) +
|
||||
sum( v_Harm_time )+
|
||||
sum( pf_time ) +
|
||||
sum( v_Phasic_time ) +
|
||||
sum( v1_Phasic_time ) +
|
||||
sum( fluc_time )+
|
||||
sum( pst_time ) +
|
||||
sum( dip_time ) +
|
||||
sum( rise_time )
|
||||
) allTime,
|
||||
sum( freq_time ) AS freqTime,
|
||||
sum( freq_Dev_time ) AS freqDevTime,
|
||||
sum( v_Rms_time ) AS vRmsTime,
|
||||
sum( v_Pos_time ) AS vPosTime,
|
||||
sum( v_Neg_time ) AS vNegTime,
|
||||
sum( v_Zero_time ) AS vZeroTime,
|
||||
sum( v_Unbalance_time ) AS vUnbalanceTime,
|
||||
sum( rms_Lvr_time ) AS rmsLvrTime,
|
||||
sum( vu_Dev_time ) AS vuDevTime,
|
||||
sum( vl_Dev_time ) AS vlDevTime,
|
||||
sum( v_Thd_time ) AS vThdTime,
|
||||
sum( v_time ) AS vTime,
|
||||
sum( i_Rms_time ) AS iRmsTime,
|
||||
sum( plt_time ) AS pltTime,
|
||||
sum( v_Inharm_time ) AS vInharmTime,
|
||||
sum( v_Harm_time ) AS vHarmTime,
|
||||
sum( pf_time ) AS pfTime,
|
||||
sum( v_Phasic_time ) AS vPhasicTime,
|
||||
sum( v1_Phasic_time ) AS v1PhasicTime,
|
||||
sum( fluc_time ) AS flucTime,
|
||||
sum( pst_time ) AS pstTime,
|
||||
sum( dip_time ) AS dipTime,
|
||||
sum( rise_time ) AS riseTime
|
||||
from
|
||||
pq_data_verify_bak
|
||||
<where>
|
||||
state = 1
|
||||
<if test="param.monitorIds != null and param.monitorIds.size > 0">
|
||||
AND line_id IN
|
||||
<foreach collection='param.monitorIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.searchBeginTime != null and param.searchBeginTime !=''">
|
||||
AND time_id >= #{param.searchBeginTime}
|
||||
</if>
|
||||
<if test="param.searchEndTime != null and param.searchEndTime != ''">
|
||||
AND time_id <= #{param.searchEndTime}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
GROUP BY line_id
|
||||
) a
|
||||
WHERE
|
||||
allTime >0
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.PqDataVerifyCountMapper">
|
||||
|
||||
|
||||
<select id="selectSumVerify" resultType="com.njcn.device.pq.pojo.po.PqDataVerifyCount">
|
||||
SELECT
|
||||
line_id AS lineId,
|
||||
SUM(total) AS total,
|
||||
SUM(total_all) AS totalAll
|
||||
FROM
|
||||
pq_data_verify_count
|
||||
<where>
|
||||
<if test="param!=null and param.ids != null and param.ids.size > 0">
|
||||
AND line_id IN
|
||||
<foreach collection='param.ids' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
group by line_id ;
|
||||
</select>
|
||||
|
||||
<select id="getAnomalousData" resultType="OnlineMonitorVo">
|
||||
SELECT DISTINCT
|
||||
t6.Name gdName,
|
||||
t5.Name subName,
|
||||
t4.Name deviceName,
|
||||
t1.Line_Id lineId,
|
||||
t2.Name lineName,
|
||||
t8.Name monitorObjType,
|
||||
t7.Obj_Name monitorObj,
|
||||
"异常数据" as target,
|
||||
count(t1.time_id) lastDay
|
||||
FROM
|
||||
pq_data_verify_count t1
|
||||
left join pq_line t2 on t1.Line_Id = t2.Id
|
||||
left join pq_line t3 on t2.Pid = t3.Id
|
||||
left join pq_line t4 on t3.Pid = t4.Id
|
||||
left join pq_line t5 on t4.Pid = t5.Id
|
||||
left join pq_line t6 on t5.Pid = t6.Id
|
||||
left join pq_line_detail t7 on t1.Line_Id = t7.Id
|
||||
left join sys_dict_data t8 on t7.Load_Type = t8.Id
|
||||
WHERE
|
||||
t1.total > 0
|
||||
<if test="lineIds!=null and lineIds.size > 0">
|
||||
and Line_Id in
|
||||
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" startTime != null and startTime !=''">
|
||||
and time_id >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null and endTime != ''">
|
||||
and time_id <= #{endTime}
|
||||
</if>
|
||||
GROUP BY
|
||||
Line_Id
|
||||
order by lastDay desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pq.mapper.RStatOnlinerateDMapper">
|
||||
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlinerateVO">
|
||||
<select id="getOnlineRateByDevIds" resultType="com.njcn.device.pq.pojo.vo.RStatOnlineRateVO">
|
||||
select
|
||||
dev_index,
|
||||
sum(online_min) as onlineMin,
|
||||
|
||||
@@ -176,7 +176,6 @@
|
||||
<select id="getDevOnlineByDevIds" resultType="TerminalOnlineRateData">
|
||||
select
|
||||
dev_index devId,
|
||||
avg(online_min/(online_min+offline_min))*100 onlineRate,
|
||||
sum(online_min) onlineMin,
|
||||
sum(offline_min) offlineMin
|
||||
from r_stat_onlinerate_d
|
||||
|
||||
@@ -381,7 +381,7 @@
|
||||
line.LEVEL,
|
||||
line.sort,
|
||||
line.pids,
|
||||
CONCAT(voltage.name, '_', line.name, '(',device.`Name`,')') name,
|
||||
CONCAT(voltage.name, '_', line.name, '(',device.Name,')') name,
|
||||
comFlag.Com_Flag,
|
||||
detail.pt_type,
|
||||
detail.obj_id
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.njcn.device.pq.service;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -40,11 +40,13 @@ public interface CommTerminalService {
|
||||
*/
|
||||
List<DeptGetChildrenMoreDTO> deptGetLine(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
|
||||
List<MonitorCommLedgerInfoDTO> deptGetLineInfo(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<DeptGetChildrenMoreDTO> deptGetAllLine(DeptGetLineParam deptGetLineParam);
|
||||
|
||||
List<LineDevGetDTO> deptGetLineByIdList(List<String> monitorIds);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据单位获取所有变电站
|
||||
* @author cdf
|
||||
|
||||
@@ -41,7 +41,8 @@ public interface IDataVerifyService extends IService<DataVerify> {
|
||||
|
||||
List<DetailAbnormalVO> monitorLimitTable(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface IPowerDistributionAreaService extends IService<DistributionArea> {
|
||||
|
||||
/**
|
||||
* 分页查询所有
|
||||
* @return
|
||||
*/
|
||||
Page<DistributionArea> getList(TaiZhangParam baseParam);
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
boolean add(PowerDistributionareaParam newParam);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param
|
||||
*/
|
||||
boolean update(PowerDistributionareaParam updateParam);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids ids
|
||||
*/
|
||||
boolean delete(List<String> ids);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pms.pojo.po.PowerGenerationUser;
|
||||
import com.njcn.device.pms.pojo.vo.PowerGenerationUserVO;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
public interface IPowerGenerationUserService extends IService<GenerationUser> {
|
||||
|
||||
/**
|
||||
* 新增发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserParam 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean addPowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
|
||||
|
||||
/**
|
||||
* 修改发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserParam 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updatePowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam);
|
||||
|
||||
/**
|
||||
* 删除发电用户
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param powerGenerationUserIds 发电用户
|
||||
* @return boolean
|
||||
*/
|
||||
boolean delPowerGenerationUser(List<String> powerGenerationUserIds);
|
||||
|
||||
/**
|
||||
* 分页查询发电用户列表
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param baseParam 基础参数
|
||||
* @return boolean
|
||||
*/
|
||||
Page<GenerationUser> getPowerGenerationUserPageList(BaseParam baseParam);
|
||||
|
||||
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -27,10 +29,9 @@ public interface IPqDataVerifyBakService extends IService<PqDataVerifyBak> {
|
||||
List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
|
||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam);
|
||||
|
||||
|
||||
void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2025-06-10
|
||||
*/
|
||||
public interface IPqDataVerifyCountService extends IService<PqDataVerifyCount> {
|
||||
|
||||
List<PqDataVerifyCount> getSumVerify( OnlineRateParam param);
|
||||
|
||||
List<OnlineMonitorVo> getAnomalousData(LineBaseQueryParam par);
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineDataQualityParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.pojo.vo.common.DeviceOnlineRate;
|
||||
|
||||
import java.util.List;
|
||||
@@ -37,4 +38,6 @@ public interface IRStatIntegrityDService extends IMppService<RStatIntegrityD> {
|
||||
Boolean saveOrUpdateData(List<MonitorIntegrityDTO> monitorIntegrityDTOList);
|
||||
|
||||
DeviceOnlineRate getData(DeviceInfoParam.BusinessParam param);
|
||||
|
||||
List<OnlineMonitorVo> getNoData(LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
@@ -10,9 +11,10 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.param.SubstationParam;
|
||||
import com.njcn.device.line.mapper.DeptLineMapper;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.biz.pojo.dto.MonitorCommLedgerInfoDTO;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.redis.utils.RedisUtil;
|
||||
@@ -27,6 +29,8 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.njcn.device.pq.enums.LineBaseEnum.DEV_DATA_TYPE_ALL;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
@@ -48,23 +52,17 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
private final RedisUtil redisUtil;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
private final DeptLineMapper deptLineMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 基础获取单位信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@Override
|
||||
public List<DeptGetBase> getDeptChildrenByParent(DeptGetLineParam deptGetLineParam) {
|
||||
/*List<DeptGetBase> redisResult = (List<DeptGetBase>) redisUtil.getObjectByKey(commTerminal + deptGetLineParam.getDeptId());
|
||||
if (CollectionUtil.isNotEmpty(redisResult)) {
|
||||
return redisResult;
|
||||
}*/
|
||||
List<DeptGetBase> result = new ArrayList<>();
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptGetLineParam.getDeptId(), Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
deptDTOList.forEach(it -> {
|
||||
@@ -77,7 +75,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptGetBase.setUnitChildrenList(deptChildren);
|
||||
result.add(deptGetBase);
|
||||
});
|
||||
redisUtil.saveByKey(commTerminal + deptGetLineParam.getDeptId(),result);
|
||||
redisUtil.saveByKey(commTerminal + deptGetLineParam.getDeptId(), result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -87,8 +85,8 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<DeptGetChildrenMoreDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, String> deptMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetChildrenMoreDTO deptGetChildrenMoreDTO = new DeptGetChildrenMoreDTO();
|
||||
deptGetChildrenMoreDTO.setUnitId(item.getUnitId());
|
||||
@@ -100,8 +98,54 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<LineDevGetDTO> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(x->{
|
||||
if(deptMap.containsKey(x.getUnitId())){
|
||||
map.get(i).forEach(x -> {
|
||||
if (deptMap.containsKey(x.getUnitId())) {
|
||||
x.setUnitName(deptMap.get(x.getUnitId()));
|
||||
}
|
||||
});
|
||||
lineList.addAll(map.get(i));
|
||||
}
|
||||
});
|
||||
|
||||
//去重
|
||||
ArrayList<LineDevGetDTO> collect = lineList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
|
||||
Comparator.comparing(LineDevGetDTO::getPointId)
|
||||
)), ArrayList::new));
|
||||
|
||||
deptGetChildrenMoreDTO.setLineBaseList(collect);
|
||||
}
|
||||
result.add(deptGetChildrenMoreDTO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MonitorCommLedgerInfoDTO> deptGetLineInfo(DeptGetLineParam deptGetLineParam) {
|
||||
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(deptGetLineParam.getDeptId()).getData();
|
||||
List<MonitorCommLedgerInfoDTO> ledgerList = deptLineMapper.getMonitorByDeptIds(Stream.of(DEV_DATA_TYPE_ALL.getCode()).collect(Collectors.toList()),deptIds);
|
||||
return ledgerList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetChildrenMoreDTO> deptGetAllLine(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetChildrenMoreDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, String> deptMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevAllGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
1, deptGetLineParam.getLineRunFlag(), deptGetLineParam.getIsUpToGrid());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetChildrenMoreDTO deptGetChildrenMoreDTO = new DeptGetChildrenMoreDTO();
|
||||
deptGetChildrenMoreDTO.setUnitId(item.getUnitId());
|
||||
deptGetChildrenMoreDTO.setUnitName(item.getUnitName());
|
||||
deptGetChildrenMoreDTO.setUnitChildrenList(item.getUnitChildrenList());
|
||||
deptGetChildrenMoreDTO.setDeptLevel(item.getDeptLevel());
|
||||
List<String> deptIds = item.getUnitChildrenList();
|
||||
if (CollectionUtil.isNotEmpty(deptIds)) {
|
||||
List<LineDevGetDTO> lineList = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(x -> {
|
||||
if (deptMap.containsKey(x.getUnitId())) {
|
||||
x.setUnitName(deptMap.get(x.getUnitId()));
|
||||
}
|
||||
});
|
||||
@@ -145,7 +189,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
subList.addAll(map.get(i).stream().map(TerminalGetBase::getLedgerId).distinct().collect(Collectors.toList()));
|
||||
subList.addAll(map.get(i).stream().filter(x-> StrUtil.isNotBlank(x.getObjId())).map(TerminalGetBase::getObjId).distinct().collect(Collectors.toList()));
|
||||
subList.addAll(map.get(i).stream().filter(x -> StrUtil.isNotBlank(x.getObjId())).map(TerminalGetBase::getObjId).distinct().collect(Collectors.toList()));
|
||||
lineList.addAll(map.get(i).stream().map(TerminalGetBase::getLineId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
});
|
||||
@@ -161,7 +205,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetBusBarDTO> deptBusBar(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetBusBarDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),2,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()), 2, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetBusBarDTO deptGetBusBarDTO = new DeptGetBusBarDTO();
|
||||
deptGetBusBarDTO.setUnitId(item.getUnitId());
|
||||
@@ -186,10 +230,10 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type) {
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam, Integer type) {
|
||||
List<DeptGetDeviceDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),type,deptGetLineParam.getLineRunFlag());
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()), type, deptGetLineParam.getLineRunFlag());
|
||||
temDept.forEach(item -> {
|
||||
DeptGetDeviceDTO deptGetDeviceDTO = new DeptGetDeviceDTO();
|
||||
deptGetDeviceDTO.setUnitId(item.getUnitId());
|
||||
@@ -227,7 +271,11 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetSubStationDTO.Info> deptSubStationInfo(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetSubStationDTO.Info> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),deptGetLineParam.getPowerFlag(),deptGetLineParam.getLineRunFlag());
|
||||
List<TerminalGetBase.Extend> anExtends = deptLineService.orgSubStationInfoGet(filterDataTypeNew(deptGetLineParam.getServerName()),
|
||||
deptGetLineParam.getPowerFlag(),
|
||||
deptGetLineParam.getLineRunFlag(),
|
||||
deptGetLineParam.getIsUpToGrid(),
|
||||
deptGetLineParam.getSearchValue());
|
||||
Map<String, List<TerminalGetBase.Extend>> orgSub = anExtends.stream().collect(Collectors.groupingBy(TerminalGetBase::getUnitId));
|
||||
Map<String, String> deptNameMap = temDept.stream().collect(Collectors.toMap(DeptGetBase::getUnitId, DeptGetBase::getUnitName));
|
||||
temDept.forEach(item -> {
|
||||
@@ -245,15 +293,15 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
//获取部门下变电信息
|
||||
List<TerminalGetBase.Extend> sub = orgSub.get(deptId);
|
||||
Map<String, List<TerminalGetBase.Extend>> subMap = sub.stream()
|
||||
.collect(Collectors.groupingBy(x->x.getLedgerId()+"_"+x.getSubName()+"_"+x.getVoltageLevel()));
|
||||
.collect(Collectors.groupingBy(x -> x.getLedgerId() + "_" + x.getSubName() + "_" + x.getVoltageLevel()));
|
||||
for (Map.Entry<String, List<TerminalGetBase.Extend>> stringListEntry : subMap.entrySet()) {
|
||||
String[] split = stringListEntry.getKey().split("_");
|
||||
subGetBase=new SubGetBase();
|
||||
subGetBase = new SubGetBase();
|
||||
subGetBase.setId(split[0]);
|
||||
subGetBase.setName(split[1]);
|
||||
subGetBase.setVoltageLevel(split[2]);
|
||||
subGetBase.setOrgId(deptId);
|
||||
if(deptNameMap.containsKey(deptId)){
|
||||
if (deptNameMap.containsKey(deptId)) {
|
||||
subGetBase.setOrgName(deptNameMap.get(deptId));
|
||||
}
|
||||
//国网监测点
|
||||
@@ -279,12 +327,12 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
@Override
|
||||
public List<SubGetBase> tagOrIdGetSub(SubstationParam substationParam) {
|
||||
List<SubGetBase> subStationList = deptLineService.getSubStationList(substationParam);
|
||||
if(CollUtil.isNotEmpty(subStationList)){
|
||||
if (CollUtil.isNotEmpty(subStationList)) {
|
||||
List<String> ids = subStationList.stream().map(SubGetBase::getOrgId).collect(Collectors.toList());
|
||||
List<Dept> data = deptFeignClient.getDeptInfoListByIds(ids).getData();
|
||||
Map<String, String> deptMap = data.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
subStationList.stream().forEach(x->{
|
||||
if(deptMap.containsKey(x.getOrgId())){
|
||||
subStationList.stream().forEach(x -> {
|
||||
if (deptMap.containsKey(x.getOrgId())) {
|
||||
x.setOrgName(deptMap.get(x.getOrgId()));
|
||||
}
|
||||
});
|
||||
@@ -295,7 +343,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
@Override
|
||||
public List<String> getRunMonitorByDept(MonitorBaseParam monitorBaseParam) {
|
||||
List<String> ids = deptFeignClient.getDepSonIdtByDeptId(monitorBaseParam.getDeptId()).getData();
|
||||
List<String> monitorIds = deptLineService.getLineByDeptIds(ids,monitorBaseParam.getManufacturer(),Stream.of(RunFlagEnum.RUNNING.getStatus()).collect(Collectors.toList()),Stream.of(0,1,2).collect(Collectors.toList()),monitorBaseParam.getObjType());
|
||||
List<String> monitorIds = deptLineService.getLineByDeptIds(ids, monitorBaseParam.getManufacturer(),
|
||||
ObjectUtil.isNotNull(monitorBaseParam.getLineRunFlag())? Arrays.asList(monitorBaseParam.getLineRunFlag()):null,
|
||||
Stream.of(0, 1, 2).collect(Collectors.toList()), monitorBaseParam.getObjType());
|
||||
return monitorIds;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class CommunicateServiceImpl implements CommunicateService {
|
||||
param.setEndTime(DateUtil.endOfDay(DateUtil.parse(endTime)).toString());
|
||||
if (state == 1) {
|
||||
//在线率
|
||||
List<RStatOnlinerateVO> onlineRateByDevIds = onlinerateDMapper.getOnlineRateByDevIds(param);
|
||||
List<RStatOnlineRateVO> onlineRateByDevIds = onlinerateDMapper.getOnlineRateByDevIds(param);
|
||||
if (CollUtil.isNotEmpty(onlineRateByDevIds)) {
|
||||
onlineRateByDevIds.forEach(po -> {
|
||||
//数据完整性 保留四位小数
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -17,35 +18,38 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.overlimit.service.IOverLimitService;
|
||||
import com.njcn.device.pq.mapper.DataVerifyMapper;
|
||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.DataVerify;
|
||||
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IDataVerifyService;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -67,28 +71,19 @@ import java.util.stream.Collectors;
|
||||
public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVerify> implements IDataVerifyService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataVerifyServiceImpl.class);
|
||||
|
||||
private static final String SEPARATOR = "&";
|
||||
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||
|
||||
private final CommTerminalService commTerminalService;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
||||
|
||||
private final DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
||||
|
||||
private final DataLimitRateFeignClient dataLimitRateFeignClient;
|
||||
|
||||
private final DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
private final PqDataVerifyBakMapper pqDataVerifyBakMapper;
|
||||
private final IOverLimitService overLimitService;
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -214,7 +209,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitTargetDto> limitTarget = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> it.getAllTime() > 0).collect(Collectors.toList());
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.toList());
|
||||
long abnormalCount = limitList.stream().map(DataLimitTargetDto::getLineId).distinct().count();
|
||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||
@@ -235,7 +230,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitTargetDto> limitTarget = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> it.getAllTime() > 0).collect(Collectors.toList());
|
||||
List<DataLimitTargetDto> limitList = limitTarget.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.toList());
|
||||
return getLimitTable(limitList, monitorBaseParam);
|
||||
}
|
||||
|
||||
@@ -244,137 +239,50 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(monitorBaseParam.getMonitorIds());
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitRateDetailDto> dataLimitRateDetailDtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Map<LocalDate, List<DataLimitRateDetailDto>> limitMap = dataLimitRateDetailDtoList.stream().collect(Collectors.groupingBy(DataLimitRateDetailDto::getTime));
|
||||
|
||||
limitMap.forEach((date, list) -> {
|
||||
Map<String, DataLimitRateDetailDto> map = list.stream().collect(Collectors.toMap(DataLimitRateDetailDto::getLineId, Function.identity()));
|
||||
map.forEach((lineId, line) -> {
|
||||
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
||||
Integer timeInterval = lineInfoVO.getTimeInterval();
|
||||
Set<String> timeSet = new HashSet<>();
|
||||
List<String> specialTargetList = new ArrayList<>();
|
||||
String jonsStr = "";
|
||||
if (monitorBaseParam.getTargetKey().equals(DicDataEnum.VOLTAGE_DEV.getCode())) {
|
||||
//电压偏差
|
||||
jonsStr = line.getVoltageDevOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.FLICKER.getCode())) {
|
||||
jonsStr = line.getFlickerOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.phase_Voltage.getCode())) {
|
||||
jonsStr = line.getUbalanceOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.FREQUENCY_DEV.getCode())) {
|
||||
jonsStr = line.getFreqDevOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.NEG_CURRENT.getCode())) {
|
||||
jonsStr = line.getINegOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.THD_V.getCode())) {
|
||||
jonsStr = line.getUaberranceOvertime();
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.HARMONIC_VOLTAGE.getCode())) {
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "uharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
}
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.HARMONIC_CURRENT.getCode())) {
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "iharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
}
|
||||
} else if (monitorBaseParam.getTargetKey().equals(DicDataEnum.INTERHARMONIC_VOLTAGE.getCode())) {
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
String uHarmKey = "inuharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
List<DataLimitTargetDto> dataLimitTargetDtoList = dataLimitTargetFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Map<String, List<DataLimitTargetDto>> limitMap = dataLimitTargetDtoList.stream().filter(it -> (it.getAllTime() > 0 || it.getFlickerAllTime() > 0)).collect(Collectors.groupingBy(DataLimitTargetDto::getLineId));
|
||||
limitMap.forEach((lineId, value) -> {
|
||||
LineDetailDataVO lineInfoVO = lineDetailMap.get(lineId);
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setMonitorId(lineId);
|
||||
List<DetailAbnormalVO.TimeAndTargetKey> targetKeyList = new ArrayList<>();
|
||||
DetailAbnormalVO.TimeAndTargetKey targetKey;
|
||||
for (DataLimitTargetDto dto : value) {
|
||||
List<VerifyTargetVO> verifyS = assLimitTarget(Arrays.asList(dto)).stream().filter(x -> x.getIds().size() > 0).collect(Collectors.toList());
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
List<VerifyTargetVO> verify = verifyS.stream().filter(x -> x.getKey().equals(monitorBaseParam.getTargetKey())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(verify)) {
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(dto.getTime().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(verify);
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(line.getVoltageDevOvertime())) {
|
||||
specialTargetList.add(line.getVoltageDevOvertime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(line.getFlickerOvertime())) {
|
||||
specialTargetList.add(line.getFlickerOvertime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(line.getUbalanceOvertime())) {
|
||||
specialTargetList.add(line.getUbalanceOvertime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(line.getFreqDevOvertime())) {
|
||||
specialTargetList.add(line.getFreqDevOvertime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(line.getINegOvertime())) {
|
||||
specialTargetList.add(line.getINegOvertime());
|
||||
}
|
||||
if (StrUtil.isNotBlank(line.getUaberranceOvertime())) {
|
||||
specialTargetList.add(line.getUaberranceOvertime());
|
||||
}
|
||||
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "uharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
}
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "iharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
String uHarmKey = "inuharm" + i + "Overtime";
|
||||
String json = getFieldValueForDetail(line, uHarmKey);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
specialTargetList.add(json);
|
||||
}
|
||||
}
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(dto.getTime().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(verifyS);
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
|
||||
if (CollUtil.isNotEmpty(specialTargetList)) {
|
||||
for (String str : specialTargetList) {
|
||||
JSONArray jsonArray = new JSONArray(str);
|
||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
||||
jsonBaseVOList.forEach(it -> {
|
||||
timeSet.addAll(Arrays.asList(it.getTime().split(StrUtil.COMMA)));
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(StrUtil.isNotBlank(jonsStr)){
|
||||
JSONArray jsonArray = new JSONArray(jonsStr);
|
||||
List<JsonBaseVO> jsonBaseVOList = jsonArray.toList(JsonBaseVO.class);
|
||||
jsonBaseVOList.forEach(it -> {
|
||||
timeSet.addAll(Arrays.asList(it.getTime().split(StrUtil.COMMA)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if(timeSet.size()>0){
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setMonitorId(lineId);
|
||||
detailAbnormalVO.setDate(date.format(DATE_FORMAT));
|
||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||
detailAbnormalVO.setTimeSum(String.valueOf(timeInterval*timeSet.size()));
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
}
|
||||
});
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
detailAbnormalVO.setMonitorName(lineInfoVO.getLineName());
|
||||
detailAbnormalVO.setBdName(lineInfoVO.getBdName());
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DetailAbnormalVO.DetailLimitInnerVO> monitorLimitTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
public DetailAbnormalVO.DetailLimitCountVO monitorLimitTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
List<LineDetailDataVO> lineDetailList = lineMapper.getLineDetailDataVO(monitorBaseParam.getMonitorIds());
|
||||
Map<String, LineDetailDataVO> lineDetailMap = lineDetailList.stream().collect(Collectors.toMap(LineDetailDataVO::getLineId, Function.identity()));
|
||||
DetailAbnormalVO.DetailLimitCountVO v = new DetailAbnormalVO.DetailLimitCountVO();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> result = new ArrayList<>();
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
||||
@@ -382,7 +290,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchBeginTime());
|
||||
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
if (CollUtil.isEmpty(dtoList)) {
|
||||
return result;
|
||||
return v;
|
||||
}
|
||||
|
||||
DataLimitRateDetailDto dto = dtoList.get(0);
|
||||
@@ -392,7 +300,219 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
} else {
|
||||
processAllTargets(dto, targetMap, result);
|
||||
}
|
||||
return result;
|
||||
int size = result.stream().map(DetailAbnormalVO.DetailLimitInnerVO::getTime).collect(Collectors.toSet()).size();
|
||||
v.setTimeSum(lineDetailMap.get(monitorBaseParam.getMonitorIds().get(0)).getTimeInterval() * size);
|
||||
v.setTime(result);
|
||||
return v;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DetailAbnormalVO.Assess limitTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
DetailAbnormalVO.Assess assess = new DetailAbnormalVO.Assess();
|
||||
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
|
||||
lineCountEvaluateParam.setLineId(Collections.singletonList(monitorBaseParam.getMonitorIds().get(0)));
|
||||
lineCountEvaluateParam.setStartTime(monitorBaseParam.getSearchBeginTime());
|
||||
lineCountEvaluateParam.setEndTime(monitorBaseParam.getSearchEndTime());
|
||||
List<DataLimitRateDetailDto> dtoList = dataLimitRateDetailFeignClient.getRawData(lineCountEvaluateParam).getData();
|
||||
Overlimit overLimitDataById = overLimitService.getOverLimitDataById(monitorBaseParam.getMonitorIds().get(0));
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> freq = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> voltage = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> uaberrance = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> ubalance = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> flicker = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> iNeg = new ArrayList<>();
|
||||
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> uharm = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> iharm = new ArrayList<>();
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> inuharm = new ArrayList<>();
|
||||
|
||||
for (DataLimitRateDetailDto dto : dtoList) {
|
||||
dealJsonArr(new JSONArray(dto.getFreqDevOvertime()), freq, DicDataEnum.FREQUENCY_DEV.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getVoltageDevOvertime()), voltage, DicDataEnum.VOLTAGE_DEV.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getUaberranceOvertime()), uaberrance, DicDataEnum.THD_V.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getUbalanceOvertime()), ubalance, DicDataEnum.phase_Voltage.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getFlickerOvertime()), flicker, DicDataEnum.FLICKER.getName(), null);
|
||||
dealJsonArr(new JSONArray(dto.getINegOvertime()), iNeg, DicDataEnum.NEG_CURRENT.getName(), null);
|
||||
// 处理谐波类指标
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.HARMONIC_VOLTAGE.getName(), "uharm", 2, 25, uharm);
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.HARMONIC_CURRENT.getName(), "iharm", 2, 25, iharm);
|
||||
processHarmonicTargetHarm(dto, DicDataEnum.INTERHARMONIC_VOLTAGE.getName(), "inuharm", 1, 16, inuharm);
|
||||
}
|
||||
assess.setFreqLimit(overLimitDataById.getFreqDev());
|
||||
assess.setVDevLimit(overLimitDataById.getVoltageDev());
|
||||
assess.setUDevLimit(overLimitDataById.getUvoltageDev());
|
||||
assess.setUaberranceLimit(overLimitDataById.getUaberrance());
|
||||
assess.setUnbalanceLimit(overLimitDataById.getUbalance());
|
||||
assess.setFlickerLimit(overLimitDataById.getFlicker());
|
||||
assess.setINegLimit(overLimitDataById.getINeg());
|
||||
Map<String, List<PqReasonableRangeDto>> map = new HashMap<>();
|
||||
DataCleanParam param = new DataCleanParam();
|
||||
param.setSystemType(DataCleanEnum.Pqs.getCode());
|
||||
List<PqReasonableRangeDto> list = pqReasonableRangeFeignClient.getData(param).getData();
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
map = list.stream().collect(Collectors.groupingBy(PqReasonableRangeDto::getInfluxdbTableName));
|
||||
}
|
||||
|
||||
List<PqReasonableRangeDto> dataV = map.get(DataCleanEnum.DataV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataVCode = dataV.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
//频率偏差
|
||||
if (CollUtil.isNotEmpty(freq)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.FreqDev.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(freq, dto);
|
||||
assess.setFreqData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
|
||||
//电压偏差
|
||||
if (CollUtil.isNotEmpty(voltage)) {
|
||||
//上偏差
|
||||
PqReasonableRangeDto dto1 = dataVCode.get(DataCleanEnum.VuDev.getCode());
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) > 0)
|
||||
.filter(x -> Double.valueOf(x.getVal()) < dto1.getMaxValue())
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed()).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
DetailAbnormalVO.DetailLimitInnerVO val;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) > 0)
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val = collect2.get(0);
|
||||
val.setVal(dto1.getMaxValue().toString());
|
||||
}
|
||||
assess.setVDevData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//下偏差
|
||||
PqReasonableRangeDto dto2 = dataVCode.get(DataCleanEnum.VlDev.getCode());
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) < 0)
|
||||
.filter(x -> dto2.getMinValue() < Double.valueOf(x.getVal()))
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(collect2)) {
|
||||
DetailAbnormalVO.DetailLimitInnerVO val2;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val2 = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect3 = voltage.stream()
|
||||
.filter(x -> Double.valueOf(x.getVal()) < 0)
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val2 = collect3.get(0);
|
||||
val2.setVal(dto2.getMaxValue().toString());
|
||||
}
|
||||
assess.setUDevData(NumberUtil.round(val2.getVal(), 2).doubleValue());
|
||||
}
|
||||
}
|
||||
//负序电流
|
||||
if (CollUtil.isNotEmpty(iNeg)) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = iNeg.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = collect.get(0);
|
||||
assess.setINegData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//电压总谐波
|
||||
if (CollUtil.isNotEmpty(uaberrance)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||
assess.setUaberranceData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//三相不平衡度
|
||||
if (CollUtil.isNotEmpty(ubalance)) {
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VUnbalance.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(ubalance, dto);
|
||||
assess.setUnbalanceData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//闪变
|
||||
List<PqReasonableRangeDto> dataPlt = map.get(DataCleanEnum.DataPlt.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataPltCode = dataPlt.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(flicker)) {
|
||||
PqReasonableRangeDto dto = dataPltCode.get(DataCleanEnum.Plt.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(flicker, dto);
|
||||
assess.setFlickerData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
//谐波电压
|
||||
List<PqReasonableRangeDto> dataHarmRate = map.get(DataCleanEnum.DataHarmRateV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataHarmRateCode = dataHarmRate.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(uharm)) {
|
||||
PqReasonableRangeDto dto = dataHarmRateCode.get(DataCleanEnum.V_Rate.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uharm, dto);
|
||||
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getUharm" + split[0];
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setUharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} else {
|
||||
if(CollUtil.isNotEmpty(uaberrance)){
|
||||
PqReasonableRangeDto dto = dataVCode.get(DataCleanEnum.VThd.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(uaberrance, dto);
|
||||
assess.setUharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
}
|
||||
}
|
||||
//谐波电流
|
||||
if (CollUtil.isNotEmpty(iharm)) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = iharm.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = collect.get(0);
|
||||
assess.setIharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getIharm" + split[0];
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setIharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
//间谐波电压
|
||||
List<PqReasonableRangeDto> dataInHarm = map.get(DataCleanEnum.DataInHarmV.getCode());
|
||||
Map<String, PqReasonableRangeDto> dataInHarmCode = dataInHarm.stream().collect(Collectors.toMap(PqReasonableRangeDto::getIndexCode, Function.identity()));
|
||||
if (CollUtil.isNotEmpty(inuharm)) {
|
||||
PqReasonableRangeDto dto = dataInHarmCode.get(DataCleanEnum.V_InHarm.getCode());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val = reasonAble(inuharm, dto);
|
||||
assess.setInuharmData(NumberUtil.round(val.getVal(), 2).doubleValue());
|
||||
String[] split = val.getTargetName().split("次");
|
||||
try {
|
||||
Class<?> clazz = overLimitDataById.getClass();
|
||||
String methodName = "getInuharm" + (int)(Double.valueOf(split[0])+0.5);
|
||||
Method method = clazz.getMethod(methodName);
|
||||
Float value = (Float) method.invoke(overLimitDataById);
|
||||
assess.setInuharmLimit(value);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return assess;
|
||||
}
|
||||
|
||||
private DetailAbnormalVO.DetailLimitInnerVO reasonAble(List<DetailAbnormalVO.DetailLimitInnerVO> limit, PqReasonableRangeDto dto) {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect = limit.stream()
|
||||
.filter(x -> dto.getMinValue() < Double.valueOf(x.getVal()) && Double.valueOf(x.getVal()) < dto.getMaxValue())
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed()).collect(Collectors.toList());
|
||||
DetailAbnormalVO.DetailLimitInnerVO val;
|
||||
if (CollUtil.isNotEmpty(collect)) {
|
||||
val = collect.get(0);
|
||||
} else {
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> collect2 = limit.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailLimitInnerVO::getVal).reversed())
|
||||
.collect(Collectors.toList());
|
||||
val = collect2.get(0);
|
||||
val.setVal(dto.getMaxValue().toString());
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
private Map<String, DictData> getTargetMap() {
|
||||
@@ -463,6 +583,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
processHarmonicTarget(dto, targetMap, DicDataEnum.HARMONIC_CURRENT.getCode(), "iharm", 2, 25, result);
|
||||
processHarmonicTarget(dto, targetMap, DicDataEnum.INTERHARMONIC_VOLTAGE.getCode(), "inuharm", 1, 16, result);
|
||||
}
|
||||
|
||||
private void processStandardTarget(DataLimitRateDetailDto dto, Map<String, DictData> targetMap,
|
||||
String targetCode, String data,
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
||||
@@ -482,6 +603,13 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
processSpecialTargets(tempList, result, targetName);
|
||||
}
|
||||
|
||||
private void processHarmonicTargetHarm(DataLimitRateDetailDto dto, String targetCode, String prefix, int start, int end,
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> result) {
|
||||
List<String> tempList = new ArrayList<>();
|
||||
collectHarmonicData(dto, prefix, start, end, tempList);
|
||||
processSpecialTargets(tempList, result, targetCode);
|
||||
}
|
||||
|
||||
private void processSpecialTargets(List<String> specialTargetList, List<DetailAbnormalVO.DetailLimitInnerVO> result, String targetName) {
|
||||
for (String strJson : specialTargetList) {
|
||||
String[] temStr = strJson.split(SEPARATOR);
|
||||
@@ -559,13 +687,15 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
for (int i = 2; i <= 25; i++) {
|
||||
String uHarmKey = "uharm" + i + "Overtime";
|
||||
String iHarmKey = "iharm" + i + "Overtime";
|
||||
String inuHarmKey = "inuharm" + i + "Overtime";
|
||||
if (getFieldValue(it, uHarmKey) != null && getFieldValue(it, uHarmKey) == 1) {
|
||||
HARMONIC_VOLTAGE.add(it.getLineId());
|
||||
}
|
||||
if (getFieldValue(it, iHarmKey) != null && getFieldValue(it, iHarmKey) == 1) {
|
||||
HARMONIC_CURRENT.add(it.getLineId());
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
String inuHarmKey = "inuharm" + i + "Overtime";
|
||||
if (getFieldValue(it, inuHarmKey) != null && getFieldValue(it, inuHarmKey) == 1) {
|
||||
INTERHARMONIC_VOLTAGE.add(it.getLineId());
|
||||
}
|
||||
@@ -599,7 +729,12 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
String fieldName = prefix + i + "Overtime";
|
||||
String json = getFieldValueForDetail(dto, fieldName);
|
||||
if (StrUtil.isNotBlank(json)) {
|
||||
result.add(json + SEPARATOR + i);
|
||||
if (end == 16) {
|
||||
result.add(json + SEPARATOR + (i - 0.5));
|
||||
} else {
|
||||
result.add(json + SEPARATOR + i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -758,7 +893,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<LocalDate> dateList = list.stream().map(it -> it.getTime().toLocalDate()).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||
processTable(monitorBaseParam, dateList, result, key);
|
||||
});
|
||||
dealTableResult(result);
|
||||
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -770,7 +905,7 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
List<LocalDate> dateList = list.stream().map(DataLimitTargetDto::getTime).distinct().sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||
processTable(monitorBaseParam, dateList, result, key);
|
||||
});
|
||||
dealTableResult(result);
|
||||
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -797,34 +932,44 @@ public class DataVerifyServiceImpl extends ServiceImpl<DataVerifyMapper, DataVer
|
||||
}
|
||||
}
|
||||
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result) {
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
|
||||
if (CollUtil.isNotEmpty(result)) {
|
||||
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
// List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
// Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
||||
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
|
||||
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
result.forEach(it -> {
|
||||
if (areaMap.containsKey(it.getMonitorId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId());
|
||||
it.setMonitorName(areaLineInfoVO.getLineName());
|
||||
it.setStationName(areaLineInfoVO.getSubName());
|
||||
it.setDevName(areaLineInfoVO.getDeviceName());
|
||||
it.setVoltageLevel(areaLineInfoVO.getVoltageScale());
|
||||
it.setIp(Base64.encode(areaLineInfoVO.getIp()));
|
||||
it.setManufacturer(areaLineInfoVO.getManufacturer());
|
||||
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
}
|
||||
if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
|
||||
Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
|
||||
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
|
||||
Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
|
||||
// List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
// List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
// Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
List<PowerQualityIndicatorsVO> info = new ArrayList<>();
|
||||
for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
|
||||
if (areaMap.containsKey(lineDetail.getLineId())) {
|
||||
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||
it.setMonitorName(lineDetail.getLineName());
|
||||
it.setStationName(lineDetail.getSubName());
|
||||
if (deptName.containsKey(lineDetail.getLineId())) {
|
||||
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||
}
|
||||
it.setDevName(lineDetail.getDeviceName());
|
||||
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||
it.setIp(Base64.encode(lineDetail.getIp()));
|
||||
it.setManufacturer(lineDetail.getManufacturer());
|
||||
it.setObjType(lineDetail.getLoadType());
|
||||
it.setObjName(lineDetail.getObjName());
|
||||
info.add(it);
|
||||
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
// }
|
||||
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
result.clear();
|
||||
result.addAll(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateField;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
@@ -14,22 +15,19 @@ import com.njcn.device.common.mapper.onlinerate.OnLineRateMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.line.service.LineService;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DevRunEvaluateParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.enums.PowerFlagEnum;
|
||||
import com.njcn.device.pq.enums.RunFlagEnum;
|
||||
import com.njcn.device.pq.mapper.RStatOnlinerateDMapper;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.dto.MonitorInfoDTO;
|
||||
import com.njcn.device.pq.pojo.param.DevRunEvaluateParam;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.*;
|
||||
import com.njcn.device.pq.service.DeviceRunEvaluateService;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyCountService;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.harmonic.api.RStatLimitRateDClient;
|
||||
import com.njcn.harmonic.pojo.param.RStatLimitQueryParam;
|
||||
@@ -48,9 +46,8 @@ import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
@@ -73,6 +70,7 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
private final OnLineRateMapper onLineRateMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final IPqDataVerifyCountService pqDataVerifyCountService;
|
||||
/**
|
||||
* 数据完整性:50%
|
||||
*/
|
||||
@@ -352,8 +350,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
Map<String, String> deptMap = deptList.stream().collect(Collectors.toMap(Dept::getId, Dept::getName));
|
||||
|
||||
List<DeviceRunEvaluateVO.Detail> info = new ArrayList<>();
|
||||
List<Integer> devRun=ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag());
|
||||
param.setLineRunFlag(null);
|
||||
//获取终端台账类信息
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, ObjectUtil.isNull(param.getLineRunFlag()) ? null : Arrays.asList(param.getLineRunFlag()), Arrays.asList(1));
|
||||
List<GeneralDeviceDTO> deviceInfo = deviceService.getDeviceInfo(param, devRun, Arrays.asList(1));
|
||||
if (CollUtil.isNotEmpty(deviceInfo)) {
|
||||
List<String> deviceIds = deviceInfo.stream()
|
||||
.flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList())
|
||||
@@ -378,10 +378,12 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
DeviceRunEvaluateVO.Detail detail;
|
||||
//完整率
|
||||
List<RStatIntegrityVO> integrityList = integrityDMapper.getLineIntegrityRateInfo(lineIds, param.getSearchBeginTime(), param.getSearchEndTime());
|
||||
//超标率
|
||||
List<RStatLimitRateDPO> limitRatePOList = rStatLimitRateDClient.monitorIdsGetLimitInfo(rStatLimitQueryParam).getData();
|
||||
//获取所有终端在线率
|
||||
List<RStatOnlinerateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
List<RStatOnlineRateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
//异常信息
|
||||
onlineRateParam.setIds(lineIds);
|
||||
List<PqDataVerifyCount> sumVerify = pqDataVerifyCountService.getSumVerify(onlineRateParam);
|
||||
|
||||
|
||||
for (GeneralDeviceDTO dto : deviceInfo) {
|
||||
detail = new DeviceRunEvaluateVO.Detail();
|
||||
@@ -389,10 +391,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
detail.setCount(dto.getDeviceIndexes().size());
|
||||
detail.setOnline(onLineRate(onlineRateByDev, dto.getDeviceIndexes()));
|
||||
detail.setIntegrity(integrity(integrityList, dto.getLineIndexes()));
|
||||
detail.setQualified(limitRate(limitRatePOList, dto.getLineIndexes()));
|
||||
detail.setQualified(verifyDev(sumVerify, dto.getLineIndexes(), dto.getDeviceIndexes()));
|
||||
detail.setScore(ONINTEGRITY.multiply(detail.getIntegrity())
|
||||
.add(ONLINERATE.multiply(detail.getOnline())
|
||||
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros());
|
||||
.add(LIMITRATE.multiply(detail.getQualified()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
||||
Map<String, List<DevDetailVO>> dev = lineDeviceByDevIds
|
||||
.stream()
|
||||
.filter(x -> dto.getDeviceIndexes().contains(x.getDevId()))
|
||||
@@ -406,6 +408,8 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
evaluateVO.setName(value.get(0).getDevName());
|
||||
evaluateVO.setSubName(value.get(0).getSubName());
|
||||
evaluateVO.setIp(value.get(0).getIp());
|
||||
evaluateVO.setCompany(value.get(0).getCompany());
|
||||
evaluateVO.setRunFlag(RunFlagEnum.getRunFlagRemarkByStatus(value.get(0).getRunFlag()));
|
||||
//部门
|
||||
if (deptMap.containsKey(value.get(0).getCit())) {
|
||||
evaluateVO.setCit(deptMap.get(value.get(0).getCit()));
|
||||
@@ -416,10 +420,10 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
}
|
||||
evaluateVO.setOnLineRate(onLineRate(onlineRateByDev, Arrays.asList(key)));
|
||||
evaluateVO.setIntegrityRate(integrity(integrityList, ids));
|
||||
evaluateVO.setPassRate(limitRate(limitRatePOList, ids));
|
||||
evaluateVO.setPassRate(verify(sumVerify, ids));
|
||||
evaluateVO.setEvaluate(ONINTEGRITY.multiply(evaluateVO.getIntegrityRate())
|
||||
.add(ONLINERATE.multiply(evaluateVO.getOnLineRate())
|
||||
.add(LIMITRATE.multiply(evaluateVO.getPassRate()))).stripTrailingZeros());
|
||||
.add(LIMITRATE.multiply(evaluateVO.getPassRate()))).stripTrailingZeros().setScale(2, RoundingMode.HALF_UP));
|
||||
deviceDetail.add(evaluateVO);
|
||||
});
|
||||
}
|
||||
@@ -430,24 +434,62 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
return info;
|
||||
}
|
||||
|
||||
private BigDecimal verifyDev(List<PqDataVerifyCount> sumVerify, List<String> lineIds, List<String> devIds) {
|
||||
//异常率
|
||||
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x->x.getTotal()>0).filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
List<String> verifyLine = verifyList.stream().map(PqDataVerifyCount::getLineId).distinct().collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(verifyLine)) {
|
||||
List<String> devIdsLine = lineMapper.getDevIdsLine(verifyLine);
|
||||
if (CollUtil.isNotEmpty(devIdsLine)) {
|
||||
return NumberUtil.round(Math.min(devIdsLine.size() * 100.0 / devIds.size(), 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private BigDecimal verify(List<PqDataVerifyCount> sumVerify, List<String> lineIds) {
|
||||
//异常率
|
||||
List<PqDataVerifyCount> verifyList = sumVerify.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(verifyList)) {
|
||||
double total = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotal).sum();
|
||||
double totalAll = verifyList.stream().mapToDouble(PqDataVerifyCount::getTotalAll).sum();
|
||||
if (totalAll == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return NumberUtil.round(Math.min(total * 100.0 / totalAll, 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal integrity(List<RStatIntegrityVO> integrityList, List<String> lineIds) {
|
||||
//监测完整率
|
||||
List<RStatIntegrityVO> integrityDS = integrityList.stream().filter(x -> lineIds.contains(x.getLineIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(integrityDS)) {
|
||||
double realTime = integrityDS.stream().mapToDouble(RStatIntegrityVO::getRealTime).sum();
|
||||
double dueTime = integrityDS.stream().mapToDouble(RStatIntegrityVO::getDueTime).sum();
|
||||
return NumberUtil.round(Math.min(realTime * 100 / dueTime, 100), 2);
|
||||
if (dueTime == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return NumberUtil.round(Math.min(realTime * 100.0 / dueTime, 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
}
|
||||
|
||||
private BigDecimal onLineRate(List<RStatOnlinerateVO> onlineRateByDev, List<String> devIds) {
|
||||
private BigDecimal onLineRate(List<RStatOnlineRateVO> onlineRateByDev, List<String> devIds) {
|
||||
//终端在线率
|
||||
List<RStatOnlinerateVO> onlineRateDS = onlineRateByDev.stream().filter(x -> devIds.contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
List<RStatOnlineRateVO> onlineRateDS = onlineRateByDev.stream().filter(x -> devIds.contains(x.getDevIndex())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(onlineRateDS)) {
|
||||
double onlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateVO::getOnlineMin).sum();
|
||||
double offlineTime = onlineRateDS.stream().mapToDouble(RStatOnlinerateVO::getOfflineMin).sum();
|
||||
double onlineTime = onlineRateDS.stream().mapToDouble(RStatOnlineRateVO::getOnlineMin).sum();
|
||||
double offlineTime = onlineRateDS.stream().mapToDouble(RStatOnlineRateVO::getOfflineMin).sum();
|
||||
if ((onlineTime + offlineTime) == 0) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
return NumberUtil.round(Math.min(onlineTime * 100.0 / (onlineTime + offlineTime), 100), 2);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
@@ -455,6 +497,9 @@ public class DeviceRunEvaluateServiceImpl implements DeviceRunEvaluateService {
|
||||
}
|
||||
|
||||
private BigDecimal limitRate(List<RStatLimitRateDPO> limitRatePOList, List<String> lineIds) {
|
||||
if (CollUtil.isEmpty(limitRatePOList)) {
|
||||
return new BigDecimal(0);
|
||||
}
|
||||
//超标信息
|
||||
List<RStatLimitRateDPO> limitRateDPOS = limitRatePOList.stream().filter(x -> lineIds.contains(x.getLineId())).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(limitRateDPOS)) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenMoreDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.common.mapper.onlinerate.OnLineRateMapper;
|
||||
import com.njcn.device.common.service.GeneralDeviceService;
|
||||
import com.njcn.device.device.service.IDeviceService;
|
||||
import com.njcn.device.line.mapper.LineDetailMapper;
|
||||
@@ -26,6 +27,7 @@ import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.*;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramProVO;
|
||||
import com.njcn.device.pq.pojo.vo.GridDiagramVO;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlineRateVO;
|
||||
import com.njcn.device.pq.service.*;
|
||||
import com.njcn.device.rstatintegrity.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
@@ -66,6 +68,7 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
private final LineService lineService;
|
||||
private final DeptLineService deptLineService;
|
||||
private final LineDetailMapper lineDetailMapper;
|
||||
private final OnLineRateMapper onLineRateMapper;
|
||||
|
||||
@Override
|
||||
public GridDiagramVO getGridDiagramMonitor(GridDiagramParam param) {
|
||||
@@ -74,15 +77,14 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
List<DictData> v = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.PANORAMIC_VOLTAGE.getCode()).getData();
|
||||
List<String> voltageIds;
|
||||
//获取电压等级550 220 110 35
|
||||
if(CollUtil.isNotEmpty(v)){
|
||||
if (CollUtil.isNotEmpty(v)) {
|
||||
List<String> vName = v.stream().map(DictData::getName).collect(Collectors.toList());
|
||||
voltageIds = dictDataList.stream().filter(item -> vName.contains(item.getName())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList());
|
||||
}else{
|
||||
} else {
|
||||
voltageIds = dictDataList.stream().filter(item -> Objects.equals(DicDataEnum.DY_500KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_220KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_110KV.getCode(), item.getCode()) || Objects.equals(DicDataEnum.DY_35KV.getCode(), item.getCode())).sorted(Comparator.comparing(DictData::getSort).reversed()).map(DictData::getId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
GridDiagramVO gridDiagramVO = new GridDiagramVO();
|
||||
List<GridDiagramVO.LineStatistics> info = new ArrayList<>();
|
||||
List<GridDiagramVO.LineStatistics> gwInfo = new ArrayList<>();
|
||||
@@ -295,11 +297,11 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public Map<String, Long> getGridDiagramDevTendency(GridDiagramParam param, Integer type) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
if (type == 3) {
|
||||
param.getDeviceInfoParam().setPowerFlag(0);
|
||||
List<Integer> runFlag = new ArrayList<>();
|
||||
if (3 != type) {
|
||||
runFlag.add(0);
|
||||
}
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), runFlag, Stream.of(1).collect(Collectors.toList()));
|
||||
Map<String, Long> map = new LinkedHashMap<>();
|
||||
DateField dateField;
|
||||
DateTime parse;
|
||||
@@ -359,7 +361,6 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public List<GridDiagramVO.DeviceData> getGridDiagramDevData(GridDiagramParam param) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
// 获取所有数据
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfo(param.getDeviceInfoParam(), Stream.of(0).collect(Collectors.toList()), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
|
||||
@@ -399,9 +400,8 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
|
||||
@Override
|
||||
public List<GridDiagramVO.DevData> getGridDiagramDevDataList(GridDiagramParam param) {
|
||||
param.getDeviceInfoParam().setLineRunFlag(0);
|
||||
List<GridDiagramVO.DevData> info = new ArrayList<>();
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfoAsDept(param.getDeviceInfoParam(), null, Stream.of(1).collect(Collectors.toList()));
|
||||
List<GeneralDeviceDTO> generalDeviceDTOList = generalDeviceService.getDeviceInfoAsDept(param.getDeviceInfoParam(), Arrays.asList(0), Stream.of(1).collect(Collectors.toList()));
|
||||
List<String> devIds = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).collect(Collectors.toList());
|
||||
//终端信息
|
||||
List<Device> devList = new ArrayList<>();
|
||||
@@ -475,13 +475,16 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
GridDiagramProVO.Details details = new GridDiagramProVO.Details();
|
||||
Stream<LineDetail> stream = lines.stream();
|
||||
Stream<LineDetail> stream2 = lines.stream();
|
||||
Stream<LineDetail> stream3 = lines.stream();
|
||||
if (gwType != null) {
|
||||
stream = stream.filter(x -> x.getMonitorFlag() == gwType);
|
||||
stream2 = stream2.filter(x -> x.getMonitorFlag() == gwType);
|
||||
stream3 = stream3.filter(x -> x.getMonitorFlag() == gwType);
|
||||
}
|
||||
if (powerFlag != null) {
|
||||
stream = stream.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
stream2 = stream2.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
stream3 = stream3.filter(x -> x.getPowerFlag() == powerFlag);
|
||||
}
|
||||
//总监测点
|
||||
List<String> ids = stream.map(LineDetail::getId).collect(Collectors.toList());
|
||||
@@ -499,6 +502,23 @@ public class GridDiagramServiceImpl implements GridDiagramService {
|
||||
} else {
|
||||
details.setIntegrityRate(0.0f);
|
||||
}
|
||||
|
||||
List<String> devIds = stream3.map(LineDetail::getMonitorName).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(devIds)) {
|
||||
OnlineRateParam onlineRateParam = new OnlineRateParam();
|
||||
onlineRateParam.setIds(devIds);
|
||||
onlineRateParam.setStartTime(baseQueryParam.getStartTime());
|
||||
onlineRateParam.setEndTime(baseQueryParam.getEndTime());
|
||||
//获取所有终端在线率
|
||||
List<RStatOnlineRateVO> onlineRateByDev = onLineRateMapper.getOnlineRateByDevIds(onlineRateParam);
|
||||
if(CollUtil.isNotEmpty(onlineRateByDev)){
|
||||
details.setOnLineRate(onlineRateByDev.get(0).getOnlineRate().floatValue());
|
||||
}else{
|
||||
details.setOnLineRate(0.0f);
|
||||
}
|
||||
} else {
|
||||
details.setOnLineRate(0.0f);
|
||||
}
|
||||
return details;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,13 +173,17 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
}
|
||||
|
||||
// 数据封装
|
||||
Double temValue = lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
// 汇总所有监测点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineIntegrityDataVO.setRealTime(totalRealTime);
|
||||
lineIntegrityDataVO.setDueTime(totalDueTime);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||
lineIntegrityDataVO.setLevel(0);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
pro.add(lineIntegrityDataVO);
|
||||
|
||||
}
|
||||
@@ -193,12 +197,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
|
||||
|
||||
private void dealDataJinDu(List<LineIntegrityDataVO> mList,LineIntegrityDataVO children){
|
||||
double temValue = mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
if(temValue!=3.14159){
|
||||
children.setIntegrityData(new BigDecimal(temValue).setScale(2,RoundingMode.HALF_UP).doubleValue());
|
||||
}else {
|
||||
children.setIntegrityData(temValue);
|
||||
}
|
||||
// 汇总子节点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) mList.stream().filter(it->it.getIntegrityData()!=3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
children.setRealTime(totalRealTime);
|
||||
children.setDueTime(totalDueTime);
|
||||
children.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
}
|
||||
|
||||
private void dealMonitorData(List<LineIntegrityDataVO> lineList,List<LineDataIntegrity> percentageOfCompleteDatas,Map<String, Integer> mapA){
|
||||
@@ -209,10 +213,13 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if(dataIntegrityMap.containsKey(monitor.getId())){
|
||||
flag = true;
|
||||
LineDataIntegrity integrity = dataIntegrityMap.get(monitor.getId());
|
||||
monitor.setIntegrityData(DataStatisticsUtil.dataLimits(integrity.getIntegrityData()));
|
||||
monitor.setRealTime(integrity.getReal() == null ? 0 : integrity.getReal().intValue());
|
||||
monitor.setDueTime(integrity.getDue() == null ? 0 : integrity.getDue().intValue());
|
||||
Double integrityData = DataStatisticsUtil.calculateIntegrityRate(monitor.getRealTime(), monitor.getDueTime());
|
||||
monitor.setIntegrityData(integrityData);
|
||||
if (StrUtil.isNotBlank(monitor.getLineGrade())) {
|
||||
if (mapA.containsKey(monitor.getLineGrade())) {
|
||||
if (integrity.getIntegrityData() > mapA.get(monitor.getLineGrade())) {
|
||||
if (integrityData != 3.14159 && integrityData > mapA.get(monitor.getLineGrade())) {
|
||||
monitor.setValueOver(1);
|
||||
} else {
|
||||
monitor.setValueOver(0);
|
||||
@@ -228,6 +235,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!flag) {
|
||||
//表示未匹配到数据完整性
|
||||
monitor.setIntegrityData(3.14159);
|
||||
monitor.setRealTime(0);
|
||||
monitor.setDueTime(0);
|
||||
monitor.setValueOver(0);
|
||||
}
|
||||
}
|
||||
@@ -248,13 +257,19 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
outParam.setType(generalDeviceDTO.getName() + "\n(" + generalDeviceDTO.getLineIndexes().size() + ")");
|
||||
//根据监测点查询数据完整性
|
||||
List<PublicDTO> integrityData = getCondition(lineIndexes, integrityIconParam.getSearchBeginTime(), integrityIconParam.getSearchEndTime());
|
||||
double v = integrityData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setSingle(v!=3.14159?NumberUtil.round(v,2).doubleValue():v);
|
||||
// 汇总所有监测点的实际时间和期望时间,再计算总完整性
|
||||
int totalRealTime = (int) integrityData.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int totalDueTime = (int) integrityData.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
double v = DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime);
|
||||
outParam.setSingle(v);
|
||||
//如果存在需要比较的时间,再获取对应数据
|
||||
if (StrUtil.isNotBlank(integrityIconParam.getPeriodBeginTime()) && StrUtil.isNotBlank(integrityIconParam.getPeriodEndTime())) {
|
||||
List<PublicDTO> compareData = getCondition(lineIndexes, integrityIconParam.getPeriodBeginTime(), integrityIconParam.getPeriodEndTime());
|
||||
double v1 = compareData.stream().mapToDouble(PublicDTO::getData).average().orElse(3.14159);
|
||||
outParam.setRatio(v1!=3.14159?NumberUtil.round(v1,2).doubleValue():v1);
|
||||
// 汇总所有监测点的实际时间和期望时间,再计算总完整性
|
||||
int compareRealTime = (int) compareData.stream().mapToLong(PublicDTO::getOnlineMin).sum();
|
||||
int compareDueTime = (int) compareData.stream().mapToLong(PublicDTO::getOfflineMin).sum();
|
||||
double v1 = DataStatisticsUtil.calculateIntegrityRate(compareRealTime, compareDueTime);
|
||||
outParam.setRatio(v1);
|
||||
}
|
||||
out.add(outParam);
|
||||
}
|
||||
@@ -320,12 +335,14 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
for (LineDataIntegrity lineData : percentageOfCompleteDatas) {
|
||||
if (lineDataIntegrity.getId().equals(lineData.getLineId())) {
|
||||
flag = true;
|
||||
Double temValue = lineData.getIntegrityData();
|
||||
lineDataIntegrity.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
lineDataIntegrity.setRealTime(lineData.getReal() == null ? 0 : lineData.getReal().intValue());
|
||||
lineDataIntegrity.setDueTime(lineData.getDue() == null ? 0 : lineData.getDue().intValue());
|
||||
Double temValue = DataStatisticsUtil.calculateIntegrityRate(lineDataIntegrity.getRealTime(), lineDataIntegrity.getDueTime());
|
||||
lineDataIntegrity.setIntegrityData(temValue);
|
||||
//根据等级判断是否越限
|
||||
if (StrUtil.isNotBlank(lineDataIntegrity.getLineGrade())) {
|
||||
if (mapA.containsKey(lineDataIntegrity.getLineGrade())) {
|
||||
if (temValue > mapA.get(lineDataIntegrity.getLineGrade())) {
|
||||
if (temValue != 3.14159 && temValue > mapA.get(lineDataIntegrity.getLineGrade())) {
|
||||
lineDataIntegrity.setValueOver(1);
|
||||
} else {
|
||||
lineDataIntegrity.setValueOver(0);
|
||||
@@ -343,6 +360,8 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!flag) {
|
||||
//表示未匹配到数据完整性
|
||||
lineDataIntegrity.setIntegrityData(3.14159);
|
||||
lineDataIntegrity.setRealTime(0);
|
||||
lineDataIntegrity.setDueTime(0);
|
||||
lineDataIntegrity.setValueOver(0);
|
||||
}
|
||||
}
|
||||
@@ -352,13 +371,17 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
lineIntegrityDataVO.setChildren(subList);
|
||||
|
||||
// 数据封装
|
||||
Double temValue = lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
// 汇总所有监测点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineIntegrityDataVO.setRealTime(totalRealTime);
|
||||
lineIntegrityDataVO.setDueTime(totalDueTime);
|
||||
lineIntegrityDataVO.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineIntegrityDataVO.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
lineIntegrityDataVO.setId(generalDeviceDTO.getIndex());
|
||||
lineIntegrityDataVO.setName(generalDeviceDTO.getName());
|
||||
lineIntegrityDataVO.setLevel(0);
|
||||
lineIntegrityDataVO.setIntegrityData(Math.min(DataStatisticsUtil.dataLimits(temValue),100.0));
|
||||
pro.add(lineIntegrityDataVO);
|
||||
|
||||
}
|
||||
@@ -397,9 +420,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
for (String pid : pids) {
|
||||
if (lineAdministrationTree.getId().equals(pid)) {
|
||||
List<LineIntegrityDataVO> lineIntegrityDataVOList = groupLine.get(pid);
|
||||
//父级完整性匹配
|
||||
Double temValue = lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToDouble(LineIntegrityDataVO::getIntegrityData).average().orElse(3.14159);
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.dataLimits(temValue));
|
||||
//父级完整性匹配 - 汇总子节点的实际时间和期望时间,重新计算完整性
|
||||
int totalRealTime = (int) lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getRealTime).sum();
|
||||
int totalDueTime = (int) lineIntegrityDataVOList.stream().filter(item -> item.getIntegrityData() != 3.14159).mapToLong(LineIntegrityDataVO::getDueTime).sum();
|
||||
lineAdministrationTree.setRealTime(totalRealTime);
|
||||
lineAdministrationTree.setDueTime(totalDueTime);
|
||||
lineAdministrationTree.setIntegrityData(DataStatisticsUtil.calculateIntegrityRate(totalRealTime, totalDueTime));
|
||||
LineIntegrityDataVO temp = lineIntegrityDataVOList.stream().filter(t -> t.getAlgoDescribe() != null).min(Comparator.comparing(LineIntegrityDataVO::getAlgoDescribe)).orElse(new LineIntegrityDataVO());
|
||||
lineAdministrationTree.setAlgoDescribe(temp.getAlgoDescribe());
|
||||
}
|
||||
@@ -418,10 +444,12 @@ public class LineIntegrityDataServiceImpl extends ServiceImpl<LineIntegrityDataM
|
||||
if (!CollectionUtils.isEmpty(data)) {
|
||||
data.forEach(po -> {
|
||||
PublicDTO publicDTO = new PublicDTO();
|
||||
//数据完整性 保留四位小数
|
||||
Double integrity = po.getIntegrityRate() == null ? 3.14159 : BigDecimal.valueOf(Double.parseDouble(po.getIntegrityRate().toString())).setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
publicDTO.setId(po.getLineIndex());
|
||||
publicDTO.setData((integrity > 100.00) ? 100.00 : integrity);
|
||||
publicDTO.setOnlineMin(po.getRealTime() == null ? 0 : po.getRealTime().intValue());
|
||||
publicDTO.setOfflineMin(po.getDueTime() == null ? 0 : po.getDueTime().intValue());
|
||||
// 计算数据完整性
|
||||
Double integrity = DataStatisticsUtil.calculateIntegrityRate(publicDTO.getOnlineMin(), publicDTO.getOfflineMin());
|
||||
publicDTO.setData(integrity);
|
||||
integrityList.add(publicDTO);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.pojo.param.PowerDistributionareaParam;
|
||||
import com.njcn.device.pms.pojo.param.TaiZhangParam;
|
||||
import com.njcn.device.pq.mapper.PowerDistributionAreaMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.DistributionArea;
|
||||
import com.njcn.device.pq.service.IPowerDistributionAreaService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 台区信息
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PowerDistributionAreaServiceImpl extends ServiceImpl<PowerDistributionAreaMapper, DistributionArea> implements IPowerDistributionAreaService {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Page<DistributionArea> getList(TaiZhangParam baseParam) {
|
||||
LambdaQueryWrapper<DistributionArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DistributionArea::getStatus,DataStateEnum.ENABLE.getCode())
|
||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()),
|
||||
i->i.like(DistributionArea::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(DistributionArea::getPowerrName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(DistributionArea::getLineName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(DistributionArea::getOrgName,baseParam.getSearchValue())).orderByDesc(DistributionArea::getCreateTime);
|
||||
//初始化分页数据
|
||||
return this.page(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@Override
|
||||
public boolean add(PowerDistributionareaParam newParam) {
|
||||
LambdaQueryWrapper<DistributionArea> che = new LambdaQueryWrapper<>();
|
||||
che.eq(DistributionArea::getId,newParam.getId());
|
||||
int count = this.count(che);
|
||||
if(count>0){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.POWER_CODE_SAME);
|
||||
}
|
||||
DistributionArea powerDistributionarea = new DistributionArea();
|
||||
BeanUtils.copyProperties(newParam,powerDistributionarea);
|
||||
//设为正常状态
|
||||
powerDistributionarea.setStatus(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(powerDistributionarea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改台区信息
|
||||
* @author hany
|
||||
* @date 2022/10/26
|
||||
*/
|
||||
@Override
|
||||
public boolean update(PowerDistributionareaParam updateParam) {
|
||||
DistributionArea powerDistributionarea = this.getById(updateParam.getId());
|
||||
if(Objects.isNull(powerDistributionarea)){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.POWER_DIS_NOT_FIND);
|
||||
}
|
||||
BeanUtils.copyProperties(updateParam,powerDistributionarea);
|
||||
return this.updateById(powerDistributionarea);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor=RuntimeException.class)
|
||||
public boolean delete(List<String> ids) {
|
||||
return this.removeByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.pojo.param.PowerGenerationUserParam;
|
||||
import com.njcn.device.pq.mapper.PowerGenerationUserMapper;
|
||||
import com.njcn.device.pq.pojo.po.jb.GenerationUser;
|
||||
import com.njcn.device.pq.service.IPowerGenerationUserService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 台区信息
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2022-10-14
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class PowerGenerationUserServiceImpl extends ServiceImpl<PowerGenerationUserMapper, GenerationUser> implements IPowerGenerationUserService {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addPowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam) {
|
||||
LambdaQueryWrapper<GenerationUser> che = new LambdaQueryWrapper<>();
|
||||
che.eq(GenerationUser::getId,powerGenerationUserParam.getId());
|
||||
int count = this.count(che);
|
||||
if(count>0){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.POWER_CODE_SAME);
|
||||
}
|
||||
GenerationUser powerDistributionarea = new GenerationUser();
|
||||
BeanUtils.copyProperties(powerGenerationUserParam,powerDistributionarea);
|
||||
//设为正常状态
|
||||
powerDistributionarea.setStatus(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(powerDistributionarea);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updatePowerGenerationUser(PowerGenerationUserParam powerGenerationUserParam) {
|
||||
GenerationUser powerDistributionarea = this.getById(powerGenerationUserParam.getId());
|
||||
if(Objects.isNull(powerDistributionarea)){
|
||||
throw new BusinessException(PmsDeviceResponseEnum.POWER_DIS_NOT_FIND);
|
||||
}
|
||||
BeanUtils.copyProperties(powerGenerationUserParam,powerDistributionarea);
|
||||
return this.updateById(powerDistributionarea);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delPowerGenerationUser(List<String> powerGenerationUserIds) {
|
||||
return this.removeByIds(powerGenerationUserIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<GenerationUser> getPowerGenerationUserPageList(BaseParam baseParam) {
|
||||
LambdaQueryWrapper<GenerationUser> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(GenerationUser::getStatus, DataStateEnum.ENABLE.getCode())
|
||||
.and(StrUtil.isNotBlank(baseParam.getSearchValue()),
|
||||
i->i.like(GenerationUser::getName,baseParam.getSearchValue())
|
||||
.or()
|
||||
.like(GenerationUser::getOrgName,baseParam.getSearchValue())).orderByDesc(GenerationUser::getCreateTime);
|
||||
//初始化分页数据
|
||||
return this.page(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), lambdaQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,13 @@ package com.njcn.device.pq.service.impl;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.*;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONConfig;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONTokener;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -18,29 +20,28 @@ import com.njcn.dataProcess.enums.DataCleanEnum;
|
||||
import com.njcn.dataProcess.param.DataCleanParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||
import com.njcn.device.line.mapper.LineMapper;
|
||||
import com.njcn.device.line.service.DeptLineService;
|
||||
import com.njcn.device.pq.constant.Param;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.mapper.PqDataVerifyBakMapper;
|
||||
import com.njcn.device.pq.pojo.param.dataClean.MonitorBaseParam;
|
||||
import com.njcn.device.pq.pojo.po.DeptLine;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyBak;
|
||||
import com.njcn.device.pq.pojo.vo.AreaLineInfoVO;
|
||||
import com.njcn.device.pq.pojo.vo.LineDetailDataVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.DetailAbnormalVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.PowerQualityIndicatorsVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyMonitorVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.VerifyTargetVO;
|
||||
import com.njcn.device.pq.pojo.vo.dataClean.*;
|
||||
import com.njcn.device.pq.service.CommTerminalService;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyBakService;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.poi.excel.ExcelUtil;
|
||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||
import com.njcn.system.api.DictTreeFeignClient;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.pojo.po.SysDicTreePO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -65,38 +66,34 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
private static final String SEPARATOR = "-";
|
||||
private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN);
|
||||
|
||||
private final CommTerminalService commTerminalService;
|
||||
|
||||
private final PqReasonableRangeFeignClient pqReasonableRangeFeignClient;
|
||||
|
||||
private final LineMapper lineMapper;
|
||||
|
||||
private final DictTreeFeignClient dictTreeFeignClient;
|
||||
|
||||
private final UserLedgerFeignClient userLedgerFeignClient;
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
private final DeptLineService deptLineService;
|
||||
|
||||
@Override
|
||||
public VerifyMonitorVO getMonitorVerifyData(MonitorBaseParam monitorBaseParam) {
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
VerifyMonitorVO verifyMonitorVO = new VerifyMonitorVO();
|
||||
if (CollUtil.isNotEmpty(monitorIds)) {
|
||||
List<PqDataVerifyBak> dataVerifyList = baseDataVerifyQuery(monitorIds, monitorBaseParam);
|
||||
verifyMonitorVO.setRunNum(monitorIds.size());
|
||||
verifyMonitorVO.setAbnormalNum(dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId)).size());
|
||||
List<PqDataVerifyBak> dataSumVerifyList = baseDataSumVerifyQuery(monitorIds, monitorBaseParam);
|
||||
// List<PqDataVerifyBak> dataSumVerifyList = baseDataSumVerifyQuery(monitorIds, monitorBaseParam);
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, dataVerifyList));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataSumVerifyList));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(dataVerifyList, monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(dataVerifyList, monitorBaseParam));
|
||||
} else {
|
||||
verifyMonitorVO.setRunNum(0);
|
||||
verifyMonitorVO.setAbnormalNum(0);
|
||||
|
||||
verifyMonitorVO.setMapList(getRangeAbnormalMonitor(monitorBaseParam, new ArrayList<>()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>()));
|
||||
verifyMonitorVO.setTargetList(getAbnormalTarget(new ArrayList<>(), monitorBaseParam.getErrorTimeCount()));
|
||||
verifyMonitorVO.setMonitorAlarmInfo(getAbnormalTable(new ArrayList<>(), monitorBaseParam));
|
||||
}
|
||||
|
||||
@@ -111,7 +108,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
List<LocalDate> dateList = list.stream().map(PqDataVerifyBak::getTimeId).sorted(Comparator.comparing(Function.identity())).collect(Collectors.toList());
|
||||
processTable(monitorBaseParam, dateList, result, key);
|
||||
});
|
||||
dealTableResult(result);
|
||||
dealTableResult(result, monitorBaseParam.getSearchValue());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -137,34 +134,44 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
}
|
||||
}
|
||||
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result) {
|
||||
private void dealTableResult(List<PowerQualityIndicatorsVO> result, String searchValue) {
|
||||
if (CollUtil.isNotEmpty(result)) {
|
||||
List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
// List<SysDicTreePO> dicTreePOList = dictTreeFeignClient.queryAllByType(Integer.valueOf(DicDataEnum.Obj_Type.getCode())).getData();
|
||||
// Map<String, SysDicTreePO> sysDicTreePOMap = dicTreePOList.stream().collect(Collectors.toMap(SysDicTreePO::getId, Function.identity()));
|
||||
List<String> ids = result.stream().map(PowerQualityIndicatorsVO::getMonitorId).distinct().collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
||||
Map<String, AreaLineInfoVO> areaMap = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
|
||||
List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
result.forEach(it -> {
|
||||
if (areaMap.containsKey(it.getMonitorId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = areaMap.get(it.getMonitorId());
|
||||
it.setMonitorName(areaLineInfoVO.getLineName());
|
||||
it.setStationName(areaLineInfoVO.getSubName());
|
||||
it.setDevName(areaLineInfoVO.getDeviceName());
|
||||
it.setVoltageLevel(areaLineInfoVO.getVoltageScale());
|
||||
it.setIp(Base64.encode(areaLineInfoVO.getIp()));
|
||||
it.setManufacturer(areaLineInfoVO.getManufacturer());
|
||||
if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
}
|
||||
if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, searchValue, null);
|
||||
Map<String, PowerQualityIndicatorsVO> areaMap = result.stream().collect(Collectors.toMap(PowerQualityIndicatorsVO::getMonitorId, Function.identity()));
|
||||
List<DeptLine> deptLines = deptLineService.selectDeptLine(ids);
|
||||
Map<String, String> deptName = deptLines.stream().collect(Collectors.toMap(DeptLine::getLineId, DeptLine::getId));
|
||||
// List<String> objIds = areaLineInfoVOList.stream().map(AreaLineInfoVO::getObjId).distinct().collect(Collectors.toList());
|
||||
// List<NewUserReportVO> userLedgerVOList = userLedgerFeignClient.getUserReportByIds(objIds).getData();
|
||||
// Map<String, NewUserReportVO> userMap = userLedgerVOList.stream().collect(Collectors.toMap(NewUserReportVO::getId, Function.identity()));
|
||||
List<PowerQualityIndicatorsVO> info = new ArrayList<>();
|
||||
for (AreaLineInfoVO lineDetail : areaLineInfoVOList) {
|
||||
if (areaMap.containsKey(lineDetail.getLineId())) {
|
||||
PowerQualityIndicatorsVO it = areaMap.get(lineDetail.getLineId());
|
||||
it.setMonitorName(lineDetail.getLineName());
|
||||
it.setStationName(lineDetail.getSubName());
|
||||
it.setDevName(lineDetail.getDeviceName());
|
||||
if (deptName.containsKey(lineDetail.getLineId())) {
|
||||
it.setCity(deptName.get(lineDetail.getLineId()));
|
||||
}
|
||||
it.setVoltageLevel(lineDetail.getVoltageScale());
|
||||
it.setIp(Base64.encode(lineDetail.getIp()));
|
||||
it.setManufacturer(lineDetail.getManufacturer());
|
||||
it.setObjType(lineDetail.getLoadType());
|
||||
it.setObjName(lineDetail.getObjName());
|
||||
info.add(it);
|
||||
// if (sysDicTreePOMap.containsKey(areaLineInfoVO.getSmallObjType())) {
|
||||
// it.setObjType(sysDicTreePOMap.get(areaLineInfoVO.getSmallObjType()).getName());
|
||||
// }
|
||||
// if (userMap.containsKey(areaLineInfoVO.getObjId())) {
|
||||
// it.setObjName(userMap.get(areaLineInfoVO.getObjId()).getProjectName());
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
result.clear();
|
||||
result.addAll(info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +184,9 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
@Override
|
||||
public List<DetailAbnormalVO> monitorAbnormalTable(MonitorBaseParam monitorBaseParam) {
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
List<DetailAbnormalVO> result = new ArrayList<>();
|
||||
//参数校验
|
||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||
@@ -199,67 +209,73 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
switch (monitorBaseParam.getTargetKey()) {
|
||||
case Param.freq:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreq, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.freq_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFreqDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_v:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVRms, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_lvr:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getRmsLvr, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.vu_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVuDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.vl_dev:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVlDev, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.rms_i:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getIRms, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_thd:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVThd, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_1_v:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.phasic_v_1:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getV1Phasic, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.phasic_rate_x:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPhasic, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_rate:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVHarm, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.in_v_rate:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVInharm, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_zero:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVZero, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_neg:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVNeg, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_pos:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVPos, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.v_unbalance:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getVUnbalance, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.fluc:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getFluc, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.pst:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPst, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.plt:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPlt, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.pf:
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getPf, 1);
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
lambdaQueryWrapper.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount());
|
||||
break;
|
||||
default:
|
||||
log.error("方法{}未匹配到异常数据指标", "monitorAbnormalTable");
|
||||
@@ -267,97 +283,37 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
}
|
||||
}
|
||||
List<PqDataVerifyBak> dataVerifyList = this.list(lambdaQueryWrapper);
|
||||
for (PqDataVerifyBak pqDataVerifyBak : dataVerifyList) {
|
||||
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(pqDataVerifyBak.getLineId());
|
||||
Map<String, List<PqDataVerifyBak>> VerifyMap = dataVerifyList.stream().collect(Collectors.groupingBy(PqDataVerifyBak::getLineId));
|
||||
VerifyMap.forEach((key, value) -> {
|
||||
LineDetailDataVO lineDevGetDTO = lineDetailMap.get(key);
|
||||
String temBgName = "";
|
||||
if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG.getCode())) {
|
||||
temBgName = lineDevGetDTO.getBdName();
|
||||
} else if (lineDevGetDTO.getPowerFlag().equals(LineBaseEnum.POWER_FLAG_NOT.getCode())) {
|
||||
temBgName = lineDevGetDTO.getObjName();
|
||||
}
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
String[] errorTimeCount = {"0"};
|
||||
Long[] errAllCount = {0L};
|
||||
jsonArray.forEach(it -> {
|
||||
JSONObject targetJson = (JSONObject) it;
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
JSONArray innerJson = targetJson.getJSONArray(monitorBaseParam.getTargetKey());
|
||||
PqReasonableRangeDto dto = rangeMap.get(monitorBaseParam.getTargetKey());
|
||||
if (Objects.nonNull(dto.getHarmStart()) && Objects.nonNull(dto.getHarmEnd())) {
|
||||
errorTimeCount[0] = targetJson.get("errorTimes").toString();
|
||||
for (Object oJson : innerJson) {
|
||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
||||
list.forEach(listItem -> {
|
||||
JSONObject object = (JSONObject) listItem;
|
||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
||||
errAllCount[0] += errCount;
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (Object oJson : innerJson) {
|
||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
||||
list.forEach(listItem -> {
|
||||
JSONObject object = (JSONObject) listItem;
|
||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
||||
errAllCount[0] += errCount;
|
||||
});
|
||||
errorTimeCount[0] = jsonObjectTem.get("errorTimes").toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rangeMap.forEach((rangeKey, val) -> {
|
||||
if (targetJson.containsKey(rangeKey)) {
|
||||
JSONArray innerJson = targetJson.getJSONArray(rangeKey);
|
||||
for (Object oJson : innerJson) {
|
||||
JSONObject jsonObjectTem = (JSONObject) oJson;
|
||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
||||
list.forEach(listItem -> {
|
||||
JSONObject object = (JSONObject) listItem;
|
||||
long errCount = Long.parseLong(object.get("errorCounts").toString());
|
||||
errAllCount[0] += errCount;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
if (targetJson.containsKey("lineErrorTimes")) {
|
||||
errorTimeCount[0] = targetJson.get("lineErrorTimes").toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setTimeSum(errorTimeCount[0]);
|
||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||
detailAbnormalVO.setBdName(temBgName);
|
||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
detailAbnormalVO.setErrCount(errAllCount[0].toString());
|
||||
result.add(detailAbnormalVO);
|
||||
} catch (BusinessException b) {
|
||||
//文件为空时候的特殊处理
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
detailAbnormalVO.setTimeSum("/");
|
||||
detailAbnormalVO.setDate(pqDataVerifyBak.getTimeId().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN)));
|
||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||
detailAbnormalVO.setBdName(temBgName);
|
||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("数据异常");
|
||||
List<DetailAbnormalVO.TimeAndTargetKey> targetKeyList = new ArrayList<>();
|
||||
DetailAbnormalVO.TimeAndTargetKey targetKey;
|
||||
DetailAbnormalVO detailAbnormalVO = new DetailAbnormalVO();
|
||||
for (PqDataVerifyBak pqDataVerifyBak : value) {
|
||||
targetKey = new DetailAbnormalVO.TimeAndTargetKey();
|
||||
targetKey.setDate(pqDataVerifyBak.getTimeId().format(DatePattern.NORM_DATE_FORMATTER));
|
||||
targetKey.setTargetKeys(getAbnormalTarget(Arrays.asList(pqDataVerifyBak), monitorBaseParam.getErrorTimeCount()).stream().filter(x -> x.getIds().size() > 0).collect(Collectors.toList()));
|
||||
targetKeyList.add(targetKey);
|
||||
}
|
||||
}
|
||||
detailAbnormalVO.setDateTargetList(targetKeyList);
|
||||
detailAbnormalVO.setMonitorName(lineDevGetDTO.getLineName());
|
||||
detailAbnormalVO.setBdName(temBgName);
|
||||
detailAbnormalVO.setMonitorId(lineDevGetDTO.getLineId());
|
||||
detailAbnormalVO.setTargetKey(monitorBaseParam.getTargetKey());
|
||||
result.add(detailAbnormalVO);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DetailAbnormalVO.DetailAbnormalInnerVO> monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
public DetailAbnormalVO.DetailAbnormalCountVO monitorAbnormalTableDetail(MonitorBaseParam monitorBaseParam) {
|
||||
Map<String, PqReasonableRangeDto> dtoMap = getStandRange();
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (!dtoMap.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
@@ -366,44 +322,84 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
}
|
||||
List<DetailAbnormalVO.DetailAbnormalInnerVO> result = new ArrayList<>();
|
||||
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds()).orderByAsc(PqDataVerifyBak::getTimeId);
|
||||
lambdaQueryWrapper.in(PqDataVerifyBak::getTimeId, monitorBaseParam.getTime())
|
||||
.in(PqDataVerifyBak::getLineId, monitorBaseParam.getMonitorIds());
|
||||
|
||||
List<PqDataVerifyBak> pqDataVerifyBak = this.list(lambdaQueryWrapper);
|
||||
//index[0] 总异常时间 index[1]指标异常时间
|
||||
Integer[] errorTimeCount = {0, 0};
|
||||
Integer[] errAllCount = {0};
|
||||
for (PqDataVerifyBak dataVerifyBak : pqDataVerifyBak) {
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(dataVerifyBak.getPath())) {
|
||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
jsonArray.forEach(it -> {
|
||||
JSONObject targetJson = (JSONObject) it;
|
||||
if (targetJson.containsKey("lineErrorTimes")) {
|
||||
errorTimeCount[0] += Integer.valueOf(targetJson.get("lineErrorTimes").toString());
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||
}
|
||||
} else {
|
||||
for (Map.Entry<String, PqReasonableRangeDto> entry : dtoMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (targetJson.containsKey(key)) {
|
||||
resultDeal(dtoMap, key, targetJson, result, dataVerifyBak.getTimeId().toString(), errorTimeCount, errAllCount);
|
||||
}
|
||||
}
|
||||
|
||||
PqDataVerifyBak pqDataVerifyBak = this.getOne(lambdaQueryWrapper);
|
||||
try (InputStream fileStream = fileStorageUtil.getFileStream(pqDataVerifyBak.getPath())) {
|
||||
JSONArray jsonArray = new JSONArray(new JSONTokener(fileStream, new JSONConfig()));
|
||||
for (Object it : jsonArray) {
|
||||
JSONObject targetJson = (JSONObject) it;
|
||||
if (targetJson.containsKey("lineErrorTimes")) {
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getTargetKey())) {
|
||||
if (targetJson.containsKey(monitorBaseParam.getTargetKey())) {
|
||||
resultDeal(dtoMap, monitorBaseParam.getTargetKey(), targetJson, result);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
String tarKey = "";
|
||||
for (Map.Entry<String, PqReasonableRangeDto> entry : dtoMap.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
if (targetJson.containsKey(key)) {
|
||||
tarKey = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
resultDeal(dtoMap, tarKey, targetJson, result);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("数据异常" + e);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException("数据异常");
|
||||
}
|
||||
// 排序实现
|
||||
result = result.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime)
|
||||
DetailAbnormalVO.DetailAbnormalCountVO info = new DetailAbnormalVO.DetailAbnormalCountVO();
|
||||
info.setTimeSum(StrUtil.isBlank(monitorBaseParam.getTargetKey()) ? errorTimeCount[0] : errorTimeCount[1]);
|
||||
info.setErrCount(errAllCount[0]);
|
||||
info.setTime(result.stream()
|
||||
.sorted(Comparator.comparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName)
|
||||
.thenComparing(vo -> extractHarmonicOrder(vo.getTargetName()))
|
||||
.thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTargetName))
|
||||
.collect(Collectors.toList());
|
||||
return result;
|
||||
.thenComparing(DetailAbnormalVO.DetailAbnormalInnerVO::getTime))
|
||||
.collect(Collectors.toList()));
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dataVerifyExcel(HttpServletResponse response, MonitorBaseParam monitorBaseParam) throws IOException {
|
||||
if (StrUtil.isNotBlank(monitorBaseParam.getDeptId())) {
|
||||
List<String> monitorIds = commTerminalService.getRunMonitorByDept(monitorBaseParam);
|
||||
monitorBaseParam.setMonitorIds(monitorIds);
|
||||
}
|
||||
List<DataVerifyExcel> dataVerifyExcels = this.baseMapper.selectDataVerifySum(monitorBaseParam);
|
||||
List<String> ids = dataVerifyExcels.stream().map(DataVerifyExcel::getLineId).collect(Collectors.toList());
|
||||
List<AreaLineInfoVO> areaLineInfoVOList = lineMapper.getBaseLineAreaInfo(ids, null, null);
|
||||
Map<String, AreaLineInfoVO> map = areaLineInfoVOList.stream().collect(Collectors.toMap(AreaLineInfoVO::getLineId, Function.identity()));
|
||||
for (DataVerifyExcel dataVerifyExcel : dataVerifyExcels) {
|
||||
if (map.containsKey(dataVerifyExcel.getLineId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = map.get(dataVerifyExcel.getLineId());
|
||||
dataVerifyExcel.setCity(areaLineInfoVO.getGdName());
|
||||
dataVerifyExcel.setLineName(areaLineInfoVO.getLineName());
|
||||
dataVerifyExcel.setLoadType(areaLineInfoVO.getLoadType());
|
||||
dataVerifyExcel.setObjName(areaLineInfoVO.getObjName());
|
||||
dataVerifyExcel.setStationName(areaLineInfoVO.getSubName());
|
||||
dataVerifyExcel.setPowerSubstationName(areaLineInfoVO.getPowerSubstationName());
|
||||
dataVerifyExcel.setDevName(areaLineInfoVO.getDeviceName());
|
||||
dataVerifyExcel.setIp(areaLineInfoVO.getIp());
|
||||
dataVerifyExcel.setManufacturer(areaLineInfoVO.getManufacturer());
|
||||
}
|
||||
}
|
||||
Set<String> excludeColumnFiledNames = new HashSet<>(1);
|
||||
excludeColumnFiledNames.add("lineId");
|
||||
dataVerifyExcels.sort(Comparator.comparing((DataVerifyExcel item) -> item.getCity() + "_" + item.getStationName()+"_"+item.getDevName())
|
||||
.thenComparing(DataVerifyExcel::getAllTime, Comparator.reverseOrder())
|
||||
);
|
||||
EasyExcel.write(response.getOutputStream(), DataVerifyExcel.class)
|
||||
.excludeColumnFiledNames(excludeColumnFiledNames).sheet("sheet")
|
||||
.doWrite(dataVerifyExcels);
|
||||
}
|
||||
|
||||
|
||||
@@ -431,12 +427,14 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
* 处理json对象中list数组
|
||||
*/
|
||||
|
||||
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result) {
|
||||
private void resultDeal(Map<String, PqReasonableRangeDto> dtoMap, String targetKey, JSONObject targetJson, List<DetailAbnormalVO.DetailAbnormalInnerVO> result, String date, Integer[] errorTimeCount, Integer[] errorCounts) {
|
||||
PqReasonableRangeDto pqReasonableRangeDto = dtoMap.get(targetKey);
|
||||
JSONArray innerJson = targetJson.getJSONArray(targetKey);
|
||||
innerJson.forEach(oo -> {
|
||||
JSONObject jsonObjectTem = (JSONObject) oo;
|
||||
String targetName = jsonObjectTem.get("targetName").toString();
|
||||
errorCounts[0] += Integer.valueOf(jsonObjectTem.get("errorCounts").toString());
|
||||
errorTimeCount[1] += Integer.valueOf(jsonObjectTem.get("errorTimes").toString());
|
||||
JSONArray list = jsonObjectTem.getJSONArray("list");
|
||||
List<DetailAbnormalVO.DetailLimitInnerVO> temList = new ArrayList<>();
|
||||
list.forEach(listItem -> {
|
||||
@@ -447,7 +445,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
String valueType = object.get("valueType").toString();
|
||||
for (int i = 0; i < timeArr.size(); i++) {
|
||||
DetailAbnormalVO.DetailLimitInnerVO temData = new DetailAbnormalVO.DetailLimitInnerVO();
|
||||
temData.setTime(timeArr.get(i).toString());
|
||||
temData.setTime(date + " " + timeArr.get(i).toString());
|
||||
temData.setVal(valueArr.get(i).toString());
|
||||
temData.setTargetName(targetName);
|
||||
temData.setTargetKey(targetKey);
|
||||
@@ -475,11 +473,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
vo.setTargetKey(targetKey);
|
||||
vo.setPhaseType(phaseKey);
|
||||
|
||||
if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
|
||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
|
||||
} else {
|
||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
||||
}
|
||||
// if ((DataCleanEnum.DataI.getCode() + SEPARATOR + DataCleanEnum.RmsI.getCode() ).equals(targetKey)) {
|
||||
// vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + "*CT1" + unit);
|
||||
// } else {
|
||||
vo.setRangeDesc(pqReasonableRangeDto.getMinValue() + unit + " ~ " + pqReasonableRangeDto.getMaxValue() + unit);
|
||||
// }
|
||||
valueList.forEach(ites -> {
|
||||
switch (ites.getType()) {
|
||||
case "AVG":
|
||||
@@ -493,6 +491,7 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
break;
|
||||
case "CP95":
|
||||
vo.setCp95(ites.getVal());
|
||||
break;
|
||||
case "Feature_Amplitude":
|
||||
vo.setFeatureAmplitude(ites.getVal());
|
||||
break;
|
||||
@@ -507,10 +506,59 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
|
||||
|
||||
private List<PqDataVerifyBak> baseDataVerifyQuery(List<String> monitorIds, MonitorBaseParam monitorBaseParam) {
|
||||
if (Objects.isNull(monitorBaseParam.getErrorTimeCount())) {
|
||||
monitorBaseParam.setErrorTimeCount(720);
|
||||
}
|
||||
LambdaQueryWrapper<PqDataVerifyBak> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||
.eq(PqDataVerifyBak::getState, 1)
|
||||
.and(x -> x.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount())
|
||||
)
|
||||
.orderByAsc(PqDataVerifyBak::getTimeId);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
@@ -524,6 +572,52 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
.lambda().between(PqDataVerifyBak::getTimeId, DateUtil.beginOfDay(DateUtil.parse(monitorBaseParam.getSearchBeginTime())), DateUtil.endOfDay(DateUtil.parse(monitorBaseParam.getSearchEndTime())))
|
||||
.in(PqDataVerifyBak::getLineId, monitorIds)
|
||||
.eq(PqDataVerifyBak::getState, 1)
|
||||
.and(x -> x.ge(PqDataVerifyBak::getFreqTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFreqDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPosTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVNegTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVZeroTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVUnbalanceTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRmsLvrTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVuDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVlDevTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVThdTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getIRmsTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPltTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVInharmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVHarmTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPfTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getVPhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getV1PhasicTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getFlucTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getPstTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getDipTime, monitorBaseParam.getErrorTimeCount())
|
||||
.or()
|
||||
.ge(PqDataVerifyBak::getRiseTime, monitorBaseParam.getErrorTimeCount())
|
||||
)
|
||||
.groupBy(PqDataVerifyBak::getLineId);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
@@ -564,102 +658,102 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
/**
|
||||
* 指标异常测点数量
|
||||
*/
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList) {
|
||||
public List<VerifyTargetVO> getAbnormalTarget(List<PqDataVerifyBak> dataVerifyList, Integer errorTimeCount) {
|
||||
List<VerifyTargetVO> result = new ArrayList<>();
|
||||
Map<String, PqReasonableRangeDto> rangeMap = getStandRange();
|
||||
rangeMap.forEach((key, dto) -> {
|
||||
Set<String> ids;
|
||||
switch (key) {
|
||||
case Param.freq:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFreq() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFreqTime())).filter(it -> it.getFreqTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.freq_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFreqDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFreqDevTime())).filter(it -> it.getFreqDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_v:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVRms() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVRmsTime())).filter(it -> it.getVRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_lvr:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getRmsLvr() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getRmsLvrTime())).filter(it -> it.getRmsLvrTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vu_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVuDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVuDevTime())).filter(it -> it.getVuDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.vl_dev:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVlDev() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVlDevTime())).filter(it -> it.getVlDevTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.rms_i:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getIRms() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getIRmsTime())).filter(it -> it.getIRmsTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_thd:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVThd() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVThdTime())).filter(it -> it.getVThdTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_1_v:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getV() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVTime())).filter(it -> it.getVTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_v_1:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getV1Phasic() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getV1PhasicTime())).filter(it -> it.getV1PhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.phasic_rate_x:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVPhasic() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVPhasicTime())).filter(it -> it.getVPhasicTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_rate:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVHarm() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVHarmTime())).filter(it -> it.getVHarmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.in_v_rate:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVInharm() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVInharmTime())).filter(it -> it.getVInharmTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_zero:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVZero() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVZeroTime())).filter(it -> it.getVZeroTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_neg:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVNeg() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVNegTime())).filter(it -> it.getVNegTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_pos:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVPos() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVPosTime())).filter(it -> it.getVPosTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.v_unbalance:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getVUnbalance() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getVUnbalanceTime())).filter(it -> it.getVUnbalanceTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.fluc:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getFluc() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getFlucTime())).filter(it -> it.getFlucTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pst:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPst() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPstTime())).filter(it -> it.getPstTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.plt:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPlt() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPltTime())).filter(it -> it.getPltTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.pf:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getPf() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getPfTime())).filter(it -> it.getPfTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Dip:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getDip() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getDipTime())).filter(it -> it.getDipTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
case Param.Voltage_Rise:
|
||||
ids = dataVerifyList.stream().filter(it -> it.getRise() > 0).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
ids = dataVerifyList.stream().filter(x -> ObjUtil.isNotNull(x.getRiseTime())).filter(it -> it.getRiseTime() > errorTimeCount).map(PqDataVerifyBak::getLineId).collect(Collectors.toSet());
|
||||
assembleEntity(ids, dto, result);
|
||||
break;
|
||||
default:
|
||||
@@ -685,12 +779,11 @@ public class PqDataVerifyBakServiceImpl extends ServiceImpl<PqDataVerifyBakMappe
|
||||
if (StrUtil.isNotBlank(dto.getUnit())) {
|
||||
unit = dto.getUnit();
|
||||
}
|
||||
if (temStr.equals(Param.rms_i)) {
|
||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
|
||||
} else {
|
||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
||||
}
|
||||
|
||||
// if (temStr.equals(Param.rms_i)) {
|
||||
// verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + "*CT1" + unit);
|
||||
// } else {
|
||||
verifyTargetVO.setRangeDesc(dto.getMinValue() + unit + " ~ " + dto.getMaxValue() + unit);
|
||||
// }
|
||||
result.add(verifyTargetVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.device.pq.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.PqDataVerifyCountMapper;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.PqDataVerifyCount;
|
||||
import com.njcn.device.pq.pojo.vo.OnlineMonitorVo;
|
||||
import com.njcn.device.pq.service.IPqDataVerifyCountService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author cdf
|
||||
* @since 2025-06-10
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PqDataVerifyCountServiceImpl extends ServiceImpl<PqDataVerifyCountMapper, PqDataVerifyCount> implements IPqDataVerifyCountService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<PqDataVerifyCount> getSumVerify(OnlineRateParam param) {
|
||||
return this.baseMapper.selectSumVerify(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OnlineMonitorVo> getAnomalousData(LineBaseQueryParam par) {
|
||||
return this.baseMapper.getAnomalousData(par.getLineIds(),par.getStartTime(),par.getEndTime());
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user