Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37959a4a7e | ||
| 2d07a60001 | |||
|
|
0c8b17d336 | ||
|
|
88e0d71718 | ||
|
|
e982fa960e | ||
|
|
f6d8fe73f7 | ||
|
|
e6ed7c655a | ||
|
|
6cf56d6768 | ||
|
|
61e67fc1c8 | ||
|
|
234ba26bbe | ||
| 3d59a3d058 | |||
| 1b9d736e55 | |||
|
|
c31d91074d | ||
|
|
044f3c4d64 | ||
|
|
09fe5ca317 | ||
|
|
7412e2beda | ||
|
|
90baa65b71 | ||
| 3f9e2076d2 | |||
| 1bda6b1156 | |||
| d3b4146674 | |||
| 365448d8a0 | |||
| d3e46f5ba4 | |||
| 35939e6f8f | |||
| ba1f5a2e00 | |||
|
|
97e3386d53 | ||
| 4f8c34d21b | |||
|
|
fd398a85de | ||
|
|
1aae135e83 | ||
| 60bad4bc06 | |||
| fe3c0363fb | |||
| 718fd012c8 | |||
|
|
7bac8f5b14 | ||
|
|
fec6e6c27d | ||
| fe2e3b118d | |||
| dbf0027c65 | |||
| 91ff704f0a | |||
|
|
4c239b1604 | ||
|
|
ab96d247fa | ||
|
|
e49dee8263 | ||
|
|
e126a3f800 | ||
|
|
f09409c553 | ||
|
|
63f20da451 | ||
| 1043097a11 | |||
| 713db187c5 | |||
| 6b21e9927a | |||
|
|
c5cb96e8d6 | ||
|
|
76f9c9cb10 | ||
| 386fd1ed1e | |||
| d8d516f63d | |||
|
|
074c020b10 | ||
|
|
af781010f6 | ||
| ca0dd1eea0 | |||
|
|
76deaeee71 | ||
|
|
6a6f7c2f77 | ||
|
|
b0972ba896 | ||
|
|
5afb860467 | ||
|
|
2624d7d495 |
@@ -6,6 +6,7 @@ import org.springframework.boot.SpringApplication;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
import org.springframework.context.annotation.DependsOn;
|
import org.springframework.context.annotation.DependsOn;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,6 +17,7 @@ import org.springframework.context.annotation.DependsOn;
|
|||||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||||
@MapperScan("com.njcn.**.mapper")
|
@MapperScan("com.njcn.**.mapper")
|
||||||
@DependsOn("proxyMapperRegister")
|
@DependsOn("proxyMapperRegister")
|
||||||
|
@EnableAsync
|
||||||
public class AlgorithmBootApplication {
|
public class AlgorithmBootApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -6,13 +6,12 @@ import cn.hutool.core.date.DatePattern;
|
|||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.text.StrPool;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.njcn.algorithm.pojo.bo.BaseParam;
|
import com.njcn.algorithm.pojo.bo.BaseParam;
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.algorithm.pojo.bo.HourParam;
|
import com.njcn.algorithm.pojo.bo.HourParam;
|
||||||
import com.njcn.algorithm.pojo.enums.PrepareResponseEnum;
|
import com.njcn.algorithm.pojo.enums.PrepareResponseEnum;
|
||||||
import com.njcn.algorithm.utils.MemorySizeUtil;
|
import com.njcn.algorithm.service.line.FlowAsyncService;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
@@ -29,7 +28,6 @@ import com.njcn.user.pojo.po.Dept;
|
|||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
import com.yomahub.liteflow.core.FlowExecutor;
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
import com.yomahub.liteflow.flow.entity.CmpStep;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -47,6 +45,8 @@ import javax.annotation.Resource;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.njcn.algorithm.utils.MemorySizeUtil.dealResponse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
@@ -71,6 +71,8 @@ public class ExecutionCenter extends BaseController {
|
|||||||
private DeptLineFeignClient deptLineFeignClient;
|
private DeptLineFeignClient deptLineFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private CsLineFeignClient csLineFeignClient;
|
private CsLineFeignClient csLineFeignClient;
|
||||||
|
@Resource
|
||||||
|
private FlowAsyncService flowService;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 1、校验非全链执行时,tagNames节点标签集合必须为非空,否则提示---无可执行节点
|
* 1、校验非全链执行时,tagNames节点标签集合必须为非空,否则提示---无可执行节点
|
||||||
@@ -95,41 +97,6 @@ public class ExecutionCenter extends BaseController {
|
|||||||
return calculatedParam;
|
return calculatedParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* @author hongawen
|
|
||||||
* @date 2023/11/7 14:44
|
|
||||||
*/
|
|
||||||
private void dealResponse(CalculatedParam calculatedParam, LiteflowResponse liteflowResponse, String methodDescribe) {
|
|
||||||
MemorySizeUtil.getNowMemory();
|
|
||||||
if (liteflowResponse.isSuccess()) {
|
|
||||||
// 获取执行步骤列表
|
|
||||||
long allTime = 0;
|
|
||||||
Map<String, List<CmpStep>> executeSteps = liteflowResponse.getExecuteSteps();
|
|
||||||
for (String key : executeSteps.keySet()) {
|
|
||||||
List<CmpStep> cmpSteps = executeSteps.get(key);
|
|
||||||
long timeSum = cmpSteps.stream().mapToLong(CmpStep::getTimeSpent).sum();
|
|
||||||
allTime+=timeSum;
|
|
||||||
}
|
|
||||||
logger.info("日期{},{}执行{}成功,执行总时长{}分钟", calculatedParam.getDataDate(), methodDescribe, calculatedParam.isFullChain() ? "全链" : "指定节点:".concat(String.join(StrPool.COMMA, calculatedParam.getTagNames())),allTime/1000/60);
|
|
||||||
} else {
|
|
||||||
Map<String, List<CmpStep>> executeSteps = liteflowResponse.getExecuteSteps();
|
|
||||||
CmpStep failStep = null;
|
|
||||||
for (String key : executeSteps.keySet()) {
|
|
||||||
List<CmpStep> cmpSteps = executeSteps.get(key);
|
|
||||||
cmpSteps = cmpSteps.stream().filter(cmpStep -> !cmpStep.isSuccess()).collect(Collectors.toList());
|
|
||||||
if (CollectionUtil.isNotEmpty(cmpSteps)) {
|
|
||||||
failStep = cmpSteps.get(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
logger.error("日期{},{}执行{}失败,在执行{}失败,失败原因:{}"
|
|
||||||
, calculatedParam.getDataDate()
|
|
||||||
, methodDescribe
|
|
||||||
, calculatedParam.isFullChain() ? "全链" : "指定节点:".concat(String.join(StrPool.COMMA, calculatedParam.getTagNames()))
|
|
||||||
, failStep.getNodeId().concat(Objects.isNull(failStep.getTag()) ? "" : StrPool.DASHED.concat(failStep.getTag()))
|
|
||||||
, Objects.isNull(failStep.getException()) ? null : failStep.getException().getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -151,16 +118,18 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
||||||
liteflowResponse = flowExecutor.execute2Resp("measurement_point", calculatedParam);
|
CalculatedParam repairParam = BeanUtil.copyProperties(calculatedParam, CalculatedParam.class);
|
||||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
repairParam.setType(0);
|
||||||
|
flowService.execute2Resp(methodDescribe, repairParam);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//非补招
|
//非补招
|
||||||
|
calculatedParam.setType(0);
|
||||||
liteflowResponse = flowExecutor.execute2Resp("measurement_point", calculatedParam);
|
liteflowResponse = flowExecutor.execute2Resp("measurement_point", calculatedParam);
|
||||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -185,16 +154,18 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
||||||
|
calculatedParam.setType(2);
|
||||||
liteflowResponse = flowExecutor.execute2Resp("wl_measurement_point", calculatedParam);
|
liteflowResponse = flowExecutor.execute2Resp("wl_measurement_point", calculatedParam);
|
||||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//非补招
|
//非补招
|
||||||
|
calculatedParam.setType(2);
|
||||||
liteflowResponse = flowExecutor.execute2Resp("wl_measurement_point", calculatedParam);
|
liteflowResponse = flowExecutor.execute2Resp("wl_measurement_point", calculatedParam);
|
||||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||||
}
|
}
|
||||||
@@ -219,7 +190,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
@@ -262,7 +233,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATETIME_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATETIME_FORMAT);
|
||||||
long betweenHour = DateUtil.between(startDate, endDate, DateUnit.HOUR);
|
long betweenHour = DateUtil.between(startDate, endDate, DateUnit.HOUR);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenHour; i++) {
|
for (int i = 0; i <= betweenHour; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetHour(startDate, 1);
|
startDate = DateUtil.offsetHour(startDate, 1);
|
||||||
}
|
}
|
||||||
@@ -304,7 +275,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
@@ -343,7 +314,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
@@ -431,7 +402,7 @@ public class ExecutionCenter extends BaseController {
|
|||||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||||
//递增日期执行算法链
|
//递增日期执行算法链
|
||||||
for (int i = 0; i < betweenDay; i++) {
|
for (int i = 0; i <= betweenDay; i++) {
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
startDate = DateUtil.offsetDay(startDate, 1);
|
startDate = DateUtil.offsetDay(startDate, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.njcn.algorithm.service.line;
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.PqReasonableRangeDto;
|
||||||
|
import com.njcn.device.pq.pojo.vo.LineDetailVO;
|
||||||
|
import com.njcn.system.pojo.po.DictData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface FlowAsyncService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 算法多线程执行
|
||||||
|
* @param methodDescribe
|
||||||
|
* @param calculatedParam
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/12/17 9:25
|
||||||
|
*/
|
||||||
|
void execute2Resp(String methodDescribe,CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多线程数据清洗方法
|
||||||
|
* @param line
|
||||||
|
* @param map
|
||||||
|
* @param dataDate
|
||||||
|
* @param dip
|
||||||
|
* @param rise
|
||||||
|
* @param size
|
||||||
|
* @param i
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/12/17 10:48
|
||||||
|
*/
|
||||||
|
void lineDataClean(LineDetailVO.Detail line,
|
||||||
|
Map<String, List<PqReasonableRangeDto>> map,
|
||||||
|
String dataDate,
|
||||||
|
DictData dip,
|
||||||
|
DictData rise,
|
||||||
|
int size,
|
||||||
|
int i
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,8 @@ package com.njcn.algorithm.service.line;
|
|||||||
|
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
|
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author xy
|
* @author xy
|
||||||
*/
|
*/
|
||||||
@@ -92,4 +94,5 @@ public interface IDataCleanService {
|
|||||||
* @param calculatedParam 查询条件
|
* @param calculatedParam 查询条件
|
||||||
*/
|
*/
|
||||||
void dataFlickerCleanHandler(CalculatedParam calculatedParam);
|
void dataFlickerCleanHandler(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.algorithm.service.line;
|
||||||
|
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public interface IDataLimitRateAsync {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* limit_rate多线程算法
|
||||||
|
*
|
||||||
|
* @param dataDate
|
||||||
|
* @param list
|
||||||
|
* @param phase
|
||||||
|
* @param overLimitMap
|
||||||
|
* @param size
|
||||||
|
* @param i
|
||||||
|
* @param type 系统类型
|
||||||
|
* @return
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/12/17 12:16
|
||||||
|
*/
|
||||||
|
CompletableFuture<Void> lineDataRate(String dataDate,
|
||||||
|
List<String> list,
|
||||||
|
List<String> phase,
|
||||||
|
Map<String, Overlimit> overLimitMap,
|
||||||
|
int size,
|
||||||
|
int i,
|
||||||
|
int type);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@ public class DataComAssServiceImpl implements IDataComAssService {
|
|||||||
lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate()));
|
lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate()));
|
||||||
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
|
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
|
||||||
List<String> lineIdList = calculatedParam.getIdList();
|
List<String> lineIdList = calculatedParam.getIdList();
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
for (String lineId : lineIdList) {
|
for (String lineId : lineIdList) {
|
||||||
DataComassesDPO rStatComassesDpo = new DataComassesDPO();
|
DataComassesDPO rStatComassesDpo = new DataComassesDPO();
|
||||||
rStatComassesDpo.setTime(calculatedParam.getDataDate());
|
rStatComassesDpo.setTime(calculatedParam.getDataDate());
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import org.springframework.stereotype.Component;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,9 +65,13 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
private DataInharmVFeignClient dataInharmVFeignClient;
|
private DataInharmVFeignClient dataInharmVFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataPltFeignClient dataPltFeignClient;
|
private DataPltFeignClient dataPltFeignClient;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
||||||
|
/**
|
||||||
|
* 查询配置 辽宁版本比较特殊,没有CP95值,采用平均值进行判断
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dataVHandler(CalculatedParam calculatedParam) {
|
public void dataVHandler(CalculatedParam calculatedParam) {
|
||||||
@@ -82,7 +87,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataVFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataVFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -100,9 +105,10 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataVHandler(item3,valueTypes,dto,true);
|
//默认CP95值取 CP95的最大值;如果有特殊要求,可以根据平均值的数据取CP95
|
||||||
|
channelDataVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -131,7 +137,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataIFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataIFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -148,9 +154,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataIHandler(item3,valueTypes,dto,true);
|
channelDataIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -180,7 +186,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataFlickerFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataFlickerFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -196,9 +202,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item4);
|
dto.setValueType(item4.toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataFlickerHandler(item3,dto,item4,true);
|
channelDataFlickerHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -229,7 +235,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataFlucFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataFlucFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -245,9 +251,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item4);
|
dto.setValueType(item4.toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataFlucHandler(item3,dto,item4,true);
|
channelDataFlucHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -277,7 +283,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmphasicIFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmphasicIFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -294,9 +300,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmPhasicIHandler(item3,valueTypes,dto,true);
|
channelDataHarmPhasicIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -325,7 +331,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmphasicVFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmphasicVFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -342,9 +348,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmPhasicVHandler(item3,valueTypes,dto,true);
|
channelDataHarmPhasicVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -373,7 +379,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmpowerPFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmpowerPFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -390,9 +396,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmPowerPHandler(item3,valueTypes,dto,true);
|
channelDataHarmPowerPHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -421,7 +427,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmpowerQFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmpowerQFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -438,9 +444,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmPowerQHandler(item3,valueTypes,dto,true);
|
channelDataHarmPowerQHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -469,7 +475,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmpowerSFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmpowerSFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -486,9 +492,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmPowerSHandler(item3,valueTypes,dto,true);
|
channelDataHarmPowerSHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -517,7 +523,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmRateIFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmRateIFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -534,9 +540,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmRateIHandler(item3,valueTypes,dto,true);
|
channelDataHarmRateIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -565,7 +571,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataHarmRateVFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataHarmRateVFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -582,9 +588,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataHarmRateVHandler(item3,valueTypes,dto,true);
|
channelDataHarmRateVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -613,7 +619,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataInharmIFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataInharmIFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -630,9 +636,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataInHarmIHandler(item3,valueTypes,dto,true);
|
channelDataInHarmIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -661,7 +667,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataInharmVFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataInharmVFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -678,9 +684,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item3.getValueType());
|
dto.setValueType(item3.getValueType().toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataInHarmVHandler(item3,valueTypes,dto,true);
|
channelDataInHarmVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -710,7 +716,7 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
pendingIds.forEach(list->{
|
pendingIds.forEach(list->{
|
||||||
lineParam.setLineId(list);
|
lineParam.setLineId(list);
|
||||||
//添加异常数据时间点
|
//添加异常数据时间点
|
||||||
getAbnormalData(lineParam);
|
//getAbnormalData(lineParam);
|
||||||
//获取原始数据
|
//获取原始数据
|
||||||
List<CommonMinuteDto> partList = dataPltFeignClient.getBaseData(lineParam).getData();
|
List<CommonMinuteDto> partList = dataPltFeignClient.getBaseData(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(partList)) {
|
if (CollUtil.isNotEmpty(partList)) {
|
||||||
@@ -726,9 +732,9 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
dto.setTime(item.getTime());
|
dto.setTime(item.getTime());
|
||||||
dto.setLineId(item.getLineId());
|
dto.setLineId(item.getLineId());
|
||||||
dto.setPhasicType(item2.getPhasicType());
|
dto.setPhasicType(item2.getPhasicType());
|
||||||
dto.setValueType(item4);
|
dto.setValueType(item4.toUpperCase());
|
||||||
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
|
||||||
channelDataPltHandler(item3,dto,item4,true);
|
channelDataPltHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1549,47 +1555,64 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
valueType = valueType.toUpperCase();
|
valueType = valueType.toUpperCase();
|
||||||
if (scheme) {
|
if (scheme) {
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case InfluxDbSqlConstant.MAX:
|
case "MAX":
|
||||||
case InfluxDbSqlConstant.CP95:
|
case "CP95":
|
||||||
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
|
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
|
||||||
result = max.orElse(null);
|
result = max.orElse(0.0);
|
||||||
break;
|
break;
|
||||||
case InfluxDbSqlConstant.MIN:
|
case "MIN":
|
||||||
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
|
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
|
||||||
result = min.orElse(null);
|
result = min.orElse(0.0);
|
||||||
break;
|
break;
|
||||||
case InfluxDbSqlConstant.AVG_WEB:
|
case "AVG":
|
||||||
OptionalDouble average = list.stream()
|
OptionalDouble average = list.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.mapToDouble(Double::doubleValue)
|
.mapToDouble(Double::doubleValue)
|
||||||
.average();
|
.average();
|
||||||
result = average.isPresent() ? average.getAsDouble() : null;
|
result = average.isPresent() ? average.getAsDouble() : 0.0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch (valueType) {
|
switch (valueType) {
|
||||||
case InfluxDbSqlConstant.MAX:
|
case "MAX":
|
||||||
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
|
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
|
||||||
result = max.orElse(null);
|
result = max.orElse(0.0);
|
||||||
break;
|
break;
|
||||||
case InfluxDbSqlConstant.MIN:
|
case "MIN":
|
||||||
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
|
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
|
||||||
result = min.orElse(null);
|
result = min.orElse(0.0);
|
||||||
break;
|
break;
|
||||||
case InfluxDbSqlConstant.AVG_WEB:
|
case "AVG":
|
||||||
OptionalDouble average = list.stream()
|
OptionalDouble average = list.stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.mapToDouble(Double::doubleValue)
|
.mapToDouble(Double::doubleValue)
|
||||||
.average();
|
.average();
|
||||||
result = average.isPresent() ? average.getAsDouble() : null;
|
result = average.isPresent() ? average.getAsDouble() : 0.0;
|
||||||
break;
|
break;
|
||||||
case InfluxDbSqlConstant.CP95:
|
case "CP95":
|
||||||
list.sort(Collections.reverseOrder());
|
if (list == null || list.isEmpty()) {
|
||||||
int discardCount = (int) Math.ceil(list.size() * 0.05);
|
result = 0.0;
|
||||||
List<Double> remainingList = list.subList(discardCount, list.size());
|
break;
|
||||||
result = remainingList.isEmpty() ? null : remainingList.get(0);
|
}
|
||||||
|
// 过滤掉 null 元素
|
||||||
|
List<Double> filteredList = list.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (filteredList.isEmpty()) {
|
||||||
|
result = 0.0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
filteredList.sort(Collections.reverseOrder());
|
||||||
|
int discardCount = (int) Math.ceil(filteredList.size() * 0.05);
|
||||||
|
if (discardCount >= filteredList.size()) {
|
||||||
|
result = 0.0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
List<Double> remainingList = filteredList.subList(discardCount, filteredList.size());
|
||||||
|
result = remainingList.isEmpty() ? 0.0 : remainingList.get(0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1603,4 +1626,28 @@ public class DayDataServiceImpl implements IDayDataService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将平均值赋值给 CP95
|
||||||
|
*/
|
||||||
|
public void putCP95ByAvg(List<CommonMinuteDto> list) {
|
||||||
|
list.forEach(po1->{
|
||||||
|
List<CommonMinuteDto.PhasicType> phasicTypeList = po1.getPhasicTypeList();
|
||||||
|
phasicTypeList.forEach(po2 -> {
|
||||||
|
List<CommonMinuteDto.ValueType> valueTypeList = po2.getValueTypeList();
|
||||||
|
AtomicReference<List<List<Double>>> valueList = new AtomicReference<>(new ArrayList<>());
|
||||||
|
valueTypeList.forEach(po3 -> {
|
||||||
|
if (po3.getValueType().equals(InfluxDbSqlConstant.AVG_WEB)) {
|
||||||
|
valueList.set(po3.getValueList());
|
||||||
|
}
|
||||||
|
if (po3.getValueType().equals(InfluxDbSqlConstant.CP95)) {
|
||||||
|
po3.setValueList((List<List<Double>>) valueList);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -6,29 +6,32 @@ import cn.hutool.core.collection.ListUtil;
|
|||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.algorithm.service.line.IDataCrossingService;
|
import com.njcn.algorithm.service.line.IDataCrossingService;
|
||||||
|
import com.njcn.algorithm.service.line.IDataLimitRateAsync;
|
||||||
import com.njcn.algorithm.utils.MemorySizeUtil;
|
import com.njcn.algorithm.utils.MemorySizeUtil;
|
||||||
import com.njcn.common.utils.PubUtils;
|
import com.njcn.common.utils.PubUtils;
|
||||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||||
import com.njcn.dataProcess.api.*;
|
import com.njcn.csdevice.api.CsOverLimitClient;
|
||||||
|
import com.njcn.dataProcess.api.DataLimitQualifiedFeignClient;
|
||||||
|
import com.njcn.dataProcess.api.DataLimitRateFeignClient;
|
||||||
|
import com.njcn.dataProcess.api.DataLimitTargetFeignClient;
|
||||||
import com.njcn.dataProcess.constant.PhaseType;
|
import com.njcn.dataProcess.constant.PhaseType;
|
||||||
import com.njcn.dataProcess.enums.DataCleanEnum;
|
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.*;
|
import com.njcn.dataProcess.pojo.dto.DataLimitDetailDto;
|
||||||
import com.njcn.dataProcess.pojo.po.PqDataVerify;
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitTargetDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
import com.njcn.dataProcess.util.TimeUtils;
|
import com.njcn.dataProcess.util.TimeUtils;
|
||||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
|
||||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.ListUtils;
|
import org.apache.commons.collections4.ListUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -40,9 +43,10 @@ import java.math.BigDecimal;
|
|||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -58,54 +62,27 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class);
|
private static final Logger logger = LoggerFactory.getLogger(DayDataServiceImpl.class);
|
||||||
@Value("${line.num}")
|
@Value("${line.num}")
|
||||||
private Integer NUM = 100;
|
private Integer NUM;
|
||||||
@Resource
|
|
||||||
private DataVFeignClient dataVFeignClient;
|
|
||||||
@Resource
|
@Resource
|
||||||
private CommTerminalGeneralClient commTerminalGeneralClient;
|
private CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataIFeignClient dataIFeignClient;
|
|
||||||
@Resource
|
|
||||||
private DataPltFeignClient dataPltFeignClient;
|
|
||||||
@Resource
|
|
||||||
private DataInharmVFeignClient dataInharmVFeignClient;
|
|
||||||
@Resource
|
|
||||||
private DataHarmRateVFeignClient dataHarmRateVFeignClient;
|
|
||||||
@Resource
|
|
||||||
private DataLimitRateFeignClient dataLimitRateFeignClient;
|
private DataLimitRateFeignClient dataLimitRateFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
|
||||||
@Resource
|
|
||||||
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
|
||||||
@Resource
|
|
||||||
private DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
private DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataLimitQualifiedFeignClient dataLimitQualifiedFeignClient;
|
private DataLimitQualifiedFeignClient dataLimitQualifiedFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
|
private IDataLimitRateAsync dataLimitRateAsync;
|
||||||
|
@Resource
|
||||||
private CsLineFeignClient csLineFeignClient;
|
private CsLineFeignClient csLineFeignClient;
|
||||||
|
@Resource
|
||||||
|
private CsOverLimitClient csOverLimitClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void limitRateHandler(CalculatedParam calculatedParam) {
|
public void limitRateHandler(CalculatedParam calculatedParam) {
|
||||||
MemorySizeUtil.getNowMemory();
|
MemorySizeUtil.getNowMemory();
|
||||||
|
System.err.println("limitRate表转r_stat_limit_rate_d算法开始,执行日期为{}=====》"+calculatedParam.getDataDate());
|
||||||
Runtime runtime = Runtime.getRuntime();
|
|
||||||
// 获取 JVM 最大可用内存(以字节为单位)
|
|
||||||
long maxMemory = runtime.maxMemory();
|
|
||||||
// 获取 JVM 当前已分配的内存(以字节为单位)
|
|
||||||
long totalMemory = runtime.totalMemory();
|
|
||||||
// 获取 JVM 当前空闲内存(以字节为单位)
|
|
||||||
long freeMemory = runtime.freeMemory();
|
|
||||||
// 计算已使用的内存
|
|
||||||
long usedMemory = totalMemory - freeMemory;
|
|
||||||
|
|
||||||
System.out.println("最大可用内存: " + maxMemory / (1024 * 1024) + " MB");
|
|
||||||
System.out.println("当前已分配的内存: " + totalMemory / (1024 * 1024) + " MB");
|
|
||||||
System.out.println("当前空闲内存: " + freeMemory / (1024 * 1024) + " MB");
|
|
||||||
System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB");
|
|
||||||
System.out.println("第一次分析结束-----------------------------------------");
|
|
||||||
|
|
||||||
logger.info("{},limitRate表转r_stat_limit_rate_d算法开始=====》", LocalDateTime.now());
|
|
||||||
List<DataLimitDetailDto> result = new ArrayList<>();
|
List<DataLimitDetailDto> result = new ArrayList<>();
|
||||||
//远程接口获取分钟数据
|
//远程接口获取分钟数据
|
||||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
@@ -113,153 +90,45 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
|
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
|
||||||
lineParam.setType(calculatedParam.getType());
|
lineParam.setType(calculatedParam.getType());
|
||||||
List<String> lineIds = calculatedParam.getIdList();
|
List<String> lineIds = calculatedParam.getIdList();
|
||||||
|
List<Overlimit> overLimitList;
|
||||||
//获取所有监测点的限值
|
//获取所有监测点的限值
|
||||||
List<Overlimit> overLimitList = csLineFeignClient.getOverLimitData(lineIds).getData();
|
if (Objects.equals(lineParam.getType(), 2)) {
|
||||||
|
List<Overlimit> list = csOverLimitClient.getOverLimitByLineIds(lineIds).getData();
|
||||||
|
overLimitList = list.stream()
|
||||||
|
.map(item -> {
|
||||||
|
Overlimit overlimit = new Overlimit();
|
||||||
|
BeanUtils.copyProperties(item, overlimit);
|
||||||
|
return overlimit;
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
overLimitList = commTerminalGeneralClient.getOverLimitDataByIds(lineIds).getData();
|
||||||
|
}
|
||||||
Map<String, Overlimit> overLimitMap = overLimitList.stream().collect(Collectors.toMap(Overlimit::getId, Function.identity()));
|
Map<String, Overlimit> overLimitMap = overLimitList.stream().collect(Collectors.toMap(Overlimit::getId, Function.identity()));
|
||||||
//添加异常数据时间点
|
|
||||||
getAbnormalData(lineParam);
|
|
||||||
//以100个监测点分片处理
|
//以100个监测点分片处理
|
||||||
List<List<String>> pendingIds = ListUtils.partition(lineIds, NUM);
|
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1);
|
||||||
ArrayList<String> phase = ListUtil.toList(PhaseType.PHASE_A, PhaseType.PHASE_B, PhaseType.PHASE_C);
|
ArrayList<String> phase = ListUtil.toList(PhaseType.PHASE_A, PhaseType.PHASE_B, PhaseType.PHASE_C);
|
||||||
MemorySizeUtil.getNowMemory();
|
MemorySizeUtil.getNowMemory();
|
||||||
pendingIds.forEach(list -> {
|
|
||||||
lineParam.setLineId(list);
|
|
||||||
//获取电压数据
|
|
||||||
List<DataVDto> dataVAllTime = dataVFeignClient.getRawData(lineParam).getData();
|
|
||||||
//闪变数据
|
|
||||||
List<DataPltDto> dataPltAllTime = dataPltFeignClient.getRawData(lineParam).getData();
|
|
||||||
//谐波数据
|
|
||||||
List<DataHarmDto> dataVHarmList = dataHarmRateVFeignClient.getRawData(lineParam).getData();
|
|
||||||
//间谐波数据
|
|
||||||
List<DataHarmDto> dataVInHarmList = dataInharmVFeignClient.getRawData(lineParam).getData();
|
|
||||||
//电流数据
|
|
||||||
List<DataIDto> dataIList = dataIFeignClient.getRawData(lineParam).getData();
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_v ->
|
|
||||||
* 总计算次数(用data_v中phasic_type=A,value_type=avg,quality_flag=0来参与统计)
|
|
||||||
*/
|
|
||||||
Map<String, List<DataVDto>> allTime = dataVAllTime.stream()
|
|
||||||
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
List<CompletableFuture<Void>> futures = new ArrayList<>();
|
||||||
* 功能描述:获取influxDB -> data_plt ->
|
for (int i = 0; i < pendingIds.size(); i++) {
|
||||||
* 闪变总计算次数(用data_plt中phasic_type=A,value_type=avg,quality_flag=0来参与统计)
|
logger.info(calculatedParam.getDataDate()+" 总分区数据:" + pendingIds.size() + "=====》当前第"+(i + 1)+"小分区");
|
||||||
*/
|
List<String> list = pendingIds.get(i);
|
||||||
Map<String, List<DataPltDto>> pltAllTime = dataPltAllTime.stream()
|
// 获取Future
|
||||||
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
CompletableFuture<Void> future = dataLimitRateAsync.lineDataRate(
|
||||||
.filter(x -> InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(x.getValueType()))
|
calculatedParam.getDataDate(),
|
||||||
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
list,
|
||||||
|
phase,
|
||||||
|
overLimitMap,
|
||||||
|
pendingIds.size(),
|
||||||
|
(i + 1),
|
||||||
|
lineParam.getType()
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
futures.add(future);
|
||||||
*功能描述:获取influxDB -> data_harmrate_v ->
|
|
||||||
* 2-25次谐波电压含有率 -> A相||B相||C相的日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataHarmDto>> harmRateV = dataVHarmList.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_i -> 2-25次谐波电流 -> 日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataIDto>> dataI = dataIList.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_inharm_v -> 0.5-15.5次间谐波电压含有率 -> 日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataHarmDto>> inHarmV = dataVInHarmList.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_v -> 电压总谐波畸变率 -> 日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataVDto>> dataVThd = dataVAllTime.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_v -> 负序电压不平衡度 -> 最大值 && 日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataVDto>> dataVUnbalance = dataVAllTime.stream()
|
|
||||||
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()) ||
|
|
||||||
InfluxDBTableConstant.MAX.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_i -> 负序电流 -> 最大值 && 日95%概率值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataIDto>> dataINeg = dataIList.stream()
|
|
||||||
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.CP95.equals(x.getValueType()) ||
|
|
||||||
InfluxDBTableConstant.MAX.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_v -> 频率偏差 -> 最大值 && 最小值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataVDto>> dataVFreq = dataVAllTime.stream()
|
|
||||||
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equals(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.MIN.equals(x.getValueType()) ||
|
|
||||||
InfluxDBTableConstant.MAX.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_v -> 电压偏差 -> 最大值
|
|
||||||
*/
|
|
||||||
Map<String, List<DataVDto>> dataVDev = dataVAllTime.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.filter(x -> InfluxDBTableConstant.MAX.equals(x.getValueType()))
|
|
||||||
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能描述:获取influxDB -> data_plt -> 长时间闪变 -> 注(取最大值原始算法去掉了,现没有根据最大值比较)
|
|
||||||
*/
|
|
||||||
Map<String, List<DataPltDto>> dataPlt = dataPltAllTime.stream()
|
|
||||||
.filter(x -> phase.contains(x.getPhasicType()))
|
|
||||||
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
|
||||||
|
|
||||||
for (String item : list) {
|
|
||||||
if(ObjectUtil.isNotNull(overLimitMap.get(item))){
|
|
||||||
result.addAll(getData(calculatedParam.getDataDate(),
|
|
||||||
overLimitMap.get(item),
|
|
||||||
allTime.get(item),
|
|
||||||
pltAllTime.get(item),
|
|
||||||
harmRateV.get(item),
|
|
||||||
dataI.get(item),
|
|
||||||
inHarmV.get(item),
|
|
||||||
dataVThd.get(item),
|
|
||||||
dataVUnbalance.get(item),
|
|
||||||
dataINeg.get(item),
|
|
||||||
dataVFreq.get(item),
|
|
||||||
dataVDev.get(item),
|
|
||||||
dataPlt.get(item)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
MemorySizeUtil.getNowMemory();
|
|
||||||
if (CollUtil.isNotEmpty(result)) {
|
|
||||||
//存储数据
|
|
||||||
List<DataLimitRateDto> dataLimitRate = result.stream().map(DataLimitDetailDto::getDataLimitRate).filter(ObjectUtil::isNotNull).collect(Collectors.toList());
|
|
||||||
if(CollUtil.isNotEmpty(dataLimitRate)){
|
|
||||||
dataLimitRateFeignClient.batchInsertion(dataLimitRate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (CollUtil.isNotEmpty(result)) {
|
|
||||||
//存储数据
|
|
||||||
List<DataLimitRateDetailDto> detail = result.stream().map(DataLimitDetailDto::getDataLimitRateDetail).filter(x -> ObjectUtil.isNotNull(x)).collect(Collectors.toList());
|
|
||||||
if(CollUtil.isNotEmpty(detail)){
|
|
||||||
dataLimitRateDetailFeignClient.batchInsertion(detail);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// 等待所有任务完成
|
||||||
|
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
|
||||||
System.gc();
|
System.gc();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,665 +334,6 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: getData
|
|
||||||
* @Param: [overlimit, allTimeList, flickerAllTimeList, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVPOUnbalanceList, dataIPONegList, dataVPOFreqList, dataVPODevList, dataPltPOList]
|
|
||||||
* @return: java.util.List<com.njcn.harmonic.pojo.po.LimitRate>
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/10/18
|
|
||||||
*/
|
|
||||||
private List<DataLimitDetailDto> getData(String dataDate,
|
|
||||||
Overlimit overlimit,
|
|
||||||
List<DataVDto> allTimeList,
|
|
||||||
List<DataPltDto> flickerAllTimeList,
|
|
||||||
List<DataHarmDto> dataHarmRateVPOList,
|
|
||||||
List<DataIDto> dataIPOList,
|
|
||||||
List<DataHarmDto> dataInHarmVPOList,
|
|
||||||
List<DataVDto> dataVPOList,
|
|
||||||
List<DataVDto> dataVPOUnbalanceList,
|
|
||||||
List<DataIDto> dataIPONegList,
|
|
||||||
List<DataVDto> dataVPOFreqList,
|
|
||||||
List<DataVDto> dataVPODevList,
|
|
||||||
List<DataPltDto> dataPltPOList) {
|
|
||||||
List<DataLimitDetailDto> result = new ArrayList<>();
|
|
||||||
|
|
||||||
Map<String, List<DataHarmDto>> harmRateVByPhaseType = new HashMap<>();
|
|
||||||
Map<String, List<DataIDto>> dataIByPhaseType = new HashMap<>();
|
|
||||||
Map<String, List<DataHarmDto>> dataInHarmVPhaseType = new HashMap<>();
|
|
||||||
Map<String, List<DataVDto>> dataVPhaseType = new HashMap<>();
|
|
||||||
Map<String, List<DataVDto>> dataVDevPhaseType = new HashMap<>();
|
|
||||||
Map<String, List<DataPltDto>> dataPltPhaseType = new HashMap<>();
|
|
||||||
|
|
||||||
|
|
||||||
Integer allTime = 0;
|
|
||||||
Integer flickerAllTime = 0;
|
|
||||||
if (!CollectionUtils.isEmpty(allTimeList)) {
|
|
||||||
allTime = allTimeList.size();
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(flickerAllTimeList)) {
|
|
||||||
flickerAllTime = flickerAllTimeList.size();
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
|
||||||
harmRateVByPhaseType = dataHarmRateVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
|
||||||
dataIByPhaseType = dataIPOList.stream().collect(Collectors.groupingBy(DataIDto::getPhasicType));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
|
||||||
dataInHarmVPhaseType = dataInHarmVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
|
||||||
dataVPhaseType = dataVPOList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
|
||||||
dataVDevPhaseType = dataVPODevList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType));
|
|
||||||
}
|
|
||||||
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
|
||||||
dataPltPhaseType = dataPltPOList.stream().collect(Collectors.groupingBy(DataPltDto::getPhasicType));
|
|
||||||
}
|
|
||||||
DataLimitDetailDto a = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_A, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_A), dataIByPhaseType.get(PhaseType.PHASE_A), dataInHarmVPhaseType.get(PhaseType.PHASE_A), dataVPhaseType.get(PhaseType.PHASE_A), dataVDevPhaseType.get(PhaseType.PHASE_A), dataPltPhaseType.get(PhaseType.PHASE_A));
|
|
||||||
DataLimitDetailDto b = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_B, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_B), dataIByPhaseType.get(PhaseType.PHASE_B), dataInHarmVPhaseType.get(PhaseType.PHASE_B), dataVPhaseType.get(PhaseType.PHASE_B), dataVDevPhaseType.get(PhaseType.PHASE_B), dataPltPhaseType.get(PhaseType.PHASE_B));
|
|
||||||
DataLimitDetailDto c = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_C, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_C), dataIByPhaseType.get(PhaseType.PHASE_C), dataInHarmVPhaseType.get(PhaseType.PHASE_C), dataVPhaseType.get(PhaseType.PHASE_C), dataVDevPhaseType.get(PhaseType.PHASE_C), dataPltPhaseType.get(PhaseType.PHASE_C));
|
|
||||||
DataLimitDetailDto t = limitRateDataT(dataDate, overlimit, allTime, flickerAllTime, overlimit.getId(), dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVPOUnbalanceList, dataIPONegList, dataVPOFreqList, dataVPODevList, dataPltPOList);
|
|
||||||
result.add(a);
|
|
||||||
result.add(b);
|
|
||||||
result.add(c);
|
|
||||||
result.add(t);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param lineParam
|
|
||||||
* @Description:
|
|
||||||
* @Author: wr
|
|
||||||
* @Date: 2025/3/11 9:04
|
|
||||||
*/
|
|
||||||
private void getAbnormalData(LineCountEvaluateParam lineParam) {
|
|
||||||
lineParam.setTableName(DataCleanEnum.DataV.getCode());
|
|
||||||
// 获取异常数据,用于排除异常数据
|
|
||||||
List<PqDataVerify> pqDataVerifies = pqDataVerifyFeignClient.queryData(lineParam).getData();
|
|
||||||
if (CollUtil.isNotEmpty(pqDataVerifies)) {
|
|
||||||
Map<String, List<String>> timeMap = pqDataVerifies.stream()
|
|
||||||
.collect(Collectors.groupingBy(
|
|
||||||
PqDataVerify::getLineId,
|
|
||||||
Collectors.mapping(item -> TimeUtils.LocalDateTimeToString(item.getTime()), Collectors.toList())
|
|
||||||
));
|
|
||||||
lineParam.setAbnormalTime(timeMap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: limitRateData
|
|
||||||
* @Param: [overlimit, allTime, flickerAllTime, phasicType, lineId, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVUnbalanceList, dataINegList]
|
|
||||||
* @return: com.njcn.harmonic.pojo.po.LimitRate
|
|
||||||
* @Author: clam
|
|
||||||
* @Date: 2022/10/18
|
|
||||||
*/
|
|
||||||
public DataLimitDetailDto limitRateData(String dataDate,
|
|
||||||
Overlimit overlimit,
|
|
||||||
Integer allTime,
|
|
||||||
Integer flickerAllTime,
|
|
||||||
String phasicType, String lineId,
|
|
||||||
List<DataHarmDto> dataHarmRateVPOList,
|
|
||||||
List<DataIDto> dataIPOList,
|
|
||||||
List<DataHarmDto> dataInHarmVPOList,
|
|
||||||
List<DataVDto> dataVPOList,
|
|
||||||
List<DataVDto> dataVPODevList,
|
|
||||||
List<DataPltDto> dataPltPOList) {
|
|
||||||
List<AbnormalData> thd = new ArrayList<>(), uDev = new ArrayList<>(), flicker = new ArrayList<>(), freqDev = new ArrayList<>(), uAberrance = new ArrayList<>(), iNeg = new ArrayList<>();
|
|
||||||
DataLimitDetailDto dto = new DataLimitDetailDto();
|
|
||||||
DataLimitRateDto limitRate = new DataLimitRateDto();
|
|
||||||
// 初始化 v 系列列表
|
|
||||||
List<AbnormalData>[] v = new List[24];
|
|
||||||
for (int i = 0; i < 24; i++) {
|
|
||||||
v[i] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
|
||||||
for (DataHarmDto item : dataHarmRateVPOList) {
|
|
||||||
for (int i = 2; i < 26; i++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getVx 方法
|
|
||||||
Method getVMethod = DataHarmDto.class.getMethod("getV" + i);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getUharm" + i);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (ObjectUtil.isNotNull(value)){
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化 i 系列列表
|
|
||||||
List<AbnormalData>[] i = new List[24];
|
|
||||||
for (int j = 0; j < 24; j++) {
|
|
||||||
i[j] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
|
||||||
for (DataIDto item : dataIPOList) {
|
|
||||||
for (int j = 2; j < 26; j++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getIx 方法
|
|
||||||
Method getVMethod = DataIDto.class.getMethod("getI" + j);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getIharm" + j);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(i[j - 2], item.getValueType(), item.getPhasicType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 初始化 uHarm 系列列表
|
|
||||||
List<AbnormalData>[] uHarm = new List[16];
|
|
||||||
for (int j = 0; j < 16; j++) {
|
|
||||||
uHarm[j] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
|
||||||
for (DataHarmDto item : dataInHarmVPOList) {
|
|
||||||
for (int j = 1; j < 17; j++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getVx 方法
|
|
||||||
Method getVMethod = DataHarmDto.class.getMethod("getV" + j);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getInuharm" + j);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(uHarm[j - 1], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//电压总谐波畸变率
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
|
||||||
for (DataVDto item : dataVPOList) {
|
|
||||||
if (ObjectUtil.isNull(item.getVThd())||item.getVThd() > overlimit.getUaberrance()) {
|
|
||||||
addAbnormalData(thd, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVThd(), overlimit.getUaberrance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限)
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
|
||||||
for (DataVDto item : dataVPODevList) {
|
|
||||||
if (ObjectUtil.isNull(item.getVlDev())||item.getVlDev() >= 0) {
|
|
||||||
if (item.getVlDev() > overlimit.getVoltageDev()) {
|
|
||||||
addAbnormalData(uDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVlDev(), overlimit.getVoltageDev());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Math.abs(item.getVuDev()) > Math.abs(overlimit.getUvoltageDev())) {
|
|
||||||
addAbnormalData(uDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVlDev(), overlimit.getUvoltageDev());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//长时间闪变
|
|
||||||
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
|
||||||
for (DataPltDto item : dataPltPOList) {
|
|
||||||
if (ObjectUtil.isNull(item.getPlt())||item.getPlt() > overlimit.getFlicker()) {
|
|
||||||
addAbnormalData(flicker, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getPlt(), overlimit.getFlicker());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
limitRate.setLineId(lineId);
|
|
||||||
limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
|
||||||
limitRate.setPhasicType(phasicType);
|
|
||||||
limitRate.setAllTime(allTime);
|
|
||||||
limitRate.setFlickerAllTime(flickerAllTime);
|
|
||||||
|
|
||||||
limitRate.setFlickerOvertime(flicker.size());
|
|
||||||
limitRate.setUaberranceOvertime(thd.size());
|
|
||||||
limitRate.setINegOvertime(iNeg.size());
|
|
||||||
limitRate.setFreqDevOvertime(freqDev.size());
|
|
||||||
limitRate.setUbalanceOvertime(uAberrance.size());
|
|
||||||
limitRate.setVoltageDevOvertime(uDev.size());
|
|
||||||
dto.setDataLimitRate(getDataLimitRateDto(limitRate, v, i, uHarm));
|
|
||||||
|
|
||||||
return dto;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public DataLimitDetailDto limitRateDataT(
|
|
||||||
String dataDate,
|
|
||||||
Overlimit overlimit,
|
|
||||||
Integer allTime,
|
|
||||||
Integer flickerAllTime,
|
|
||||||
String lineId,
|
|
||||||
List<DataHarmDto> dataHarmRateVPOList,
|
|
||||||
List<DataIDto> dataIPOList,
|
|
||||||
List<DataHarmDto> dataInHarmVPOList,
|
|
||||||
List<DataVDto> dataVPOList,
|
|
||||||
List<DataVDto> dataVPOUnbalanceList,
|
|
||||||
List<DataIDto> dataIPONegList,
|
|
||||||
List<DataVDto> dataVPOFreqList,
|
|
||||||
List<DataVDto> dataVPODevList,
|
|
||||||
List<DataPltDto> dataPltPOList) {
|
|
||||||
DataLimitDetailDto dto = new DataLimitDetailDto();
|
|
||||||
DataLimitRateDto limitRate = new DataLimitRateDto();
|
|
||||||
List<AbnormalData> thd = new ArrayList<>(), uDev = new ArrayList<>(), flicker = new ArrayList<>(), freqDev = new ArrayList<>(), uAberrance = new ArrayList<>(), iNeg = new ArrayList<>();
|
|
||||||
// 初始化 v 系列列表
|
|
||||||
List<AbnormalData>[] v = new List[24];
|
|
||||||
for (int i = 0; i < 24; i++) {
|
|
||||||
v[i] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
|
||||||
for (DataHarmDto item : dataHarmRateVPOList) {
|
|
||||||
for (int i = 2; i < 26; i++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getVx 方法
|
|
||||||
Method getVMethod = DataHarmDto.class.getMethod("getV" + i);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getUharm" + i);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (ObjectUtil.isNotNull(value)){
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
System.out.println(item);
|
|
||||||
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 初始化 i 系列列表
|
|
||||||
List<AbnormalData>[] i = new List[24];
|
|
||||||
for (int j = 0; j < 24; j++) {
|
|
||||||
i[j] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
|
||||||
for (DataIDto item : dataIPOList) {
|
|
||||||
for (int j = 2; j < 26; j++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getIx 方法
|
|
||||||
Method getVMethod = DataIDto.class.getMethod("getI" + j);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getIharm" + j);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(i[j - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 初始化 uHarm 系列列表
|
|
||||||
List<AbnormalData>[] uHarm = new List[16];
|
|
||||||
for (int j = 0; j < 16; j++) {
|
|
||||||
uHarm[j] = new ArrayList<>();
|
|
||||||
}
|
|
||||||
// 处理数据
|
|
||||||
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
|
||||||
for (DataHarmDto item : dataInHarmVPOList) {
|
|
||||||
for (int j = 1; j < 17; j++) {
|
|
||||||
try {
|
|
||||||
// 获取 DataHarmDto 类的 getVx 方法
|
|
||||||
Method getVMethod = DataHarmDto.class.getMethod("getV" + j);
|
|
||||||
Double value = (Double) getVMethod.invoke(item);
|
|
||||||
// 获取 Overlimit 类的 getUharmx 方法
|
|
||||||
Method getUharmMethod = Overlimit.class.getMethod("getInuharm" + j);
|
|
||||||
float limit = (float) getUharmMethod.invoke(overlimit);
|
|
||||||
if (value > limit) {
|
|
||||||
addAbnormalData(uHarm[j - 1], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//电压总谐波畸变率
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
|
||||||
for (DataVDto item : dataVPOList) {
|
|
||||||
if (ObjectUtil.isNull(item.getVThd())||item.getVThd() > overlimit.getUaberrance()) {
|
|
||||||
addAbnormalData(thd, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVThd(), overlimit.getUaberrance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//三相电压不平衡度
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOUnbalanceList)) {
|
|
||||||
for (DataVDto item : dataVPOUnbalanceList) {
|
|
||||||
if (ObjectUtil.isNull(item.getVUnbalance())||item.getVUnbalance() > overlimit.getUbalance()) {
|
|
||||||
addAbnormalData(uAberrance, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVUnbalance(), overlimit.getUbalance());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//负序电流
|
|
||||||
if (!CollectionUtils.isEmpty(dataIPONegList)) {
|
|
||||||
for (DataIDto item : dataIPONegList) {
|
|
||||||
if(ObjectUtil.isNotNull(item.getINeg())){
|
|
||||||
if (item.getINeg() > overlimit.getINeg()) {
|
|
||||||
addAbnormalData(iNeg, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getINeg(), overlimit.getINeg());
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
System.out.println(item);
|
|
||||||
addAbnormalData(iNeg, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getINeg(), overlimit.getINeg());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//频率偏差
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPOFreqList)) {
|
|
||||||
for (DataVDto item : dataVPOFreqList) {
|
|
||||||
if (ObjectUtil.isNull(item.getFreqDev())||item.getFreqDev() > overlimit.getFreqDev()) {
|
|
||||||
addAbnormalData(freqDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getFreqDev(), overlimit.getFreqDev());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限)
|
|
||||||
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
|
||||||
for (DataVDto item : dataVPODevList) {
|
|
||||||
if (ObjectUtil.isNull(item.getVlDev())||item.getVlDev() >= 0) {
|
|
||||||
if (item.getVlDev() > overlimit.getVoltageDev()) {
|
|
||||||
addAbnormalData(uDev, item.getPhasicType(), item.getMinTime(), item.getValueType(), item.getVlDev(), overlimit.getVoltageDev());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Math.abs(item.getVuDev()) > Math.abs(overlimit.getUvoltageDev())) {
|
|
||||||
addAbnormalData(uDev, item.getPhasicType(), item.getMinTime(), item.getValueType(), item.getVlDev(), overlimit.getUvoltageDev());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//长时间闪变
|
|
||||||
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
|
||||||
for (DataPltDto item : dataPltPOList) {
|
|
||||||
if (ObjectUtil.isNull(item.getPlt())||item.getPlt() > overlimit.getFlicker()) {
|
|
||||||
addAbnormalData(flicker, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getPlt(), overlimit.getFlicker());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
limitRate.setLineId(lineId);
|
|
||||||
limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
|
||||||
limitRate.setPhasicType(PhaseType.PHASE_T);
|
|
||||||
limitRate.setAllTime(allTime);
|
|
||||||
limitRate.setFlickerAllTime(flickerAllTime);
|
|
||||||
limitRate.setUaberranceOvertime(thd.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setINegOvertime(iNeg.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setFreqDevOvertime(freqDev.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUbalanceOvertime(uAberrance.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setVoltageDevOvertime(uDev.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setFlickerOvertime(flicker.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm2Overtime(v[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm3Overtime(v[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm4Overtime(v[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm5Overtime(v[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm6Overtime(v[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm7Overtime(v[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm8Overtime(v[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm9Overtime(v[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm10Overtime(v[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm11Overtime(v[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm12Overtime(v[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm13Overtime(v[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm14Overtime(v[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm15Overtime(v[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm16Overtime(v[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm17Overtime(v[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm18Overtime(v[16].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm19Overtime(v[17].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm20Overtime(v[18].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm21Overtime(v[19].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm22Overtime(v[20].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm23Overtime(v[21].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm24Overtime(v[22].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setUharm25Overtime(v[23].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm2Overtime(i[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm3Overtime(i[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm4Overtime(i[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm5Overtime(i[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm6Overtime(i[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm7Overtime(i[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm8Overtime(i[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm9Overtime(i[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm10Overtime(i[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm11Overtime(i[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm12Overtime(i[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm13Overtime(i[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm14Overtime(i[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm15Overtime(i[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm16Overtime(i[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm17Overtime(i[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm18Overtime(i[16].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm19Overtime(i[17].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm20Overtime(i[18].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm21Overtime(i[19].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm22Overtime(i[20].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm23Overtime(i[21].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm24Overtime(i[22].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setIharm25Overtime(i[23].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm1Overtime(uHarm[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm2Overtime(uHarm[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm3Overtime(uHarm[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm4Overtime(uHarm[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm5Overtime(uHarm[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm6Overtime(uHarm[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm7Overtime(uHarm[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm8Overtime(uHarm[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm9Overtime(uHarm[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm10Overtime(uHarm[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm11Overtime(uHarm[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm12Overtime(uHarm[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm13Overtime(uHarm[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm14Overtime(uHarm[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm15Overtime(uHarm[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
limitRate.setInuharm16Overtime(uHarm[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
|
||||||
dto.setDataLimitRate(limitRate);
|
|
||||||
|
|
||||||
int detailAllTime = flicker.size() + uAberrance.size() + iNeg.size() + freqDev.size() + thd.size() + uDev.size() +
|
|
||||||
v[0].size() + v[1].size() + v[2].size() + v[3].size() + v[4].size() + v[5].size() + v[6].size() + v[7].size() + v[8].size() + v[9].size() + v[11].size() + v[12].size() + v[13].size() + v[14].size() + v[15].size() + v[16].size() + v[17].size() + v[18].size() + v[19].size() + v[20].size() + v[21].size() + v[22].size() + v[23].size() +
|
|
||||||
i[0].size() + i[1].size() + i[2].size() + i[3].size() + i[4].size() + i[5].size() + i[6].size() + i[7].size() + i[8].size() + i[9].size() + i[10].size() + i[11].size() + i[12].size() + i[13].size() + i[14].size() + i[15].size() + i[16].size() + i[17].size() + i[18].size() + i[19].size() + i[20].size() + i[21].size() + i[22].size() + i[23].size() +
|
|
||||||
uHarm[0].size() + uHarm[1].size() + uHarm[2].size() + uHarm[3].size() + uHarm[4].size() + uHarm[5].size() + uHarm[6].size() + uHarm[7].size() + uHarm[8].size() + uHarm[9].size() + uHarm[10].size() + uHarm[11].size() + uHarm[12].size() + uHarm[13].size() + uHarm[14].size() + uHarm[15].size();
|
|
||||||
if (detailAllTime > 0) {
|
|
||||||
DataLimitRateDetailDto detail = new DataLimitRateDetailDto();
|
|
||||||
detail.setLineId(lineId);
|
|
||||||
detail.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
|
||||||
detail.setFlickerOvertime(toJson(flicker));
|
|
||||||
detail.setUaberranceOvertime(toJson(uAberrance));
|
|
||||||
detail.setINegOvertime(toJson(iNeg));
|
|
||||||
detail.setFreqDevOvertime(toJson(freqDev));
|
|
||||||
detail.setUbalanceOvertime(toJson(thd));
|
|
||||||
detail.setVoltageDevOvertime(toJson(uDev));
|
|
||||||
detail.setUharm2Overtime(toJson(v[0]));
|
|
||||||
detail.setUharm3Overtime(toJson(v[1]));
|
|
||||||
detail.setUharm4Overtime(toJson(v[2]));
|
|
||||||
detail.setUharm5Overtime(toJson(v[3]));
|
|
||||||
detail.setUharm6Overtime(toJson(v[4]));
|
|
||||||
detail.setUharm7Overtime(toJson(v[5]));
|
|
||||||
detail.setUharm8Overtime(toJson(v[6]));
|
|
||||||
detail.setUharm9Overtime(toJson(v[7]));
|
|
||||||
detail.setUharm10Overtime(toJson(v[8]));
|
|
||||||
detail.setUharm11Overtime(toJson(v[9]));
|
|
||||||
detail.setUharm12Overtime(toJson(v[10]));
|
|
||||||
detail.setUharm13Overtime(toJson(v[11]));
|
|
||||||
detail.setUharm14Overtime(toJson(v[12]));
|
|
||||||
detail.setUharm15Overtime(toJson(v[13]));
|
|
||||||
detail.setUharm16Overtime(toJson(v[14]));
|
|
||||||
detail.setUharm17Overtime(toJson(v[15]));
|
|
||||||
detail.setUharm18Overtime(toJson(v[16]));
|
|
||||||
detail.setUharm19Overtime(toJson(v[17]));
|
|
||||||
detail.setUharm20Overtime(toJson(v[18]));
|
|
||||||
detail.setUharm21Overtime(toJson(v[19]));
|
|
||||||
detail.setUharm22Overtime(toJson(v[20]));
|
|
||||||
detail.setUharm23Overtime(toJson(v[21]));
|
|
||||||
detail.setUharm24Overtime(toJson(v[22]));
|
|
||||||
detail.setUharm25Overtime(toJson(v[23]));
|
|
||||||
detail.setIharm2Overtime(toJson(i[0]));
|
|
||||||
detail.setIharm3Overtime(toJson(i[1]));
|
|
||||||
detail.setIharm4Overtime(toJson(i[2]));
|
|
||||||
detail.setIharm5Overtime(toJson(i[3]));
|
|
||||||
detail.setIharm6Overtime(toJson(i[4]));
|
|
||||||
detail.setIharm7Overtime(toJson(i[5]));
|
|
||||||
detail.setIharm8Overtime(toJson(i[6]));
|
|
||||||
detail.setIharm9Overtime(toJson(i[7]));
|
|
||||||
detail.setIharm10Overtime(toJson(i[8]));
|
|
||||||
detail.setIharm11Overtime(toJson(i[9]));
|
|
||||||
detail.setIharm12Overtime(toJson(i[10]));
|
|
||||||
detail.setIharm13Overtime(toJson(i[11]));
|
|
||||||
detail.setIharm14Overtime(toJson(i[12]));
|
|
||||||
detail.setIharm15Overtime(toJson(i[13]));
|
|
||||||
detail.setIharm16Overtime(toJson(i[14]));
|
|
||||||
detail.setIharm17Overtime(toJson(i[15]));
|
|
||||||
detail.setIharm18Overtime(toJson(i[16]));
|
|
||||||
detail.setIharm19Overtime(toJson(i[17]));
|
|
||||||
detail.setIharm20Overtime(toJson(i[18]));
|
|
||||||
detail.setIharm21Overtime(toJson(i[19]));
|
|
||||||
detail.setIharm22Overtime(toJson(i[20]));
|
|
||||||
detail.setIharm23Overtime(toJson(i[21]));
|
|
||||||
detail.setIharm24Overtime(toJson(i[22]));
|
|
||||||
detail.setIharm25Overtime(toJson(i[23]));
|
|
||||||
detail.setInuharm1Overtime(toJson(uHarm[0]));
|
|
||||||
detail.setInuharm2Overtime(toJson(uHarm[1]));
|
|
||||||
detail.setInuharm3Overtime(toJson(uHarm[2]));
|
|
||||||
detail.setInuharm4Overtime(toJson(uHarm[3]));
|
|
||||||
detail.setInuharm5Overtime(toJson(uHarm[4]));
|
|
||||||
detail.setInuharm6Overtime(toJson(uHarm[5]));
|
|
||||||
detail.setInuharm7Overtime(toJson(uHarm[6]));
|
|
||||||
detail.setInuharm8Overtime(toJson(uHarm[7]));
|
|
||||||
detail.setInuharm9Overtime(toJson(uHarm[8]));
|
|
||||||
detail.setInuharm10Overtime(toJson(uHarm[9]));
|
|
||||||
detail.setInuharm11Overtime(toJson(uHarm[10]));
|
|
||||||
detail.setInuharm12Overtime(toJson(uHarm[11]));
|
|
||||||
detail.setInuharm13Overtime(toJson(uHarm[12]));
|
|
||||||
detail.setInuharm14Overtime(toJson(uHarm[13]));
|
|
||||||
detail.setInuharm15Overtime(toJson(uHarm[14]));
|
|
||||||
detail.setInuharm16Overtime(toJson(uHarm[15]));
|
|
||||||
dto.setDataLimitRateDetail(detail);
|
|
||||||
}
|
|
||||||
return dto;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private DataLimitRateDto getDataLimitRateDto(DataLimitRateDto limitRate, List<AbnormalData>[] v, List<AbnormalData>[] i, List<AbnormalData>[] uHarm) {
|
|
||||||
limitRate.setUharm2Overtime(v[0].size());
|
|
||||||
limitRate.setUharm3Overtime(v[1].size());
|
|
||||||
limitRate.setUharm4Overtime(v[2].size());
|
|
||||||
limitRate.setUharm5Overtime(v[3].size());
|
|
||||||
limitRate.setUharm6Overtime(v[4].size());
|
|
||||||
limitRate.setUharm7Overtime(v[5].size());
|
|
||||||
limitRate.setUharm8Overtime(v[6].size());
|
|
||||||
limitRate.setUharm9Overtime(v[7].size());
|
|
||||||
limitRate.setUharm10Overtime(v[8].size());
|
|
||||||
limitRate.setUharm11Overtime(v[9].size());
|
|
||||||
limitRate.setUharm12Overtime(v[10].size());
|
|
||||||
limitRate.setUharm13Overtime(v[11].size());
|
|
||||||
limitRate.setUharm14Overtime(v[12].size());
|
|
||||||
limitRate.setUharm15Overtime(v[13].size());
|
|
||||||
limitRate.setUharm16Overtime(v[14].size());
|
|
||||||
limitRate.setUharm17Overtime(v[15].size());
|
|
||||||
limitRate.setUharm18Overtime(v[16].size());
|
|
||||||
limitRate.setUharm19Overtime(v[17].size());
|
|
||||||
limitRate.setUharm20Overtime(v[18].size());
|
|
||||||
limitRate.setUharm21Overtime(v[19].size());
|
|
||||||
limitRate.setUharm22Overtime(v[20].size());
|
|
||||||
limitRate.setUharm23Overtime(v[21].size());
|
|
||||||
limitRate.setUharm24Overtime(v[22].size());
|
|
||||||
limitRate.setUharm25Overtime(v[23].size());
|
|
||||||
limitRate.setIharm2Overtime(i[0].size());
|
|
||||||
limitRate.setIharm3Overtime(i[1].size());
|
|
||||||
limitRate.setIharm4Overtime(i[2].size());
|
|
||||||
limitRate.setIharm5Overtime(i[3].size());
|
|
||||||
limitRate.setIharm6Overtime(i[4].size());
|
|
||||||
limitRate.setIharm7Overtime(i[5].size());
|
|
||||||
limitRate.setIharm8Overtime(i[6].size());
|
|
||||||
limitRate.setIharm9Overtime(i[7].size());
|
|
||||||
limitRate.setIharm10Overtime(i[8].size());
|
|
||||||
limitRate.setIharm11Overtime(i[9].size());
|
|
||||||
limitRate.setIharm12Overtime(i[10].size());
|
|
||||||
limitRate.setIharm13Overtime(i[11].size());
|
|
||||||
limitRate.setIharm14Overtime(i[12].size());
|
|
||||||
limitRate.setIharm15Overtime(i[13].size());
|
|
||||||
limitRate.setIharm16Overtime(i[14].size());
|
|
||||||
limitRate.setIharm17Overtime(i[15].size());
|
|
||||||
limitRate.setIharm18Overtime(i[16].size());
|
|
||||||
limitRate.setIharm19Overtime(i[17].size());
|
|
||||||
limitRate.setIharm20Overtime(i[18].size());
|
|
||||||
limitRate.setIharm21Overtime(i[19].size());
|
|
||||||
limitRate.setIharm22Overtime(i[20].size());
|
|
||||||
limitRate.setIharm23Overtime(i[21].size());
|
|
||||||
limitRate.setIharm24Overtime(i[22].size());
|
|
||||||
limitRate.setIharm25Overtime(i[23].size());
|
|
||||||
limitRate.setInuharm1Overtime(uHarm[0].size());
|
|
||||||
limitRate.setInuharm2Overtime(uHarm[1].size());
|
|
||||||
limitRate.setInuharm3Overtime(uHarm[2].size());
|
|
||||||
limitRate.setInuharm4Overtime(uHarm[3].size());
|
|
||||||
limitRate.setInuharm5Overtime(uHarm[4].size());
|
|
||||||
limitRate.setInuharm6Overtime(uHarm[5].size());
|
|
||||||
limitRate.setInuharm7Overtime(uHarm[6].size());
|
|
||||||
limitRate.setInuharm8Overtime(uHarm[7].size());
|
|
||||||
limitRate.setInuharm9Overtime(uHarm[8].size());
|
|
||||||
limitRate.setInuharm10Overtime(uHarm[9].size());
|
|
||||||
limitRate.setInuharm11Overtime(uHarm[10].size());
|
|
||||||
limitRate.setInuharm12Overtime(uHarm[11].size());
|
|
||||||
limitRate.setInuharm13Overtime(uHarm[12].size());
|
|
||||||
limitRate.setInuharm14Overtime(uHarm[13].size());
|
|
||||||
limitRate.setInuharm15Overtime(uHarm[14].size());
|
|
||||||
limitRate.setInuharm16Overtime(uHarm[15].size());
|
|
||||||
return limitRate;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String toJson(List<AbnormalData> list) {
|
|
||||||
Map<String, List<AbnormalData>> abnormalMap = list.stream().collect(Collectors.groupingBy(x -> x.getPhasic() + "_" + x.getValueType()));
|
|
||||||
List<AbnormalData.Json> info = new ArrayList<>();
|
|
||||||
abnormalMap.forEach((key, value) -> {
|
|
||||||
String[] split = key.split("_");
|
|
||||||
AbnormalData.Json json = new AbnormalData.Json();
|
|
||||||
json.setPhasic(split[0]);
|
|
||||||
json.setValueType(split[1]);
|
|
||||||
json.setTime(String.join(",", value.stream()
|
|
||||||
.map(abnormal -> abnormal.getTime())
|
|
||||||
.collect(Collectors.toList())));
|
|
||||||
json.setValue(String.join(",", value.stream()
|
|
||||||
.map(abnormal -> abnormal.getValue() + "")
|
|
||||||
.collect(Collectors.toList())));
|
|
||||||
json.setOverLimitValue(list.get(0).getOverLimitValue());
|
|
||||||
info.add(json);
|
|
||||||
});
|
|
||||||
if (CollUtil.isNotEmpty(info)) {
|
|
||||||
return JSON.toJSONString(info);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addAbnormalData(List<AbnormalData> list, String phasicType, String valueType, String time, Double value, float overLimitValue) {
|
|
||||||
AbnormalData data = new AbnormalData();
|
|
||||||
data.setTime(time.substring(11, time.length()));
|
|
||||||
data.setPhasic(phasicType);
|
|
||||||
data.setValueType(valueType);
|
|
||||||
data.setValue(value);
|
|
||||||
data.setOverLimitValue(overLimitValue);
|
|
||||||
list.add(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void chanelData(DataLimitRateDto limitRate, DataLimitTargetDto limitTarget) {
|
private void chanelData(DataLimitRateDto limitRate, DataLimitTargetDto limitTarget) {
|
||||||
//有一个指标超标,allTime则为1
|
//有一个指标超标,allTime则为1
|
||||||
int allTime = limitRate.getFreqDevOvertime() + limitRate.getVoltageDevOvertime() + limitRate.getUbalanceOvertime() + limitRate.getUaberranceOvertime() + limitRate.getINegOvertime();
|
int allTime = limitRate.getFreqDevOvertime() + limitRate.getVoltageDevOvertime() + limitRate.getUbalanceOvertime() + limitRate.getUaberranceOvertime() + limitRate.getINegOvertime();
|
||||||
|
|||||||
@@ -0,0 +1,971 @@
|
|||||||
|
package com.njcn.algorithm.serviceimpl.line;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.njcn.algorithm.service.line.IDataLimitRateAsync;
|
||||||
|
import com.njcn.algorithm.utils.MemorySizeUtil;
|
||||||
|
import com.njcn.dataProcess.api.*;
|
||||||
|
import com.njcn.dataProcess.constant.PhaseType;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.*;
|
||||||
|
import com.njcn.dataProcess.util.TimeUtils;
|
||||||
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
|
import com.njcn.influx.constant.InfluxDbSqlConstant;
|
||||||
|
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author wr
|
||||||
|
* @description
|
||||||
|
* @date 2025/12/17 10:56
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(IDataLimitRateAsyncImpl.class);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DataVFeignClient dataVFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataIFeignClient dataIFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataPltFeignClient dataPltFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataInharmVFeignClient dataInharmVFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataHarmRateVFeignClient dataHarmRateVFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataLimitRateFeignClient dataLimitRateFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
||||||
|
/**
|
||||||
|
* 查询配置 辽宁版本比较特殊,没有CP95值,采用平均值进行判断
|
||||||
|
*/
|
||||||
|
@Value("${version.used:master}")
|
||||||
|
private String versionUsed;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Async("asyncExecutor")
|
||||||
|
public CompletableFuture<Void> lineDataRate(String dataDate,
|
||||||
|
List<String> list,
|
||||||
|
List<String> phase,
|
||||||
|
Map<String, Overlimit> overLimitMap,
|
||||||
|
int size,
|
||||||
|
int i,
|
||||||
|
int type) {
|
||||||
|
List<DataLimitDetailDto> result = new ArrayList<>();
|
||||||
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
|
lineParam.setStartTime(TimeUtils.getBeginOfDay(dataDate));
|
||||||
|
lineParam.setEndTime(TimeUtils.getEndOfDay(dataDate));
|
||||||
|
lineParam.setLineId(list);
|
||||||
|
lineParam.setType(type);
|
||||||
|
//获取电压数据
|
||||||
|
List<DataVDto> dataVAllTime = dataVFeignClient.getRawData(lineParam).getData();
|
||||||
|
//闪变数据
|
||||||
|
List<DataPltDto> dataPltAllTime = dataPltFeignClient.getRawData(lineParam).getData();
|
||||||
|
//谐波数据
|
||||||
|
List<DataHarmDto> dataVHarmList = dataHarmRateVFeignClient.getRawData(lineParam).getData();
|
||||||
|
//间谐波数据
|
||||||
|
List<DataHarmDto> dataVInHarmList = dataInharmVFeignClient.getRawData(lineParam).getData();
|
||||||
|
//电流数据
|
||||||
|
List<DataIDto> dataIList = dataIFeignClient.getRawData(lineParam).getData();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_v ->
|
||||||
|
* 总计算次数(用data_v中phasic_type=A,value_type=avg,quality_flag=0来参与统计)
|
||||||
|
*/
|
||||||
|
//在线监测设备会有AB、BC、CA的数据,会导致数据重复计算,这边根据时间去重
|
||||||
|
Map<String, List<DataVDto>> allTime = dataVAllTime.stream()
|
||||||
|
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
DataVDto::getLineId,
|
||||||
|
Collectors.collectingAndThen(
|
||||||
|
Collectors.toCollection(
|
||||||
|
// 使用 TreeSet 根据时间排序并去重
|
||||||
|
() -> new TreeSet<>(
|
||||||
|
Comparator.comparing(DataVDto::getMinTime)
|
||||||
|
)
|
||||||
|
),
|
||||||
|
ArrayList::new
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_plt ->
|
||||||
|
* 闪变总计算次数(用data_plt中phasic_type=A,value_type=avg,quality_flag=0来参与统计)
|
||||||
|
*/
|
||||||
|
//fixme 冀北现场 闪变原始表没有 value_type 这个参数
|
||||||
|
Map<String, List<DataPltDto>> pltAllTime;
|
||||||
|
if (type == 2) {
|
||||||
|
pltAllTime = dataPltAllTime.stream()
|
||||||
|
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDbSqlConstant.AVG_WEB.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
||||||
|
} else {
|
||||||
|
pltAllTime = dataPltAllTime.stream()
|
||||||
|
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
||||||
|
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*功能描述:获取influxDB -> data_harmrate_v ->
|
||||||
|
* 2-25次谐波电压含有率 -> A相||B相||C相的日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataHarmDto>> harmRateV;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
harmRateV = dataVHarmList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
||||||
|
} else {
|
||||||
|
harmRateV = dataVHarmList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_i -> 2-25次谐波电流 -> 日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataIDto>> dataI;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
dataI = dataIList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
||||||
|
} else {
|
||||||
|
dataI = dataIList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_inharm_v -> 0.5-15.5次间谐波电压含有率 -> 日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataHarmDto>> inHarmV;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
inHarmV = dataVInHarmList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
||||||
|
} else {
|
||||||
|
inHarmV = dataVInHarmList.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_v -> 电压总谐波畸变率 -> 日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataVDto>> dataVThd;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
dataVThd = dataVAllTime.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
} else {
|
||||||
|
dataVThd = dataVAllTime.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_v -> 负序电压不平衡度 -> 最大值 && 日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataVDto>> dataVUnbalance;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
dataVUnbalance = dataVAllTime.stream()
|
||||||
|
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()) ||
|
||||||
|
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
// .peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
} else {
|
||||||
|
dataVUnbalance = dataVAllTime.stream()
|
||||||
|
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()) ||
|
||||||
|
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_i -> 负序电流 -> 最大值 && 日95%概率值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataIDto>> dataINeg;
|
||||||
|
if (Objects.equals(versionUsed, "liaoning")) {
|
||||||
|
dataINeg = dataIList.stream()
|
||||||
|
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()) ||
|
||||||
|
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
|
||||||
|
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
||||||
|
} else {
|
||||||
|
dataINeg = dataIList.stream()
|
||||||
|
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()) ||
|
||||||
|
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataIDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_v -> 频率偏差 -> 最大值 && 最小值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataVDto>> dataVFreq = dataVAllTime.stream()
|
||||||
|
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.MIN.equalsIgnoreCase(x.getValueType()) ||
|
||||||
|
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_v -> 电压偏差 -> 最大值
|
||||||
|
*/
|
||||||
|
Map<String, List<DataVDto>> dataVDev = dataVAllTime.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述:获取influxDB -> data_plt -> 长时间闪变 -> 注(取最大值原始算法去掉了,现没有根据最大值比较)
|
||||||
|
*/
|
||||||
|
Map<String, List<DataPltDto>> dataPlt;
|
||||||
|
if (type == 2) {
|
||||||
|
dataPlt = dataPltAllTime.stream()
|
||||||
|
.filter(x -> phase.contains(x.getPhasicType()))
|
||||||
|
.filter(x -> InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
|
||||||
|
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
||||||
|
} else {
|
||||||
|
dataPlt = dataPltAllTime.stream()
|
||||||
|
.filter(x -> PhaseType.PHASE_A.equals(x.getPhasicType()))
|
||||||
|
.collect(Collectors.groupingBy(DataPltDto::getLineId));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (String item : list) {
|
||||||
|
if (ObjectUtil.isNotNull(overLimitMap.get(item))) {
|
||||||
|
result.addAll(getData(dataDate,
|
||||||
|
overLimitMap.get(item),
|
||||||
|
allTime.get(item),
|
||||||
|
pltAllTime.get(item),
|
||||||
|
harmRateV.get(item),
|
||||||
|
dataI.get(item),
|
||||||
|
inHarmV.get(item),
|
||||||
|
dataVThd.get(item),
|
||||||
|
dataVUnbalance.get(item),
|
||||||
|
dataINeg.get(item),
|
||||||
|
dataVFreq.get(item),
|
||||||
|
dataVDev.get(item),
|
||||||
|
dataPlt.get(item)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(result)) {
|
||||||
|
//存储数据
|
||||||
|
List<DataLimitRateDto> dataLimitRate = result.stream().map(DataLimitDetailDto::getDataLimitRate).filter(ObjectUtil::isNotNull).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(dataLimitRate)) {
|
||||||
|
dataLimitRateFeignClient.batchInsertion(dataLimitRate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(result)) {
|
||||||
|
//存储数据
|
||||||
|
List<DataLimitRateDetailDto> detail = result.stream().map(DataLimitDetailDto::getDataLimitRateDetail).filter(x -> ObjectUtil.isNotNull(x)).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(detail)) {
|
||||||
|
dataLimitRateDetailFeignClient.batchInsertion(detail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info(dataDate + " 总分区数据:" + size + "=====》当前第" + i + "小分区已完成!");
|
||||||
|
result = null;
|
||||||
|
if(i==size){
|
||||||
|
MemorySizeUtil.getNowMemory();
|
||||||
|
}
|
||||||
|
System.gc();
|
||||||
|
|
||||||
|
return CompletableFuture.completedFuture(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: getData
|
||||||
|
* @Param: [overlimit, allTimeList, flickerAllTimeList, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVPOUnbalanceList, dataIPONegList, dataVPOFreqList, dataVPODevList, dataPltPOList]
|
||||||
|
* @return: java.util.List<com.njcn.harmonic.pojo.po.LimitRate>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/10/18
|
||||||
|
*/
|
||||||
|
private List<DataLimitDetailDto> getData(String dataDate,
|
||||||
|
Overlimit overlimit,
|
||||||
|
List<DataVDto> allTimeList,
|
||||||
|
List<DataPltDto> flickerAllTimeList,
|
||||||
|
List<DataHarmDto> dataHarmRateVPOList,
|
||||||
|
List<DataIDto> dataIPOList,
|
||||||
|
List<DataHarmDto> dataInHarmVPOList,
|
||||||
|
List<DataVDto> dataVPOList,
|
||||||
|
List<DataVDto> dataVPOUnbalanceList,
|
||||||
|
List<DataIDto> dataIPONegList,
|
||||||
|
List<DataVDto> dataVPOFreqList,
|
||||||
|
List<DataVDto> dataVPODevList,
|
||||||
|
List<DataPltDto> dataPltPOList) {
|
||||||
|
List<DataLimitDetailDto> result = new ArrayList<>();
|
||||||
|
|
||||||
|
Map<String, List<DataHarmDto>> harmRateVByPhaseType = new HashMap<>();
|
||||||
|
Map<String, List<DataIDto>> dataIByPhaseType = new HashMap<>();
|
||||||
|
Map<String, List<DataHarmDto>> dataInHarmVPhaseType = new HashMap<>();
|
||||||
|
Map<String, List<DataVDto>> dataVPhaseType = new HashMap<>();
|
||||||
|
Map<String, List<DataVDto>> dataVDevPhaseType = new HashMap<>();
|
||||||
|
Map<String, List<DataPltDto>> dataPltPhaseType = new HashMap<>();
|
||||||
|
|
||||||
|
|
||||||
|
Integer allTime = 0;
|
||||||
|
Integer flickerAllTime = 0;
|
||||||
|
if (!CollectionUtils.isEmpty(allTimeList)) {
|
||||||
|
allTime = allTimeList.size();
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(flickerAllTimeList)) {
|
||||||
|
flickerAllTime = flickerAllTimeList.size();
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
||||||
|
harmRateVByPhaseType = dataHarmRateVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
||||||
|
dataIByPhaseType = dataIPOList.stream().collect(Collectors.groupingBy(DataIDto::getPhasicType));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
||||||
|
dataInHarmVPhaseType = dataInHarmVPOList.stream().collect(Collectors.groupingBy(DataHarmDto::getPhasicType));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
||||||
|
dataVPhaseType = dataVPOList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
||||||
|
dataVDevPhaseType = dataVPODevList.stream().collect(Collectors.groupingBy(DataVDto::getPhasicType));
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
||||||
|
dataPltPhaseType = dataPltPOList.stream().collect(Collectors.groupingBy(DataPltDto::getPhasicType));
|
||||||
|
}
|
||||||
|
DataLimitDetailDto a = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_A, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_A), dataIByPhaseType.get(PhaseType.PHASE_A), dataInHarmVPhaseType.get(PhaseType.PHASE_A), dataVPhaseType.get(PhaseType.PHASE_A), dataVDevPhaseType.get(PhaseType.PHASE_A), dataPltPhaseType.get(PhaseType.PHASE_A));
|
||||||
|
DataLimitDetailDto b = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_B, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_B), dataIByPhaseType.get(PhaseType.PHASE_B), dataInHarmVPhaseType.get(PhaseType.PHASE_B), dataVPhaseType.get(PhaseType.PHASE_B), dataVDevPhaseType.get(PhaseType.PHASE_B), dataPltPhaseType.get(PhaseType.PHASE_B));
|
||||||
|
DataLimitDetailDto c = limitRateData(dataDate, overlimit, allTime, flickerAllTime, PhaseType.PHASE_C, overlimit.getId(), harmRateVByPhaseType.get(PhaseType.PHASE_C), dataIByPhaseType.get(PhaseType.PHASE_C), dataInHarmVPhaseType.get(PhaseType.PHASE_C), dataVPhaseType.get(PhaseType.PHASE_C), dataVDevPhaseType.get(PhaseType.PHASE_C), dataPltPhaseType.get(PhaseType.PHASE_C));
|
||||||
|
DataLimitDetailDto t = limitRateDataT(dataDate, overlimit, allTime, flickerAllTime, overlimit.getId(), dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVPOUnbalanceList, dataIPONegList, dataVPOFreqList, dataVPODevList, dataPltPOList);
|
||||||
|
result.add(a);
|
||||||
|
result.add(b);
|
||||||
|
result.add(c);
|
||||||
|
result.add(t);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: limitRateData
|
||||||
|
* @Param: [overlimit, allTime, flickerAllTime, phasicType, lineId, dataHarmRateVPOList, dataIPOList, dataInHarmVPOList, dataVPOList, dataVUnbalanceList, dataINegList]
|
||||||
|
* @return: com.njcn.harmonic.pojo.po.LimitRate
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2022/10/18
|
||||||
|
*/
|
||||||
|
public DataLimitDetailDto limitRateData(String dataDate,
|
||||||
|
Overlimit overlimit,
|
||||||
|
Integer allTime,
|
||||||
|
Integer flickerAllTime,
|
||||||
|
String phasicType, String lineId,
|
||||||
|
List<DataHarmDto> dataHarmRateVPOList,
|
||||||
|
List<DataIDto> dataIPOList,
|
||||||
|
List<DataHarmDto> dataInHarmVPOList,
|
||||||
|
List<DataVDto> dataVPOList,
|
||||||
|
List<DataVDto> dataVPODevList,
|
||||||
|
List<DataPltDto> dataPltPOList) {
|
||||||
|
List<AbnormalData> thd = new ArrayList<>(), uDev = new ArrayList<>(), flicker = new ArrayList<>(), freqDev = new ArrayList<>(), uAberrance = new ArrayList<>(), iNeg = new ArrayList<>();
|
||||||
|
DataLimitDetailDto dto = new DataLimitDetailDto();
|
||||||
|
DataLimitRateDto limitRate = new DataLimitRateDto();
|
||||||
|
// 初始化 v 系列列表
|
||||||
|
List<AbnormalData>[] v = new List[24];
|
||||||
|
for (int i = 0; i < 24; i++) {
|
||||||
|
v[i] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
||||||
|
for (DataHarmDto item : dataHarmRateVPOList) {
|
||||||
|
for (int i = 2; i < 26; i++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getVx 方法
|
||||||
|
Method getVMethod = DataHarmDto.class.getMethod("getV" + i);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getUharm" + i);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化 i 系列列表
|
||||||
|
List<AbnormalData>[] i = new List[24];
|
||||||
|
for (int j = 0; j < 24; j++) {
|
||||||
|
i[j] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
||||||
|
for (DataIDto item : dataIPOList) {
|
||||||
|
for (int j = 2; j < 26; j++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getIx 方法
|
||||||
|
Method getVMethod = DataIDto.class.getMethod("getI" + j);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getIharm" + j);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(i[j - 2], item.getValueType(), item.getPhasicType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 初始化 uHarm 系列列表
|
||||||
|
List<AbnormalData>[] uHarm = new List[16];
|
||||||
|
for (int j = 0; j < 16; j++) {
|
||||||
|
uHarm[j] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
||||||
|
for (DataHarmDto item : dataInHarmVPOList) {
|
||||||
|
for (int j = 1; j < 17; j++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getVx 方法
|
||||||
|
Method getVMethod = DataHarmDto.class.getMethod("getV" + j);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getInuharm" + j);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(uHarm[j - 1], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//电压总谐波畸变率
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
||||||
|
for (DataVDto item : dataVPOList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getVThd())) {
|
||||||
|
if (item.getVThd() > overlimit.getUaberrance()) {
|
||||||
|
addAbnormalData(thd, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVThd(), overlimit.getUaberrance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限)
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
||||||
|
for (DataVDto item : dataVPODevList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getVlDev())) {
|
||||||
|
if (item.getVlDev() >= 0) {
|
||||||
|
if (item.getVlDev() > overlimit.getVoltageDev()) {
|
||||||
|
addAbnormalData(uDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVlDev(), overlimit.getVoltageDev());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Math.abs(item.getVuDev()) > Math.abs(overlimit.getUvoltageDev())) {
|
||||||
|
addAbnormalData(uDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVuDev(), overlimit.getUvoltageDev());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//长时间闪变
|
||||||
|
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
||||||
|
for (DataPltDto item : dataPltPOList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getPlt())) {
|
||||||
|
if (item.getPlt() > overlimit.getFlicker()) {
|
||||||
|
addAbnormalData(flicker, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getPlt(), overlimit.getFlicker());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
limitRate.setLineId(lineId);
|
||||||
|
limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
||||||
|
limitRate.setPhasicType(phasicType);
|
||||||
|
limitRate.setAllTime(allTime);
|
||||||
|
limitRate.setFlickerAllTime(flickerAllTime);
|
||||||
|
|
||||||
|
limitRate.setFlickerOvertime(flicker.size());
|
||||||
|
limitRate.setUaberranceOvertime(thd.size());
|
||||||
|
limitRate.setINegOvertime(iNeg.size());
|
||||||
|
limitRate.setFreqDevOvertime(freqDev.size());
|
||||||
|
limitRate.setUbalanceOvertime(uAberrance.size());
|
||||||
|
limitRate.setVoltageDevOvertime(uDev.size());
|
||||||
|
dto.setDataLimitRate(getDataLimitRateDto(limitRate, v, i, uHarm));
|
||||||
|
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public DataLimitDetailDto limitRateDataT(
|
||||||
|
String dataDate,
|
||||||
|
Overlimit overlimit,
|
||||||
|
Integer allTime,
|
||||||
|
Integer flickerAllTime,
|
||||||
|
String lineId,
|
||||||
|
List<DataHarmDto> dataHarmRateVPOList,
|
||||||
|
List<DataIDto> dataIPOList,
|
||||||
|
List<DataHarmDto> dataInHarmVPOList,
|
||||||
|
List<DataVDto> dataVPOList,
|
||||||
|
List<DataVDto> dataVPOUnbalanceList,
|
||||||
|
List<DataIDto> dataIPONegList,
|
||||||
|
List<DataVDto> dataVPOFreqList,
|
||||||
|
List<DataVDto> dataVPODevList,
|
||||||
|
List<DataPltDto> dataPltPOList) {
|
||||||
|
DataLimitDetailDto dto = new DataLimitDetailDto();
|
||||||
|
DataLimitRateDto limitRate = new DataLimitRateDto();
|
||||||
|
//thd 总谐波畸变率
|
||||||
|
List<AbnormalData> sx = new ArrayList<>(), uDev = new ArrayList<>(), flicker = new ArrayList<>(), freqDev = new ArrayList<>(), zxb = new ArrayList<>(), iNeg = new ArrayList<>();
|
||||||
|
// 初始化 v 系列列表
|
||||||
|
List<AbnormalData>[] v = new List[24];
|
||||||
|
for (int i = 0; i < 24; i++) {
|
||||||
|
v[i] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataHarmRateVPOList)) {
|
||||||
|
for (DataHarmDto item : dataHarmRateVPOList) {
|
||||||
|
for (int i = 2; i < 26; i++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getVx 方法
|
||||||
|
Method getVMethod = DataHarmDto.class.getMethod("getV" + i);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getUharm" + i);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(v[i - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化 i 系列列表
|
||||||
|
List<AbnormalData>[] i = new List[24];
|
||||||
|
for (int j = 0; j < 24; j++) {
|
||||||
|
i[j] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataIPOList)) {
|
||||||
|
for (DataIDto item : dataIPOList) {
|
||||||
|
for (int j = 2; j < 26; j++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getIx 方法
|
||||||
|
Method getVMethod = DataIDto.class.getMethod("getI" + j);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getIharm" + j);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(i[j - 2], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 初始化 uHarm 系列列表
|
||||||
|
List<AbnormalData>[] uHarm = new List[16];
|
||||||
|
for (int j = 0; j < 16; j++) {
|
||||||
|
uHarm[j] = new ArrayList<>();
|
||||||
|
}
|
||||||
|
// 处理数据
|
||||||
|
if (!CollectionUtils.isEmpty(dataInHarmVPOList)) {
|
||||||
|
for (DataHarmDto item : dataInHarmVPOList) {
|
||||||
|
for (int j = 1; j < 17; j++) {
|
||||||
|
try {
|
||||||
|
// 获取 DataHarmDto 类的 getVx 方法
|
||||||
|
Method getVMethod = DataHarmDto.class.getMethod("getV" + j);
|
||||||
|
Double value = (Double) getVMethod.invoke(item);
|
||||||
|
// 获取 Overlimit 类的 getUharmx 方法
|
||||||
|
Method getUharmMethod = Overlimit.class.getMethod("getInuharm" + j);
|
||||||
|
float limit = (float) getUharmMethod.invoke(overlimit);
|
||||||
|
if (ObjectUtil.isNotNull(value)) {
|
||||||
|
if (value > limit) {
|
||||||
|
addAbnormalData(uHarm[j - 1], item.getPhasicType(), item.getValueType(), item.getMinTime(), value, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//电压总谐波畸变率
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPOList)) {
|
||||||
|
for (DataVDto item : dataVPOList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getVThd())) {
|
||||||
|
if (item.getVThd() > overlimit.getUaberrance()) {
|
||||||
|
addAbnormalData(zxb, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVThd(), overlimit.getUaberrance());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 三相电压不平衡度
|
||||||
|
// 短时(对应测量值日统计的最大值)4%
|
||||||
|
// 一般(对应测量值日统计的95%概率大值)2%
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPOUnbalanceList)) {
|
||||||
|
for (DataVDto item : dataVPOUnbalanceList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getVUnbalance())) {
|
||||||
|
if (InfluxDBTableConstant.MAX.equalsIgnoreCase(item.getValueType())) {
|
||||||
|
if (item.getVUnbalance() > 4.0) {
|
||||||
|
addAbnormalData(sx, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getVUnbalance(), 4.0f);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.getVUnbalance() > 2.0) {
|
||||||
|
addAbnormalData(sx, item.getPhasicType(), "CP95", item.getMinTime(), item.getVUnbalance(), 2.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//负序电流
|
||||||
|
if (!CollectionUtils.isEmpty(dataIPONegList)) {
|
||||||
|
for (DataIDto item : dataIPONegList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getINeg())) {
|
||||||
|
if (item.getINeg() > overlimit.getINeg()) {
|
||||||
|
addAbnormalData(iNeg, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getINeg(), overlimit.getINeg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//频率偏差
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPOFreqList)) {
|
||||||
|
for (DataVDto item : dataVPOFreqList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getFreqDev())) {
|
||||||
|
if (item.getFreqDev() > overlimit.getFreqDev()) {
|
||||||
|
addAbnormalData(freqDev, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getFreqDev(), overlimit.getFreqDev());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//电压上偏差、电压下偏差(根据vl_dev的正负判断是用哪个值判断越限)
|
||||||
|
if (!CollectionUtils.isEmpty(dataVPODevList)) {
|
||||||
|
for (DataVDto item : dataVPODevList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getVlDev())) {
|
||||||
|
if (item.getVlDev() >= 0) {
|
||||||
|
if (item.getVlDev() > overlimit.getVoltageDev()) {
|
||||||
|
addAbnormalData(uDev, item.getPhasicType(), item.getMinTime(), item.getValueType(), item.getVlDev(), overlimit.getVoltageDev());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Math.abs(item.getVuDev()) > Math.abs(overlimit.getUvoltageDev())) {
|
||||||
|
addAbnormalData(uDev, item.getPhasicType(), item.getMinTime(), item.getValueType(), item.getVuDev(), overlimit.getUvoltageDev());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//长时间闪变
|
||||||
|
if (!CollectionUtils.isEmpty(dataPltPOList)) {
|
||||||
|
for (DataPltDto item : dataPltPOList) {
|
||||||
|
if (ObjectUtil.isNotNull(item.getPlt())) {
|
||||||
|
if (item.getPlt() > overlimit.getFlicker()) {
|
||||||
|
addAbnormalData(flicker, item.getPhasicType(), item.getValueType(), item.getMinTime(), item.getPlt(), overlimit.getFlicker());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
limitRate.setLineId(lineId);
|
||||||
|
limitRate.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
||||||
|
limitRate.setPhasicType(PhaseType.PHASE_T);
|
||||||
|
limitRate.setAllTime(allTime);
|
||||||
|
limitRate.setFlickerAllTime(flickerAllTime);
|
||||||
|
limitRate.setUaberranceOvertime(zxb.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setINegOvertime(iNeg.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setFreqDevOvertime(freqDev.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUbalanceOvertime(sx.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setVoltageDevOvertime(uDev.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setFlickerOvertime(flicker.stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm2Overtime(v[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm3Overtime(v[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm4Overtime(v[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm5Overtime(v[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm6Overtime(v[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm7Overtime(v[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm8Overtime(v[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm9Overtime(v[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm10Overtime(v[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm11Overtime(v[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm12Overtime(v[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm13Overtime(v[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm14Overtime(v[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm15Overtime(v[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm16Overtime(v[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm17Overtime(v[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm18Overtime(v[16].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm19Overtime(v[17].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm20Overtime(v[18].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm21Overtime(v[19].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm22Overtime(v[20].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm23Overtime(v[21].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm24Overtime(v[22].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setUharm25Overtime(v[23].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm2Overtime(i[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm3Overtime(i[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm4Overtime(i[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm5Overtime(i[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm6Overtime(i[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm7Overtime(i[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm8Overtime(i[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm9Overtime(i[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm10Overtime(i[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm11Overtime(i[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm12Overtime(i[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm13Overtime(i[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm14Overtime(i[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm15Overtime(i[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm16Overtime(i[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm17Overtime(i[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm18Overtime(i[16].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm19Overtime(i[17].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm20Overtime(i[18].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm21Overtime(i[19].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm22Overtime(i[20].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm23Overtime(i[21].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm24Overtime(i[22].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setIharm25Overtime(i[23].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm1Overtime(uHarm[0].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm2Overtime(uHarm[1].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm3Overtime(uHarm[2].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm4Overtime(uHarm[3].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm5Overtime(uHarm[4].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm6Overtime(uHarm[5].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm7Overtime(uHarm[6].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm8Overtime(uHarm[7].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm9Overtime(uHarm[8].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm10Overtime(uHarm[9].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm11Overtime(uHarm[10].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm12Overtime(uHarm[11].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm13Overtime(uHarm[12].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm14Overtime(uHarm[13].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm15Overtime(uHarm[14].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
limitRate.setInuharm16Overtime(uHarm[15].stream().map(AbnormalData::getTime).distinct().collect(Collectors.toList()).size());
|
||||||
|
dto.setDataLimitRate(limitRate);
|
||||||
|
|
||||||
|
int detailAllTime = flicker.size() + sx.size() + iNeg.size() + freqDev.size() + zxb.size() + uDev.size() +
|
||||||
|
v[0].size() + v[1].size() + v[2].size() + v[3].size() + v[4].size() + v[5].size() + v[6].size() + v[7].size() + v[8].size() + v[9].size() + v[11].size() + v[12].size() + v[13].size() + v[14].size() + v[15].size() + v[16].size() + v[17].size() + v[18].size() + v[19].size() + v[20].size() + v[21].size() + v[22].size() + v[23].size() +
|
||||||
|
i[0].size() + i[1].size() + i[2].size() + i[3].size() + i[4].size() + i[5].size() + i[6].size() + i[7].size() + i[8].size() + i[9].size() + i[10].size() + i[11].size() + i[12].size() + i[13].size() + i[14].size() + i[15].size() + i[16].size() + i[17].size() + i[18].size() + i[19].size() + i[20].size() + i[21].size() + i[22].size() + i[23].size() +
|
||||||
|
uHarm[0].size() + uHarm[1].size() + uHarm[2].size() + uHarm[3].size() + uHarm[4].size() + uHarm[5].size() + uHarm[6].size() + uHarm[7].size() + uHarm[8].size() + uHarm[9].size() + uHarm[10].size() + uHarm[11].size() + uHarm[12].size() + uHarm[13].size() + uHarm[14].size() + uHarm[15].size();
|
||||||
|
if (detailAllTime > 0) {
|
||||||
|
DataLimitRateDetailDto detail = new DataLimitRateDetailDto();
|
||||||
|
detail.setLineId(lineId);
|
||||||
|
detail.setTime(LocalDateTimeUtil.parseDate(dataDate, DatePattern.NORM_DATE_PATTERN));
|
||||||
|
detail.setFlickerOvertime(toJson(flicker));
|
||||||
|
detail.setUaberranceOvertime(toJson(zxb));
|
||||||
|
detail.setINegOvertime(toJson(iNeg));
|
||||||
|
detail.setFreqDevOvertime(toJson(freqDev));
|
||||||
|
detail.setUbalanceOvertime(toJson(sx));
|
||||||
|
detail.setVoltageDevOvertime(toJson(uDev));
|
||||||
|
detail.setUharm2Overtime(toJson(v[0]));
|
||||||
|
detail.setUharm3Overtime(toJson(v[1]));
|
||||||
|
detail.setUharm4Overtime(toJson(v[2]));
|
||||||
|
detail.setUharm5Overtime(toJson(v[3]));
|
||||||
|
detail.setUharm6Overtime(toJson(v[4]));
|
||||||
|
detail.setUharm7Overtime(toJson(v[5]));
|
||||||
|
detail.setUharm8Overtime(toJson(v[6]));
|
||||||
|
detail.setUharm9Overtime(toJson(v[7]));
|
||||||
|
detail.setUharm10Overtime(toJson(v[8]));
|
||||||
|
detail.setUharm11Overtime(toJson(v[9]));
|
||||||
|
detail.setUharm12Overtime(toJson(v[10]));
|
||||||
|
detail.setUharm13Overtime(toJson(v[11]));
|
||||||
|
detail.setUharm14Overtime(toJson(v[12]));
|
||||||
|
detail.setUharm15Overtime(toJson(v[13]));
|
||||||
|
detail.setUharm16Overtime(toJson(v[14]));
|
||||||
|
detail.setUharm17Overtime(toJson(v[15]));
|
||||||
|
detail.setUharm18Overtime(toJson(v[16]));
|
||||||
|
detail.setUharm19Overtime(toJson(v[17]));
|
||||||
|
detail.setUharm20Overtime(toJson(v[18]));
|
||||||
|
detail.setUharm21Overtime(toJson(v[19]));
|
||||||
|
detail.setUharm22Overtime(toJson(v[20]));
|
||||||
|
detail.setUharm23Overtime(toJson(v[21]));
|
||||||
|
detail.setUharm24Overtime(toJson(v[22]));
|
||||||
|
detail.setUharm25Overtime(toJson(v[23]));
|
||||||
|
detail.setIharm2Overtime(toJson(i[0]));
|
||||||
|
detail.setIharm3Overtime(toJson(i[1]));
|
||||||
|
detail.setIharm4Overtime(toJson(i[2]));
|
||||||
|
detail.setIharm5Overtime(toJson(i[3]));
|
||||||
|
detail.setIharm6Overtime(toJson(i[4]));
|
||||||
|
detail.setIharm7Overtime(toJson(i[5]));
|
||||||
|
detail.setIharm8Overtime(toJson(i[6]));
|
||||||
|
detail.setIharm9Overtime(toJson(i[7]));
|
||||||
|
detail.setIharm10Overtime(toJson(i[8]));
|
||||||
|
detail.setIharm11Overtime(toJson(i[9]));
|
||||||
|
detail.setIharm12Overtime(toJson(i[10]));
|
||||||
|
detail.setIharm13Overtime(toJson(i[11]));
|
||||||
|
detail.setIharm14Overtime(toJson(i[12]));
|
||||||
|
detail.setIharm15Overtime(toJson(i[13]));
|
||||||
|
detail.setIharm16Overtime(toJson(i[14]));
|
||||||
|
detail.setIharm17Overtime(toJson(i[15]));
|
||||||
|
detail.setIharm18Overtime(toJson(i[16]));
|
||||||
|
detail.setIharm19Overtime(toJson(i[17]));
|
||||||
|
detail.setIharm20Overtime(toJson(i[18]));
|
||||||
|
detail.setIharm21Overtime(toJson(i[19]));
|
||||||
|
detail.setIharm22Overtime(toJson(i[20]));
|
||||||
|
detail.setIharm23Overtime(toJson(i[21]));
|
||||||
|
detail.setIharm24Overtime(toJson(i[22]));
|
||||||
|
detail.setIharm25Overtime(toJson(i[23]));
|
||||||
|
detail.setInuharm1Overtime(toJson(uHarm[0]));
|
||||||
|
detail.setInuharm2Overtime(toJson(uHarm[1]));
|
||||||
|
detail.setInuharm3Overtime(toJson(uHarm[2]));
|
||||||
|
detail.setInuharm4Overtime(toJson(uHarm[3]));
|
||||||
|
detail.setInuharm5Overtime(toJson(uHarm[4]));
|
||||||
|
detail.setInuharm6Overtime(toJson(uHarm[5]));
|
||||||
|
detail.setInuharm7Overtime(toJson(uHarm[6]));
|
||||||
|
detail.setInuharm8Overtime(toJson(uHarm[7]));
|
||||||
|
detail.setInuharm9Overtime(toJson(uHarm[8]));
|
||||||
|
detail.setInuharm10Overtime(toJson(uHarm[9]));
|
||||||
|
detail.setInuharm11Overtime(toJson(uHarm[10]));
|
||||||
|
detail.setInuharm12Overtime(toJson(uHarm[11]));
|
||||||
|
detail.setInuharm13Overtime(toJson(uHarm[12]));
|
||||||
|
detail.setInuharm14Overtime(toJson(uHarm[13]));
|
||||||
|
detail.setInuharm15Overtime(toJson(uHarm[14]));
|
||||||
|
detail.setInuharm16Overtime(toJson(uHarm[15]));
|
||||||
|
dto.setDataLimitRateDetail(detail);
|
||||||
|
}
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private DataLimitRateDto getDataLimitRateDto(DataLimitRateDto limitRate, List<AbnormalData>[] v, List<AbnormalData>[] i, List<AbnormalData>[] uHarm) {
|
||||||
|
limitRate.setUharm2Overtime(v[0].size());
|
||||||
|
limitRate.setUharm3Overtime(v[1].size());
|
||||||
|
limitRate.setUharm4Overtime(v[2].size());
|
||||||
|
limitRate.setUharm5Overtime(v[3].size());
|
||||||
|
limitRate.setUharm6Overtime(v[4].size());
|
||||||
|
limitRate.setUharm7Overtime(v[5].size());
|
||||||
|
limitRate.setUharm8Overtime(v[6].size());
|
||||||
|
limitRate.setUharm9Overtime(v[7].size());
|
||||||
|
limitRate.setUharm10Overtime(v[8].size());
|
||||||
|
limitRate.setUharm11Overtime(v[9].size());
|
||||||
|
limitRate.setUharm12Overtime(v[10].size());
|
||||||
|
limitRate.setUharm13Overtime(v[11].size());
|
||||||
|
limitRate.setUharm14Overtime(v[12].size());
|
||||||
|
limitRate.setUharm15Overtime(v[13].size());
|
||||||
|
limitRate.setUharm16Overtime(v[14].size());
|
||||||
|
limitRate.setUharm17Overtime(v[15].size());
|
||||||
|
limitRate.setUharm18Overtime(v[16].size());
|
||||||
|
limitRate.setUharm19Overtime(v[17].size());
|
||||||
|
limitRate.setUharm20Overtime(v[18].size());
|
||||||
|
limitRate.setUharm21Overtime(v[19].size());
|
||||||
|
limitRate.setUharm22Overtime(v[20].size());
|
||||||
|
limitRate.setUharm23Overtime(v[21].size());
|
||||||
|
limitRate.setUharm24Overtime(v[22].size());
|
||||||
|
limitRate.setUharm25Overtime(v[23].size());
|
||||||
|
limitRate.setIharm2Overtime(i[0].size());
|
||||||
|
limitRate.setIharm3Overtime(i[1].size());
|
||||||
|
limitRate.setIharm4Overtime(i[2].size());
|
||||||
|
limitRate.setIharm5Overtime(i[3].size());
|
||||||
|
limitRate.setIharm6Overtime(i[4].size());
|
||||||
|
limitRate.setIharm7Overtime(i[5].size());
|
||||||
|
limitRate.setIharm8Overtime(i[6].size());
|
||||||
|
limitRate.setIharm9Overtime(i[7].size());
|
||||||
|
limitRate.setIharm10Overtime(i[8].size());
|
||||||
|
limitRate.setIharm11Overtime(i[9].size());
|
||||||
|
limitRate.setIharm12Overtime(i[10].size());
|
||||||
|
limitRate.setIharm13Overtime(i[11].size());
|
||||||
|
limitRate.setIharm14Overtime(i[12].size());
|
||||||
|
limitRate.setIharm15Overtime(i[13].size());
|
||||||
|
limitRate.setIharm16Overtime(i[14].size());
|
||||||
|
limitRate.setIharm17Overtime(i[15].size());
|
||||||
|
limitRate.setIharm18Overtime(i[16].size());
|
||||||
|
limitRate.setIharm19Overtime(i[17].size());
|
||||||
|
limitRate.setIharm20Overtime(i[18].size());
|
||||||
|
limitRate.setIharm21Overtime(i[19].size());
|
||||||
|
limitRate.setIharm22Overtime(i[20].size());
|
||||||
|
limitRate.setIharm23Overtime(i[21].size());
|
||||||
|
limitRate.setIharm24Overtime(i[22].size());
|
||||||
|
limitRate.setIharm25Overtime(i[23].size());
|
||||||
|
limitRate.setInuharm1Overtime(uHarm[0].size());
|
||||||
|
limitRate.setInuharm2Overtime(uHarm[1].size());
|
||||||
|
limitRate.setInuharm3Overtime(uHarm[2].size());
|
||||||
|
limitRate.setInuharm4Overtime(uHarm[3].size());
|
||||||
|
limitRate.setInuharm5Overtime(uHarm[4].size());
|
||||||
|
limitRate.setInuharm6Overtime(uHarm[5].size());
|
||||||
|
limitRate.setInuharm7Overtime(uHarm[6].size());
|
||||||
|
limitRate.setInuharm8Overtime(uHarm[7].size());
|
||||||
|
limitRate.setInuharm9Overtime(uHarm[8].size());
|
||||||
|
limitRate.setInuharm10Overtime(uHarm[9].size());
|
||||||
|
limitRate.setInuharm11Overtime(uHarm[10].size());
|
||||||
|
limitRate.setInuharm12Overtime(uHarm[11].size());
|
||||||
|
limitRate.setInuharm13Overtime(uHarm[12].size());
|
||||||
|
limitRate.setInuharm14Overtime(uHarm[13].size());
|
||||||
|
limitRate.setInuharm15Overtime(uHarm[14].size());
|
||||||
|
limitRate.setInuharm16Overtime(uHarm[15].size());
|
||||||
|
return limitRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String toJson(List<AbnormalData> list) {
|
||||||
|
Map<String, List<AbnormalData>> abnormalMap = list.stream().collect(Collectors.groupingBy(x -> x.getPhasic() + "_" + x.getValueType()));
|
||||||
|
List<AbnormalData.Json> info = new ArrayList<>();
|
||||||
|
abnormalMap.forEach((key, value) -> {
|
||||||
|
String[] split = key.split("_");
|
||||||
|
AbnormalData.Json json = new AbnormalData.Json();
|
||||||
|
json.setPhasic(split[0]);
|
||||||
|
json.setValueType(split[1]);
|
||||||
|
json.setTime(String.join(",", value.stream()
|
||||||
|
.map(abnormal -> abnormal.getTime())
|
||||||
|
.collect(Collectors.toList())));
|
||||||
|
json.setValue(String.join(",", value.stream()
|
||||||
|
.map(abnormal -> abnormal.getValue() + "")
|
||||||
|
.collect(Collectors.toList())));
|
||||||
|
json.setOverLimitValue(list.get(0).getOverLimitValue());
|
||||||
|
info.add(json);
|
||||||
|
});
|
||||||
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
return JSON.toJSONString(info);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addAbnormalData(List<AbnormalData> list, String phasicType, String valueType, String time, Double value, float overLimitValue) {
|
||||||
|
AbnormalData data = new AbnormalData();
|
||||||
|
data.setTime(time.substring(11, time.length()));
|
||||||
|
data.setPhasic(phasicType);
|
||||||
|
data.setValueType(valueType);
|
||||||
|
data.setValue(value);
|
||||||
|
data.setOverLimitValue(overLimitValue);
|
||||||
|
list.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,16 +3,18 @@ package com.njcn.algorithm.serviceimpl.line;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DateTime;
|
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.algorithm.service.line.IDataOnlineRateService;
|
import com.njcn.algorithm.service.line.IDataOnlineRateService;
|
||||||
|
import com.njcn.dataProcess.api.DataIntegrityFeignClient;
|
||||||
import com.njcn.dataProcess.api.DataOnlineRateFeignClient;
|
import com.njcn.dataProcess.api.DataOnlineRateFeignClient;
|
||||||
import com.njcn.dataProcess.api.DataVFeignClient;
|
import com.njcn.dataProcess.api.DataVFeignClient;
|
||||||
import com.njcn.dataProcess.api.PqsCommunicateFeignClient;
|
import com.njcn.dataProcess.api.PqsCommunicateFeignClient;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataIntegrityDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataOnlineRateDto;
|
import com.njcn.dataProcess.pojo.dto.DataOnlineRateDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||||
import com.njcn.dataProcess.util.TimeUtils;
|
import com.njcn.dataProcess.util.TimeUtils;
|
||||||
@@ -61,7 +63,8 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
private CommTerminalGeneralClient commTerminalGeneralClient;
|
private CommTerminalGeneralClient commTerminalGeneralClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DeptFeignClient deptFeignClient;
|
private DeptFeignClient deptFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataIntegrityFeignClient dataIntegrityFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -73,8 +76,6 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
List<String> devIdList = calculatedParam.getIdList();
|
List<String> devIdList = calculatedParam.getIdList();
|
||||||
|
|
||||||
List<DataOnlineRateDto.Detail> list = new ArrayList<>();
|
List<DataOnlineRateDto.Detail> list = new ArrayList<>();
|
||||||
if(ObjectUtil.isNotNull(calculatedParam.getType())){
|
|
||||||
if(calculatedParam.getType()==1){
|
|
||||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||||
Dept dept = deptFeignClient.getRootDept().getData();
|
Dept dept = deptFeignClient.getRootDept().getData();
|
||||||
deptGetLineParam.setDeptId(dept.getId());
|
deptGetLineParam.setDeptId(dept.getId());
|
||||||
@@ -84,24 +85,24 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
Map<String, List<LineDevGetDTO>> LineDevGetMap = devList.stream()
|
Map<String, List<LineDevGetDTO>> LineDevGetMap = devList.stream()
|
||||||
.filter(x -> devIdList.contains(x.getDevId()))
|
.filter(x -> devIdList.contains(x.getDevId()))
|
||||||
.collect(Collectors.groupingBy(LineDevGetDTO::getDevId));
|
.collect(Collectors.groupingBy(LineDevGetDTO::getDevId));
|
||||||
LineDevGetMap.forEach((key,value)->{
|
if (ObjectUtil.isNotNull(calculatedParam.getType()) && calculatedParam.getType() == 1) {
|
||||||
|
LineDevGetMap.forEach((key, value) -> {
|
||||||
DataOnlineRateDto.Detail onlineRateDpo = new DataOnlineRateDto.Detail();
|
DataOnlineRateDto.Detail onlineRateDpo = new DataOnlineRateDto.Detail();
|
||||||
List<String> collect = value.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
List<String> collect = value.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
lineParam.setLineId(collect);
|
lineParam.setLineId(collect);
|
||||||
Integer data = dataVFeignClient.getCountRawData(lineParam).getData();
|
Integer data = dataVFeignClient.getCountRawData(lineParam).getData();
|
||||||
onlineRateDpo.setTimeId(calculatedParam.getDataDate());
|
onlineRateDpo.setTimeId(calculatedParam.getDataDate());
|
||||||
onlineRateDpo.setDevIndex(key);
|
onlineRateDpo.setDevIndex(key);
|
||||||
if(data>0){
|
if (data > 0) {
|
||||||
onlineRateDpo.setOnlineMin(InfluxDBPublicParam.DAY_MINUTE);
|
onlineRateDpo.setOnlineMin(InfluxDBPublicParam.DAY_MINUTE);
|
||||||
onlineRateDpo.setOfflineMin(0);
|
onlineRateDpo.setOfflineMin(0);
|
||||||
}else{
|
} else {
|
||||||
onlineRateDpo.setOnlineMin(0);
|
onlineRateDpo.setOnlineMin(0);
|
||||||
onlineRateDpo.setOfflineMin(InfluxDBPublicParam.DAY_MINUTE);
|
onlineRateDpo.setOfflineMin(InfluxDBPublicParam.DAY_MINUTE);
|
||||||
}
|
}
|
||||||
list.add(onlineRateDpo);
|
list.add(onlineRateDpo);
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
}else{
|
|
||||||
List<PqsCommunicateDto> outCommunicateData = new ArrayList<>();
|
List<PqsCommunicateDto> outCommunicateData = new ArrayList<>();
|
||||||
for (String s : devIdList) {
|
for (String s : devIdList) {
|
||||||
lineParam.setLineId(Arrays.asList(s));
|
lineParam.setLineId(Arrays.asList(s));
|
||||||
@@ -120,6 +121,35 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
onlineRateDpo.setOfflineMin(onLineRate.getOfflineMin());
|
onlineRateDpo.setOfflineMin(onLineRate.getOfflineMin());
|
||||||
list.add(onlineRateDpo);
|
list.add(onlineRateDpo);
|
||||||
}
|
}
|
||||||
|
LineDevGetMap.forEach((key, value) -> {
|
||||||
|
DataOnlineRateDto.Detail onlineRateDpo = new DataOnlineRateDto.Detail();
|
||||||
|
long count = list.stream().filter(x -> x.getDevIndex().equals(key)).count();
|
||||||
|
if (count < 1) {
|
||||||
|
onlineRateDpo.setTimeId(calculatedParam.getDataDate());
|
||||||
|
onlineRateDpo.setDevIndex(key);
|
||||||
|
List<String> lineIds = value.stream().map(LineDevGetDTO::getPointId).collect(Collectors.toList());
|
||||||
|
lineParam.setLineId(lineIds);
|
||||||
|
List<DataIntegrityDto> integrityDS = dataIntegrityFeignClient.getRawData(lineParam).getData();
|
||||||
|
Double max = 0.0;
|
||||||
|
if (CollUtil.isNotEmpty(integrityDS)) {
|
||||||
|
List<Double> info = new ArrayList<>();
|
||||||
|
for (DataIntegrityDto integrityD : integrityDS) {
|
||||||
|
double realTime = integrityD.getRealTime();
|
||||||
|
double dueTime = integrityD.getDueTime();
|
||||||
|
Double decimal = 0.0;
|
||||||
|
if (dueTime != 0) {
|
||||||
|
decimal = NumberUtil.round(Math.min(realTime / dueTime, 1), 6).doubleValue();
|
||||||
|
}
|
||||||
|
info.add(decimal);
|
||||||
|
}
|
||||||
|
max = info.stream().max(Comparator.naturalOrder()).orElse(0.0);
|
||||||
|
}
|
||||||
|
int v = (int) Math.ceil(InfluxDBPublicParam.DAY_MINUTE * max);
|
||||||
|
onlineRateDpo.setOnlineMin(v);
|
||||||
|
onlineRateDpo.setOfflineMin(InfluxDBPublicParam.DAY_MINUTE - v);
|
||||||
|
list.add(onlineRateDpo);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (CollectionUtil.isNotEmpty(list)) {
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
onlineRateFeignClient.batchInsertion(list);
|
onlineRateFeignClient.batchInsertion(list);
|
||||||
@@ -134,14 +164,14 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
lineParam.setEndTime(TimeUtils.getEndOfMonth(calculatedParam.getDataDate()));
|
lineParam.setEndTime(TimeUtils.getEndOfMonth(calculatedParam.getDataDate()));
|
||||||
List<String> devIdList = calculatedParam.getIdList();
|
List<String> devIdList = calculatedParam.getIdList();
|
||||||
|
|
||||||
List<DataOnlineRateDto.Detail> info=new ArrayList<>();
|
List<DataOnlineRateDto.Detail> info = new ArrayList<>();
|
||||||
List<List<String>> pendingIds = ListUtils.partition(devIdList,NUM);
|
List<List<String>> pendingIds = ListUtils.partition(devIdList, NUM);
|
||||||
for (List<String> pendingId : pendingIds) {
|
for (List<String> pendingId : pendingIds) {
|
||||||
lineParam.setLineId(pendingId);
|
lineParam.setLineId(pendingId);
|
||||||
List<DataOnlineRateDto.Detail> data = onlineRateFeignClient.getRawData(lineParam).getData();
|
List<DataOnlineRateDto.Detail> data = onlineRateFeignClient.getRawData(lineParam).getData();
|
||||||
Map<String, List<DataOnlineRateDto.Detail>> collect = data.stream().collect(Collectors.groupingBy(DataOnlineRateDto.Detail::getDevIndex));
|
Map<String, List<DataOnlineRateDto.Detail>> collect = data.stream().collect(Collectors.groupingBy(DataOnlineRateDto.Detail::getDevIndex));
|
||||||
collect.forEach((key,value)->{
|
collect.forEach((key, value) -> {
|
||||||
DataOnlineRateDto.Detail onlineRateDto=new DataOnlineRateDto.Detail();
|
DataOnlineRateDto.Detail onlineRateDto = new DataOnlineRateDto.Detail();
|
||||||
onlineRateDto.setTimeId(calculatedParam.getDataDate());
|
onlineRateDto.setTimeId(calculatedParam.getDataDate());
|
||||||
onlineRateDto.setDevIndex(key);
|
onlineRateDto.setDevIndex(key);
|
||||||
onlineRateDto.setOnlineMin(value.stream().mapToInt(DataOnlineRateDto.Detail::getOnlineMin).sum());
|
onlineRateDto.setOnlineMin(value.stream().mapToInt(DataOnlineRateDto.Detail::getOnlineMin).sum());
|
||||||
@@ -149,7 +179,7 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
info.add(onlineRateDto);
|
info.add(onlineRateDto);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(CollUtil.isNotEmpty(info)){
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -182,7 +212,7 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
return onLineRate;
|
return onLineRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer processData(Date newDate, Date date, Integer type,LineCountEvaluateParam lineParam) {
|
private Integer processData(Date newDate, Date date, Integer type, LineCountEvaluateParam lineParam) {
|
||||||
int minute = 0;
|
int minute = 0;
|
||||||
List<PqsCommunicateDto> communicateData = communicateFeignClient.getRawData(lineParam).getData();
|
List<PqsCommunicateDto> communicateData = communicateFeignClient.getRawData(lineParam).getData();
|
||||||
/*当前统计时间内存在多条数据*/
|
/*当前统计时间内存在多条数据*/
|
||||||
@@ -217,11 +247,13 @@ public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
|||||||
long differ = DateUtil.between(date, newDate, DateUnit.MINUTE);
|
long differ = DateUtil.between(date, newDate, DateUnit.MINUTE);
|
||||||
if (online.equals(type)) {
|
if (online.equals(type)) {
|
||||||
minute = InfluxDBPublicParam.DAY_MINUTE - (int) differ;
|
minute = InfluxDBPublicParam.DAY_MINUTE - (int) differ;
|
||||||
|
} else {
|
||||||
|
minute = (int) differ;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<PqsCommunicateDto> communicateDataOld = communicateFeignClient.getRawDataEnd(lineParam).getData();
|
List<PqsCommunicateDto> communicateDataOld = communicateFeignClient.getRawDataEnd(lineParam).getData();
|
||||||
if (communicateDataOld.size() > 0){
|
if (communicateDataOld.size() > 0) {
|
||||||
if (online.equals(communicateDataOld.get(0).getType())){
|
if (online.equals(communicateDataOld.get(0).getType())) {
|
||||||
minute = InfluxDBPublicParam.DAY_MINUTE;
|
minute = InfluxDBPublicParam.DAY_MINUTE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,23 +80,21 @@ public class PollutionCalcImpl implements IPollutionCalc {
|
|||||||
LineDevGetDTO line = lineDetailMap.get(id);
|
LineDevGetDTO line = lineDetailMap.get(id);
|
||||||
if (limitMap.containsKey(id)) {
|
if (limitMap.containsKey(id)) {
|
||||||
Overlimit overlimit = limitMap.get(id);
|
Overlimit overlimit = limitMap.get(id);
|
||||||
|
lineParam.setValueType(Arrays.asList(line.getTimeInterval() + ""));
|
||||||
|
lineParam.setLineId(Arrays.asList(id));
|
||||||
|
|
||||||
|
if(!dataVFeignClient.excludeZeroData(lineParam).getData()){
|
||||||
dataPollutionD = new DataPollutionD();
|
dataPollutionD = new DataPollutionD();
|
||||||
dataPollutionD.setLineId(id);
|
dataPollutionD.setLineId(id);
|
||||||
dataPollutionD.setDataDate(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate()));
|
dataPollutionD.setDataDate(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate()));
|
||||||
dataPollutionD.setPollutionType(vHarmonicLimit);
|
dataPollutionD.setPollutionType(vHarmonicLimit);
|
||||||
lineParam.setValueType(Arrays.asList(line.getTimeInterval() + ""));
|
|
||||||
lineParam.setLineId(Arrays.asList(id));
|
|
||||||
|
|
||||||
|
|
||||||
List<DataVDto> dataVDtoList = dataVFeignClient.getGroupByTimeDataV(lineParam).getData();
|
List<DataVDto> dataVDtoList = dataVFeignClient.getGroupByTimeDataV(lineParam).getData();
|
||||||
List<DataHarmDto> dataHarmDtoList = dataHarmRateVFeignClient.getGroupByTimeHarmRateV(lineParam).getData();
|
List<DataHarmDto> dataHarmDtoList = dataHarmRateVFeignClient.getGroupByTimeHarmRateV(lineParam).getData();
|
||||||
if (CollUtil.isNotEmpty(dataVDtoList) && CollUtil.isNotEmpty(dataHarmDtoList)) {
|
|
||||||
//计算谐波电压污染值
|
//计算谐波电压污染值
|
||||||
dataPollutionD.setValue(PubUtils.doubleRound(2, calcVAllPollutionValue(dataVDtoList, dataHarmDtoList, overlimit) * line.getTimeInterval()));
|
dataPollutionD.setValue(PubUtils.doubleRound(2, calcVAllPollutionValue(dataVDtoList, dataHarmDtoList, overlimit) * line.getTimeInterval()));
|
||||||
}else{
|
|
||||||
dataPollutionD.setValue(0.0);
|
|
||||||
}
|
|
||||||
list.add(dataPollutionD);
|
list.add(dataPollutionD);
|
||||||
|
}
|
||||||
|
|
||||||
dataPollutionD = new DataPollutionD();
|
dataPollutionD = new DataPollutionD();
|
||||||
dataPollutionD.setLineId(id);
|
dataPollutionD.setLineId(id);
|
||||||
dataPollutionD.setDataDate(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate()));
|
dataPollutionD.setDataDate(LocalDateTimeUtil.parseDate(calculatedParam.getDataDate()));
|
||||||
@@ -105,7 +103,7 @@ public class PollutionCalcImpl implements IPollutionCalc {
|
|||||||
if (CollUtil.isNotEmpty(data)) {
|
if (CollUtil.isNotEmpty(data)) {
|
||||||
//计算谐波电流污染值
|
//计算谐波电流污染值
|
||||||
dataPollutionD.setValue(PubUtils.doubleRound(2, calcIAllPollutionValue(data, overlimit) * line.getTimeInterval()));
|
dataPollutionD.setValue(PubUtils.doubleRound(2, calcIAllPollutionValue(data, overlimit) * line.getTimeInterval()));
|
||||||
}else{
|
} else {
|
||||||
dataPollutionD.setValue(0.0);
|
dataPollutionD.setValue(0.0);
|
||||||
}
|
}
|
||||||
list.add(dataPollutionD);
|
list.add(dataPollutionD);
|
||||||
@@ -129,10 +127,16 @@ public class PollutionCalcImpl implements IPollutionCalc {
|
|||||||
private double calcVAllPollutionValue(List<DataVDto> dataVDtoList, List<DataHarmDto> dataHarmDtoList, Overlimit overlimit) {
|
private double calcVAllPollutionValue(List<DataVDto> dataVDtoList, List<DataHarmDto> dataHarmDtoList, Overlimit overlimit) {
|
||||||
// 计算时间范围内指标越限百分比
|
// 计算时间范围内指标越限百分比
|
||||||
// 总畸变率的限值
|
// 总畸变率的限值
|
||||||
|
double thdPollutionValue = 0;
|
||||||
|
double harmRateVPollutionValue = 0;
|
||||||
|
if (CollUtil.isNotEmpty(dataVDtoList)) {
|
||||||
List<Double> thdValueList = dataVDtoList.stream().map(DataVDto::getVThd).collect(Collectors.toList());
|
List<Double> thdValueList = dataVDtoList.stream().map(DataVDto::getVThd).collect(Collectors.toList());
|
||||||
double thdPollutionValue = calcPollutionValue(overlimit.getUbalance(), thdValueList);
|
thdPollutionValue = calcPollutionValue(overlimit.getUbalance(), thdValueList);
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(dataVDtoList)) {
|
||||||
//谐波值2~50次
|
//谐波值2~50次
|
||||||
double harmRateVPollutionValue = calcHarmRateVPollutionValue(overlimit, dataHarmDtoList);
|
harmRateVPollutionValue = calcHarmRateVPollutionValue(overlimit, dataHarmDtoList);
|
||||||
|
}
|
||||||
return thdPollutionValue + harmRateVPollutionValue;
|
return thdPollutionValue + harmRateVPollutionValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.njcn.event.api.TransientFeignClient;
|
|||||||
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
import com.njcn.event.file.pojo.dto.WaveDataDTO;
|
||||||
import com.njcn.event.pojo.param.EventCountParam;
|
import com.njcn.event.pojo.param.EventCountParam;
|
||||||
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
import com.njcn.event.pojo.po.RmpEventDetailPO;
|
||||||
import com.njcn.supervision.api.UserLedgerFeignClient;
|
import com.njcn.supervision.api.UserLedgerOldFeignClient;
|
||||||
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
|
||||||
import com.njcn.system.api.DicDataFeignClient;
|
import com.njcn.system.api.DicDataFeignClient;
|
||||||
import com.njcn.system.api.DictTreeFeignClient;
|
import com.njcn.system.api.DictTreeFeignClient;
|
||||||
@@ -84,7 +84,7 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
|
|||||||
@Resource
|
@Resource
|
||||||
private CommLineClient commLineClient;
|
private CommLineClient commLineClient;
|
||||||
@Resource
|
@Resource
|
||||||
private UserLedgerFeignClient userLedgerFeignClient;
|
private UserLedgerOldFeignClient userLedgerFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
package com.njcn.algorithm.utils;
|
package com.njcn.algorithm.utils;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.text.StrPool;
|
||||||
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
|
import com.yomahub.liteflow.flow.LiteflowResponse;
|
||||||
|
import com.yomahub.liteflow.flow.entity.CmpStep;
|
||||||
import org.apache.commons.lang.SerializationUtils;
|
import org.apache.commons.lang.SerializationUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: cdf
|
* @Author: cdf
|
||||||
@@ -13,6 +24,8 @@ import java.util.List;
|
|||||||
|
|
||||||
public class MemorySizeUtil {
|
public class MemorySizeUtil {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(MemorySizeUtil.class);
|
||||||
|
|
||||||
public static double getObjectSize(List<?> list) {
|
public static double getObjectSize(List<?> list) {
|
||||||
byte[] serialized = SerializationUtils.serialize((java.io.Serializable) list);
|
byte[] serialized = SerializationUtils.serialize((java.io.Serializable) list);
|
||||||
return (double)serialized.length/1024/1024;
|
return (double)serialized.length/1024/1024;
|
||||||
@@ -36,5 +49,41 @@ public class MemorySizeUtil {
|
|||||||
System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB");
|
System.out.println("已使用的内存: " + usedMemory / (1024 * 1024) + " MB");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @date 2023/11/7 14:44
|
||||||
|
*/
|
||||||
|
public static void dealResponse(CalculatedParam calculatedParam, LiteflowResponse liteflowResponse, String methodDescribe) {
|
||||||
|
MemorySizeUtil.getNowMemory();
|
||||||
|
if (liteflowResponse.isSuccess()) {
|
||||||
|
// 获取执行步骤列表
|
||||||
|
long allTime = 0;
|
||||||
|
Map<String, List<CmpStep>> executeSteps = liteflowResponse.getExecuteSteps();
|
||||||
|
for (String key : executeSteps.keySet()) {
|
||||||
|
List<CmpStep> cmpSteps = executeSteps.get(key);
|
||||||
|
long timeSum = cmpSteps.stream().mapToLong(CmpStep::getTimeSpent).sum();
|
||||||
|
allTime+=timeSum;
|
||||||
|
}
|
||||||
|
logger.info("日期{},{}执行{}成功,执行总时长{}分钟", calculatedParam.getDataDate(), methodDescribe, calculatedParam.isFullChain() ? "全链" : "指定节点:".concat(String.join(StrPool.COMMA, calculatedParam.getTagNames())),allTime/1000/60);
|
||||||
|
} else {
|
||||||
|
Map<String, List<CmpStep>> executeSteps = liteflowResponse.getExecuteSteps();
|
||||||
|
CmpStep failStep = null;
|
||||||
|
for (String key : executeSteps.keySet()) {
|
||||||
|
List<CmpStep> cmpSteps = executeSteps.get(key);
|
||||||
|
cmpSteps = cmpSteps.stream().filter(cmpStep -> !cmpStep.isSuccess()).collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(cmpSteps)) {
|
||||||
|
failStep = cmpSteps.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.error("日期{},{}执行{}失败,在执行{}失败,失败原因:{}"
|
||||||
|
, calculatedParam.getDataDate()
|
||||||
|
, methodDescribe
|
||||||
|
, calculatedParam.isFullChain() ? "全链" : "指定节点:".concat(String.join(StrPool.COMMA, calculatedParam.getTagNames()))
|
||||||
|
, failStep.getNodeId().concat(Objects.isNull(failStep.getTag()) ? "" : StrPool.DASHED.concat(failStep.getTag()))
|
||||||
|
, Objects.isNull(failStep.getException()) ? null : failStep.getException().getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
76
algorithm/algorithm-boot/src/main/resources/bootstrap-jb.yml
Normal file
76
algorithm/algorithm-boot/src/main/resources/bootstrap-jb.yml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10401
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
compression:
|
||||||
|
request:
|
||||||
|
enabled: true
|
||||||
|
# 配置压缩支持的MIME TYPE
|
||||||
|
mime-types: text/xml,application/xml,application/json
|
||||||
|
# 配置压缩数据大小的下限
|
||||||
|
min-request-size: 1024
|
||||||
|
response:
|
||||||
|
# 配置响应GZIP压缩
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
config:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
liteflow:
|
||||||
|
rule-source-ext-data-map:
|
||||||
|
serverAddr: @nacos.url@
|
||||||
|
dataId: prepare_liteflow
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
when-max-wait-time: 3600000
|
||||||
|
print-banner: false
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
com.alibaba.nacos.client: INFO
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
line:
|
||||||
|
num: 20
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10401
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
compression:
|
||||||
|
request:
|
||||||
|
enabled: true
|
||||||
|
# 配置压缩支持的MIME TYPE
|
||||||
|
mime-types: text/xml,application/xml,application/json
|
||||||
|
# 配置压缩数据大小的下限
|
||||||
|
min-request-size: 1024
|
||||||
|
response:
|
||||||
|
# 配置响应GZIP压缩
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
ip: @service.server.url@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
config:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-Id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
liteflow:
|
||||||
|
rule-source-ext-data-map:
|
||||||
|
serverAddr: @nacos.url@
|
||||||
|
dataId: prepare_liteflow
|
||||||
|
group: DEFAULT_GROUP
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
when-max-wait-time: 3600000
|
||||||
|
print-banner: false
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
com.alibaba.nacos.client: INFO
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
line:
|
||||||
|
num: 20
|
||||||
|
|
||||||
|
#mqtt:
|
||||||
|
# client-id: @artifactId@${random.value}
|
||||||
@@ -1,72 +1,3 @@
|
|||||||
#当前服务的基本信息
|
|
||||||
microservice:
|
|
||||||
ename: @artifactId@
|
|
||||||
name: '@name@'
|
|
||||||
version: @version@
|
|
||||||
sentinel:
|
|
||||||
url: @sentinel.url@
|
|
||||||
gateway:
|
|
||||||
url: @gateway.url@
|
|
||||||
server:
|
|
||||||
port: 10401
|
|
||||||
#feign接口开启服务熔断降级处理
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
compression:
|
|
||||||
request:
|
|
||||||
enabled: true
|
|
||||||
# 配置压缩支持的MIME TYPE
|
|
||||||
mime-types: text/xml,application/xml,application/json
|
|
||||||
# 配置压缩数据大小的下限
|
|
||||||
min-request-size: 1024
|
|
||||||
response:
|
|
||||||
# 配置响应GZIP压缩
|
|
||||||
enabled: true
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
profiles:
|
||||||
name: @artifactId@
|
active: @spring.profiles.active@
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
ip: @service.server.url@
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
config:
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
file-extension: yaml
|
|
||||||
shared-configs:
|
|
||||||
- data-id: share-config.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: share-config-datasource-db.yaml
|
|
||||||
refresh: true
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
|
|
||||||
liteflow:
|
|
||||||
rule-source-ext-data-map:
|
|
||||||
serverAddr: @nacos.url@
|
|
||||||
dataId: prepare_liteflow
|
|
||||||
group: DEFAULT_GROUP
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
when-max-wait-time: 600000
|
|
||||||
print-banner: false
|
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
|
||||||
logging:
|
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
|
||||||
level:
|
|
||||||
root:
|
|
||||||
|
|
||||||
|
|
||||||
#mybatis配置信息
|
|
||||||
mybatis-plus:
|
|
||||||
#别名扫描
|
|
||||||
type-aliases-package: com.njcn.harmonic.pojo
|
|
||||||
line:
|
|
||||||
num: 20
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
client-id: @artifactId@${random.value}
|
|
||||||
@@ -18,6 +18,28 @@ import java.util.Objects;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
public class BeanIConverter {
|
public class BeanIConverter {
|
||||||
|
/**
|
||||||
|
* 角度相关常量
|
||||||
|
*/
|
||||||
|
private static final double ANGLE_180 = 180.0;
|
||||||
|
private static final double ANGLE_360 = 360.0;
|
||||||
|
private static final double ANGLE_MINUS_180 = -180.0;
|
||||||
|
|
||||||
|
public static Double adjustPhase(Double phase) {
|
||||||
|
if (phase == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 使用模运算将角度标准化到[-180, 180]范围
|
||||||
|
double normalizedPhase = phase % ANGLE_360;
|
||||||
|
// 处理超出[-180, 180]范围的情况
|
||||||
|
if (normalizedPhase > ANGLE_180) {
|
||||||
|
normalizedPhase -= ANGLE_360;
|
||||||
|
} else if (normalizedPhase < ANGLE_MINUS_180) {
|
||||||
|
normalizedPhase += ANGLE_360;
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalizedPhase;
|
||||||
|
}
|
||||||
//A,B,C三项
|
//A,B,C三项
|
||||||
public static DataIDTO messageDataITODataI(MessageDataI messageDataI){
|
public static DataIDTO messageDataITODataI(MessageDataI messageDataI){
|
||||||
DataIDTO dataI = new DataIDTO();
|
DataIDTO dataI = new DataIDTO();
|
||||||
@@ -283,209 +305,209 @@ public class BeanIConverter {
|
|||||||
public static DataHarmphasicIDTO messageDataITODataHarmphasicI(MessageDataI messageDataI){
|
public static DataHarmphasicIDTO messageDataITODataHarmphasicI(MessageDataI messageDataI){
|
||||||
DataHarmphasicIDTO dataHarmphasicI = new DataHarmphasicIDTO();
|
DataHarmphasicIDTO dataHarmphasicI = new DataHarmphasicIDTO();
|
||||||
if(Objects.nonNull(messageDataI)){
|
if(Objects.nonNull(messageDataI)){
|
||||||
dataHarmphasicI.setI1(messageDataI.getIfundAngle());
|
dataHarmphasicI.setI1(adjustPhase(messageDataI.getIfundAngle()));
|
||||||
dataHarmphasicI.setI2(messageDataI.getIa2());
|
dataHarmphasicI.setI2(adjustPhase(messageDataI.getIa2()));
|
||||||
dataHarmphasicI.setI3(messageDataI.getIa3());
|
dataHarmphasicI.setI3(adjustPhase(messageDataI.getIa3()));
|
||||||
dataHarmphasicI.setI4(messageDataI.getIa4());
|
dataHarmphasicI.setI4(adjustPhase(messageDataI.getIa4()));
|
||||||
dataHarmphasicI.setI5(messageDataI.getIa5());
|
dataHarmphasicI.setI5(adjustPhase(messageDataI.getIa5()));
|
||||||
dataHarmphasicI.setI6(messageDataI.getIa6());
|
dataHarmphasicI.setI6(adjustPhase(messageDataI.getIa6()));
|
||||||
dataHarmphasicI.setI7(messageDataI.getIa7());
|
dataHarmphasicI.setI7(adjustPhase(messageDataI.getIa7()));
|
||||||
dataHarmphasicI.setI8(messageDataI.getIa8());
|
dataHarmphasicI.setI8(adjustPhase(messageDataI.getIa8()));
|
||||||
dataHarmphasicI.setI9(messageDataI.getIa9());
|
dataHarmphasicI.setI9(adjustPhase(messageDataI.getIa9()));
|
||||||
dataHarmphasicI.setI10(messageDataI.getIa10());
|
dataHarmphasicI.setI10(adjustPhase(messageDataI.getIa10()));
|
||||||
dataHarmphasicI.setI11(messageDataI.getIa11());
|
dataHarmphasicI.setI11(adjustPhase(messageDataI.getIa11()));
|
||||||
dataHarmphasicI.setI12(messageDataI.getIa12());
|
dataHarmphasicI.setI12(adjustPhase(messageDataI.getIa12()));
|
||||||
dataHarmphasicI.setI13(messageDataI.getIa13());
|
dataHarmphasicI.setI13(adjustPhase(messageDataI.getIa13()));
|
||||||
dataHarmphasicI.setI14(messageDataI.getIa14());
|
dataHarmphasicI.setI14(adjustPhase(messageDataI.getIa14()));
|
||||||
dataHarmphasicI.setI15(messageDataI.getIa15());
|
dataHarmphasicI.setI15(adjustPhase(messageDataI.getIa15()));
|
||||||
dataHarmphasicI.setI16(messageDataI.getIa16());
|
dataHarmphasicI.setI16(adjustPhase(messageDataI.getIa16()));
|
||||||
dataHarmphasicI.setI17(messageDataI.getIa17());
|
dataHarmphasicI.setI17(adjustPhase(messageDataI.getIa17()));
|
||||||
dataHarmphasicI.setI18(messageDataI.getIa18());
|
dataHarmphasicI.setI18(adjustPhase(messageDataI.getIa18()));
|
||||||
dataHarmphasicI.setI19(messageDataI.getIa19());
|
dataHarmphasicI.setI19(adjustPhase(messageDataI.getIa19()));
|
||||||
dataHarmphasicI.setI20(messageDataI.getIa20());
|
dataHarmphasicI.setI20(adjustPhase(messageDataI.getIa20()));
|
||||||
dataHarmphasicI.setI21(messageDataI.getIa21());
|
dataHarmphasicI.setI21(adjustPhase(messageDataI.getIa21()));
|
||||||
dataHarmphasicI.setI22(messageDataI.getIa22());
|
dataHarmphasicI.setI22(adjustPhase(messageDataI.getIa22()));
|
||||||
dataHarmphasicI.setI23(messageDataI.getIa23());
|
dataHarmphasicI.setI23(adjustPhase(messageDataI.getIa23()));
|
||||||
dataHarmphasicI.setI24(messageDataI.getIa24());
|
dataHarmphasicI.setI24(adjustPhase(messageDataI.getIa24()));
|
||||||
dataHarmphasicI.setI25(messageDataI.getIa25());
|
dataHarmphasicI.setI25(adjustPhase(messageDataI.getIa25()));
|
||||||
dataHarmphasicI.setI26(messageDataI.getIa26());
|
dataHarmphasicI.setI26(adjustPhase(messageDataI.getIa26()));
|
||||||
dataHarmphasicI.setI27(messageDataI.getIa27());
|
dataHarmphasicI.setI27(adjustPhase(messageDataI.getIa27()));
|
||||||
dataHarmphasicI.setI28(messageDataI.getIa28());
|
dataHarmphasicI.setI28(adjustPhase(messageDataI.getIa28()));
|
||||||
dataHarmphasicI.setI29(messageDataI.getIa29());
|
dataHarmphasicI.setI29(adjustPhase(messageDataI.getIa29()));
|
||||||
dataHarmphasicI.setI30(messageDataI.getIa30());
|
dataHarmphasicI.setI30(adjustPhase(messageDataI.getIa30()));
|
||||||
dataHarmphasicI.setI31(messageDataI.getIa31());
|
dataHarmphasicI.setI31(adjustPhase(messageDataI.getIa31()));
|
||||||
dataHarmphasicI.setI32(messageDataI.getIa32());
|
dataHarmphasicI.setI32(adjustPhase(messageDataI.getIa32()));
|
||||||
dataHarmphasicI.setI33(messageDataI.getIa33());
|
dataHarmphasicI.setI33(adjustPhase(messageDataI.getIa33()));
|
||||||
dataHarmphasicI.setI34(messageDataI.getIa34());
|
dataHarmphasicI.setI34(adjustPhase(messageDataI.getIa34()));
|
||||||
dataHarmphasicI.setI35(messageDataI.getIa35());
|
dataHarmphasicI.setI35(adjustPhase(messageDataI.getIa35()));
|
||||||
dataHarmphasicI.setI36(messageDataI.getIa36());
|
dataHarmphasicI.setI36(adjustPhase(messageDataI.getIa36()));
|
||||||
dataHarmphasicI.setI37(messageDataI.getIa37());
|
dataHarmphasicI.setI37(adjustPhase(messageDataI.getIa37()));
|
||||||
dataHarmphasicI.setI38(messageDataI.getIa38());
|
dataHarmphasicI.setI38(adjustPhase(messageDataI.getIa38()));
|
||||||
dataHarmphasicI.setI39(messageDataI.getIa39());
|
dataHarmphasicI.setI39(adjustPhase(messageDataI.getIa39()));
|
||||||
dataHarmphasicI.setI40(messageDataI.getIa40());
|
dataHarmphasicI.setI40(adjustPhase(messageDataI.getIa40()));
|
||||||
dataHarmphasicI.setI41(messageDataI.getIa41());
|
dataHarmphasicI.setI41(adjustPhase(messageDataI.getIa41()));
|
||||||
dataHarmphasicI.setI42(messageDataI.getIa42());
|
dataHarmphasicI.setI42(adjustPhase(messageDataI.getIa42()));
|
||||||
dataHarmphasicI.setI43(messageDataI.getIa43());
|
dataHarmphasicI.setI43(adjustPhase(messageDataI.getIa43()));
|
||||||
dataHarmphasicI.setI44(messageDataI.getIa44());
|
dataHarmphasicI.setI44(adjustPhase(messageDataI.getIa44()));
|
||||||
dataHarmphasicI.setI45(messageDataI.getIa45());
|
dataHarmphasicI.setI45(adjustPhase(messageDataI.getIa45()));
|
||||||
dataHarmphasicI.setI46(messageDataI.getIa46());
|
dataHarmphasicI.setI46(adjustPhase(messageDataI.getIa46()));
|
||||||
dataHarmphasicI.setI47(messageDataI.getIa47());
|
dataHarmphasicI.setI47(adjustPhase(messageDataI.getIa47()));
|
||||||
dataHarmphasicI.setI48(messageDataI.getIa48());
|
dataHarmphasicI.setI48(adjustPhase(messageDataI.getIa48()));
|
||||||
dataHarmphasicI.setI49(messageDataI.getIa49());
|
dataHarmphasicI.setI49(adjustPhase(messageDataI.getIa49()));
|
||||||
dataHarmphasicI.setI50(messageDataI.getIa50());
|
dataHarmphasicI.setI50(adjustPhase(messageDataI.getIa50()));
|
||||||
|
|
||||||
dataHarmphasicI.setI1Max( messageDataI.getMaxIfundAngle());
|
dataHarmphasicI.setI1Max( adjustPhase(messageDataI.getMaxIfundAngle()));
|
||||||
dataHarmphasicI.setI2Max(messageDataI.getMaxIa2());
|
dataHarmphasicI.setI2Max(adjustPhase(messageDataI.getMaxIa2()));
|
||||||
dataHarmphasicI.setI3Max(messageDataI.getMaxIa3());
|
dataHarmphasicI.setI3Max(adjustPhase(messageDataI.getMaxIa3()));
|
||||||
dataHarmphasicI.setI4Max(messageDataI.getMaxIa4());
|
dataHarmphasicI.setI4Max(adjustPhase(messageDataI.getMaxIa4()));
|
||||||
dataHarmphasicI.setI5Max(messageDataI.getMaxIa5());
|
dataHarmphasicI.setI5Max(adjustPhase(messageDataI.getMaxIa5()));
|
||||||
dataHarmphasicI.setI6Max(messageDataI.getMaxIa6());
|
dataHarmphasicI.setI6Max(adjustPhase(messageDataI.getMaxIa6()));
|
||||||
dataHarmphasicI.setI7Max(messageDataI.getMaxIa7());
|
dataHarmphasicI.setI7Max(adjustPhase(messageDataI.getMaxIa7()));
|
||||||
dataHarmphasicI.setI8Max(messageDataI.getMaxIa8());
|
dataHarmphasicI.setI8Max(adjustPhase(messageDataI.getMaxIa8()));
|
||||||
dataHarmphasicI.setI9Max(messageDataI.getMaxIa9());
|
dataHarmphasicI.setI9Max(adjustPhase(messageDataI.getMaxIa9()));
|
||||||
dataHarmphasicI.setI10Max(messageDataI.getMaxIa10());
|
dataHarmphasicI.setI10Max(adjustPhase(messageDataI.getMaxIa10()));
|
||||||
dataHarmphasicI.setI11Max(messageDataI.getMaxIa11());
|
dataHarmphasicI.setI11Max(adjustPhase(messageDataI.getMaxIa11()));
|
||||||
dataHarmphasicI.setI12Max(messageDataI.getMaxIa12());
|
dataHarmphasicI.setI12Max(adjustPhase(messageDataI.getMaxIa12()));
|
||||||
dataHarmphasicI.setI13Max(messageDataI.getMaxIa13());
|
dataHarmphasicI.setI13Max(adjustPhase(messageDataI.getMaxIa13()));
|
||||||
dataHarmphasicI.setI14Max(messageDataI.getMaxIa14());
|
dataHarmphasicI.setI14Max(adjustPhase(messageDataI.getMaxIa14()));
|
||||||
dataHarmphasicI.setI15Max(messageDataI.getMaxIa15());
|
dataHarmphasicI.setI15Max(adjustPhase(messageDataI.getMaxIa15()));
|
||||||
dataHarmphasicI.setI16Max(messageDataI.getMaxIa16());
|
dataHarmphasicI.setI16Max(adjustPhase(messageDataI.getMaxIa16()));
|
||||||
dataHarmphasicI.setI17Max(messageDataI.getMaxIa17());
|
dataHarmphasicI.setI17Max(adjustPhase(messageDataI.getMaxIa17()));
|
||||||
dataHarmphasicI.setI18Max(messageDataI.getMaxIa18());
|
dataHarmphasicI.setI18Max(adjustPhase(messageDataI.getMaxIa18()));
|
||||||
dataHarmphasicI.setI19Max(messageDataI.getMaxIa19());
|
dataHarmphasicI.setI19Max(adjustPhase(messageDataI.getMaxIa19()));
|
||||||
dataHarmphasicI.setI20Max(messageDataI.getMaxIa20());
|
dataHarmphasicI.setI20Max(adjustPhase(messageDataI.getMaxIa20()));
|
||||||
dataHarmphasicI.setI21Max(messageDataI.getMaxIa21());
|
dataHarmphasicI.setI21Max(adjustPhase(messageDataI.getMaxIa21()));
|
||||||
dataHarmphasicI.setI22Max(messageDataI.getMaxIa22());
|
dataHarmphasicI.setI22Max(adjustPhase(messageDataI.getMaxIa22()));
|
||||||
dataHarmphasicI.setI23Max(messageDataI.getMaxIa23());
|
dataHarmphasicI.setI23Max(adjustPhase(messageDataI.getMaxIa23()));
|
||||||
dataHarmphasicI.setI24Max(messageDataI.getMaxIa24());
|
dataHarmphasicI.setI24Max(adjustPhase(messageDataI.getMaxIa24()));
|
||||||
dataHarmphasicI.setI25Max(messageDataI.getMaxIa25());
|
dataHarmphasicI.setI25Max(adjustPhase(messageDataI.getMaxIa25()));
|
||||||
dataHarmphasicI.setI26Max(messageDataI.getMaxIa26());
|
dataHarmphasicI.setI26Max(adjustPhase(messageDataI.getMaxIa26()));
|
||||||
dataHarmphasicI.setI27Max(messageDataI.getMaxIa27());
|
dataHarmphasicI.setI27Max(adjustPhase(messageDataI.getMaxIa27()));
|
||||||
dataHarmphasicI.setI28Max(messageDataI.getMaxIa28());
|
dataHarmphasicI.setI28Max(adjustPhase(messageDataI.getMaxIa28()));
|
||||||
dataHarmphasicI.setI29Max(messageDataI.getMaxIa29());
|
dataHarmphasicI.setI29Max(adjustPhase(messageDataI.getMaxIa29()));
|
||||||
dataHarmphasicI.setI30Max(messageDataI.getMaxIa30());
|
dataHarmphasicI.setI30Max(adjustPhase(messageDataI.getMaxIa30()));
|
||||||
dataHarmphasicI.setI31Max(messageDataI.getMaxIa31());
|
dataHarmphasicI.setI31Max(adjustPhase(messageDataI.getMaxIa31()));
|
||||||
dataHarmphasicI.setI32Max(messageDataI.getMaxIa32());
|
dataHarmphasicI.setI32Max(adjustPhase(messageDataI.getMaxIa32()));
|
||||||
dataHarmphasicI.setI33Max(messageDataI.getMaxIa33());
|
dataHarmphasicI.setI33Max(adjustPhase(messageDataI.getMaxIa33()));
|
||||||
dataHarmphasicI.setI34Max(messageDataI.getMaxIa34());
|
dataHarmphasicI.setI34Max(adjustPhase(messageDataI.getMaxIa34()));
|
||||||
dataHarmphasicI.setI35Max(messageDataI.getMaxIa35());
|
dataHarmphasicI.setI35Max(adjustPhase(messageDataI.getMaxIa35()));
|
||||||
dataHarmphasicI.setI36Max(messageDataI.getMaxIa36());
|
dataHarmphasicI.setI36Max(adjustPhase(messageDataI.getMaxIa36()));
|
||||||
dataHarmphasicI.setI37Max(messageDataI.getMaxIa37());
|
dataHarmphasicI.setI37Max(adjustPhase(messageDataI.getMaxIa37()));
|
||||||
dataHarmphasicI.setI38Max(messageDataI.getMaxIa38());
|
dataHarmphasicI.setI38Max(adjustPhase(messageDataI.getMaxIa38()));
|
||||||
dataHarmphasicI.setI39Max(messageDataI.getMaxIa39());
|
dataHarmphasicI.setI39Max(adjustPhase(messageDataI.getMaxIa39()));
|
||||||
dataHarmphasicI.setI40Max(messageDataI.getMaxIa40());
|
dataHarmphasicI.setI40Max(adjustPhase(messageDataI.getMaxIa40()));
|
||||||
dataHarmphasicI.setI41Max(messageDataI.getMaxIa41());
|
dataHarmphasicI.setI41Max(adjustPhase(messageDataI.getMaxIa41()));
|
||||||
dataHarmphasicI.setI42Max(messageDataI.getMaxIa42());
|
dataHarmphasicI.setI42Max(adjustPhase(messageDataI.getMaxIa42()));
|
||||||
dataHarmphasicI.setI43Max(messageDataI.getMaxIa43());
|
dataHarmphasicI.setI43Max(adjustPhase(messageDataI.getMaxIa43()));
|
||||||
dataHarmphasicI.setI44Max(messageDataI.getMaxIa44());
|
dataHarmphasicI.setI44Max(adjustPhase(messageDataI.getMaxIa44()));
|
||||||
dataHarmphasicI.setI45Max(messageDataI.getMaxIa45());
|
dataHarmphasicI.setI45Max(adjustPhase(messageDataI.getMaxIa45()));
|
||||||
dataHarmphasicI.setI46Max(messageDataI.getMaxIa46());
|
dataHarmphasicI.setI46Max(adjustPhase(messageDataI.getMaxIa46()));
|
||||||
dataHarmphasicI.setI47Max(messageDataI.getMaxIa47());
|
dataHarmphasicI.setI47Max(adjustPhase(messageDataI.getMaxIa47()));
|
||||||
dataHarmphasicI.setI48Max(messageDataI.getMaxIa48());
|
dataHarmphasicI.setI48Max(adjustPhase(messageDataI.getMaxIa48()));
|
||||||
dataHarmphasicI.setI49Max(messageDataI.getMaxIa49());
|
dataHarmphasicI.setI49Max(adjustPhase(messageDataI.getMaxIa49()));
|
||||||
dataHarmphasicI.setI50Max(messageDataI.getMaxIa50());
|
dataHarmphasicI.setI50Max(adjustPhase(messageDataI.getMaxIa50()));
|
||||||
|
|
||||||
dataHarmphasicI.setI1Min(messageDataI.getMinIfundAngle());
|
dataHarmphasicI.setI1Min(adjustPhase(messageDataI.getMinIfundAngle()));
|
||||||
dataHarmphasicI.setI2Min(messageDataI.getMinIa2());
|
dataHarmphasicI.setI2Min(adjustPhase(messageDataI.getMinIa2()));
|
||||||
dataHarmphasicI.setI3Min(messageDataI.getMinIa3());
|
dataHarmphasicI.setI3Min(adjustPhase(messageDataI.getMinIa3()));
|
||||||
dataHarmphasicI.setI4Min(messageDataI.getMinIa4());
|
dataHarmphasicI.setI4Min(adjustPhase(messageDataI.getMinIa4()));
|
||||||
dataHarmphasicI.setI5Min(messageDataI.getMinIa5());
|
dataHarmphasicI.setI5Min(adjustPhase(messageDataI.getMinIa5()));
|
||||||
dataHarmphasicI.setI6Min(messageDataI.getMinIa6());
|
dataHarmphasicI.setI6Min(adjustPhase(messageDataI.getMinIa6()));
|
||||||
dataHarmphasicI.setI7Min(messageDataI.getMinIa7());
|
dataHarmphasicI.setI7Min(adjustPhase(messageDataI.getMinIa7()));
|
||||||
dataHarmphasicI.setI8Min(messageDataI.getMinIa8());
|
dataHarmphasicI.setI8Min(adjustPhase(messageDataI.getMinIa8()));
|
||||||
dataHarmphasicI.setI9Min(messageDataI.getMinIa9());
|
dataHarmphasicI.setI9Min(adjustPhase(messageDataI.getMinIa9()));
|
||||||
dataHarmphasicI.setI10Min(messageDataI.getMinIa10());
|
dataHarmphasicI.setI10Min(adjustPhase(messageDataI.getMinIa10()));
|
||||||
dataHarmphasicI.setI11Min(messageDataI.getMinIa11());
|
dataHarmphasicI.setI11Min(adjustPhase(messageDataI.getMinIa11()));
|
||||||
dataHarmphasicI.setI12Min(messageDataI.getMinIa12());
|
dataHarmphasicI.setI12Min(adjustPhase(messageDataI.getMinIa12()));
|
||||||
dataHarmphasicI.setI13Min(messageDataI.getMinIa13());
|
dataHarmphasicI.setI13Min(adjustPhase(messageDataI.getMinIa13()));
|
||||||
dataHarmphasicI.setI14Min(messageDataI.getMinIa14());
|
dataHarmphasicI.setI14Min(adjustPhase(messageDataI.getMinIa14()));
|
||||||
dataHarmphasicI.setI15Min(messageDataI.getMinIa15());
|
dataHarmphasicI.setI15Min(adjustPhase(messageDataI.getMinIa15()));
|
||||||
dataHarmphasicI.setI16Min(messageDataI.getMinIa16());
|
dataHarmphasicI.setI16Min(adjustPhase(messageDataI.getMinIa16()));
|
||||||
dataHarmphasicI.setI17Min(messageDataI.getMinIa17());
|
dataHarmphasicI.setI17Min(adjustPhase(messageDataI.getMinIa17()));
|
||||||
dataHarmphasicI.setI18Min(messageDataI.getMinIa18());
|
dataHarmphasicI.setI18Min(adjustPhase(messageDataI.getMinIa18()));
|
||||||
dataHarmphasicI.setI19Min(messageDataI.getMinIa19());
|
dataHarmphasicI.setI19Min(adjustPhase(messageDataI.getMinIa19()));
|
||||||
dataHarmphasicI.setI20Min(messageDataI.getMinIa20());
|
dataHarmphasicI.setI20Min(adjustPhase(messageDataI.getMinIa20()));
|
||||||
dataHarmphasicI.setI21Min(messageDataI.getMinIa21());
|
dataHarmphasicI.setI21Min(adjustPhase(messageDataI.getMinIa21()));
|
||||||
dataHarmphasicI.setI22Min(messageDataI.getMinIa22());
|
dataHarmphasicI.setI22Min(adjustPhase(messageDataI.getMinIa22()));
|
||||||
dataHarmphasicI.setI23Min(messageDataI.getMinIa23());
|
dataHarmphasicI.setI23Min(adjustPhase(messageDataI.getMinIa23()));
|
||||||
dataHarmphasicI.setI24Min(messageDataI.getMinIa24());
|
dataHarmphasicI.setI24Min(adjustPhase(messageDataI.getMinIa24()));
|
||||||
dataHarmphasicI.setI25Min(messageDataI.getMinIa25());
|
dataHarmphasicI.setI25Min(adjustPhase(messageDataI.getMinIa25()));
|
||||||
dataHarmphasicI.setI26Min(messageDataI.getMinIa26());
|
dataHarmphasicI.setI26Min(adjustPhase(messageDataI.getMinIa26()));
|
||||||
dataHarmphasicI.setI27Min(messageDataI.getMinIa27());
|
dataHarmphasicI.setI27Min(adjustPhase(messageDataI.getMinIa27()));
|
||||||
dataHarmphasicI.setI28Min(messageDataI.getMinIa28());
|
dataHarmphasicI.setI28Min(adjustPhase(messageDataI.getMinIa28()));
|
||||||
dataHarmphasicI.setI29Min(messageDataI.getMinIa29());
|
dataHarmphasicI.setI29Min(adjustPhase(messageDataI.getMinIa29()));
|
||||||
dataHarmphasicI.setI30Min(messageDataI.getMinIa30());
|
dataHarmphasicI.setI30Min(adjustPhase(messageDataI.getMinIa30()));
|
||||||
dataHarmphasicI.setI31Min(messageDataI.getMinIa31());
|
dataHarmphasicI.setI31Min(adjustPhase(messageDataI.getMinIa31()));
|
||||||
dataHarmphasicI.setI32Min(messageDataI.getMinIa32());
|
dataHarmphasicI.setI32Min(adjustPhase(messageDataI.getMinIa32()));
|
||||||
dataHarmphasicI.setI33Min(messageDataI.getMinIa33());
|
dataHarmphasicI.setI33Min(adjustPhase(messageDataI.getMinIa33()));
|
||||||
dataHarmphasicI.setI34Min(messageDataI.getMinIa34());
|
dataHarmphasicI.setI34Min(adjustPhase(messageDataI.getMinIa34()));
|
||||||
dataHarmphasicI.setI35Min(messageDataI.getMinIa35());
|
dataHarmphasicI.setI35Min(adjustPhase(messageDataI.getMinIa35()));
|
||||||
dataHarmphasicI.setI36Min(messageDataI.getMinIa36());
|
dataHarmphasicI.setI36Min(adjustPhase(messageDataI.getMinIa36()));
|
||||||
dataHarmphasicI.setI37Min(messageDataI.getMinIa37());
|
dataHarmphasicI.setI37Min(adjustPhase(messageDataI.getMinIa37()));
|
||||||
dataHarmphasicI.setI38Min(messageDataI.getMinIa38());
|
dataHarmphasicI.setI38Min(adjustPhase(messageDataI.getMinIa38()));
|
||||||
dataHarmphasicI.setI39Min(messageDataI.getMinIa39());
|
dataHarmphasicI.setI39Min(adjustPhase(messageDataI.getMinIa39()));
|
||||||
dataHarmphasicI.setI40Min(messageDataI.getMinIa40());
|
dataHarmphasicI.setI40Min(adjustPhase(messageDataI.getMinIa40()));
|
||||||
dataHarmphasicI.setI41Min(messageDataI.getMinIa41());
|
dataHarmphasicI.setI41Min(adjustPhase(messageDataI.getMinIa41()));
|
||||||
dataHarmphasicI.setI42Min(messageDataI.getMinIa42());
|
dataHarmphasicI.setI42Min(adjustPhase(messageDataI.getMinIa42()));
|
||||||
dataHarmphasicI.setI43Min(messageDataI.getMinIa43());
|
dataHarmphasicI.setI43Min(adjustPhase(messageDataI.getMinIa43()));
|
||||||
dataHarmphasicI.setI44Min(messageDataI.getMinIa44());
|
dataHarmphasicI.setI44Min(adjustPhase(messageDataI.getMinIa44()));
|
||||||
dataHarmphasicI.setI45Min(messageDataI.getMinIa45());
|
dataHarmphasicI.setI45Min(adjustPhase(messageDataI.getMinIa45()));
|
||||||
dataHarmphasicI.setI46Min(messageDataI.getMinIa46());
|
dataHarmphasicI.setI46Min(adjustPhase(messageDataI.getMinIa46()));
|
||||||
dataHarmphasicI.setI47Min(messageDataI.getMinIa47());
|
dataHarmphasicI.setI47Min(adjustPhase(messageDataI.getMinIa47()));
|
||||||
dataHarmphasicI.setI48Min(messageDataI.getMinIa48());
|
dataHarmphasicI.setI48Min(adjustPhase(messageDataI.getMinIa48()));
|
||||||
dataHarmphasicI.setI49Min(messageDataI.getMinIa49());
|
dataHarmphasicI.setI49Min(adjustPhase(messageDataI.getMinIa49()));
|
||||||
dataHarmphasicI.setI50Min(messageDataI.getMinIa50());
|
dataHarmphasicI.setI50Min(adjustPhase(messageDataI.getMinIa50()));
|
||||||
|
|
||||||
dataHarmphasicI.setI1Cp95(messageDataI.getGIfundAngle());
|
dataHarmphasicI.setI1Cp95(adjustPhase(messageDataI.getGIfundAngle()));
|
||||||
dataHarmphasicI.setI2Cp95(messageDataI.getGIa2());
|
dataHarmphasicI.setI2Cp95(adjustPhase(messageDataI.getGIa2()));
|
||||||
dataHarmphasicI.setI3Cp95(messageDataI.getGIa3());
|
dataHarmphasicI.setI3Cp95(adjustPhase(messageDataI.getGIa3()));
|
||||||
dataHarmphasicI.setI4Cp95(messageDataI.getGIa4());
|
dataHarmphasicI.setI4Cp95(adjustPhase(messageDataI.getGIa4()));
|
||||||
dataHarmphasicI.setI5Cp95(messageDataI.getGIa5());
|
dataHarmphasicI.setI5Cp95(adjustPhase(messageDataI.getGIa5()));
|
||||||
dataHarmphasicI.setI6Cp95(messageDataI.getGIa6());
|
dataHarmphasicI.setI6Cp95(adjustPhase(messageDataI.getGIa6()));
|
||||||
dataHarmphasicI.setI7Cp95(messageDataI.getGIa7());
|
dataHarmphasicI.setI7Cp95(adjustPhase(messageDataI.getGIa7()));
|
||||||
dataHarmphasicI.setI8Cp95(messageDataI.getGIa8());
|
dataHarmphasicI.setI8Cp95(adjustPhase(messageDataI.getGIa8()));
|
||||||
dataHarmphasicI.setI9Cp95(messageDataI.getGIa9());
|
dataHarmphasicI.setI9Cp95(adjustPhase(messageDataI.getGIa9()));
|
||||||
dataHarmphasicI.setI10Cp95(messageDataI.getGIa10());
|
dataHarmphasicI.setI10Cp95(adjustPhase(messageDataI.getGIa10()));
|
||||||
dataHarmphasicI.setI11Cp95(messageDataI.getGIa11());
|
dataHarmphasicI.setI11Cp95(adjustPhase(messageDataI.getGIa11()));
|
||||||
dataHarmphasicI.setI12Cp95(messageDataI.getGIa12());
|
dataHarmphasicI.setI12Cp95(adjustPhase(messageDataI.getGIa12()));
|
||||||
dataHarmphasicI.setI13Cp95(messageDataI.getGIa13());
|
dataHarmphasicI.setI13Cp95(adjustPhase(messageDataI.getGIa13()));
|
||||||
dataHarmphasicI.setI14Cp95(messageDataI.getGIa14());
|
dataHarmphasicI.setI14Cp95(adjustPhase(messageDataI.getGIa14()));
|
||||||
dataHarmphasicI.setI15Cp95(messageDataI.getGIa15());
|
dataHarmphasicI.setI15Cp95(adjustPhase(messageDataI.getGIa15()));
|
||||||
dataHarmphasicI.setI16Cp95(messageDataI.getGIa16());
|
dataHarmphasicI.setI16Cp95(adjustPhase(messageDataI.getGIa16()));
|
||||||
dataHarmphasicI.setI17Cp95(messageDataI.getGIa17());
|
dataHarmphasicI.setI17Cp95(adjustPhase(messageDataI.getGIa17()));
|
||||||
dataHarmphasicI.setI18Cp95(messageDataI.getGIa18());
|
dataHarmphasicI.setI18Cp95(adjustPhase(messageDataI.getGIa18()));
|
||||||
dataHarmphasicI.setI19Cp95(messageDataI.getGIa19());
|
dataHarmphasicI.setI19Cp95(adjustPhase(messageDataI.getGIa19()));
|
||||||
dataHarmphasicI.setI20Cp95(messageDataI.getGIa20());
|
dataHarmphasicI.setI20Cp95(adjustPhase(messageDataI.getGIa20()));
|
||||||
dataHarmphasicI.setI21Cp95(messageDataI.getGIa21());
|
dataHarmphasicI.setI21Cp95(adjustPhase(messageDataI.getGIa21()));
|
||||||
dataHarmphasicI.setI22Cp95(messageDataI.getGIa22());
|
dataHarmphasicI.setI22Cp95(adjustPhase(messageDataI.getGIa22()));
|
||||||
dataHarmphasicI.setI23Cp95(messageDataI.getGIa23());
|
dataHarmphasicI.setI23Cp95(adjustPhase(messageDataI.getGIa23()));
|
||||||
dataHarmphasicI.setI24Cp95(messageDataI.getGIa24());
|
dataHarmphasicI.setI24Cp95(adjustPhase(messageDataI.getGIa24()));
|
||||||
dataHarmphasicI.setI25Cp95(messageDataI.getGIa25());
|
dataHarmphasicI.setI25Cp95(adjustPhase(messageDataI.getGIa25()));
|
||||||
dataHarmphasicI.setI26Cp95(messageDataI.getGIa26());
|
dataHarmphasicI.setI26Cp95(adjustPhase(messageDataI.getGIa26()));
|
||||||
dataHarmphasicI.setI27Cp95(messageDataI.getGIa27());
|
dataHarmphasicI.setI27Cp95(adjustPhase(messageDataI.getGIa27()));
|
||||||
dataHarmphasicI.setI28Cp95(messageDataI.getGIa28());
|
dataHarmphasicI.setI28Cp95(adjustPhase(messageDataI.getGIa28()));
|
||||||
dataHarmphasicI.setI29Cp95(messageDataI.getGIa29());
|
dataHarmphasicI.setI29Cp95(adjustPhase(messageDataI.getGIa29()));
|
||||||
dataHarmphasicI.setI30Cp95(messageDataI.getGIa30());
|
dataHarmphasicI.setI30Cp95(adjustPhase(messageDataI.getGIa30()));
|
||||||
dataHarmphasicI.setI31Cp95(messageDataI.getGIa31());
|
dataHarmphasicI.setI31Cp95(adjustPhase(messageDataI.getGIa31()));
|
||||||
dataHarmphasicI.setI32Cp95(messageDataI.getGIa32());
|
dataHarmphasicI.setI32Cp95(adjustPhase(messageDataI.getGIa32()));
|
||||||
dataHarmphasicI.setI33Cp95(messageDataI.getGIa33());
|
dataHarmphasicI.setI33Cp95(adjustPhase(messageDataI.getGIa33()));
|
||||||
dataHarmphasicI.setI34Cp95(messageDataI.getGIa34());
|
dataHarmphasicI.setI34Cp95(adjustPhase(messageDataI.getGIa34()));
|
||||||
dataHarmphasicI.setI35Cp95(messageDataI.getGIa35());
|
dataHarmphasicI.setI35Cp95(adjustPhase(messageDataI.getGIa35()));
|
||||||
dataHarmphasicI.setI36Cp95(messageDataI.getGIa36());
|
dataHarmphasicI.setI36Cp95(adjustPhase(messageDataI.getGIa36()));
|
||||||
dataHarmphasicI.setI37Cp95(messageDataI.getGIa37());
|
dataHarmphasicI.setI37Cp95(adjustPhase(messageDataI.getGIa37()));
|
||||||
dataHarmphasicI.setI38Cp95(messageDataI.getGIa38());
|
dataHarmphasicI.setI38Cp95(adjustPhase(messageDataI.getGIa38()));
|
||||||
dataHarmphasicI.setI39Cp95(messageDataI.getGIa39());
|
dataHarmphasicI.setI39Cp95(adjustPhase(messageDataI.getGIa39()));
|
||||||
dataHarmphasicI.setI40Cp95(messageDataI.getGIa40());
|
dataHarmphasicI.setI40Cp95(adjustPhase(messageDataI.getGIa40()));
|
||||||
dataHarmphasicI.setI41Cp95(messageDataI.getGIa41());
|
dataHarmphasicI.setI41Cp95(adjustPhase(messageDataI.getGIa41()));
|
||||||
dataHarmphasicI.setI42Cp95(messageDataI.getGIa42());
|
dataHarmphasicI.setI42Cp95(adjustPhase(messageDataI.getGIa42()));
|
||||||
dataHarmphasicI.setI43Cp95(messageDataI.getGIa43());
|
dataHarmphasicI.setI43Cp95(adjustPhase(messageDataI.getGIa43()));
|
||||||
dataHarmphasicI.setI44Cp95(messageDataI.getGIa44());
|
dataHarmphasicI.setI44Cp95(adjustPhase(messageDataI.getGIa44()));
|
||||||
dataHarmphasicI.setI45Cp95(messageDataI.getGIa45());
|
dataHarmphasicI.setI45Cp95(adjustPhase(messageDataI.getGIa45()));
|
||||||
dataHarmphasicI.setI46Cp95(messageDataI.getGIa46());
|
dataHarmphasicI.setI46Cp95(adjustPhase(messageDataI.getGIa46()));
|
||||||
dataHarmphasicI.setI47Cp95(messageDataI.getGIa47());
|
dataHarmphasicI.setI47Cp95(adjustPhase(messageDataI.getGIa47()));
|
||||||
dataHarmphasicI.setI48Cp95(messageDataI.getGIa48());
|
dataHarmphasicI.setI48Cp95(adjustPhase(messageDataI.getGIa48()));
|
||||||
dataHarmphasicI.setI49Cp95(messageDataI.getGIa49());
|
dataHarmphasicI.setI49Cp95(adjustPhase(messageDataI.getGIa49()));
|
||||||
dataHarmphasicI.setI50Cp95(messageDataI.getGIa50());
|
dataHarmphasicI.setI50Cp95(adjustPhase(messageDataI.getGIa50()));
|
||||||
|
|
||||||
}
|
}
|
||||||
return dataHarmphasicI;
|
return dataHarmphasicI;
|
||||||
|
|||||||
@@ -19,6 +19,28 @@ import java.util.Objects;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
public class BeanVConverter {
|
public class BeanVConverter {
|
||||||
|
/**
|
||||||
|
* 角度相关常量
|
||||||
|
*/
|
||||||
|
private static final double ANGLE_180 = 180.0;
|
||||||
|
private static final double ANGLE_360 = 360.0;
|
||||||
|
private static final double ANGLE_MINUS_180 = -180.0;
|
||||||
|
|
||||||
|
public static Double adjustPhase(Double phase) {
|
||||||
|
if (phase == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
// 使用模运算将角度标准化到[-180, 180]范围
|
||||||
|
double normalizedPhase = phase % ANGLE_360;
|
||||||
|
// 处理超出[-180, 180]范围的情况
|
||||||
|
if (normalizedPhase > ANGLE_180) {
|
||||||
|
normalizedPhase -= ANGLE_360;
|
||||||
|
} else if (normalizedPhase < ANGLE_MINUS_180) {
|
||||||
|
normalizedPhase += ANGLE_360;
|
||||||
|
}
|
||||||
|
|
||||||
|
return normalizedPhase;
|
||||||
|
}
|
||||||
//A,B,C三项
|
//A,B,C三项
|
||||||
public static DataVDTO messageDataVTODataV(MessageDataV messageDataV){
|
public static DataVDTO messageDataVTODataV(MessageDataV messageDataV){
|
||||||
DataVDTO dataVRelation = new DataVDTO();
|
DataVDTO dataVRelation = new DataVDTO();
|
||||||
@@ -561,209 +583,209 @@ public class BeanVConverter {
|
|||||||
public static DataHarmphasicVDTO messageDataVTODataHarmphasicV(MessageDataV messageDataV){
|
public static DataHarmphasicVDTO messageDataVTODataHarmphasicV(MessageDataV messageDataV){
|
||||||
DataHarmphasicVDTO dataHarmphasicV = new DataHarmphasicVDTO();
|
DataHarmphasicVDTO dataHarmphasicV = new DataHarmphasicVDTO();
|
||||||
if (Objects.nonNull(messageDataV)){
|
if (Objects.nonNull(messageDataV)){
|
||||||
dataHarmphasicV.setV1(messageDataV.getVfundAngle());
|
dataHarmphasicV.setV1(adjustPhase(messageDataV.getVfundAngle()));
|
||||||
dataHarmphasicV.setV2(messageDataV.getVa2());
|
dataHarmphasicV.setV2(adjustPhase(messageDataV.getVa2()));
|
||||||
dataHarmphasicV.setV3(messageDataV.getVa3());
|
dataHarmphasicV.setV3(adjustPhase(messageDataV.getVa3()));
|
||||||
dataHarmphasicV.setV4(messageDataV.getVa4());
|
dataHarmphasicV.setV4(adjustPhase(messageDataV.getVa4()));
|
||||||
dataHarmphasicV.setV5(messageDataV.getVa5());
|
dataHarmphasicV.setV5(adjustPhase(messageDataV.getVa5()));
|
||||||
dataHarmphasicV.setV6(messageDataV.getVa6());
|
dataHarmphasicV.setV6(adjustPhase(messageDataV.getVa6()));
|
||||||
dataHarmphasicV.setV7(messageDataV.getVa7());
|
dataHarmphasicV.setV7(adjustPhase(messageDataV.getVa7()));
|
||||||
dataHarmphasicV.setV8(messageDataV.getVa8());
|
dataHarmphasicV.setV8(adjustPhase(messageDataV.getVa8()));
|
||||||
dataHarmphasicV.setV9(messageDataV.getVa9());
|
dataHarmphasicV.setV9(adjustPhase(messageDataV.getVa9()));
|
||||||
dataHarmphasicV.setV10(messageDataV.getVa10());
|
dataHarmphasicV.setV10(adjustPhase(messageDataV.getVa10()));
|
||||||
dataHarmphasicV.setV11(messageDataV.getVa11());
|
dataHarmphasicV.setV11(adjustPhase(messageDataV.getVa11()));
|
||||||
dataHarmphasicV.setV12(messageDataV.getVa12());
|
dataHarmphasicV.setV12(adjustPhase(messageDataV.getVa12()));
|
||||||
dataHarmphasicV.setV13(messageDataV.getVa13());
|
dataHarmphasicV.setV13(adjustPhase(messageDataV.getVa13()));
|
||||||
dataHarmphasicV.setV14(messageDataV.getVa14());
|
dataHarmphasicV.setV14(adjustPhase(messageDataV.getVa14()));
|
||||||
dataHarmphasicV.setV15(messageDataV.getVa15());
|
dataHarmphasicV.setV15(adjustPhase(messageDataV.getVa15()));
|
||||||
dataHarmphasicV.setV16(messageDataV.getVa16());
|
dataHarmphasicV.setV16(adjustPhase(messageDataV.getVa16()));
|
||||||
dataHarmphasicV.setV17(messageDataV.getVa17());
|
dataHarmphasicV.setV17(adjustPhase(messageDataV.getVa17()));
|
||||||
dataHarmphasicV.setV18(messageDataV.getVa18());
|
dataHarmphasicV.setV18(adjustPhase(messageDataV.getVa18()));
|
||||||
dataHarmphasicV.setV19(messageDataV.getVa19());
|
dataHarmphasicV.setV19(adjustPhase(messageDataV.getVa19()));
|
||||||
dataHarmphasicV.setV20(messageDataV.getVa20());
|
dataHarmphasicV.setV20(adjustPhase(messageDataV.getVa20()));
|
||||||
dataHarmphasicV.setV21(messageDataV.getVa21());
|
dataHarmphasicV.setV21(adjustPhase(messageDataV.getVa21()));
|
||||||
dataHarmphasicV.setV22(messageDataV.getVa22());
|
dataHarmphasicV.setV22(adjustPhase(messageDataV.getVa22()));
|
||||||
dataHarmphasicV.setV23(messageDataV.getVa23());
|
dataHarmphasicV.setV23(adjustPhase(messageDataV.getVa23()));
|
||||||
dataHarmphasicV.setV24(messageDataV.getVa24());
|
dataHarmphasicV.setV24(adjustPhase(messageDataV.getVa24()));
|
||||||
dataHarmphasicV.setV25(messageDataV.getVa25());
|
dataHarmphasicV.setV25(adjustPhase(messageDataV.getVa25()));
|
||||||
dataHarmphasicV.setV26(messageDataV.getVa26());
|
dataHarmphasicV.setV26(adjustPhase(messageDataV.getVa26()));
|
||||||
dataHarmphasicV.setV27(messageDataV.getVa27());
|
dataHarmphasicV.setV27(adjustPhase(messageDataV.getVa27()));
|
||||||
dataHarmphasicV.setV28(messageDataV.getVa28());
|
dataHarmphasicV.setV28(adjustPhase(messageDataV.getVa28()));
|
||||||
dataHarmphasicV.setV29(messageDataV.getVa29());
|
dataHarmphasicV.setV29(adjustPhase(messageDataV.getVa29()));
|
||||||
dataHarmphasicV.setV30(messageDataV.getVa30());
|
dataHarmphasicV.setV30(adjustPhase(messageDataV.getVa30()));
|
||||||
dataHarmphasicV.setV31(messageDataV.getVa31());
|
dataHarmphasicV.setV31(adjustPhase(messageDataV.getVa31()));
|
||||||
dataHarmphasicV.setV32(messageDataV.getVa32());
|
dataHarmphasicV.setV32(adjustPhase(messageDataV.getVa32()));
|
||||||
dataHarmphasicV.setV33(messageDataV.getVa33());
|
dataHarmphasicV.setV33(adjustPhase(messageDataV.getVa33()));
|
||||||
dataHarmphasicV.setV34(messageDataV.getVa34());
|
dataHarmphasicV.setV34(adjustPhase(messageDataV.getVa34()));
|
||||||
dataHarmphasicV.setV35(messageDataV.getVa35());
|
dataHarmphasicV.setV35(adjustPhase(messageDataV.getVa35()));
|
||||||
dataHarmphasicV.setV36(messageDataV.getVa36());
|
dataHarmphasicV.setV36(adjustPhase(messageDataV.getVa36()));
|
||||||
dataHarmphasicV.setV37(messageDataV.getVa37());
|
dataHarmphasicV.setV37(adjustPhase(messageDataV.getVa37()));
|
||||||
dataHarmphasicV.setV38(messageDataV.getVa38());
|
dataHarmphasicV.setV38(adjustPhase(messageDataV.getVa38()));
|
||||||
dataHarmphasicV.setV39(messageDataV.getVa39());
|
dataHarmphasicV.setV39(adjustPhase(messageDataV.getVa39()));
|
||||||
dataHarmphasicV.setV40(messageDataV.getVa40());
|
dataHarmphasicV.setV40(adjustPhase(messageDataV.getVa40()));
|
||||||
dataHarmphasicV.setV41(messageDataV.getVa41());
|
dataHarmphasicV.setV41(adjustPhase(messageDataV.getVa41()));
|
||||||
dataHarmphasicV.setV42(messageDataV.getVa42());
|
dataHarmphasicV.setV42(adjustPhase(messageDataV.getVa42()));
|
||||||
dataHarmphasicV.setV43(messageDataV.getVa43());
|
dataHarmphasicV.setV43(adjustPhase(messageDataV.getVa43()));
|
||||||
dataHarmphasicV.setV44(messageDataV.getVa44());
|
dataHarmphasicV.setV44(adjustPhase(messageDataV.getVa44()));
|
||||||
dataHarmphasicV.setV45(messageDataV.getVa45());
|
dataHarmphasicV.setV45(adjustPhase(messageDataV.getVa45()));
|
||||||
dataHarmphasicV.setV46(messageDataV.getVa46());
|
dataHarmphasicV.setV46(adjustPhase(messageDataV.getVa46()));
|
||||||
dataHarmphasicV.setV47(messageDataV.getVa47());
|
dataHarmphasicV.setV47(adjustPhase(messageDataV.getVa47()));
|
||||||
dataHarmphasicV.setV48(messageDataV.getVa48());
|
dataHarmphasicV.setV48(adjustPhase(messageDataV.getVa48()));
|
||||||
dataHarmphasicV.setV49(messageDataV.getVa49());
|
dataHarmphasicV.setV49(adjustPhase(messageDataV.getVa49()));
|
||||||
dataHarmphasicV.setV50(messageDataV.getVa50());
|
dataHarmphasicV.setV50(adjustPhase(messageDataV.getVa50()));
|
||||||
|
|
||||||
dataHarmphasicV.setV1Max(messageDataV.getMaxVfundAngle());
|
dataHarmphasicV.setV1Max(adjustPhase(messageDataV.getMaxVfundAngle()));
|
||||||
dataHarmphasicV.setV2Max(messageDataV.getMaxVa2());
|
dataHarmphasicV.setV2Max(adjustPhase(messageDataV.getMaxVa2()));
|
||||||
dataHarmphasicV.setV3Max(messageDataV.getMaxVa3());
|
dataHarmphasicV.setV3Max(adjustPhase(messageDataV.getMaxVa3()));
|
||||||
dataHarmphasicV.setV4Max(messageDataV.getMaxVa4());
|
dataHarmphasicV.setV4Max(adjustPhase(messageDataV.getMaxVa4()));
|
||||||
dataHarmphasicV.setV5Max(messageDataV.getMaxVa5());
|
dataHarmphasicV.setV5Max(adjustPhase(messageDataV.getMaxVa5()));
|
||||||
dataHarmphasicV.setV6Max(messageDataV.getMaxVa6());
|
dataHarmphasicV.setV6Max(adjustPhase(messageDataV.getMaxVa6()));
|
||||||
dataHarmphasicV.setV7Max(messageDataV.getMaxVa7());
|
dataHarmphasicV.setV7Max(adjustPhase(messageDataV.getMaxVa7()));
|
||||||
dataHarmphasicV.setV8Max(messageDataV.getMaxVa8());
|
dataHarmphasicV.setV8Max(adjustPhase(messageDataV.getMaxVa8()));
|
||||||
dataHarmphasicV.setV9Max(messageDataV.getMaxVa9());
|
dataHarmphasicV.setV9Max(adjustPhase(messageDataV.getMaxVa9()));
|
||||||
dataHarmphasicV.setV10Max(messageDataV.getMaxVa10());
|
dataHarmphasicV.setV10Max(adjustPhase(messageDataV.getMaxVa10()));
|
||||||
dataHarmphasicV.setV11Max(messageDataV.getMaxVa11());
|
dataHarmphasicV.setV11Max(adjustPhase(messageDataV.getMaxVa11()));
|
||||||
dataHarmphasicV.setV12Max(messageDataV.getMaxVa12());
|
dataHarmphasicV.setV12Max(adjustPhase(messageDataV.getMaxVa12()));
|
||||||
dataHarmphasicV.setV13Max(messageDataV.getMaxVa13());
|
dataHarmphasicV.setV13Max(adjustPhase(messageDataV.getMaxVa13()));
|
||||||
dataHarmphasicV.setV14Max(messageDataV.getMaxVa14());
|
dataHarmphasicV.setV14Max(adjustPhase(messageDataV.getMaxVa14()));
|
||||||
dataHarmphasicV.setV15Max(messageDataV.getMaxVa15());
|
dataHarmphasicV.setV15Max(adjustPhase(messageDataV.getMaxVa15()));
|
||||||
dataHarmphasicV.setV16Max(messageDataV.getMaxVa16());
|
dataHarmphasicV.setV16Max(adjustPhase(messageDataV.getMaxVa16()));
|
||||||
dataHarmphasicV.setV17Max(messageDataV.getMaxVa17());
|
dataHarmphasicV.setV17Max(adjustPhase(messageDataV.getMaxVa17()));
|
||||||
dataHarmphasicV.setV18Max(messageDataV.getMaxVa18());
|
dataHarmphasicV.setV18Max(adjustPhase(messageDataV.getMaxVa18()));
|
||||||
dataHarmphasicV.setV19Max(messageDataV.getMaxVa19());
|
dataHarmphasicV.setV19Max(adjustPhase(messageDataV.getMaxVa19()));
|
||||||
dataHarmphasicV.setV20Max(messageDataV.getMaxVa20());
|
dataHarmphasicV.setV20Max(adjustPhase(messageDataV.getMaxVa20()));
|
||||||
dataHarmphasicV.setV21Max(messageDataV.getMaxVa21());
|
dataHarmphasicV.setV21Max(adjustPhase(messageDataV.getMaxVa21()));
|
||||||
dataHarmphasicV.setV22Max(messageDataV.getMaxVa22());
|
dataHarmphasicV.setV22Max(adjustPhase(messageDataV.getMaxVa22()));
|
||||||
dataHarmphasicV.setV23Max(messageDataV.getMaxVa23());
|
dataHarmphasicV.setV23Max(adjustPhase(messageDataV.getMaxVa23()));
|
||||||
dataHarmphasicV.setV24Max(messageDataV.getMaxVa24());
|
dataHarmphasicV.setV24Max(adjustPhase(messageDataV.getMaxVa24()));
|
||||||
dataHarmphasicV.setV25Max(messageDataV.getMaxVa25());
|
dataHarmphasicV.setV25Max(adjustPhase(messageDataV.getMaxVa25()));
|
||||||
dataHarmphasicV.setV26Max(messageDataV.getMaxVa26());
|
dataHarmphasicV.setV26Max(adjustPhase(messageDataV.getMaxVa26()));
|
||||||
dataHarmphasicV.setV27Max(messageDataV.getMaxVa27());
|
dataHarmphasicV.setV27Max(adjustPhase(messageDataV.getMaxVa27()));
|
||||||
dataHarmphasicV.setV28Max(messageDataV.getMaxVa28());
|
dataHarmphasicV.setV28Max(adjustPhase(messageDataV.getMaxVa28()));
|
||||||
dataHarmphasicV.setV29Max(messageDataV.getMaxVa29());
|
dataHarmphasicV.setV29Max(adjustPhase(messageDataV.getMaxVa29()));
|
||||||
dataHarmphasicV.setV30Max(messageDataV.getMaxVa30());
|
dataHarmphasicV.setV30Max(adjustPhase(messageDataV.getMaxVa30()));
|
||||||
dataHarmphasicV.setV31Max(messageDataV.getMaxVa31());
|
dataHarmphasicV.setV31Max(adjustPhase(messageDataV.getMaxVa31()));
|
||||||
dataHarmphasicV.setV32Max(messageDataV.getMaxVa32());
|
dataHarmphasicV.setV32Max(adjustPhase(messageDataV.getMaxVa32()));
|
||||||
dataHarmphasicV.setV33Max(messageDataV.getMaxVa33());
|
dataHarmphasicV.setV33Max(adjustPhase(messageDataV.getMaxVa33()));
|
||||||
dataHarmphasicV.setV34Max(messageDataV.getMaxVa34());
|
dataHarmphasicV.setV34Max(adjustPhase(messageDataV.getMaxVa34()));
|
||||||
dataHarmphasicV.setV35Max(messageDataV.getMaxVa35());
|
dataHarmphasicV.setV35Max(adjustPhase(messageDataV.getMaxVa35()));
|
||||||
dataHarmphasicV.setV36Max(messageDataV.getMaxVa36());
|
dataHarmphasicV.setV36Max(adjustPhase(messageDataV.getMaxVa36()));
|
||||||
dataHarmphasicV.setV37Max(messageDataV.getMaxVa37());
|
dataHarmphasicV.setV37Max(adjustPhase(messageDataV.getMaxVa37()));
|
||||||
dataHarmphasicV.setV38Max(messageDataV.getMaxVa38());
|
dataHarmphasicV.setV38Max(adjustPhase(messageDataV.getMaxVa38()));
|
||||||
dataHarmphasicV.setV39Max(messageDataV.getMaxVa39());
|
dataHarmphasicV.setV39Max(adjustPhase(messageDataV.getMaxVa39()));
|
||||||
dataHarmphasicV.setV40Max(messageDataV.getMaxVa40());
|
dataHarmphasicV.setV40Max(adjustPhase(messageDataV.getMaxVa40()));
|
||||||
dataHarmphasicV.setV41Max(messageDataV.getMaxVa41());
|
dataHarmphasicV.setV41Max(adjustPhase(messageDataV.getMaxVa41()));
|
||||||
dataHarmphasicV.setV42Max(messageDataV.getMaxVa42());
|
dataHarmphasicV.setV42Max(adjustPhase(messageDataV.getMaxVa42()));
|
||||||
dataHarmphasicV.setV43Max(messageDataV.getMaxVa43());
|
dataHarmphasicV.setV43Max(adjustPhase(messageDataV.getMaxVa43()));
|
||||||
dataHarmphasicV.setV44Max(messageDataV.getMaxVa44());
|
dataHarmphasicV.setV44Max(adjustPhase(messageDataV.getMaxVa44()));
|
||||||
dataHarmphasicV.setV45Max(messageDataV.getMaxVa45());
|
dataHarmphasicV.setV45Max(adjustPhase(messageDataV.getMaxVa45()));
|
||||||
dataHarmphasicV.setV46Max(messageDataV.getMaxVa46());
|
dataHarmphasicV.setV46Max(adjustPhase(messageDataV.getMaxVa46()));
|
||||||
dataHarmphasicV.setV47Max(messageDataV.getMaxVa47());
|
dataHarmphasicV.setV47Max(adjustPhase(messageDataV.getMaxVa47()));
|
||||||
dataHarmphasicV.setV48Max(messageDataV.getMaxVa48());
|
dataHarmphasicV.setV48Max(adjustPhase(messageDataV.getMaxVa48()));
|
||||||
dataHarmphasicV.setV49Max(messageDataV.getMaxVa49());
|
dataHarmphasicV.setV49Max(adjustPhase(messageDataV.getMaxVa49()));
|
||||||
dataHarmphasicV.setV50Max(messageDataV.getMaxVa50());
|
dataHarmphasicV.setV50Max(adjustPhase(messageDataV.getMaxVa50()));
|
||||||
|
|
||||||
dataHarmphasicV.setV1Min(messageDataV.getMinVfundAngle());
|
dataHarmphasicV.setV1Min(adjustPhase(messageDataV.getMinVfundAngle()));
|
||||||
dataHarmphasicV.setV2Min(messageDataV.getMinVa2());
|
dataHarmphasicV.setV2Min(adjustPhase(messageDataV.getMinVa2()));
|
||||||
dataHarmphasicV.setV3Min(messageDataV.getMinVa3());
|
dataHarmphasicV.setV3Min(adjustPhase(messageDataV.getMinVa3()));
|
||||||
dataHarmphasicV.setV4Min(messageDataV.getMinVa4());
|
dataHarmphasicV.setV4Min(adjustPhase(messageDataV.getMinVa4()));
|
||||||
dataHarmphasicV.setV5Min(messageDataV.getMinVa5());
|
dataHarmphasicV.setV5Min(adjustPhase(messageDataV.getMinVa5()));
|
||||||
dataHarmphasicV.setV6Min(messageDataV.getMinVa6());
|
dataHarmphasicV.setV6Min(adjustPhase(messageDataV.getMinVa6()));
|
||||||
dataHarmphasicV.setV7Min(messageDataV.getMinVa7());
|
dataHarmphasicV.setV7Min(adjustPhase(messageDataV.getMinVa7()));
|
||||||
dataHarmphasicV.setV8Min(messageDataV.getMinVa8());
|
dataHarmphasicV.setV8Min(adjustPhase(messageDataV.getMinVa8()));
|
||||||
dataHarmphasicV.setV9Min(messageDataV.getMinVa9());
|
dataHarmphasicV.setV9Min(adjustPhase(messageDataV.getMinVa9()));
|
||||||
dataHarmphasicV.setV10Min(messageDataV.getMinVa10());
|
dataHarmphasicV.setV10Min(adjustPhase(messageDataV.getMinVa10()));
|
||||||
dataHarmphasicV.setV11Min(messageDataV.getMinVa11());
|
dataHarmphasicV.setV11Min(adjustPhase(messageDataV.getMinVa11()));
|
||||||
dataHarmphasicV.setV12Min(messageDataV.getMinVa12());
|
dataHarmphasicV.setV12Min(adjustPhase(messageDataV.getMinVa12()));
|
||||||
dataHarmphasicV.setV13Min(messageDataV.getMinVa13());
|
dataHarmphasicV.setV13Min(adjustPhase(messageDataV.getMinVa13()));
|
||||||
dataHarmphasicV.setV14Min(messageDataV.getMinVa14());
|
dataHarmphasicV.setV14Min(adjustPhase(messageDataV.getMinVa14()));
|
||||||
dataHarmphasicV.setV15Min(messageDataV.getMinVa15());
|
dataHarmphasicV.setV15Min(adjustPhase(messageDataV.getMinVa15()));
|
||||||
dataHarmphasicV.setV16Min(messageDataV.getMinVa16());
|
dataHarmphasicV.setV16Min(adjustPhase(messageDataV.getMinVa16()));
|
||||||
dataHarmphasicV.setV17Min(messageDataV.getMinVa17());
|
dataHarmphasicV.setV17Min(adjustPhase(messageDataV.getMinVa17()));
|
||||||
dataHarmphasicV.setV18Min(messageDataV.getMinVa18());
|
dataHarmphasicV.setV18Min(adjustPhase(messageDataV.getMinVa18()));
|
||||||
dataHarmphasicV.setV19Min(messageDataV.getMinVa19());
|
dataHarmphasicV.setV19Min(adjustPhase(messageDataV.getMinVa19()));
|
||||||
dataHarmphasicV.setV20Min(messageDataV.getMinVa20());
|
dataHarmphasicV.setV20Min(adjustPhase(messageDataV.getMinVa20()));
|
||||||
dataHarmphasicV.setV21Min(messageDataV.getMinVa21());
|
dataHarmphasicV.setV21Min(adjustPhase(messageDataV.getMinVa21()));
|
||||||
dataHarmphasicV.setV22Min(messageDataV.getMinVa22());
|
dataHarmphasicV.setV22Min(adjustPhase(messageDataV.getMinVa22()));
|
||||||
dataHarmphasicV.setV23Min(messageDataV.getMinVa23());
|
dataHarmphasicV.setV23Min(adjustPhase(messageDataV.getMinVa23()));
|
||||||
dataHarmphasicV.setV24Min(messageDataV.getMinVa24());
|
dataHarmphasicV.setV24Min(adjustPhase(messageDataV.getMinVa24()));
|
||||||
dataHarmphasicV.setV25Min(messageDataV.getMinVa25());
|
dataHarmphasicV.setV25Min(adjustPhase(messageDataV.getMinVa25()));
|
||||||
dataHarmphasicV.setV26Min(messageDataV.getMinVa26());
|
dataHarmphasicV.setV26Min(adjustPhase(messageDataV.getMinVa26()));
|
||||||
dataHarmphasicV.setV27Min(messageDataV.getMinVa27());
|
dataHarmphasicV.setV27Min(adjustPhase(messageDataV.getMinVa27()));
|
||||||
dataHarmphasicV.setV28Min(messageDataV.getMinVa28());
|
dataHarmphasicV.setV28Min(adjustPhase(messageDataV.getMinVa28()));
|
||||||
dataHarmphasicV.setV29Min(messageDataV.getMinVa29());
|
dataHarmphasicV.setV29Min(adjustPhase(messageDataV.getMinVa29()));
|
||||||
dataHarmphasicV.setV30Min(messageDataV.getMinVa30());
|
dataHarmphasicV.setV30Min(adjustPhase(messageDataV.getMinVa30()));
|
||||||
dataHarmphasicV.setV31Min(messageDataV.getMinVa31());
|
dataHarmphasicV.setV31Min(adjustPhase(messageDataV.getMinVa31()));
|
||||||
dataHarmphasicV.setV32Min(messageDataV.getMinVa32());
|
dataHarmphasicV.setV32Min(adjustPhase(messageDataV.getMinVa32()));
|
||||||
dataHarmphasicV.setV33Min(messageDataV.getMinVa33());
|
dataHarmphasicV.setV33Min(adjustPhase(messageDataV.getMinVa33()));
|
||||||
dataHarmphasicV.setV34Min(messageDataV.getMinVa34());
|
dataHarmphasicV.setV34Min(adjustPhase(messageDataV.getMinVa34()));
|
||||||
dataHarmphasicV.setV35Min(messageDataV.getMinVa35());
|
dataHarmphasicV.setV35Min(adjustPhase(messageDataV.getMinVa35()));
|
||||||
dataHarmphasicV.setV36Min(messageDataV.getMinVa36());
|
dataHarmphasicV.setV36Min(adjustPhase(messageDataV.getMinVa36()));
|
||||||
dataHarmphasicV.setV37Min(messageDataV.getMinVa37());
|
dataHarmphasicV.setV37Min(adjustPhase(messageDataV.getMinVa37()));
|
||||||
dataHarmphasicV.setV38Min(messageDataV.getMinVa38());
|
dataHarmphasicV.setV38Min(adjustPhase(messageDataV.getMinVa38()));
|
||||||
dataHarmphasicV.setV39Min(messageDataV.getMinVa39());
|
dataHarmphasicV.setV39Min(adjustPhase(messageDataV.getMinVa39()));
|
||||||
dataHarmphasicV.setV40Min(messageDataV.getMinVa40());
|
dataHarmphasicV.setV40Min(adjustPhase(messageDataV.getMinVa40()));
|
||||||
dataHarmphasicV.setV41Min(messageDataV.getMinVa41());
|
dataHarmphasicV.setV41Min(adjustPhase(messageDataV.getMinVa41()));
|
||||||
dataHarmphasicV.setV42Min(messageDataV.getMinVa42());
|
dataHarmphasicV.setV42Min(adjustPhase(messageDataV.getMinVa42()));
|
||||||
dataHarmphasicV.setV43Min(messageDataV.getMinVa43());
|
dataHarmphasicV.setV43Min(adjustPhase(messageDataV.getMinVa43()));
|
||||||
dataHarmphasicV.setV44Min(messageDataV.getMinVa44());
|
dataHarmphasicV.setV44Min(adjustPhase(messageDataV.getMinVa44()));
|
||||||
dataHarmphasicV.setV45Min(messageDataV.getMinVa45());
|
dataHarmphasicV.setV45Min(adjustPhase(messageDataV.getMinVa45()));
|
||||||
dataHarmphasicV.setV46Min(messageDataV.getMinVa46());
|
dataHarmphasicV.setV46Min(adjustPhase(messageDataV.getMinVa46()));
|
||||||
dataHarmphasicV.setV47Min(messageDataV.getMinVa47());
|
dataHarmphasicV.setV47Min(adjustPhase(messageDataV.getMinVa47()));
|
||||||
dataHarmphasicV.setV48Min(messageDataV.getMinVa48());
|
dataHarmphasicV.setV48Min(adjustPhase(messageDataV.getMinVa48()));
|
||||||
dataHarmphasicV.setV49Min(messageDataV.getMinVa49());
|
dataHarmphasicV.setV49Min(adjustPhase(messageDataV.getMinVa49()));
|
||||||
dataHarmphasicV.setV50Min(messageDataV.getMinVa50());
|
dataHarmphasicV.setV50Min(adjustPhase(messageDataV.getMinVa50()));
|
||||||
|
|
||||||
dataHarmphasicV.setV1Cp95(messageDataV.getGVfundAngle());
|
dataHarmphasicV.setV1Cp95(adjustPhase(messageDataV.getGVfundAngle()));
|
||||||
dataHarmphasicV.setV2Cp95(messageDataV.getGVa2());
|
dataHarmphasicV.setV2Cp95(adjustPhase(messageDataV.getGVa2()));
|
||||||
dataHarmphasicV.setV3Cp95(messageDataV.getGVa3());
|
dataHarmphasicV.setV3Cp95(adjustPhase(messageDataV.getGVa3()));
|
||||||
dataHarmphasicV.setV4Cp95(messageDataV.getGVa4());
|
dataHarmphasicV.setV4Cp95(adjustPhase(messageDataV.getGVa4()));
|
||||||
dataHarmphasicV.setV5Cp95(messageDataV.getGVa5());
|
dataHarmphasicV.setV5Cp95(adjustPhase(messageDataV.getGVa5()));
|
||||||
dataHarmphasicV.setV6Cp95(messageDataV.getGVa6());
|
dataHarmphasicV.setV6Cp95(adjustPhase(messageDataV.getGVa6()));
|
||||||
dataHarmphasicV.setV7Cp95(messageDataV.getGVa7());
|
dataHarmphasicV.setV7Cp95(adjustPhase(messageDataV.getGVa7()));
|
||||||
dataHarmphasicV.setV8Cp95(messageDataV.getGVa8());
|
dataHarmphasicV.setV8Cp95(adjustPhase(messageDataV.getGVa8()));
|
||||||
dataHarmphasicV.setV9Cp95(messageDataV.getGVa9());
|
dataHarmphasicV.setV9Cp95(adjustPhase(messageDataV.getGVa9()));
|
||||||
dataHarmphasicV.setV10Cp95(messageDataV.getGVa10());
|
dataHarmphasicV.setV10Cp95(adjustPhase(messageDataV.getGVa10()));
|
||||||
dataHarmphasicV.setV11Cp95(messageDataV.getGVa11());
|
dataHarmphasicV.setV11Cp95(adjustPhase(messageDataV.getGVa11()));
|
||||||
dataHarmphasicV.setV12Cp95(messageDataV.getGVa12());
|
dataHarmphasicV.setV12Cp95(adjustPhase(messageDataV.getGVa12()));
|
||||||
dataHarmphasicV.setV13Cp95(messageDataV.getGVa13());
|
dataHarmphasicV.setV13Cp95(adjustPhase(messageDataV.getGVa13()));
|
||||||
dataHarmphasicV.setV14Cp95(messageDataV.getGVa14());
|
dataHarmphasicV.setV14Cp95(adjustPhase(messageDataV.getGVa14()));
|
||||||
dataHarmphasicV.setV15Cp95(messageDataV.getGVa15());
|
dataHarmphasicV.setV15Cp95(adjustPhase(messageDataV.getGVa15()));
|
||||||
dataHarmphasicV.setV16Cp95(messageDataV.getGVa16());
|
dataHarmphasicV.setV16Cp95(adjustPhase(messageDataV.getGVa16()));
|
||||||
dataHarmphasicV.setV17Cp95(messageDataV.getGVa17());
|
dataHarmphasicV.setV17Cp95(adjustPhase(messageDataV.getGVa17()));
|
||||||
dataHarmphasicV.setV18Cp95(messageDataV.getGVa18());
|
dataHarmphasicV.setV18Cp95(adjustPhase(messageDataV.getGVa18()));
|
||||||
dataHarmphasicV.setV19Cp95(messageDataV.getGVa19());
|
dataHarmphasicV.setV19Cp95(adjustPhase(messageDataV.getGVa19()));
|
||||||
dataHarmphasicV.setV20Cp95(messageDataV.getGVa20());
|
dataHarmphasicV.setV20Cp95(adjustPhase(messageDataV.getGVa20()));
|
||||||
dataHarmphasicV.setV21Cp95(messageDataV.getGVa21());
|
dataHarmphasicV.setV21Cp95(adjustPhase(messageDataV.getGVa21()));
|
||||||
dataHarmphasicV.setV22Cp95(messageDataV.getGVa22());
|
dataHarmphasicV.setV22Cp95(adjustPhase(messageDataV.getGVa22()));
|
||||||
dataHarmphasicV.setV23Cp95(messageDataV.getGVa23());
|
dataHarmphasicV.setV23Cp95(adjustPhase(messageDataV.getGVa23()));
|
||||||
dataHarmphasicV.setV24Cp95(messageDataV.getGVa24());
|
dataHarmphasicV.setV24Cp95(adjustPhase(messageDataV.getGVa24()));
|
||||||
dataHarmphasicV.setV25Cp95(messageDataV.getGVa25());
|
dataHarmphasicV.setV25Cp95(adjustPhase(messageDataV.getGVa25()));
|
||||||
dataHarmphasicV.setV26Cp95(messageDataV.getGVa26());
|
dataHarmphasicV.setV26Cp95(adjustPhase(messageDataV.getGVa26()));
|
||||||
dataHarmphasicV.setV27Cp95(messageDataV.getGVa27());
|
dataHarmphasicV.setV27Cp95(adjustPhase(messageDataV.getGVa27()));
|
||||||
dataHarmphasicV.setV28Cp95(messageDataV.getGVa28());
|
dataHarmphasicV.setV28Cp95(adjustPhase(messageDataV.getGVa28()));
|
||||||
dataHarmphasicV.setV29Cp95(messageDataV.getGVa29());
|
dataHarmphasicV.setV29Cp95(adjustPhase(messageDataV.getGVa29()));
|
||||||
dataHarmphasicV.setV30Cp95(messageDataV.getGVa30());
|
dataHarmphasicV.setV30Cp95(adjustPhase(messageDataV.getGVa30()));
|
||||||
dataHarmphasicV.setV31Cp95(messageDataV.getGVa31());
|
dataHarmphasicV.setV31Cp95(adjustPhase(messageDataV.getGVa31()));
|
||||||
dataHarmphasicV.setV32Cp95(messageDataV.getGVa32());
|
dataHarmphasicV.setV32Cp95(adjustPhase(messageDataV.getGVa32()));
|
||||||
dataHarmphasicV.setV33Cp95(messageDataV.getGVa33());
|
dataHarmphasicV.setV33Cp95(adjustPhase(messageDataV.getGVa33()));
|
||||||
dataHarmphasicV.setV34Cp95(messageDataV.getGVa34());
|
dataHarmphasicV.setV34Cp95(adjustPhase(messageDataV.getGVa34()));
|
||||||
dataHarmphasicV.setV35Cp95(messageDataV.getGVa35());
|
dataHarmphasicV.setV35Cp95(adjustPhase(messageDataV.getGVa35()));
|
||||||
dataHarmphasicV.setV36Cp95(messageDataV.getGVa36());
|
dataHarmphasicV.setV36Cp95(adjustPhase(messageDataV.getGVa36()));
|
||||||
dataHarmphasicV.setV37Cp95(messageDataV.getGVa37());
|
dataHarmphasicV.setV37Cp95(adjustPhase(messageDataV.getGVa37()));
|
||||||
dataHarmphasicV.setV38Cp95(messageDataV.getGVa38());
|
dataHarmphasicV.setV38Cp95(adjustPhase(messageDataV.getGVa38()));
|
||||||
dataHarmphasicV.setV39Cp95(messageDataV.getGVa39());
|
dataHarmphasicV.setV39Cp95(adjustPhase(messageDataV.getGVa39()));
|
||||||
dataHarmphasicV.setV40Cp95(messageDataV.getGVa40());
|
dataHarmphasicV.setV40Cp95(adjustPhase(messageDataV.getGVa40()));
|
||||||
dataHarmphasicV.setV41Cp95(messageDataV.getGVa41());
|
dataHarmphasicV.setV41Cp95(adjustPhase(messageDataV.getGVa41()));
|
||||||
dataHarmphasicV.setV42Cp95(messageDataV.getGVa42());
|
dataHarmphasicV.setV42Cp95(adjustPhase(messageDataV.getGVa42()));
|
||||||
dataHarmphasicV.setV43Cp95(messageDataV.getGVa43());
|
dataHarmphasicV.setV43Cp95(adjustPhase(messageDataV.getGVa43()));
|
||||||
dataHarmphasicV.setV44Cp95(messageDataV.getGVa44());
|
dataHarmphasicV.setV44Cp95(adjustPhase(messageDataV.getGVa44()));
|
||||||
dataHarmphasicV.setV45Cp95(messageDataV.getGVa45());
|
dataHarmphasicV.setV45Cp95(adjustPhase(messageDataV.getGVa45()));
|
||||||
dataHarmphasicV.setV46Cp95(messageDataV.getGVa46());
|
dataHarmphasicV.setV46Cp95(adjustPhase(messageDataV.getGVa46()));
|
||||||
dataHarmphasicV.setV47Cp95(messageDataV.getGVa47());
|
dataHarmphasicV.setV47Cp95(adjustPhase(messageDataV.getGVa47()));
|
||||||
dataHarmphasicV.setV48Cp95(messageDataV.getGVa48());
|
dataHarmphasicV.setV48Cp95(adjustPhase(messageDataV.getGVa48()));
|
||||||
dataHarmphasicV.setV49Cp95(messageDataV.getGVa49());
|
dataHarmphasicV.setV49Cp95(adjustPhase(messageDataV.getGVa49()));
|
||||||
dataHarmphasicV.setV50Cp95(messageDataV.getGVa50());
|
dataHarmphasicV.setV50Cp95(adjustPhase(messageDataV.getGVa50()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -980,4 +1002,5 @@ public class BeanVConverter {
|
|||||||
|
|
||||||
return dataHarmrateVDTO;
|
return dataHarmrateVDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
52
analysis/stat/stat-boot/src/main/resources/bootstrap-jb.yml
Normal file
52
analysis/stat/stat-boot/src/main/resources/bootstrap-jb.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10404
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
config:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10404
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
ip: @service.server.url@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
config:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: data-platform.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
@@ -1,53 +1,3 @@
|
|||||||
#当前服务的基本信息
|
|
||||||
microservice:
|
|
||||||
ename: @artifactId@
|
|
||||||
name: '@name@'
|
|
||||||
version: @version@
|
|
||||||
sentinel:
|
|
||||||
url: @sentinel.url@
|
|
||||||
gateway:
|
|
||||||
url: @gateway.url@
|
|
||||||
server:
|
|
||||||
port: 10404
|
|
||||||
#feign接口开启服务熔断降级处理
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
profiles:
|
||||||
name: @artifactId@
|
active: @spring.profiles.active@
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
ip: @service.server.url@
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
config:
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
file-extension: yaml
|
|
||||||
shared-configs:
|
|
||||||
- data-id: share-config.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: share-config-datasource-db.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: data-platform.yaml
|
|
||||||
refresh: true
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
|
||||||
logging:
|
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
|
||||||
level:
|
|
||||||
root: info
|
|
||||||
|
|
||||||
|
|
||||||
#mybatis配置信息
|
|
||||||
mybatis-plus:
|
|
||||||
#别名扫描
|
|
||||||
type-aliases-package: com.njcn.harmonic.pojo
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
client-id: @artifactId@${random.value}
|
|
||||||
@@ -68,4 +68,8 @@ public interface DataVFeignClient {
|
|||||||
//按时间分组获取原始数据
|
//按时间分组获取原始数据
|
||||||
@PostMapping("/getGroupByTimeDataV")
|
@PostMapping("/getGroupByTimeDataV")
|
||||||
HttpResult<List<DataVDto>> getGroupByTimeDataV(@RequestBody LineCountEvaluateParam lineParam);
|
HttpResult<List<DataVDto>> getGroupByTimeDataV(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/excludeZeroData")
|
||||||
|
HttpResult<Boolean> excludeZeroData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.dataProcess.api;
|
||||||
|
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.dataProcess.api.fallback.PqDataVerifyNewFeignClientFallbackFactory;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
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
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2025年02月13日 20:11
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/pqDataVerifyCount", fallbackFactory = PqDataVerifyNewFeignClientFallbackFactory.class, contextId = "pqDataVerifyNew")
|
||||||
|
public interface PqDataVerifyCountFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/insertDataBatch")
|
||||||
|
HttpResult<List<String>> insertDataBatch(@RequestBody List<PqDataVerifyCount> list);
|
||||||
|
|
||||||
|
@PostMapping("/insertData")
|
||||||
|
HttpResult<List<String>> insertData(@RequestBody PqDataVerifyCount pqDataVerifyCount);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -116,6 +116,12 @@ public class DataVFeignClientFallbackFactory implements FallbackFactory<DataVFei
|
|||||||
log.error("{}异常,降级处理,异常为:{}","DataV按时间分组获取原始数据",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","DataV按时间分组获取原始数据",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Boolean> excludeZeroData(LineCountEvaluateParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","判断是否存在是零飘数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.dataProcess.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.dataProcess.api.PqDataVerifyCountFeignClient;
|
||||||
|
import com.njcn.dataProcess.api.PqDataVerifyNewFeignClient;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xy
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2025年02月13日 20:13
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PqDataVerifyCountFeignClientFallbackFactory implements FallbackFactory<PqDataVerifyCountFeignClient> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输出远程请求接口异常日志
|
||||||
|
* @param cause RPC请求异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public PqDataVerifyCountFeignClient create(Throwable cause) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if(cause.getCause() instanceof BusinessException){
|
||||||
|
BusinessException businessException = (BusinessException) cause.getCause();
|
||||||
|
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new PqDataVerifyCountFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> insertDataBatch(List<PqDataVerifyCount> list) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","批量存储清洗的异常数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> insertData(PqDataVerifyCount pqDataVerifyCount) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","单监测点存储清洗的异常数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ public class DataVDTO {
|
|||||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||||
private LocalDateTime timeid;
|
private LocalDateTime timeid;
|
||||||
|
private String devId;
|
||||||
private String lineid;
|
private String lineid;
|
||||||
private String phasicType;
|
private String phasicType;
|
||||||
private Double rms;
|
private Double rms;
|
||||||
|
|||||||
@@ -213,6 +213,115 @@ public class DataHarmpowerP {
|
|||||||
@Column(name = "p_50")
|
@Column(name = "p_50")
|
||||||
private Double p50;
|
private Double p50;
|
||||||
|
|
||||||
|
//在线监测添加的字段
|
||||||
|
@Column(name = "totPf")
|
||||||
|
private Double totPf;
|
||||||
|
@Column(name = "totDf")
|
||||||
|
private Double totDf;
|
||||||
|
@Column(name = "totP")
|
||||||
|
private Double totP;
|
||||||
|
@Column(name = "totP1")
|
||||||
|
private Double totP1;
|
||||||
|
@Column(name = "totP2")
|
||||||
|
private Double totP2;
|
||||||
|
@Column(name = "totP3")
|
||||||
|
private Double totP3;
|
||||||
|
@Column(name = "totP4")
|
||||||
|
private Double totP4;
|
||||||
|
@Column(name = "totP5")
|
||||||
|
private Double totP5;
|
||||||
|
@Column(name = "totP6")
|
||||||
|
private Double totP6;
|
||||||
|
@Column(name = "totP7")
|
||||||
|
private Double totP7;
|
||||||
|
@Column(name = "totP8")
|
||||||
|
private Double totP8;
|
||||||
|
@Column(name = "totP9")
|
||||||
|
private Double totP9;
|
||||||
|
@Column(name = "totP10")
|
||||||
|
private Double totP10;
|
||||||
|
@Column(name = "totP11")
|
||||||
|
private Double totP11;
|
||||||
|
@Column(name = "totP12")
|
||||||
|
private Double totP12;
|
||||||
|
@Column(name = "totP13")
|
||||||
|
private Double totP13;
|
||||||
|
@Column(name = "totP14")
|
||||||
|
private Double totP14;
|
||||||
|
@Column(name = "totP15")
|
||||||
|
private Double totP15;
|
||||||
|
@Column(name = "totP16")
|
||||||
|
private Double totP16;
|
||||||
|
@Column(name = "totP17")
|
||||||
|
private Double totP17;
|
||||||
|
@Column(name = "totP18")
|
||||||
|
private Double totP18;
|
||||||
|
@Column(name = "totP19")
|
||||||
|
private Double totP19;
|
||||||
|
@Column(name = "totP20")
|
||||||
|
private Double totP20;
|
||||||
|
@Column(name = "totP21")
|
||||||
|
private Double totP21;
|
||||||
|
@Column(name = "totP22")
|
||||||
|
private Double totP22;
|
||||||
|
@Column(name = "totP23")
|
||||||
|
private Double totP23;
|
||||||
|
@Column(name = "totP24")
|
||||||
|
private Double totP24;
|
||||||
|
@Column(name = "totP25")
|
||||||
|
private Double totP25;
|
||||||
|
@Column(name = "totP26")
|
||||||
|
private Double totP26;
|
||||||
|
@Column(name = "totP27")
|
||||||
|
private Double totP27;
|
||||||
|
@Column(name = "totP28")
|
||||||
|
private Double totP28;
|
||||||
|
@Column(name = "totP29")
|
||||||
|
private Double totP29;
|
||||||
|
@Column(name = "totP30")
|
||||||
|
private Double totP30;
|
||||||
|
@Column(name = "totP31")
|
||||||
|
private Double totP31;
|
||||||
|
@Column(name = "totP32")
|
||||||
|
private Double totP32;
|
||||||
|
@Column(name = "totP33")
|
||||||
|
private Double totP33;
|
||||||
|
@Column(name = "totP34")
|
||||||
|
private Double totP34;
|
||||||
|
@Column(name = "totP35")
|
||||||
|
private Double totP35;
|
||||||
|
@Column(name = "totP36")
|
||||||
|
private Double totP36;
|
||||||
|
@Column(name = "totP37")
|
||||||
|
private Double totP37;
|
||||||
|
@Column(name = "totP38")
|
||||||
|
private Double totP38;
|
||||||
|
@Column(name = "totP39")
|
||||||
|
private Double totP39;
|
||||||
|
@Column(name = "totP40")
|
||||||
|
private Double totP40;
|
||||||
|
@Column(name = "totP41")
|
||||||
|
private Double totP41;
|
||||||
|
@Column(name = "totP42")
|
||||||
|
private Double totP42;
|
||||||
|
@Column(name = "totP43")
|
||||||
|
private Double totP43;
|
||||||
|
@Column(name = "totP44")
|
||||||
|
private Double totP44;
|
||||||
|
@Column(name = "totP45")
|
||||||
|
private Double totP45;
|
||||||
|
@Column(name = "totP46")
|
||||||
|
private Double totP46;
|
||||||
|
@Column(name = "totP47")
|
||||||
|
private Double totP47;
|
||||||
|
@Column(name = "totP49")
|
||||||
|
private Double totP48;
|
||||||
|
@Column(name = "totP49")
|
||||||
|
private Double totP49;
|
||||||
|
@Column(name = "totP50")
|
||||||
|
private Double totP50;
|
||||||
|
|
||||||
|
|
||||||
public static List<DataHarmpowerP> relationToInfluxDB(DataHarmpowerPDTO dataHarmpowerP) {
|
public static List<DataHarmpowerP> relationToInfluxDB(DataHarmpowerPDTO dataHarmpowerP) {
|
||||||
if (dataHarmpowerP == null) {
|
if (dataHarmpowerP == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -207,6 +207,111 @@ public class DataHarmpowerQ {
|
|||||||
@Column(name = "q_50")
|
@Column(name = "q_50")
|
||||||
private Double q50;
|
private Double q50;
|
||||||
|
|
||||||
|
//在线监测添加的字段
|
||||||
|
@Column(name = "totQ")
|
||||||
|
private Double totQ;
|
||||||
|
@Column(name = "totQ1")
|
||||||
|
private Double totQ1;
|
||||||
|
@Column(name = "totQ2")
|
||||||
|
private Double totQ2;
|
||||||
|
@Column(name = "totQ3")
|
||||||
|
private Double totQ3;
|
||||||
|
@Column(name = "totQ4")
|
||||||
|
private Double totQ4;
|
||||||
|
@Column(name = "totQ5")
|
||||||
|
private Double totQ5;
|
||||||
|
@Column(name = "totQ6")
|
||||||
|
private Double totQ6;
|
||||||
|
@Column(name = "totQ7")
|
||||||
|
private Double totQ7;
|
||||||
|
@Column(name = "totQ8")
|
||||||
|
private Double totQ8;
|
||||||
|
@Column(name = "totQ9")
|
||||||
|
private Double totQ9;
|
||||||
|
@Column(name = "totQ10")
|
||||||
|
private Double totQ10;
|
||||||
|
@Column(name = "totQ11")
|
||||||
|
private Double totQ11;
|
||||||
|
@Column(name = "totQ12")
|
||||||
|
private Double totQ12;
|
||||||
|
@Column(name = "totQ13")
|
||||||
|
private Double totQ13;
|
||||||
|
@Column(name = "totQ14")
|
||||||
|
private Double totQ14;
|
||||||
|
@Column(name = "totQ15")
|
||||||
|
private Double totQ15;
|
||||||
|
@Column(name = "totQ16")
|
||||||
|
private Double totQ16;
|
||||||
|
@Column(name = "totQ17")
|
||||||
|
private Double totQ17;
|
||||||
|
@Column(name = "totQ18")
|
||||||
|
private Double totQ18;
|
||||||
|
@Column(name = "totQ19")
|
||||||
|
private Double totQ19;
|
||||||
|
@Column(name = "totQ20")
|
||||||
|
private Double totQ20;
|
||||||
|
@Column(name = "totQ21")
|
||||||
|
private Double totQ21;
|
||||||
|
@Column(name = "totQ22")
|
||||||
|
private Double totQ22;
|
||||||
|
@Column(name = "totQ23")
|
||||||
|
private Double totQ23;
|
||||||
|
@Column(name = "totQ24")
|
||||||
|
private Double totQ24;
|
||||||
|
@Column(name = "totQ25")
|
||||||
|
private Double totQ25;
|
||||||
|
@Column(name = "totQ26")
|
||||||
|
private Double totQ26;
|
||||||
|
@Column(name = "totQ27")
|
||||||
|
private Double totQ27;
|
||||||
|
@Column(name = "totQ28")
|
||||||
|
private Double totQ28;
|
||||||
|
@Column(name = "totQ29")
|
||||||
|
private Double totQ29;
|
||||||
|
@Column(name = "totQ30")
|
||||||
|
private Double totQ30;
|
||||||
|
@Column(name = "totQ31")
|
||||||
|
private Double totQ31;
|
||||||
|
@Column(name = "totQ32")
|
||||||
|
private Double totQ32;
|
||||||
|
@Column(name = "totQ33")
|
||||||
|
private Double totQ33;
|
||||||
|
@Column(name = "totQ34")
|
||||||
|
private Double totQ34;
|
||||||
|
@Column(name = "totQ35")
|
||||||
|
private Double totQ35;
|
||||||
|
@Column(name = "totQ36")
|
||||||
|
private Double totQ36;
|
||||||
|
@Column(name = "totQ37")
|
||||||
|
private Double totQ37;
|
||||||
|
@Column(name = "totQ38")
|
||||||
|
private Double totQ38;
|
||||||
|
@Column(name = "totQ39")
|
||||||
|
private Double totQ39;
|
||||||
|
@Column(name = "totQ40")
|
||||||
|
private Double totQ40;
|
||||||
|
@Column(name = "totQ41")
|
||||||
|
private Double totQ41;
|
||||||
|
@Column(name = "totQ42")
|
||||||
|
private Double totQ42;
|
||||||
|
@Column(name = "totQ43")
|
||||||
|
private Double totQ43;
|
||||||
|
@Column(name = "totQ44")
|
||||||
|
private Double totQ44;
|
||||||
|
@Column(name = "totQ45")
|
||||||
|
private Double totQ45;
|
||||||
|
@Column(name = "totQ46")
|
||||||
|
private Double totQ46;
|
||||||
|
@Column(name = "totQ47")
|
||||||
|
private Double totQ47;
|
||||||
|
@Column(name = "totQ49")
|
||||||
|
private Double totQ48;
|
||||||
|
@Column(name = "totQ49")
|
||||||
|
private Double totQ49;
|
||||||
|
@Column(name = "totQ50")
|
||||||
|
private Double totQ50;
|
||||||
|
|
||||||
|
|
||||||
public static List<DataHarmpowerQ> relationToInfluxDB(DataHarmpowerQDTO dataHarmpowerQ) {
|
public static List<DataHarmpowerQ> relationToInfluxDB(DataHarmpowerQDTO dataHarmpowerQ) {
|
||||||
if (dataHarmpowerQ == null) {
|
if (dataHarmpowerQ == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -207,6 +207,111 @@ public class DataHarmpowerS {
|
|||||||
@Column(name = "s_50")
|
@Column(name = "s_50")
|
||||||
private Double s50;
|
private Double s50;
|
||||||
|
|
||||||
|
//在线监测添加的字段
|
||||||
|
@Column(name = "totS")
|
||||||
|
private Double totS;
|
||||||
|
@Column(name = "totS1")
|
||||||
|
private Double totS1;
|
||||||
|
@Column(name = "totS2")
|
||||||
|
private Double totS2;
|
||||||
|
@Column(name = "totS3")
|
||||||
|
private Double totS3;
|
||||||
|
@Column(name = "totS4")
|
||||||
|
private Double totS4;
|
||||||
|
@Column(name = "totS5")
|
||||||
|
private Double totS5;
|
||||||
|
@Column(name = "totS6")
|
||||||
|
private Double totS6;
|
||||||
|
@Column(name = "totS7")
|
||||||
|
private Double totS7;
|
||||||
|
@Column(name = "totS8")
|
||||||
|
private Double totS8;
|
||||||
|
@Column(name = "totS9")
|
||||||
|
private Double totS9;
|
||||||
|
@Column(name = "totS10")
|
||||||
|
private Double totS10;
|
||||||
|
@Column(name = "totS11")
|
||||||
|
private Double totS11;
|
||||||
|
@Column(name = "totS12")
|
||||||
|
private Double totS12;
|
||||||
|
@Column(name = "totS13")
|
||||||
|
private Double totS13;
|
||||||
|
@Column(name = "totS14")
|
||||||
|
private Double totS14;
|
||||||
|
@Column(name = "totS15")
|
||||||
|
private Double totS15;
|
||||||
|
@Column(name = "totS16")
|
||||||
|
private Double totS16;
|
||||||
|
@Column(name = "totS17")
|
||||||
|
private Double totS17;
|
||||||
|
@Column(name = "totS18")
|
||||||
|
private Double totS18;
|
||||||
|
@Column(name = "totS19")
|
||||||
|
private Double totS19;
|
||||||
|
@Column(name = "totS20")
|
||||||
|
private Double totS20;
|
||||||
|
@Column(name = "totS21")
|
||||||
|
private Double totS21;
|
||||||
|
@Column(name = "totS22")
|
||||||
|
private Double totS22;
|
||||||
|
@Column(name = "totS23")
|
||||||
|
private Double totS23;
|
||||||
|
@Column(name = "totS24")
|
||||||
|
private Double totS24;
|
||||||
|
@Column(name = "totS25")
|
||||||
|
private Double totS25;
|
||||||
|
@Column(name = "totS26")
|
||||||
|
private Double totS26;
|
||||||
|
@Column(name = "totS27")
|
||||||
|
private Double totS27;
|
||||||
|
@Column(name = "totS28")
|
||||||
|
private Double totS28;
|
||||||
|
@Column(name = "totS29")
|
||||||
|
private Double totS29;
|
||||||
|
@Column(name = "totS30")
|
||||||
|
private Double totS30;
|
||||||
|
@Column(name = "totS31")
|
||||||
|
private Double totS31;
|
||||||
|
@Column(name = "totS32")
|
||||||
|
private Double totS32;
|
||||||
|
@Column(name = "totS33")
|
||||||
|
private Double totS33;
|
||||||
|
@Column(name = "totS34")
|
||||||
|
private Double totS34;
|
||||||
|
@Column(name = "totS35")
|
||||||
|
private Double totS35;
|
||||||
|
@Column(name = "totS36")
|
||||||
|
private Double totS36;
|
||||||
|
@Column(name = "totS37")
|
||||||
|
private Double totS37;
|
||||||
|
@Column(name = "totS38")
|
||||||
|
private Double totS38;
|
||||||
|
@Column(name = "totS39")
|
||||||
|
private Double totS39;
|
||||||
|
@Column(name = "totS40")
|
||||||
|
private Double totS40;
|
||||||
|
@Column(name = "totS41")
|
||||||
|
private Double totS41;
|
||||||
|
@Column(name = "totS42")
|
||||||
|
private Double totS42;
|
||||||
|
@Column(name = "totS43")
|
||||||
|
private Double totS43;
|
||||||
|
@Column(name = "totS44")
|
||||||
|
private Double totS44;
|
||||||
|
@Column(name = "totS45")
|
||||||
|
private Double totS45;
|
||||||
|
@Column(name = "totS46")
|
||||||
|
private Double totS46;
|
||||||
|
@Column(name = "totS47")
|
||||||
|
private Double totS47;
|
||||||
|
@Column(name = "totS49")
|
||||||
|
private Double totS48;
|
||||||
|
@Column(name = "totS49")
|
||||||
|
private Double totS49;
|
||||||
|
@Column(name = "totS50")
|
||||||
|
private Double totS50;
|
||||||
|
|
||||||
|
|
||||||
public static List<DataHarmpowerS> relationToInfluxDB(DataHarmpowerSDTO dataHarmpowerS) {
|
public static List<DataHarmpowerS> relationToInfluxDB(DataHarmpowerSDTO dataHarmpowerS) {
|
||||||
if (dataHarmpowerS == null) {
|
if (dataHarmpowerS == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -17,7 +17,10 @@ public class PqsCommunicateDto {
|
|||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
//1是在线 0是离线
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
//是否更新updateTime标志;数据上送更新1,状态翻转不更新0
|
||||||
|
private Integer flag=0;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class PqDataVerifyBak implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@MppMultiId
|
@MppMultiId
|
||||||
@TableField(value = "time_id")
|
@TableField(value = "time_id")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private LocalDate time;
|
private LocalDate time;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,138 +53,275 @@ public class PqDataVerifyBak implements Serializable {
|
|||||||
@TableField(value = "freq")
|
@TableField(value = "freq")
|
||||||
private Integer freq = 0;
|
private Integer freq = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "freq_time")
|
||||||
|
private Integer freqTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 频率偏差指标
|
* 频率偏差指标
|
||||||
*/
|
*/
|
||||||
@TableField(value = "freq_dev")
|
@TableField(value = "freq_dev")
|
||||||
private Integer freqDev = 0;
|
private Integer freqDev = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率偏差异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "freq_dev_time")
|
||||||
|
private Integer freqDevTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相电压有效值
|
* 相电压有效值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_rms")
|
@TableField(value = "v_rms")
|
||||||
private Integer vRms = 0;
|
private Integer vRms = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相电压有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_rms_time")
|
||||||
|
private Integer vRmsTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 正序电压
|
* 正序电压
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_pos")
|
@TableField(value = "v_pos")
|
||||||
private Integer vPos = 0;
|
private Integer vPos = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 正序电压异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_pos_time")
|
||||||
|
private Integer vPosTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 负序电压
|
* 负序电压
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_neg")
|
@TableField(value = "v_neg")
|
||||||
private Integer vNeg = 0;
|
private Integer vNeg = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负序电压异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_neg_time")
|
||||||
|
private Integer vNegTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 零序电压
|
* 零序电压
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_zero")
|
@TableField(value = "v_zero")
|
||||||
private Integer vZero = 0;
|
private Integer vZero = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 零序电压异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_zero_time")
|
||||||
|
private Integer vZeroTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压不平衡度
|
* 电压不平衡度
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_unbalance")
|
@TableField(value = "v_unbalance")
|
||||||
private Integer vUnbalance = 0;
|
private Integer vUnbalance = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压不平衡度异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_unbalance_time")
|
||||||
|
private Integer vUnbalanceTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 线电压有效值
|
* 线电压有效值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "rms_lvr")
|
@TableField(value = "rms_lvr")
|
||||||
private Integer rmsLvr = 0;
|
private Integer rmsLvr = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 线电压有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "rms_lvr_time")
|
||||||
|
private Integer rmsLvrTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压正偏差
|
* 电压正偏差
|
||||||
*/
|
*/
|
||||||
@TableField(value = "vu_dev")
|
@TableField(value = "vu_dev")
|
||||||
private Integer vuDev = 0;
|
private Integer vuDev = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压正偏差异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "vu_dev_time")
|
||||||
|
private Integer vuDevTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压负偏差
|
* 电压负偏差
|
||||||
*/
|
*/
|
||||||
@TableField(value = "vl_Dev")
|
@TableField(value = "vl_Dev")
|
||||||
private Integer vlDev = 0;
|
private Integer vlDev = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压负偏差异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "vl_Dev_time")
|
||||||
|
private Integer vlDevTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压总谐波畸变率
|
* 电压总谐波畸变率
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_thd")
|
@TableField(value = "v_thd")
|
||||||
private Integer vThd = 0;
|
private Integer vThd = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压总谐波畸变率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_thd_time")
|
||||||
|
private Integer vThdTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 相电压基波有效值
|
* 相电压基波有效值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v")
|
@TableField(value = "v")
|
||||||
private Integer v = 0;
|
private Integer v = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相电压基波有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_time")
|
||||||
|
private Integer vTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电流有效值
|
* 电流有效值
|
||||||
*/
|
*/
|
||||||
@TableField(value = "i_rms")
|
@TableField(value = "i_rms")
|
||||||
private Integer iRms = 0;
|
private Integer iRms = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电流有效值异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "i_rms_time")
|
||||||
|
private Integer iRmsTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 长时闪变
|
* 长时闪变
|
||||||
*/
|
*/
|
||||||
@TableField(value = "plt")
|
@TableField(value = "plt")
|
||||||
private Integer plt = 0;
|
private Integer plt = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长时闪变异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "plt_time")
|
||||||
|
private Integer pltTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 间谐波电压含有率
|
* 间谐波电压含有率
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_inharm")
|
@TableField(value = "v_inharm")
|
||||||
private Integer vInharm = 0;
|
private Integer vInharm = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 间谐波电压含有率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_Inharm_time")
|
||||||
|
private Integer vInharmTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压含有率
|
* 谐波电压含有率
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_harm")
|
@TableField(value = "v_harm")
|
||||||
private Integer vHarm = 0;
|
private Integer vHarm = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压含有率异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_harm_time")
|
||||||
|
private Integer vHarmTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功率因数
|
* 功率因数
|
||||||
*/
|
*/
|
||||||
@TableField(value = "pf")
|
@TableField(value = "pf")
|
||||||
private Integer pf = 0;
|
private Integer pf = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功率因数异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "pf_time")
|
||||||
|
private Integer pfTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压相角
|
* 谐波电压相角
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v_phasic")
|
@TableField(value = "v_phasic")
|
||||||
private Integer vPhasic = 0;
|
private Integer vPhasic = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压相角异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v_phasic_time")
|
||||||
|
private Integer vPhasicTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 谐波电压基波相角
|
* 谐波电压基波相角
|
||||||
*/
|
*/
|
||||||
@TableField(value = "v1_phasic")
|
@TableField(value = "v1_phasic")
|
||||||
private Integer v1Phasic = 0;
|
private Integer v1Phasic = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 谐波电压基波相角异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "v1_phasic_time")
|
||||||
|
private Integer v1PhasicTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压波动
|
* 电压波动
|
||||||
*/
|
*/
|
||||||
@TableField(value = "fluc")
|
@TableField(value = "fluc")
|
||||||
private Integer fluc = 0;
|
private Integer fluc = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压波动异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "fluc_time")
|
||||||
|
private Integer flucTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短时闪变
|
* 短时闪变
|
||||||
*/
|
*/
|
||||||
@TableField(value = "pst")
|
@TableField(value = "pst")
|
||||||
private Integer pst = 0;
|
private Integer pst = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短时闪变异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "pst_time")
|
||||||
|
private Integer pstTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压暂降(0:正常 1:异常)
|
* 电压暂降(0:正常 1:异常)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "dip")
|
@TableField(value = "dip")
|
||||||
private Integer dip;
|
private Integer dip = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂降异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "dip_time")
|
||||||
|
private Integer dipTime = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电压暂升(0:正常 1:异常)
|
* 电压暂升(0:正常 1:异常)
|
||||||
*/
|
*/
|
||||||
@TableField(value = "rise")
|
@TableField(value = "rise")
|
||||||
private Integer rise;
|
private Integer rise = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压暂升异常时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "rise_time")
|
||||||
|
private Integer riseTime = 0;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.njcn.dataProcess.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 = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总指标数量
|
||||||
|
*/
|
||||||
|
@TableField(value = "total_all")
|
||||||
|
private Integer totalAll = 0;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -343,7 +343,7 @@ public class DataRecallController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(recallType ==3){
|
if(recallType ==3){
|
||||||
return;
|
// return;
|
||||||
}else if(recallType ==2){
|
}else if(recallType ==2){
|
||||||
Integer timeInterval = data.getTimeInterval();
|
Integer timeInterval = data.getTimeInterval();
|
||||||
List<LocalDateTime> localDateTimeList = generateTimeIntervals(finalCurrentDate, timeInterval);
|
List<LocalDateTime> localDateTimeList = generateTimeIntervals(finalCurrentDate, timeInterval);
|
||||||
|
|||||||
@@ -166,6 +166,15 @@ public class DataVController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dataV, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dataV, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/excludeZeroData")
|
||||||
|
@ApiOperation("判断是否存在是零飘数据")
|
||||||
|
public HttpResult<Boolean> excludeZeroData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("excludeZeroData");
|
||||||
|
Boolean b = dataVQuery.excludeZeroData(lineParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, b, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.dataProcess.controller;
|
||||||
|
|
||||||
|
|
||||||
|
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.dataProcess.pojo.po.PqDataVerifyBak;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
import com.njcn.dataProcess.service.IPqDataVerifyCountService;
|
||||||
|
import com.njcn.dataProcess.service.IPqDataVerifyNewService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
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 javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-02-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/pqDataVerifyCount")
|
||||||
|
public class PqDataVerifyCountController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPqDataVerifyCountService pqDataVerifyNewService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/insertDataBatch")
|
||||||
|
@ApiOperation("存储清洗的异常数据数量")
|
||||||
|
public HttpResult<List<String>> insertDataBatch(@RequestBody List<PqDataVerifyCount> list) {
|
||||||
|
String methodDescribe = getMethodDescribe("insertDataBatch");
|
||||||
|
pqDataVerifyNewService.insertDataBatch(list);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/insertData")
|
||||||
|
@ApiOperation("存储清洗的异常数据数量")
|
||||||
|
public HttpResult<List<String>> insertData(@RequestBody PqDataVerifyCount pqDataVerifyCount) {
|
||||||
|
String methodDescribe = getMethodDescribe("insertData");
|
||||||
|
pqDataVerifyNewService.insertData(pqDataVerifyCount);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.dataProcess.dao.relation.mapper;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-02-17
|
||||||
|
*/
|
||||||
|
public interface PqDataVerifyCountMapper extends MppBaseMapper<PqDataVerifyCount> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -81,4 +81,17 @@ public interface IDataV extends IMppService<RStatDataVD> {
|
|||||||
List<DataVDto> getDataV(LineCountEvaluateParam lineParam);
|
List<DataVDto> getDataV(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
List<DataVDto> getGroupByTimeDataV(LineCountEvaluateParam lineParam);
|
List<DataVDto> getGroupByTimeDataV(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看监测点的电压,判断是否存在是零飘数据
|
||||||
|
* 如果零飘数据占比一半多,则抛弃该监测点数据
|
||||||
|
* @param lineParam
|
||||||
|
* @return: java.lang.Boolean
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2026/1/15 9:26
|
||||||
|
*/
|
||||||
|
Boolean excludeZeroData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.dataProcess.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-02-17
|
||||||
|
*/
|
||||||
|
public interface IPqDataVerifyCountService extends IMppService<PqDataVerifyCount> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常数据插入
|
||||||
|
* @param list
|
||||||
|
*/
|
||||||
|
void insertDataBatch(List<PqDataVerifyCount> list);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常数据插入
|
||||||
|
*/
|
||||||
|
void insertData(PqDataVerifyCount pqDataVerifyCount);
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,20 +85,22 @@ public class LnDataDealServiceImpl implements LnDataDealService {
|
|||||||
//更新mysqldevice表最新数据时间
|
//更新mysqldevice表最新数据时间
|
||||||
|
|
||||||
if(!CollectionUtils.isEmpty(lnDataDTO.getDataVList())){
|
if(!CollectionUtils.isEmpty(lnDataDTO.getDataVList())){
|
||||||
DataVDTO dataVDTO =lnDataDTO.getDataVList().stream().max(Comparator.comparing(DataVDTO::getTimeid)).get();
|
|
||||||
List<String> lineIdList = lnDataDTO.getDataVList().stream().map(DataVDTO::getLineid).distinct().collect(Collectors.toList());
|
List<String> lineIdList = lnDataDTO.getDataVList().stream().map(DataVDTO::getLineid).distinct().collect(Collectors.toList());
|
||||||
List<LineDeviceStateVO> data = lineFeignClient.getAllLine(lineIdList).getData();
|
List<LineDeviceStateVO> data = lineFeignClient.getAllLine(lineIdList).getData();
|
||||||
//获取所有设备id并去重
|
Map<String, String> map = data.stream().collect(Collectors.toMap(LineDeviceStateVO::getId, temp -> temp.getPids().split(",")[4]));
|
||||||
List<String> devIds = data.stream().map(temp -> {
|
lnDataDTO.getDataVList().forEach(temp->{
|
||||||
return temp.getPids().split(",")[4];
|
temp.setDevId(map.get(temp.getLineid()));
|
||||||
}).distinct().collect(Collectors.toList());
|
});
|
||||||
|
Map<String, List<DataVDTO>> collect = lnDataDTO.getDataVList().stream().collect(Collectors.groupingBy(DataVDTO::getDevId));
|
||||||
devIds.forEach(temp->{
|
collect.forEach((temp,dataVDTOList)->{
|
||||||
PqsCommunicateDto pqsCommunicateDto = new PqsCommunicateDto();
|
PqsCommunicateDto pqsCommunicateDto = new PqsCommunicateDto();
|
||||||
|
DataVDTO dataVDTO =dataVDTOList.stream().max(Comparator.comparing(DataVDTO::getTimeid)).get();
|
||||||
|
|
||||||
pqsCommunicateDto.setTime(LocalDateTimeUtil.format(dataVDTO.getTimeid(), DatePattern.NORM_DATETIME_PATTERN));
|
pqsCommunicateDto.setTime(LocalDateTimeUtil.format(dataVDTO.getTimeid(), DatePattern.NORM_DATETIME_PATTERN));
|
||||||
pqsCommunicateDto.setDevId(temp);
|
pqsCommunicateDto.setDevId(temp);
|
||||||
pqsCommunicateDto.setType(1);
|
pqsCommunicateDto.setType(1);
|
||||||
|
pqsCommunicateDto.setFlag(1);
|
||||||
|
|
||||||
iPqsCommunicate.insertion(pqsCommunicateDto);
|
iPqsCommunicate.insertion(pqsCommunicateDto);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -67,9 +67,8 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataFlicker> collect = dataFlickerDTOList.stream().map(temp -> DataFlicker.relationToInfluxDB(temp)).collect(Collectors.toList());
|
List<DataFlicker> collect = dataFlickerDTOList.stream().map(temp -> DataFlicker.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataFlicker>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataFlicker>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataFlicker> dataFlickerList : partition) {
|
for (List<DataFlicker> dataFlickerList : partition) {
|
||||||
List<DataFlicker> sublistAsOriginalListType = new ArrayList<>(dataFlickerList);
|
List<DataFlicker> sublistAsOriginalListType = new ArrayList<>(dataFlickerList);
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,8 @@ public class InfluxdbDataFlucImpl extends MppServiceImpl<RStatDataFlucRelationMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataFluc> collect = dataFlucDTOList.stream().map(temp -> DataFluc.relationToInfluxDB(temp)).collect(Collectors.toList());
|
List<DataFluc> collect = dataFlucDTOList.stream().map(temp -> DataFluc.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataFluc>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataFluc>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataFluc> dataFlucList : partition) {
|
for (List<DataFluc> dataFlucList : partition) {
|
||||||
List<DataFluc> sublistAsOriginalListType = new ArrayList<>(dataFlucList);
|
List<DataFluc> sublistAsOriginalListType = new ArrayList<>(dataFlucList);
|
||||||
|
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class InfluxdbDataHarmRateIImpl extends MppServiceImpl<RStatDataHarmRateI
|
|||||||
List<DataHarmrateI> dataList;
|
List<DataHarmrateI> dataList;
|
||||||
List<DataHarmrateI> result = new ArrayList<>();
|
List<DataHarmrateI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmrateI::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmrateI::getLineId, lineList)
|
||||||
.select(DataHarmrateI::getLineId)
|
.select(DataHarmrateI::getLineId)
|
||||||
.select(DataHarmrateI::getPhasicType)
|
.select(DataHarmrateI::getPhasicType)
|
||||||
|
|||||||
@@ -84,9 +84,8 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataHarmrateV> collect = dataHarmrateVDTOList.stream().flatMap(temp -> DataHarmrateV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmrateV> collect = dataHarmrateVDTOList.stream().flatMap(temp -> DataHarmrateV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmrateV> dataHarmrateVList : partition) {
|
for (List<DataHarmrateV> dataHarmrateVList : partition) {
|
||||||
List<DataHarmrateV> sublistAsOriginalListType = new ArrayList<>(dataHarmrateVList);
|
List<DataHarmrateV> sublistAsOriginalListType = new ArrayList<>(dataHarmrateVList);
|
||||||
|
|
||||||
@@ -238,7 +237,7 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmDto> getGroupByTimeHarmRateV(LineCountEvaluateParam lineParam) {
|
public List<DataHarmDto> getGroupByTimeHarmRateV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper harmRateVQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
InfluxQueryWrapper harmRateVQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
||||||
harmRateVQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
harmRateVQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
harmRateVQueryWrapper.regular(DataV::getLineId, lineParam.getLineId())
|
harmRateVQueryWrapper.regular(DataV::getLineId, lineParam.getLineId())
|
||||||
.eq(DataHarmrateV::getValueType, InfluxDbSqlConstant.CP95)
|
.eq(DataHarmrateV::getValueType, InfluxDbSqlConstant.CP95)
|
||||||
.ne(DataHarmrateV::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
.ne(DataHarmrateV::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
||||||
@@ -266,7 +265,7 @@ public class InfluxdbDataHarmRateVImpl extends MppServiceImpl<RStatDataHarmRateV
|
|||||||
List<DataHarmrateV> dataList;
|
List<DataHarmrateV> dataList;
|
||||||
List<DataHarmrateV> result = new ArrayList<>();
|
List<DataHarmrateV> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmrateV::getLineId, lineParam.getLineId())
|
influxQueryWrapper.regular(DataHarmrateV::getLineId, lineParam.getLineId())
|
||||||
.select(DataHarmrateV::getLineId)
|
.select(DataHarmrateV::getLineId)
|
||||||
.select(DataHarmrateV::getPhasicType)
|
.select(DataHarmrateV::getPhasicType)
|
||||||
|
|||||||
@@ -66,9 +66,8 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataHarmphasicI> collect = dataHarmphasicIDTOList.stream().flatMap(temp -> DataHarmphasicI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmphasicI> collect = dataHarmphasicIDTOList.stream().flatMap(temp -> DataHarmphasicI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmphasicI>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmphasicI>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmphasicI> dataHarmphasicIList : partition) {
|
for (List<DataHarmphasicI> dataHarmphasicIList : partition) {
|
||||||
List<DataHarmphasicI> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicIList);
|
List<DataHarmphasicI> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicIList);
|
||||||
dataHarmphasicIMapper.insertBatch(sublistAsOriginalListType);
|
dataHarmphasicIMapper.insertBatch(sublistAsOriginalListType);
|
||||||
@@ -224,7 +223,7 @@ public class InfluxdbDataHarmphasicIImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
List<DataHarmphasicI> dataList;
|
List<DataHarmphasicI> dataList;
|
||||||
List<DataHarmphasicI> result = new ArrayList<>();
|
List<DataHarmphasicI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmphasicI::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmphasicI::getLineId, lineList)
|
||||||
.select(DataHarmphasicI::getLineId)
|
.select(DataHarmphasicI::getLineId)
|
||||||
.select(DataHarmphasicI::getPhasicType)
|
.select(DataHarmphasicI::getPhasicType)
|
||||||
|
|||||||
@@ -70,9 +70,8 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataHarmphasicV> collect = dataHarmphasicVDTOList.stream().flatMap(temp -> DataHarmphasicV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmphasicV> collect = dataHarmphasicVDTOList.stream().flatMap(temp -> DataHarmphasicV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmphasicV>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmphasicV>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmphasicV> dataHarmphasicVList : partition) {
|
for (List<DataHarmphasicV> dataHarmphasicVList : partition) {
|
||||||
List<DataHarmphasicV> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicVList);
|
List<DataHarmphasicV> sublistAsOriginalListType = new ArrayList<>(dataHarmphasicVList);
|
||||||
|
|
||||||
@@ -229,7 +228,7 @@ public class InfluxdbDataHarmphasicVImpl extends MppServiceImpl<RStatDataHarmPha
|
|||||||
List<DataHarmphasicV> dataList;
|
List<DataHarmphasicV> dataList;
|
||||||
List<DataHarmphasicV> result = new ArrayList<>();
|
List<DataHarmphasicV> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmphasicV::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmphasicV::getLineId, lineList)
|
||||||
.select(DataHarmphasicV::getLineId)
|
.select(DataHarmphasicV::getLineId)
|
||||||
.select(DataHarmphasicV::getPhasicType)
|
.select(DataHarmphasicV::getPhasicType)
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ import com.njcn.dataProcess.dao.imapper.DataHarmpowerPMapper;
|
|||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataHarmPowerPRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
import com.njcn.dataProcess.dto.DataHarmpowerPDTO;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.po.influx.DataHarmphasicI;
|
|
||||||
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
|
|
||||||
import com.njcn.dataProcess.po.influx.DataHarmpowerP;
|
import com.njcn.dataProcess.po.influx.DataHarmpowerP;
|
||||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
import com.njcn.dataProcess.pojo.dto.DataHarmPowerPDto;
|
||||||
@@ -29,6 +27,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -70,9 +69,8 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataHarmpowerP> collect = dataHarmpowerPDTOList.stream().flatMap(temp -> DataHarmpowerP.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmpowerP> collect = dataHarmpowerPDTOList.stream().flatMap(temp -> DataHarmpowerP.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmpowerP>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmpowerP>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmpowerP> dataHarmpowerPList : partition) {
|
for (List<DataHarmpowerP> dataHarmpowerPList : partition) {
|
||||||
List<DataHarmpowerP> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerPList);
|
List<DataHarmpowerP> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerPList);
|
||||||
|
|
||||||
@@ -129,68 +127,12 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||||
value.setValueType(valueType);
|
value.setValueType(valueType);
|
||||||
//规定好集合指标参数
|
List<List<Double>> lists;
|
||||||
List<Double> data1 = valueTypeList.stream().map(DataHarmpowerP::getDf).collect(Collectors.toList());
|
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
|
||||||
List<Double> data2 = valueTypeList.stream().map(DataHarmpowerP::getPf).collect(Collectors.toList());
|
lists = extractDataLists(valueTypeList, "Tot");
|
||||||
List<Double> data3 = valueTypeList.stream().map(DataHarmpowerP::getP).collect(Collectors.toList());
|
} else {
|
||||||
|
lists = extractDataLists(valueTypeList, "");
|
||||||
List<Double> data12 = valueTypeList.stream().map(DataHarmpowerP::getP1).collect(Collectors.toList());
|
}
|
||||||
List<Double> data13 = valueTypeList.stream().map(DataHarmpowerP::getP2).collect(Collectors.toList());
|
|
||||||
List<Double> data14 = valueTypeList.stream().map(DataHarmpowerP::getP3).collect(Collectors.toList());
|
|
||||||
List<Double> data15 = valueTypeList.stream().map(DataHarmpowerP::getP4).collect(Collectors.toList());
|
|
||||||
List<Double> data16 = valueTypeList.stream().map(DataHarmpowerP::getP5).collect(Collectors.toList());
|
|
||||||
List<Double> data17 = valueTypeList.stream().map(DataHarmpowerP::getP6).collect(Collectors.toList());
|
|
||||||
List<Double> data18 = valueTypeList.stream().map(DataHarmpowerP::getP7).collect(Collectors.toList());
|
|
||||||
List<Double> data19 = valueTypeList.stream().map(DataHarmpowerP::getP8).collect(Collectors.toList());
|
|
||||||
List<Double> data20 = valueTypeList.stream().map(DataHarmpowerP::getP9).collect(Collectors.toList());
|
|
||||||
List<Double> data21 = valueTypeList.stream().map(DataHarmpowerP::getP10).collect(Collectors.toList());
|
|
||||||
List<Double> data22 = valueTypeList.stream().map(DataHarmpowerP::getP11).collect(Collectors.toList());
|
|
||||||
List<Double> data23 = valueTypeList.stream().map(DataHarmpowerP::getP12).collect(Collectors.toList());
|
|
||||||
List<Double> data24 = valueTypeList.stream().map(DataHarmpowerP::getP13).collect(Collectors.toList());
|
|
||||||
List<Double> data25 = valueTypeList.stream().map(DataHarmpowerP::getP14).collect(Collectors.toList());
|
|
||||||
List<Double> data26 = valueTypeList.stream().map(DataHarmpowerP::getP15).collect(Collectors.toList());
|
|
||||||
List<Double> data27 = valueTypeList.stream().map(DataHarmpowerP::getP16).collect(Collectors.toList());
|
|
||||||
List<Double> data28 = valueTypeList.stream().map(DataHarmpowerP::getP17).collect(Collectors.toList());
|
|
||||||
List<Double> data29 = valueTypeList.stream().map(DataHarmpowerP::getP18).collect(Collectors.toList());
|
|
||||||
List<Double> data30 = valueTypeList.stream().map(DataHarmpowerP::getP19).collect(Collectors.toList());
|
|
||||||
List<Double> data31 = valueTypeList.stream().map(DataHarmpowerP::getP20).collect(Collectors.toList());
|
|
||||||
List<Double> data32 = valueTypeList.stream().map(DataHarmpowerP::getP21).collect(Collectors.toList());
|
|
||||||
List<Double> data33 = valueTypeList.stream().map(DataHarmpowerP::getP22).collect(Collectors.toList());
|
|
||||||
List<Double> data34 = valueTypeList.stream().map(DataHarmpowerP::getP23).collect(Collectors.toList());
|
|
||||||
List<Double> data35 = valueTypeList.stream().map(DataHarmpowerP::getP24).collect(Collectors.toList());
|
|
||||||
List<Double> data36 = valueTypeList.stream().map(DataHarmpowerP::getP25).collect(Collectors.toList());
|
|
||||||
List<Double> data37 = valueTypeList.stream().map(DataHarmpowerP::getP26).collect(Collectors.toList());
|
|
||||||
List<Double> data38 = valueTypeList.stream().map(DataHarmpowerP::getP27).collect(Collectors.toList());
|
|
||||||
List<Double> data39 = valueTypeList.stream().map(DataHarmpowerP::getP28).collect(Collectors.toList());
|
|
||||||
List<Double> data40 = valueTypeList.stream().map(DataHarmpowerP::getP29).collect(Collectors.toList());
|
|
||||||
List<Double> data41 = valueTypeList.stream().map(DataHarmpowerP::getP30).collect(Collectors.toList());
|
|
||||||
List<Double> data42 = valueTypeList.stream().map(DataHarmpowerP::getP31).collect(Collectors.toList());
|
|
||||||
List<Double> data43 = valueTypeList.stream().map(DataHarmpowerP::getP32).collect(Collectors.toList());
|
|
||||||
List<Double> data44 = valueTypeList.stream().map(DataHarmpowerP::getP33).collect(Collectors.toList());
|
|
||||||
List<Double> data45 = valueTypeList.stream().map(DataHarmpowerP::getP34).collect(Collectors.toList());
|
|
||||||
List<Double> data46 = valueTypeList.stream().map(DataHarmpowerP::getP35).collect(Collectors.toList());
|
|
||||||
List<Double> data47 = valueTypeList.stream().map(DataHarmpowerP::getP36).collect(Collectors.toList());
|
|
||||||
List<Double> data48 = valueTypeList.stream().map(DataHarmpowerP::getP37).collect(Collectors.toList());
|
|
||||||
List<Double> data49 = valueTypeList.stream().map(DataHarmpowerP::getP38).collect(Collectors.toList());
|
|
||||||
List<Double> data50 = valueTypeList.stream().map(DataHarmpowerP::getP39).collect(Collectors.toList());
|
|
||||||
List<Double> data51 = valueTypeList.stream().map(DataHarmpowerP::getP40).collect(Collectors.toList());
|
|
||||||
List<Double> data52 = valueTypeList.stream().map(DataHarmpowerP::getP41).collect(Collectors.toList());
|
|
||||||
List<Double> data53 = valueTypeList.stream().map(DataHarmpowerP::getP42).collect(Collectors.toList());
|
|
||||||
List<Double> data54 = valueTypeList.stream().map(DataHarmpowerP::getP43).collect(Collectors.toList());
|
|
||||||
List<Double> data55 = valueTypeList.stream().map(DataHarmpowerP::getP44).collect(Collectors.toList());
|
|
||||||
List<Double> data56 = valueTypeList.stream().map(DataHarmpowerP::getP45).collect(Collectors.toList());
|
|
||||||
List<Double> data57 = valueTypeList.stream().map(DataHarmpowerP::getP46).collect(Collectors.toList());
|
|
||||||
List<Double> data58 = valueTypeList.stream().map(DataHarmpowerP::getP47).collect(Collectors.toList());
|
|
||||||
List<Double> data59 = valueTypeList.stream().map(DataHarmpowerP::getP48).collect(Collectors.toList());
|
|
||||||
List<Double> data60 = valueTypeList.stream().map(DataHarmpowerP::getP49).collect(Collectors.toList());
|
|
||||||
List<Double> data61 = valueTypeList.stream().map(DataHarmpowerP::getP50).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<List<Double>> lists = Arrays.asList(data1,data2,data3,data12,data13,data14
|
|
||||||
,data15,data16,data17,data18,data19,data20,data21,data22,data23,data24
|
|
||||||
,data25,data26,data27,data28,data29,data30,data31,data32,data33,data34
|
|
||||||
,data35,data36,data37,data38,data39,data40,data41,data42,data43,data44
|
|
||||||
,data45,data46,data47,data48,data49,data50,data51,data52,data53,data54
|
|
||||||
,data55,data56,data57,data58,data59,data60,data61);
|
|
||||||
value.setValueList(lists);
|
value.setValueList(lists);
|
||||||
valueTypes.add(value);
|
valueTypes.add(value);
|
||||||
});
|
});
|
||||||
@@ -204,6 +146,43 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<List<Double>> extractDataLists(List<DataHarmpowerP> dataList, String prefix) {
|
||||||
|
List<List<Double>> result = new ArrayList<>();
|
||||||
|
// 前三个特殊字段
|
||||||
|
result.add(extractField(dataList, prefix + "Df"));
|
||||||
|
result.add(extractField(dataList, prefix + "Pf"));
|
||||||
|
result.add(extractField(dataList, prefix + "P"));
|
||||||
|
// P1到P50
|
||||||
|
for (int i = 1; i <= 50; i++) {
|
||||||
|
String fieldName = prefix + (i == 1 ? "P1" : "P" + i);
|
||||||
|
result.add(extractField(dataList, fieldName));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Double> extractField(List<DataHarmpowerP> dataList, String fieldName) {
|
||||||
|
try {
|
||||||
|
Method method = DataHarmpowerP.class.getMethod("get" + capitalize(fieldName));
|
||||||
|
return dataList.stream()
|
||||||
|
.map(data -> {
|
||||||
|
try {
|
||||||
|
return (Double) method.invoke(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Failed to get field: " + fieldName, e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new RuntimeException("Field not found: " + fieldName, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String capitalize(String str) {
|
||||||
|
if (str == null || str.isEmpty()) return str;
|
||||||
|
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addList(List<DataHarmPowerPDto> list) {
|
public void addList(List<DataHarmPowerPDto> list) {
|
||||||
|
|
||||||
@@ -233,7 +212,7 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
List<DataHarmpowerP> dataList;
|
List<DataHarmpowerP> dataList;
|
||||||
List<DataHarmpowerP> result = new ArrayList<>();
|
List<DataHarmpowerP> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.P, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.P, InfluxDbSqlConstant.P, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmpowerP::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmpowerP::getLineId, lineList)
|
||||||
.select(DataHarmpowerP::getLineId)
|
.select(DataHarmpowerP::getLineId)
|
||||||
.select(DataHarmpowerP::getPhasicType)
|
.select(DataHarmpowerP::getPhasicType)
|
||||||
@@ -299,20 +278,31 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
String devId = lineMap.get(lineId).getDeviceId();
|
String devId = lineMap.get(lineId).getDeviceId();
|
||||||
CsLinePO po = lineMap.get(lineId);
|
CsLinePO po = lineMap.get(lineId);
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
||||||
|
//A、B、C谐波有功功率有效值
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmP_", "p_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmP_", "p_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
influxQueryWrapper.eq(DataHarmpowerP::getLineId, lineId)
|
//三相总 谐波有功功率有效值
|
||||||
.eq(DataHarmpowerP::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTP_", "totP_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
|
InfluxQueryWrapper eq = influxQueryWrapper.eq(DataHarmpowerP::getLineId, lineId)
|
||||||
|
.eq(DataHarmpowerP::getProcess, Integer.toString(devsMap.get(devId).getProcess()))
|
||||||
.select(DataHarmpowerP::getLineId)
|
.select(DataHarmpowerP::getLineId)
|
||||||
.select(DataHarmpowerP::getPhasicType)
|
.select(DataHarmpowerP::getPhasicType)
|
||||||
.select(DataHarmpowerP::getValueType)
|
.select(DataHarmpowerP::getValueType)
|
||||||
//位移功率因数
|
//位移功率因数
|
||||||
.select("Pq_DF","df")
|
.select("Pq_DF", "df")
|
||||||
//视在功率因素
|
//视在功率因素
|
||||||
.select("Pq_PF","pf")
|
.select("Pq_PF", "pf")
|
||||||
//总功功率
|
//A、B、C三相有功功率
|
||||||
.select("Pq_P","p")
|
.select("Pq_P", "p")
|
||||||
//基波有功功率
|
//基波有功功率
|
||||||
.select("Pq_FundP","p_1")
|
.select("Pq_FundP", "p_1")
|
||||||
|
//三相总视在功率因数
|
||||||
|
.select("Pq_TotPF", "totPf")
|
||||||
|
//三相总位移功率因数
|
||||||
|
.select("Pq_TotDF", "totDf")
|
||||||
|
//三相总功率因数
|
||||||
|
.select("Pq_TotP", "totP")
|
||||||
|
//三相总基波有功功率
|
||||||
|
.select("Pq_TotHarmP", "totP1")
|
||||||
.between(DataHarmpowerP::getTime, startTime, endTime)
|
.between(DataHarmpowerP::getTime, startTime, endTime)
|
||||||
.eq(DataHarmpowerP::getQualityFlag, "0");
|
.eq(DataHarmpowerP::getQualityFlag, "0");
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
if (Objects.isNull(po.getLineNo())) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -66,9 +67,8 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataHarmpowerQ> collect = dataHarmpowerQDTOList.stream().flatMap(temp -> DataHarmpowerQ.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmpowerQ> collect = dataHarmpowerQDTOList.stream().flatMap(temp -> DataHarmpowerQ.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmpowerQ>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmpowerQ>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmpowerQ> dataHarmpowerQList : partition) {
|
for (List<DataHarmpowerQ> dataHarmpowerQList : partition) {
|
||||||
List<DataHarmpowerQ> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerQList);
|
List<DataHarmpowerQ> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerQList);
|
||||||
|
|
||||||
@@ -125,66 +125,13 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||||
value.setValueType(valueType);
|
value.setValueType(valueType);
|
||||||
//规定好集合指标参数
|
|
||||||
List<Double> data1 = valueTypeList.stream().map(DataHarmpowerQ::getQ).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<Double> data12 = valueTypeList.stream().map(DataHarmpowerQ::getQ1).collect(Collectors.toList());
|
List<List<Double>> lists;
|
||||||
List<Double> data13 = valueTypeList.stream().map(DataHarmpowerQ::getQ2).collect(Collectors.toList());
|
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
|
||||||
List<Double> data14 = valueTypeList.stream().map(DataHarmpowerQ::getQ3).collect(Collectors.toList());
|
lists = extractDataLists(valueTypeList, "Tot");
|
||||||
List<Double> data15 = valueTypeList.stream().map(DataHarmpowerQ::getQ4).collect(Collectors.toList());
|
} else {
|
||||||
List<Double> data16 = valueTypeList.stream().map(DataHarmpowerQ::getQ5).collect(Collectors.toList());
|
lists = extractDataLists(valueTypeList, "");
|
||||||
List<Double> data17 = valueTypeList.stream().map(DataHarmpowerQ::getQ6).collect(Collectors.toList());
|
}
|
||||||
List<Double> data18 = valueTypeList.stream().map(DataHarmpowerQ::getQ7).collect(Collectors.toList());
|
|
||||||
List<Double> data19 = valueTypeList.stream().map(DataHarmpowerQ::getQ8).collect(Collectors.toList());
|
|
||||||
List<Double> data20 = valueTypeList.stream().map(DataHarmpowerQ::getQ9).collect(Collectors.toList());
|
|
||||||
List<Double> data21 = valueTypeList.stream().map(DataHarmpowerQ::getQ10).collect(Collectors.toList());
|
|
||||||
List<Double> data22 = valueTypeList.stream().map(DataHarmpowerQ::getQ11).collect(Collectors.toList());
|
|
||||||
List<Double> data23 = valueTypeList.stream().map(DataHarmpowerQ::getQ12).collect(Collectors.toList());
|
|
||||||
List<Double> data24 = valueTypeList.stream().map(DataHarmpowerQ::getQ13).collect(Collectors.toList());
|
|
||||||
List<Double> data25 = valueTypeList.stream().map(DataHarmpowerQ::getQ14).collect(Collectors.toList());
|
|
||||||
List<Double> data26 = valueTypeList.stream().map(DataHarmpowerQ::getQ15).collect(Collectors.toList());
|
|
||||||
List<Double> data27 = valueTypeList.stream().map(DataHarmpowerQ::getQ16).collect(Collectors.toList());
|
|
||||||
List<Double> data28 = valueTypeList.stream().map(DataHarmpowerQ::getQ17).collect(Collectors.toList());
|
|
||||||
List<Double> data29 = valueTypeList.stream().map(DataHarmpowerQ::getQ18).collect(Collectors.toList());
|
|
||||||
List<Double> data30 = valueTypeList.stream().map(DataHarmpowerQ::getQ19).collect(Collectors.toList());
|
|
||||||
List<Double> data31 = valueTypeList.stream().map(DataHarmpowerQ::getQ20).collect(Collectors.toList());
|
|
||||||
List<Double> data32 = valueTypeList.stream().map(DataHarmpowerQ::getQ21).collect(Collectors.toList());
|
|
||||||
List<Double> data33 = valueTypeList.stream().map(DataHarmpowerQ::getQ22).collect(Collectors.toList());
|
|
||||||
List<Double> data34 = valueTypeList.stream().map(DataHarmpowerQ::getQ23).collect(Collectors.toList());
|
|
||||||
List<Double> data35 = valueTypeList.stream().map(DataHarmpowerQ::getQ24).collect(Collectors.toList());
|
|
||||||
List<Double> data36 = valueTypeList.stream().map(DataHarmpowerQ::getQ25).collect(Collectors.toList());
|
|
||||||
List<Double> data37 = valueTypeList.stream().map(DataHarmpowerQ::getQ26).collect(Collectors.toList());
|
|
||||||
List<Double> data38 = valueTypeList.stream().map(DataHarmpowerQ::getQ27).collect(Collectors.toList());
|
|
||||||
List<Double> data39 = valueTypeList.stream().map(DataHarmpowerQ::getQ28).collect(Collectors.toList());
|
|
||||||
List<Double> data40 = valueTypeList.stream().map(DataHarmpowerQ::getQ29).collect(Collectors.toList());
|
|
||||||
List<Double> data41 = valueTypeList.stream().map(DataHarmpowerQ::getQ30).collect(Collectors.toList());
|
|
||||||
List<Double> data42 = valueTypeList.stream().map(DataHarmpowerQ::getQ31).collect(Collectors.toList());
|
|
||||||
List<Double> data43 = valueTypeList.stream().map(DataHarmpowerQ::getQ32).collect(Collectors.toList());
|
|
||||||
List<Double> data44 = valueTypeList.stream().map(DataHarmpowerQ::getQ33).collect(Collectors.toList());
|
|
||||||
List<Double> data45 = valueTypeList.stream().map(DataHarmpowerQ::getQ34).collect(Collectors.toList());
|
|
||||||
List<Double> data46 = valueTypeList.stream().map(DataHarmpowerQ::getQ35).collect(Collectors.toList());
|
|
||||||
List<Double> data47 = valueTypeList.stream().map(DataHarmpowerQ::getQ36).collect(Collectors.toList());
|
|
||||||
List<Double> data48 = valueTypeList.stream().map(DataHarmpowerQ::getQ37).collect(Collectors.toList());
|
|
||||||
List<Double> data49 = valueTypeList.stream().map(DataHarmpowerQ::getQ38).collect(Collectors.toList());
|
|
||||||
List<Double> data50 = valueTypeList.stream().map(DataHarmpowerQ::getQ39).collect(Collectors.toList());
|
|
||||||
List<Double> data51 = valueTypeList.stream().map(DataHarmpowerQ::getQ40).collect(Collectors.toList());
|
|
||||||
List<Double> data52 = valueTypeList.stream().map(DataHarmpowerQ::getQ41).collect(Collectors.toList());
|
|
||||||
List<Double> data53 = valueTypeList.stream().map(DataHarmpowerQ::getQ42).collect(Collectors.toList());
|
|
||||||
List<Double> data54 = valueTypeList.stream().map(DataHarmpowerQ::getQ43).collect(Collectors.toList());
|
|
||||||
List<Double> data55 = valueTypeList.stream().map(DataHarmpowerQ::getQ44).collect(Collectors.toList());
|
|
||||||
List<Double> data56 = valueTypeList.stream().map(DataHarmpowerQ::getQ45).collect(Collectors.toList());
|
|
||||||
List<Double> data57 = valueTypeList.stream().map(DataHarmpowerQ::getQ46).collect(Collectors.toList());
|
|
||||||
List<Double> data58 = valueTypeList.stream().map(DataHarmpowerQ::getQ47).collect(Collectors.toList());
|
|
||||||
List<Double> data59 = valueTypeList.stream().map(DataHarmpowerQ::getQ48).collect(Collectors.toList());
|
|
||||||
List<Double> data60 = valueTypeList.stream().map(DataHarmpowerQ::getQ49).collect(Collectors.toList());
|
|
||||||
List<Double> data61 = valueTypeList.stream().map(DataHarmpowerQ::getQ50).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<List<Double>> lists = Arrays.asList(data1,data12,data13,data14
|
|
||||||
,data15,data16,data17,data18,data19,data20,data21,data22,data23,data24
|
|
||||||
,data25,data26,data27,data28,data29,data30,data31,data32,data33,data34
|
|
||||||
,data35,data36,data37,data38,data39,data40,data41,data42,data43,data44
|
|
||||||
,data45,data46,data47,data48,data49,data50,data51,data52,data53,data54
|
|
||||||
,data55,data56,data57,data58,data59,data60,data61);
|
|
||||||
value.setValueList(lists);
|
value.setValueList(lists);
|
||||||
valueTypes.add(value);
|
valueTypes.add(value);
|
||||||
});
|
});
|
||||||
@@ -198,6 +145,39 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<List<Double>> extractDataLists(List<DataHarmpowerQ> dataList, String prefix) {
|
||||||
|
List<List<Double>> result = new ArrayList<>();
|
||||||
|
result.add(extractField(dataList, prefix + "Q"));
|
||||||
|
// Q1到Q50
|
||||||
|
for (int i = 1; i <= 50; i++) {
|
||||||
|
String fieldName = prefix + (i == 1 ? "Q1" : "Q" + i);
|
||||||
|
result.add(extractField(dataList, fieldName));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Double> extractField(List<DataHarmpowerQ> dataList, String fieldName) {
|
||||||
|
try {
|
||||||
|
Method method = DataHarmpowerQ.class.getMethod("get" + capitalize(fieldName));
|
||||||
|
return dataList.stream()
|
||||||
|
.map(data -> {
|
||||||
|
try {
|
||||||
|
return (Double) method.invoke(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Failed to get field: " + fieldName, e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new RuntimeException("Field not found: " + fieldName, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String capitalize(String str) {
|
||||||
|
if (str == null || str.isEmpty()) return str;
|
||||||
|
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addList(List<DataHarmPowerQDto> list) {
|
public void addList(List<DataHarmPowerQDto> list) {
|
||||||
|
|
||||||
@@ -227,7 +207,7 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
List<DataHarmpowerQ> dataList;
|
List<DataHarmpowerQ> dataList;
|
||||||
List<DataHarmpowerQ> result = new ArrayList<>();
|
List<DataHarmpowerQ> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.Q, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.Q, InfluxDbSqlConstant.Q, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmpowerQ::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmpowerQ::getLineId, lineList)
|
||||||
.select(DataHarmpowerQ::getLineId)
|
.select(DataHarmpowerQ::getLineId)
|
||||||
.select(DataHarmpowerQ::getPhasicType)
|
.select(DataHarmpowerQ::getPhasicType)
|
||||||
@@ -291,16 +271,23 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
String devId = lineMap.get(lineId).getDeviceId();
|
String devId = lineMap.get(lineId).getDeviceId();
|
||||||
CsLinePO po = lineMap.get(lineId);
|
CsLinePO po = lineMap.get(lineId);
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
||||||
|
//A、B、C谐波无功功率有效值
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmQ_", "q_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmQ_", "q_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
|
//三相总 谐波有功功率有效值
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTQ_", "totQ_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
influxQueryWrapper.eq(DataHarmpowerQ::getLineId, lineId)
|
influxQueryWrapper.eq(DataHarmpowerQ::getLineId, lineId)
|
||||||
.eq(DataHarmpowerQ::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
.eq(DataHarmpowerQ::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
||||||
.select(DataHarmpowerQ::getLineId)
|
.select(DataHarmpowerQ::getLineId)
|
||||||
.select(DataHarmpowerQ::getPhasicType)
|
.select(DataHarmpowerQ::getPhasicType)
|
||||||
.select(DataHarmpowerQ::getValueType)
|
.select(DataHarmpowerQ::getValueType)
|
||||||
//总功功率
|
//A、B、C三相无功功率
|
||||||
.select("Pq_Q","q")
|
.select("Pq_Q", "q")
|
||||||
//基波有功功率
|
//基波无功功率
|
||||||
.select("Pq_FundQ","q_1")
|
.select("Pq_FundQ","q_1")
|
||||||
|
//总无功功率
|
||||||
|
.select("Pq_TotQ","totQ")
|
||||||
|
//基波无功功率(T)
|
||||||
|
.select("Pq_TotHarmQ","totQ1")
|
||||||
.between(DataHarmpowerQ::getTime, startTime, endTime)
|
.between(DataHarmpowerQ::getTime, startTime, endTime)
|
||||||
.eq(DataHarmpowerQ::getQualityFlag, "0");
|
.eq(DataHarmpowerQ::getQualityFlag, "0");
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
if (Objects.isNull(po.getLineNo())) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import org.springframework.beans.BeanUtils;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
@@ -66,9 +67,8 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataHarmpowerS> collect = dataHarmpowerSDTOList.stream().flatMap(temp -> DataHarmpowerS.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataHarmpowerS> collect = dataHarmpowerSDTOList.stream().flatMap(temp -> DataHarmpowerS.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataHarmpowerS>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataHarmpowerS>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataHarmpowerS> dataHarmpowerSList : partition) {
|
for (List<DataHarmpowerS> dataHarmpowerSList : partition) {
|
||||||
List<DataHarmpowerS> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerSList);
|
List<DataHarmpowerS> sublistAsOriginalListType = new ArrayList<>(dataHarmpowerSList);
|
||||||
|
|
||||||
@@ -125,66 +125,12 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
valueTypeMap.forEach((valueType,valueTypeList)->{
|
valueTypeMap.forEach((valueType,valueTypeList)->{
|
||||||
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
|
||||||
value.setValueType(valueType);
|
value.setValueType(valueType);
|
||||||
//规定好集合指标参数
|
List<List<Double>> lists;
|
||||||
List<Double> data1 = valueTypeList.stream().map(DataHarmpowerS::getS).collect(Collectors.toList());
|
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
|
||||||
|
lists = extractDataLists(valueTypeList, "Tot");
|
||||||
List<Double> data12 = valueTypeList.stream().map(DataHarmpowerS::getS1).collect(Collectors.toList());
|
} else {
|
||||||
List<Double> data13 = valueTypeList.stream().map(DataHarmpowerS::getS2).collect(Collectors.toList());
|
lists = extractDataLists(valueTypeList, "");
|
||||||
List<Double> data14 = valueTypeList.stream().map(DataHarmpowerS::getS3).collect(Collectors.toList());
|
}
|
||||||
List<Double> data15 = valueTypeList.stream().map(DataHarmpowerS::getS4).collect(Collectors.toList());
|
|
||||||
List<Double> data16 = valueTypeList.stream().map(DataHarmpowerS::getS5).collect(Collectors.toList());
|
|
||||||
List<Double> data17 = valueTypeList.stream().map(DataHarmpowerS::getS6).collect(Collectors.toList());
|
|
||||||
List<Double> data18 = valueTypeList.stream().map(DataHarmpowerS::getS7).collect(Collectors.toList());
|
|
||||||
List<Double> data19 = valueTypeList.stream().map(DataHarmpowerS::getS8).collect(Collectors.toList());
|
|
||||||
List<Double> data20 = valueTypeList.stream().map(DataHarmpowerS::getS9).collect(Collectors.toList());
|
|
||||||
List<Double> data21 = valueTypeList.stream().map(DataHarmpowerS::getS10).collect(Collectors.toList());
|
|
||||||
List<Double> data22 = valueTypeList.stream().map(DataHarmpowerS::getS11).collect(Collectors.toList());
|
|
||||||
List<Double> data23 = valueTypeList.stream().map(DataHarmpowerS::getS12).collect(Collectors.toList());
|
|
||||||
List<Double> data24 = valueTypeList.stream().map(DataHarmpowerS::getS13).collect(Collectors.toList());
|
|
||||||
List<Double> data25 = valueTypeList.stream().map(DataHarmpowerS::getS14).collect(Collectors.toList());
|
|
||||||
List<Double> data26 = valueTypeList.stream().map(DataHarmpowerS::getS15).collect(Collectors.toList());
|
|
||||||
List<Double> data27 = valueTypeList.stream().map(DataHarmpowerS::getS16).collect(Collectors.toList());
|
|
||||||
List<Double> data28 = valueTypeList.stream().map(DataHarmpowerS::getS17).collect(Collectors.toList());
|
|
||||||
List<Double> data29 = valueTypeList.stream().map(DataHarmpowerS::getS18).collect(Collectors.toList());
|
|
||||||
List<Double> data30 = valueTypeList.stream().map(DataHarmpowerS::getS19).collect(Collectors.toList());
|
|
||||||
List<Double> data31 = valueTypeList.stream().map(DataHarmpowerS::getS20).collect(Collectors.toList());
|
|
||||||
List<Double> data32 = valueTypeList.stream().map(DataHarmpowerS::getS21).collect(Collectors.toList());
|
|
||||||
List<Double> data33 = valueTypeList.stream().map(DataHarmpowerS::getS22).collect(Collectors.toList());
|
|
||||||
List<Double> data34 = valueTypeList.stream().map(DataHarmpowerS::getS23).collect(Collectors.toList());
|
|
||||||
List<Double> data35 = valueTypeList.stream().map(DataHarmpowerS::getS24).collect(Collectors.toList());
|
|
||||||
List<Double> data36 = valueTypeList.stream().map(DataHarmpowerS::getS25).collect(Collectors.toList());
|
|
||||||
List<Double> data37 = valueTypeList.stream().map(DataHarmpowerS::getS26).collect(Collectors.toList());
|
|
||||||
List<Double> data38 = valueTypeList.stream().map(DataHarmpowerS::getS27).collect(Collectors.toList());
|
|
||||||
List<Double> data39 = valueTypeList.stream().map(DataHarmpowerS::getS28).collect(Collectors.toList());
|
|
||||||
List<Double> data40 = valueTypeList.stream().map(DataHarmpowerS::getS29).collect(Collectors.toList());
|
|
||||||
List<Double> data41 = valueTypeList.stream().map(DataHarmpowerS::getS30).collect(Collectors.toList());
|
|
||||||
List<Double> data42 = valueTypeList.stream().map(DataHarmpowerS::getS31).collect(Collectors.toList());
|
|
||||||
List<Double> data43 = valueTypeList.stream().map(DataHarmpowerS::getS32).collect(Collectors.toList());
|
|
||||||
List<Double> data44 = valueTypeList.stream().map(DataHarmpowerS::getS33).collect(Collectors.toList());
|
|
||||||
List<Double> data45 = valueTypeList.stream().map(DataHarmpowerS::getS34).collect(Collectors.toList());
|
|
||||||
List<Double> data46 = valueTypeList.stream().map(DataHarmpowerS::getS35).collect(Collectors.toList());
|
|
||||||
List<Double> data47 = valueTypeList.stream().map(DataHarmpowerS::getS36).collect(Collectors.toList());
|
|
||||||
List<Double> data48 = valueTypeList.stream().map(DataHarmpowerS::getS37).collect(Collectors.toList());
|
|
||||||
List<Double> data49 = valueTypeList.stream().map(DataHarmpowerS::getS38).collect(Collectors.toList());
|
|
||||||
List<Double> data50 = valueTypeList.stream().map(DataHarmpowerS::getS39).collect(Collectors.toList());
|
|
||||||
List<Double> data51 = valueTypeList.stream().map(DataHarmpowerS::getS40).collect(Collectors.toList());
|
|
||||||
List<Double> data52 = valueTypeList.stream().map(DataHarmpowerS::getS41).collect(Collectors.toList());
|
|
||||||
List<Double> data53 = valueTypeList.stream().map(DataHarmpowerS::getS42).collect(Collectors.toList());
|
|
||||||
List<Double> data54 = valueTypeList.stream().map(DataHarmpowerS::getS43).collect(Collectors.toList());
|
|
||||||
List<Double> data55 = valueTypeList.stream().map(DataHarmpowerS::getS44).collect(Collectors.toList());
|
|
||||||
List<Double> data56 = valueTypeList.stream().map(DataHarmpowerS::getS45).collect(Collectors.toList());
|
|
||||||
List<Double> data57 = valueTypeList.stream().map(DataHarmpowerS::getS46).collect(Collectors.toList());
|
|
||||||
List<Double> data58 = valueTypeList.stream().map(DataHarmpowerS::getS47).collect(Collectors.toList());
|
|
||||||
List<Double> data59 = valueTypeList.stream().map(DataHarmpowerS::getS48).collect(Collectors.toList());
|
|
||||||
List<Double> data60 = valueTypeList.stream().map(DataHarmpowerS::getS49).collect(Collectors.toList());
|
|
||||||
List<Double> data61 = valueTypeList.stream().map(DataHarmpowerS::getS50).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<List<Double>> lists = Arrays.asList(data1,data12,data13,data14
|
|
||||||
,data15,data16,data17,data18,data19,data20,data21,data22,data23,data24
|
|
||||||
,data25,data26,data27,data28,data29,data30,data31,data32,data33,data34
|
|
||||||
,data35,data36,data37,data38,data39,data40,data41,data42,data43,data44
|
|
||||||
,data45,data46,data47,data48,data49,data50,data51,data52,data53,data54
|
|
||||||
,data55,data56,data57,data58,data59,data60,data61);
|
|
||||||
value.setValueList(lists);
|
value.setValueList(lists);
|
||||||
valueTypes.add(value);
|
valueTypes.add(value);
|
||||||
});
|
});
|
||||||
@@ -198,6 +144,39 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<List<Double>> extractDataLists(List<DataHarmpowerS> dataList, String prefix) {
|
||||||
|
List<List<Double>> result = new ArrayList<>();
|
||||||
|
result.add(extractField(dataList, prefix + "S"));
|
||||||
|
// Q1到Q50
|
||||||
|
for (int i = 1; i <= 50; i++) {
|
||||||
|
String fieldName = prefix + (i == 1 ? "S1" : "S" + i);
|
||||||
|
result.add(extractField(dataList, fieldName));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<Double> extractField(List<DataHarmpowerS> dataList, String fieldName) {
|
||||||
|
try {
|
||||||
|
Method method = DataHarmpowerS.class.getMethod("get" + capitalize(fieldName));
|
||||||
|
return dataList.stream()
|
||||||
|
.map(data -> {
|
||||||
|
try {
|
||||||
|
return (Double) method.invoke(data);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Failed to get field: " + fieldName, e);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new RuntimeException("Field not found: " + fieldName, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String capitalize(String str) {
|
||||||
|
if (str == null || str.isEmpty()) return str;
|
||||||
|
return str.substring(0, 1).toUpperCase() + str.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addList(List<DataHarmPowerSDto> list) {
|
public void addList(List<DataHarmPowerSDto> list) {
|
||||||
|
|
||||||
@@ -227,7 +206,7 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
List<DataHarmpowerS> dataList;
|
List<DataHarmpowerS> dataList;
|
||||||
List<DataHarmpowerS> result = new ArrayList<>();
|
List<DataHarmpowerS> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.S, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.S, InfluxDbSqlConstant.S, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataHarmpowerS::getLineId, lineList)
|
influxQueryWrapper.regular(DataHarmpowerS::getLineId, lineList)
|
||||||
.select(DataHarmpowerS::getLineId)
|
.select(DataHarmpowerS::getLineId)
|
||||||
.select(DataHarmpowerS::getPhasicType)
|
.select(DataHarmpowerS::getPhasicType)
|
||||||
@@ -291,16 +270,23 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
|
|||||||
String devId = lineMap.get(lineId).getDeviceId();
|
String devId = lineMap.get(lineId).getDeviceId();
|
||||||
CsLinePO po = lineMap.get(lineId);
|
CsLinePO po = lineMap.get(lineId);
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
||||||
|
//A、B、C谐波视在功率有效值
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmS_", "s_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmS_", "s_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
|
//三相总 谐波视在功率有效值
|
||||||
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmTS_", "totS_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
influxQueryWrapper.eq(DataHarmpowerS::getLineId, lineId)
|
influxQueryWrapper.eq(DataHarmpowerS::getLineId, lineId)
|
||||||
.eq(DataHarmpowerS::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
.eq(DataHarmpowerS::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
||||||
.select(DataHarmpowerS::getLineId)
|
.select(DataHarmpowerS::getLineId)
|
||||||
.select(DataHarmpowerS::getPhasicType)
|
.select(DataHarmpowerS::getPhasicType)
|
||||||
.select(DataHarmpowerS::getValueType)
|
.select(DataHarmpowerS::getValueType)
|
||||||
//总功功率
|
//A、B、C视在功率
|
||||||
.select("Pq_S","s")
|
.select("Pq_S","s")
|
||||||
//基波有功功率
|
//基波视在功率
|
||||||
.select("Pq_FundS","s_1")
|
.select("Pq_FundS","s_1")
|
||||||
|
//总视在功率
|
||||||
|
.select("Pq_TotS","totS")
|
||||||
|
//基波视在功率(T)
|
||||||
|
.select("Pq_TotHarmS","totS1")
|
||||||
.between(DataHarmpowerS::getTime, startTime, endTime)
|
.between(DataHarmpowerS::getTime, startTime, endTime)
|
||||||
.eq(DataHarmpowerS::getQualityFlag, "0");
|
.eq(DataHarmpowerS::getQualityFlag, "0");
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
if (Objects.isNull(po.getLineNo())) {
|
||||||
|
|||||||
@@ -69,9 +69,8 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataI> collect = dataIDTOList.stream().flatMap(temp -> DataI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataI> collect = dataIDTOList.stream().flatMap(temp -> DataI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataI>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataI>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataI> dataIList : partition) {
|
for (List<DataI> dataIList : partition) {
|
||||||
List<DataI> sublistAsOriginalListType = new ArrayList<>(dataIList);
|
List<DataI> sublistAsOriginalListType = new ArrayList<>(dataIList);
|
||||||
|
|
||||||
@@ -232,7 +231,7 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<DataIDto> getGroupByTimeDataI(LineCountEvaluateParam lineParam) {
|
public List<DataIDto> getGroupByTimeDataI(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||||
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.maxSamePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId())
|
influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId())
|
||||||
.eq(DataI::getValueType, InfluxDbSqlConstant.CP95)
|
.eq(DataI::getValueType, InfluxDbSqlConstant.CP95)
|
||||||
.ne(DataI::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
.ne(DataI::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
||||||
@@ -260,7 +259,7 @@ public class InfluxdbDataIImpl extends MppServiceImpl<RStatDataIRelationMapper,
|
|||||||
List<DataI> dataList;
|
List<DataI> dataList;
|
||||||
List<DataI> result = new ArrayList<>();
|
List<DataI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId())
|
influxQueryWrapper.regular(DataI::getLineId, lineParam.getLineId())
|
||||||
.select(DataI::getLineId)
|
.select(DataI::getLineId)
|
||||||
.select(DataI::getPhasicType)
|
.select(DataI::getPhasicType)
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
List<DataInharmI> collect = dataInharmIDTOList.stream().flatMap(temp -> DataInharmI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataInharmI> collect = dataInharmIDTOList.stream().flatMap(temp -> DataInharmI.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
int minSize = Math.min(1200000, collect.size());
|
||||||
|
|
||||||
List<List<DataInharmI>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataInharmI>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataInharmI> dataInharmIList : partition) {
|
for (List<DataInharmI> dataInharmIList : partition) {
|
||||||
List<DataInharmI> sublistAsOriginalListType = new ArrayList<>(dataInharmIList);
|
List<DataInharmI> sublistAsOriginalListType = new ArrayList<>(dataInharmIList);
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ public class InfluxdbDataInharmIImpl extends MppServiceImpl<RStatDataInHarmIRela
|
|||||||
List<DataInharmI> dataList;
|
List<DataInharmI> dataList;
|
||||||
List<DataInharmI> result = new ArrayList<>();
|
List<DataInharmI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataInharmI::getLineId, lineList)
|
influxQueryWrapper.regular(DataInharmI::getLineId, lineList)
|
||||||
.select(DataInharmI::getLineId)
|
.select(DataInharmI::getLineId)
|
||||||
.select(DataInharmI::getPhasicType)
|
.select(DataInharmI::getPhasicType)
|
||||||
|
|||||||
@@ -68,9 +68,8 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataInharmV> collect = dataInharmVDTOList.stream().flatMap(temp -> DataInharmV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataInharmV> collect = dataInharmVDTOList.stream().flatMap(temp -> DataInharmV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataInharmV>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataInharmV>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataInharmV> dataInharmVList : partition) {
|
for (List<DataInharmV> dataInharmVList : partition) {
|
||||||
List<DataInharmV> sublistAsOriginalListType = new ArrayList<>(dataInharmVList);
|
List<DataInharmV> sublistAsOriginalListType = new ArrayList<>(dataInharmVList);
|
||||||
|
|
||||||
@@ -227,7 +226,7 @@ public class InfluxdbDataInharmVImpl extends MppServiceImpl<RStatDataInHarmVRela
|
|||||||
List<DataInharmV> dataList;
|
List<DataInharmV> dataList;
|
||||||
List<DataInharmV> result = new ArrayList<>();
|
List<DataInharmV> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataInharmV::getLineId, lineParam.getLineId())
|
influxQueryWrapper.regular(DataInharmV::getLineId, lineParam.getLineId())
|
||||||
.select(DataInharmV::getLineId)
|
.select(DataInharmV::getLineId)
|
||||||
.select(DataInharmV::getPhasicType)
|
.select(DataInharmV::getPhasicType)
|
||||||
|
|||||||
@@ -66,9 +66,8 @@ public class InfluxdbDataPltImpl extends MppServiceImpl<RStatDataPltRelationMapp
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<DataPlt> collect = dataPltDTOList.stream().map(temp -> DataPlt.relationToInfluxDB(temp)).collect(Collectors.toList());
|
List<DataPlt> collect = dataPltDTOList.stream().map(temp -> DataPlt.relationToInfluxDB(temp)).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataPlt>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataPlt>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataPlt> dataPltList : partition) {
|
for (List<DataPlt> dataPltList : partition) {
|
||||||
List<DataPlt> sublistAsOriginalListType = new ArrayList<>(dataPltList);
|
List<DataPlt> sublistAsOriginalListType = new ArrayList<>(dataPltList);
|
||||||
|
|
||||||
|
|||||||
@@ -111,9 +111,8 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataV> collect = dataVDTOList.stream().flatMap(temp -> DataV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
List<DataV> collect = dataVDTOList.stream().flatMap(temp -> DataV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataV>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataV>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataV> dataVList : partition) {
|
for (List<DataV> dataVList : partition) {
|
||||||
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
||||||
|
|
||||||
@@ -158,7 +157,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public Integer getCountRawData(LineCountEvaluateParam lineParam) {
|
public Integer getCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper.regular(DataV::getLineId, lineParam.getLineId())
|
influxQueryWrapper.regular(DataV::getLineId, lineParam.getLineId())
|
||||||
.select(DataV::getLineId)
|
.select(DataV::getLineId)
|
||||||
.select(DataV::getPhasicType)
|
.select(DataV::getPhasicType)
|
||||||
@@ -209,7 +208,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
Map<String, List<String>> abnormalTime = lineParam.getAbnormalTime();
|
Map<String, List<String>> abnormalTime = lineParam.getAbnormalTime();
|
||||||
if(CollUtil.isNotEmpty(abnormalTime)){
|
if (CollUtil.isNotEmpty(abnormalTime)) {
|
||||||
if (abnormalTime.containsKey(lineParam.getLineId().get(0))) {
|
if (abnormalTime.containsKey(lineParam.getLineId().get(0))) {
|
||||||
List<String> timeList = abnormalTime.get(lineParam.getLineId().get(0));
|
List<String> timeList = abnormalTime.get(lineParam.getLineId().get(0));
|
||||||
//有异常数据,当前监测点自身的异常数据
|
//有异常数据,当前监测点自身的异常数据
|
||||||
@@ -217,7 +216,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()));
|
result.addAll(list.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
result.addAll(list);
|
result.addAll(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,12 +369,10 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return dataV;
|
return dataV;
|
||||||
|
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
int minSize = Math.min(1200000, collect.size());
|
|
||||||
|
|
||||||
List<List<DataV>> partition = ListUtils.partition(collect, minSize);
|
List<List<DataV>> partition = ListUtils.partition(collect, 20000);
|
||||||
for (List<DataV> dataVList : partition) {
|
for (List<DataV> dataVList : partition) {
|
||||||
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
|
||||||
|
|
||||||
dataVMapper.insertBatch(sublistAsOriginalListType);
|
dataVMapper.insertBatch(sublistAsOriginalListType);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -393,8 +390,8 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
.groupBy(DataV::getLineId)
|
.groupBy(DataV::getLineId)
|
||||||
.between(DataV::getTime, startTime, endTime);
|
.between(DataV::getTime, startTime, endTime);
|
||||||
List<MeasurementCountDTO> measurementCountDTOList = dataVMapper.getMeasurementCount(influxQueryWrapper);
|
List<MeasurementCountDTO> measurementCountDTOList = dataVMapper.getMeasurementCount(influxQueryWrapper);
|
||||||
if(CollUtil.isNotEmpty(measurementCountDTOList)){
|
if (CollUtil.isNotEmpty(measurementCountDTOList)) {
|
||||||
for(MeasurementCountDTO m : measurementCountDTOList){
|
for (MeasurementCountDTO m : measurementCountDTOList) {
|
||||||
MeasurementCountDTO.MeasurementCountResultDTO p = new MeasurementCountDTO.MeasurementCountResultDTO();
|
MeasurementCountDTO.MeasurementCountResultDTO p = new MeasurementCountDTO.MeasurementCountResultDTO();
|
||||||
p.setFreq(m.getFreq());
|
p.setFreq(m.getFreq());
|
||||||
p.setLineId(m.getLineId());
|
p.setLineId(m.getLineId());
|
||||||
@@ -428,6 +425,27 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean excludeZeroData(LineCountEvaluateParam lineParam) {
|
||||||
|
InfluxQueryWrapper dataVQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
|
dataVQueryWrapper.eq(DataV::getLineId, lineParam.getLineId().get(0))
|
||||||
|
.eq(DataV::getValueType, InfluxDbSqlConstant.AVG_WEB)
|
||||||
|
.ne(DataV::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_T)
|
||||||
|
.select(DataV::getRms)
|
||||||
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime());
|
||||||
|
List<DataV> rmsResult = dataVMapper.selectByQueryWrapper(dataVQueryWrapper);
|
||||||
|
if (CollUtil.isNotEmpty(rmsResult)) {
|
||||||
|
List<DataV> exceptionData = rmsResult.stream().filter(dataV -> dataV.getRms() < 1.0).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(exceptionData)) {
|
||||||
|
if (exceptionData.size() * 2 >= rmsResult.size()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按监测点集合、时间条件获取dataV分钟数据
|
* 按监测点集合、时间条件获取dataV分钟数据
|
||||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
@@ -486,53 +504,53 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
CsLinePO po = lineMap.get(lineId);
|
CsLinePO po = lineMap.get(lineId);
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
influxQueryWrapper.eq(DataV::getLineId, lineId)
|
influxQueryWrapper.eq(DataV::getLineId, lineId)
|
||||||
.eq(DataV::getProcess,Integer.toString(devsMap.get(devId).getProcess()))
|
.eq(DataV::getProcess, Integer.toString(devsMap.get(devId).getProcess()))
|
||||||
.select(DataV::getLineId)
|
.select(DataV::getLineId)
|
||||||
.select(DataV::getPhasicType)
|
.select(DataV::getPhasicType)
|
||||||
.select(DataV::getValueType)
|
.select(DataV::getValueType)
|
||||||
//频率
|
//频率
|
||||||
.select("Pq_Freq","freq")
|
.select("Pq_Freq", "freq")
|
||||||
//频率偏差
|
//频率偏差
|
||||||
.select("Pq_FreqDev","freq_dev")
|
.select("Pq_FreqDev", "freq_dev")
|
||||||
//相电压有效值
|
//相电压有效值
|
||||||
.select("Pq_RmsU","rms")
|
.select("Pq_RmsU", "rms")
|
||||||
//线电压有效值
|
//线电压有效值
|
||||||
.select("Pq_RmsLU","rms_lvr")
|
.select("Pq_RmsLU", "rms_lvr")
|
||||||
//电压负序
|
//电压负序
|
||||||
.select("Pq_SeqNegU","v_neg")
|
.select("Pq_SeqNegU", "v_neg")
|
||||||
//电压正序
|
//电压正序
|
||||||
.select("Pq_SeqPosU","v_pos")
|
.select("Pq_SeqPosU", "v_pos")
|
||||||
//电压零序
|
//电压零序
|
||||||
.select("Pq_SeqZeroU","v_zero")
|
.select("Pq_SeqZeroU", "v_zero")
|
||||||
//电压负序不平衡度
|
//电压负序不平衡度
|
||||||
.select("Pq_UnbalNegU","v_unbalance")
|
.select("Pq_UnbalNegU", "v_unbalance")
|
||||||
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
.eq(DataV::getQualityFlag, "0");
|
.eq(DataV::getQualityFlag, "0");
|
||||||
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
||||||
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
||||||
}
|
}
|
||||||
if (Objects.isNull(po.getLineNo())) {
|
if (Objects.isNull(po.getLineNo())) {
|
||||||
influxQueryWrapper.eq(DataV::getCldid,Integer.toString(po.getClDid()));
|
influxQueryWrapper.eq(DataV::getCldid, Integer.toString(po.getClDid()));
|
||||||
} else {
|
} else {
|
||||||
influxQueryWrapper.eq(DataV::getCldid,Integer.toString(po.getLineNo()));
|
influxQueryWrapper.eq(DataV::getCldid, Integer.toString(po.getLineNo()));
|
||||||
}
|
}
|
||||||
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
//判断接线方式 (0-星型 1-角型 2-V型) 星型是相电压 角型或者v型是线电压
|
||||||
if (Objects.equals(po.getConType(),0)) {
|
if (Objects.equals(po.getConType(), 0)) {
|
||||||
//相电压偏差
|
//相电压偏差
|
||||||
influxQueryWrapper.select("Pq_UDev","vu_dev");
|
influxQueryWrapper.select("Pq_UDev", "vu_dev");
|
||||||
//相电压谐波总畸变率
|
//相电压谐波总畸变率
|
||||||
influxQueryWrapper.select("Pq_ThdU","v_thd");
|
influxQueryWrapper.select("Pq_ThdU", "v_thd");
|
||||||
//相电压基波有效值
|
//相电压基波有效值
|
||||||
influxQueryWrapper.select("Pq_RmsFundU","v_1");
|
influxQueryWrapper.select("Pq_RmsFundU", "v_1");
|
||||||
//2-50次 相电压谐波有效值
|
//2-50次 相电压谐波有效值
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
} else {
|
} else {
|
||||||
//线电压偏差
|
//线电压偏差
|
||||||
influxQueryWrapper.select("Pq_LUDev","vu_dev");
|
influxQueryWrapper.select("Pq_LUDev", "vu_dev");
|
||||||
//线电压谐波总畸变率
|
//线电压谐波总畸变率
|
||||||
influxQueryWrapper.select("Pq_ThdLU","v_thd");
|
influxQueryWrapper.select("Pq_ThdLU", "v_thd");
|
||||||
//线电压基波有效值
|
//线电压基波有效值
|
||||||
influxQueryWrapper.select("Pq_RmsFundLU","v_1");
|
influxQueryWrapper.select("Pq_RmsFundLU", "v_1");
|
||||||
//2-50次 线电压谐波有效值
|
//2-50次 线电压谐波有效值
|
||||||
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmLUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix("Pq_HarmLUV_", "v_", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,14 +122,17 @@ public class InfluxdbPqsCommunicateImpl implements IPqsCommunicate {
|
|||||||
pqsCommunicate.setDevId(pqsCommunicateDto.getDevId());
|
pqsCommunicate.setDevId(pqsCommunicateDto.getDevId());
|
||||||
pqsCommunicate.setType(pqsCommunicateDto.getType());
|
pqsCommunicate.setType(pqsCommunicateDto.getType());
|
||||||
//如果不存数据或者状态不一样则插入数据
|
//如果不存数据或者状态不一样则插入数据
|
||||||
if(CollectionUtils.isEmpty(pqsCommunicates)|| !Objects.equals( pqsCommunicates.get(0).getType(),pqsCommunicateDto.getType())){
|
//可能存在掉线后最后一组数据还未入库,添加时间判断
|
||||||
|
if(CollectionUtils.isEmpty(pqsCommunicates)|| (!Objects.equals( pqsCommunicates.get(0).getType(),pqsCommunicateDto.getType())&&pqsCommunicates.get(0).getTime().isBefore(pqsCommunicate.getTime()))){
|
||||||
pqsCommunicateMapper.insertOne(pqsCommunicate);
|
pqsCommunicateMapper.insertOne(pqsCommunicate);
|
||||||
|
|
||||||
}
|
}
|
||||||
//更新mysql数据
|
//更新mysql数据
|
||||||
DevComFlagDTO devComFlagDTO = new DevComFlagDTO();
|
DevComFlagDTO devComFlagDTO = new DevComFlagDTO();
|
||||||
devComFlagDTO.setId(pqsCommunicateDto.getDevId());
|
devComFlagDTO.setId(pqsCommunicateDto.getDevId());
|
||||||
|
if(Objects.equals(pqsCommunicateDto.getFlag(),1)){
|
||||||
devComFlagDTO.setDate(LocalDateTime.parse(pqsCommunicateDto.getTime(), DATE_TIME_FORMATTER));
|
devComFlagDTO.setDate(LocalDateTime.parse(pqsCommunicateDto.getTime(), DATE_TIME_FORMATTER));
|
||||||
|
}
|
||||||
devComFlagDTO.setStatus(pqsCommunicateDto.getType());
|
devComFlagDTO.setStatus(pqsCommunicateDto.getType());
|
||||||
|
|
||||||
deviceFeignClient.updateDevComFlag(devComFlagDTO);
|
deviceFeignClient.updateDevComFlag(devComFlagDTO);
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.dataProcess.service.impl.relation;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.dataProcess.dao.relation.mapper.PqDataVerifyCountMapper;
|
||||||
|
import com.njcn.dataProcess.dao.relation.mapper.PqDataVerifyNewMapper;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyBak;
|
||||||
|
import com.njcn.dataProcess.pojo.po.PqDataVerifyCount;
|
||||||
|
import com.njcn.dataProcess.service.IPqDataVerifyCountService;
|
||||||
|
import com.njcn.dataProcess.service.IPqDataVerifyNewService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author xy
|
||||||
|
* @since 2025-02-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqDataVerifyCountServiceImpl extends MppServiceImpl<PqDataVerifyCountMapper, PqDataVerifyCount> implements IPqDataVerifyCountService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertDataBatch(List<PqDataVerifyCount> list) {
|
||||||
|
this.saveOrUpdateBatchByMultiId(list,1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertData(PqDataVerifyCount pqDataVerifyCount) {
|
||||||
|
this.saveOrUpdateByMultiId(pqDataVerifyCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,6 +11,7 @@ import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
|||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitRateDetailRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitRateDetailRelationMapper;
|
||||||
import com.njcn.dataProcess.pojo.dto.*;
|
import com.njcn.dataProcess.pojo.dto.*;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitRateD;
|
||||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
||||||
import com.njcn.dataProcess.service.IDataLimitRateDetail;
|
import com.njcn.dataProcess.service.IDataLimitRateDetail;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -81,7 +82,9 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
|
|||||||
LambdaQueryWrapper<RStatLimitRateDetailD> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<RStatLimitRateDetailD> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()), RStatLimitRateDetailD::getLineId, lineParam.getLineId())
|
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()), RStatLimitRateDetailD::getLineId, lineParam.getLineId())
|
||||||
.ge(RStatLimitRateDetailD::getTime, lineParam.getStartTime())
|
.ge(RStatLimitRateDetailD::getTime, lineParam.getStartTime())
|
||||||
.le(RStatLimitRateDetailD::getTime, lineParam.getEndTime());
|
.le(RStatLimitRateDetailD::getTime, lineParam.getEndTime())
|
||||||
|
.orderByAsc(RStatLimitRateDetailD::getTime)
|
||||||
|
;
|
||||||
|
|
||||||
List<RStatLimitRateDetailD> list = this.list(lambdaQueryWrapper);
|
List<RStatLimitRateDetailD> list = this.list(lambdaQueryWrapper);
|
||||||
DataLimitRateDetailTimeDto dto;
|
DataLimitRateDetailTimeDto dto;
|
||||||
@@ -111,7 +114,15 @@ public class RelationDataLimitRateDetailImpl extends MppServiceImpl<RStatLimitRa
|
|||||||
BeanUtils.copyProperties(item, limitRate);
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
result.add(limitRate);
|
result.add(limitRate);
|
||||||
});
|
});
|
||||||
this.saveOrUpdateBatchByMultiId(result,1000);
|
if(CollUtil.isNotEmpty(result)){
|
||||||
|
List<String> ids = result.stream().map(RStatLimitRateDetailD::getLineId).collect(Collectors.toList());
|
||||||
|
this.remove(new LambdaQueryWrapper<RStatLimitRateDetailD>()
|
||||||
|
.eq(RStatLimitRateDetailD::getTime,result.get(0).getTime())
|
||||||
|
.in(RStatLimitRateDetailD::getLineId,ids)
|
||||||
|
);
|
||||||
|
this.saveBatch(result,500);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ public class RelationDataLimitRateImpl extends MppServiceImpl<RStatLimitRateRela
|
|||||||
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RStatLimitRateD::getLineId,lineParam.getLineId())
|
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RStatLimitRateD::getLineId,lineParam.getLineId())
|
||||||
.ge(RStatLimitRateD::getTime,lineParam.getStartTime())
|
.ge(RStatLimitRateD::getTime,lineParam.getStartTime())
|
||||||
.le(RStatLimitRateD::getTime,lineParam.getEndTime())
|
.le(RStatLimitRateD::getTime,lineParam.getEndTime())
|
||||||
.eq(RStatLimitRateD::getPhasicType, PhaseType.PHASE_T);
|
.eq(RStatLimitRateD::getPhasicType, PhaseType.PHASE_T)
|
||||||
|
.orderByAsc(RStatLimitRateD::getTime)
|
||||||
|
;
|
||||||
List<RStatLimitRateD> list = this.list(lambdaQueryWrapper);
|
List<RStatLimitRateD> list = this.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
list.forEach(item->{
|
list.forEach(item->{
|
||||||
|
|||||||
@@ -167,6 +167,11 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean excludeZeroData(LineCountEvaluateParam lineParam) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private List<DataVDto> quality(List<DataVDto> list, LineCountEvaluateParam lineParam) {
|
private List<DataVDto> quality(List<DataVDto> list, LineCountEvaluateParam lineParam) {
|
||||||
List<DataVDto> result = new ArrayList<>();
|
List<DataVDto> result = new ArrayList<>();
|
||||||
Map<String, List<DataVDto>> lineMap = list.stream().collect(Collectors.groupingBy(DataVDto::getLineId));
|
Map<String, List<DataVDto>> lineMap = list.stream().collect(Collectors.groupingBy(DataVDto::getLineId));
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10405
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/json,application/xml,text/html,text/xml,text/plain
|
||||||
|
min-response-size: 1024
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
#nacos注册中心以及配置中心的指定
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
config:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: error
|
||||||
|
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
|
|
||||||
|
data:
|
||||||
|
source:
|
||||||
|
query: Influxdb
|
||||||
|
# insert: Influxdb
|
||||||
|
insert: Relation
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
configuration:
|
||||||
|
#配置sql日志输出
|
||||||
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
|
||||||
|
|
||||||
|
# type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
# type-handlers-package: com.njcn.db.handler
|
||||||
|
# global-config:
|
||||||
|
# db-config:
|
||||||
|
# date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
# global-config:
|
||||||
|
# enable-sql-runner: true
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10405
|
||||||
|
compression:
|
||||||
|
enabled: true
|
||||||
|
mime-types: application/json,application/xml,text/html,text/xml,text/plain
|
||||||
|
min-response-size: 1024
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
#nacos注册中心以及配置中心的指定
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
ip: @service.server.url@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
config:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 100MB
|
||||||
|
max-request-size: 100MB
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: error
|
||||||
|
|
||||||
|
|
||||||
|
#mqtt:
|
||||||
|
# client-id: @artifactId@${random.value}
|
||||||
|
|
||||||
|
data:
|
||||||
|
source:
|
||||||
|
query: Influxdb
|
||||||
|
# insert: Influxdb
|
||||||
|
insert: Relation
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
configuration:
|
||||||
|
#配置sql日志输出
|
||||||
|
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
|
||||||
|
|
||||||
|
# type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
# type-handlers-package: com.njcn.db.handler
|
||||||
|
# global-config:
|
||||||
|
# db-config:
|
||||||
|
# date-format: yyyy-MM-dd HH:mm:ss
|
||||||
|
# global-config:
|
||||||
|
# enable-sql-runner: true
|
||||||
@@ -1,77 +1,3 @@
|
|||||||
#当前服务的基本信息
|
|
||||||
microservice:
|
|
||||||
ename: @artifactId@
|
|
||||||
name: '@name@'
|
|
||||||
version: @version@
|
|
||||||
sentinel:
|
|
||||||
url: @sentinel.url@
|
|
||||||
gateway:
|
|
||||||
url: @gateway.url@
|
|
||||||
server:
|
|
||||||
port: 10405
|
|
||||||
compression:
|
|
||||||
enabled: true
|
|
||||||
mime-types: application/json,application/xml,text/html,text/xml,text/plain
|
|
||||||
min-response-size: 1024
|
|
||||||
#feign接口开启服务熔断降级处理
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
profiles:
|
||||||
name: @artifactId@
|
active: @spring.profiles.active@
|
||||||
#nacos注册中心以及配置中心的指定
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
ip: @service.server.url@
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
config:
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
file-extension: yaml
|
|
||||||
shared-configs:
|
|
||||||
- data-id: share-config.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: share-config-datasource-db.yaml
|
|
||||||
refresh: true
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 100MB
|
|
||||||
max-request-size: 100MB
|
|
||||||
jackson:
|
|
||||||
time-zone: GMT+8
|
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
|
||||||
logging:
|
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
|
||||||
level:
|
|
||||||
root: info
|
|
||||||
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
client-id: @artifactId@${random.value}
|
|
||||||
|
|
||||||
data:
|
|
||||||
source:
|
|
||||||
query: Influxdb
|
|
||||||
# insert: Influxdb
|
|
||||||
insert: Relation
|
|
||||||
#mybatis配置信息
|
|
||||||
mybatis-plus:
|
|
||||||
configuration:
|
|
||||||
#配置sql日志输出
|
|
||||||
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
|
|
||||||
|
|
||||||
|
|
||||||
# type-aliases-package: com.njcn.harmonic.pojo
|
|
||||||
# type-handlers-package: com.njcn.db.handler
|
|
||||||
# global-config:
|
|
||||||
# db-config:
|
|
||||||
# date-format: yyyy-MM-dd HH:mm:ss
|
|
||||||
# global-config:
|
|
||||||
# enable-sql-runner: true
|
|
||||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
|
||||||
import com.njcn.message.api.fallback.ProduceFeignClientFallbackFactory;
|
import com.njcn.message.api.fallback.ProduceFeignClientFallbackFactory;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
@@ -38,4 +39,7 @@ public interface ProduceFeignClient {
|
|||||||
|
|
||||||
public HttpResult<Boolean> askRestartProcess(@RequestBody ProcessRebootMessage message);
|
public HttpResult<Boolean> askRestartProcess(@RequestBody ProcessRebootMessage message);
|
||||||
|
|
||||||
|
@PostMapping("/askFileSys")
|
||||||
|
public HttpResult<String> askFileSys(@RequestBody AskFileSysMessage message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
|
||||||
import com.njcn.message.api.ProduceFeignClient;
|
import com.njcn.message.api.ProduceFeignClient;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
@@ -53,6 +54,12 @@ public class ProduceFeignClientFallbackFactory implements FallbackFactory<Produc
|
|||||||
log.error("{}异常,降级处理,异常为:{}", "进程重启", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "进程重启", throwable.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> askFileSys(AskFileSysMessage message) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "请求装置文件系统", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ public interface BusinessTopic {
|
|||||||
String ASK_REAL_DATA_TOPIC = "ask_real_data_topic";
|
String ASK_REAL_DATA_TOPIC = "ask_real_data_topic";
|
||||||
String RECALL_TOPIC = "recall_Topic";
|
String RECALL_TOPIC = "recall_Topic";
|
||||||
|
|
||||||
|
String FILE_TOPIC = "File_Topic";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************数据中心*********************************/
|
/********************************数据中心*********************************/
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.njcn.message.message;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 10:15【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AskFileSysMessage {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* guid : sdghsfdhfdhdfhdfghd234234534534
|
||||||
|
* frontid : dhdfhdfghd2342
|
||||||
|
* ProcessNo : 1
|
||||||
|
* devid : 167456737637374567
|
||||||
|
* type : 2
|
||||||
|
* Path : /remote/vol1_stat.txt
|
||||||
|
* DevPath : /etc/vol1_stat.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String guid;
|
||||||
|
private String nodeId;
|
||||||
|
private int processNo;
|
||||||
|
private String devId;
|
||||||
|
private int type;
|
||||||
|
private String path;
|
||||||
|
private String remotePath;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.njcn.message.messagedto;
|
||||||
|
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2026/04/29 下午 3:16【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class FileSysDTO<T> extends BaseMessage implements Serializable {
|
||||||
|
private String guid;
|
||||||
|
private String nodeId;
|
||||||
|
private int processNo;
|
||||||
|
private String devId;
|
||||||
|
private int type;
|
||||||
|
private String path;
|
||||||
|
private String devPath;
|
||||||
|
private int result;
|
||||||
|
private T detail;
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import com.njcn.stat.api.MessAnalysisFeignClient;
|
|||||||
import com.njcn.system.api.RocketMqLogFeignClient;
|
import com.njcn.system.api.RocketMqLogFeignClient;
|
||||||
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
|
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
import org.apache.rocketmq.spring.core.RocketMQListener;
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -32,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Device_Run_Flag_Topic",
|
topic = "Device_Run_Flag_Topic",
|
||||||
consumerGroup = "Device_Run_Flag_Consumer",
|
consumerGroup = "Device_Run_Flag_Consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
@@ -82,7 +83,20 @@ public class DeviceRunFlagDataConsumer extends EnhanceConsumerMessageHandler<Dev
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleMessage(DevComFlagDTO message) {
|
protected void handleMessage(DevComFlagDTO message) {
|
||||||
|
//获取之前设备状态
|
||||||
|
//删除设备时前置会在连接一次通道但是DevId为空所以添加
|
||||||
|
if(StringUtils.isNoneBlank(message.getId())){
|
||||||
|
String devFalg =redisUtil.getStringByKey(RedisKeyPrefix.DEVICE_RUN_FLAG.concat(message.getId()));
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(devFalg)||(!Objects.equals(Integer.valueOf(devFalg),message.getStatus()))){
|
||||||
|
//状态翻转
|
||||||
messAnalysisFeignClient.handleDevRunflag(message);
|
messAnalysisFeignClient.handleDevRunflag(message);
|
||||||
|
redisUtil.saveByKey(RedisKeyPrefix.DEVICE_RUN_FLAG.concat(message.getId()),message.getStatus()+"");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
package com.njcn.message.consumer;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.njcn.message.constant.MessageStatus;
|
||||||
|
import com.njcn.message.constant.RedisKeyPrefix;
|
||||||
|
import com.njcn.message.messagedto.FileSysDTO;
|
||||||
|
import com.njcn.message.messagedto.MessageDataDTO;
|
||||||
|
import com.njcn.message.websocket.WebSocketServer;
|
||||||
|
import com.njcn.middle.rocket.constant.EnhanceMessageConstant;
|
||||||
|
import com.njcn.middle.rocket.handler.EnhanceConsumerMessageHandler;
|
||||||
|
import com.njcn.redis.pojo.enums.RedisKeyEnum;
|
||||||
|
import com.njcn.redis.utils.RedisUtil;
|
||||||
|
import com.njcn.system.api.RocketMqLogFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.RocketmqMsgErrorLog;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQListener;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 10:06【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RocketMQMessageListener(
|
||||||
|
topic = "File_Reply_Topic",
|
||||||
|
consumerGroup = "file_sys_consumer",
|
||||||
|
consumeThreadNumber = 10,
|
||||||
|
enableMsgTrace = true
|
||||||
|
)
|
||||||
|
@Slf4j
|
||||||
|
public class FileSysDataConsumer extends EnhanceConsumerMessageHandler<FileSysDTO> implements RocketMQListener<String> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RocketMqLogFeignClient rocketMqLogFeignClient;
|
||||||
|
@Override
|
||||||
|
public void onMessage(String message) {
|
||||||
|
|
||||||
|
FileSysDTO messageDataDTO = JSONObject.parseObject(message, FileSysDTO.class);
|
||||||
|
super.dispatchMessage(messageDataDTO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 通过redis分布式锁判断当前消息所处状态
|
||||||
|
* 1、null 查不到该key的数据,属于第一次消费,放行
|
||||||
|
* 2、fail 上次消息消费时发生异常,放行
|
||||||
|
* 3、being processed 正在处理,打回去
|
||||||
|
* 4、success 最近72小时消费成功,避免重复消费,打回去
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean filter(FileSysDTO message) {
|
||||||
|
String keyStatus = redisUtil.getStringByKey(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()));
|
||||||
|
if (Objects.isNull(keyStatus) || keyStatus.equalsIgnoreCase(MessageStatus.FAIL)) {
|
||||||
|
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.BEING_PROCESSED, 30L);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 消费成功,缓存到redis5分钟,避免重复消费
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void consumeSuccess(FileSysDTO message) {
|
||||||
|
// redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.SUCCESS, 5*60L);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void handleMessage(FileSysDTO message) {
|
||||||
|
|
||||||
|
String msgId = message.getGuid();
|
||||||
|
// 1. 将结果存入 Redis,过期时间 60 秒(足够完成请求)
|
||||||
|
String key = "pending:" + msgId;
|
||||||
|
redisUtil.saveByKeyWithExpire(key, message, 60L);
|
||||||
|
// 2. 发布 Redis 通知,让等待的实例知道结果已就绪
|
||||||
|
stringRedisTemplate.convertAndSend("result_ready_channel", msgId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发生异常时,进行错误信息入库保存
|
||||||
|
* 默认没有实现类,子类可以实现该方法,调用feign接口进行入库保存
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void saveExceptionMsgLog(FileSysDTO message, String identity, Exception exception) {
|
||||||
|
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.REAL_TIME_DATA.concat(message.getKey()), MessageStatus.FAIL, RedisKeyEnum.ROCKET_MQ_KEY.getTime());
|
||||||
|
RocketmqMsgErrorLog rocketmqMsgErrorLog = new RocketmqMsgErrorLog();
|
||||||
|
rocketmqMsgErrorLog.setMsgKey(message.getKey());
|
||||||
|
rocketmqMsgErrorLog.setResource(message.getSource());
|
||||||
|
if (identity.equalsIgnoreCase(EnhanceMessageConstant.IDENTITY_SINGLE)) {
|
||||||
|
//数据库字段配置长度200,避免插入失败,大致分析异常原因
|
||||||
|
String exceptionMsg = exception.getMessage();
|
||||||
|
if(exceptionMsg.length() > 200){
|
||||||
|
exceptionMsg = exceptionMsg.substring(0,180);
|
||||||
|
}
|
||||||
|
rocketmqMsgErrorLog.setRecord(exceptionMsg);
|
||||||
|
//如果是当前消息重试的则略过
|
||||||
|
if(!message.getSource().startsWith(EnhanceMessageConstant.RETRY_PREFIX)){
|
||||||
|
//单次消费异常
|
||||||
|
rocketMqLogFeignClient.add(rocketmqMsgErrorLog);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rocketmqMsgErrorLog.setRecord("重试消费" + super.getMaxRetryTimes() + "次,依旧消费失败。");
|
||||||
|
//重试N次后,依然消费异常
|
||||||
|
rocketMqLogFeignClient.add(rocketmqMsgErrorLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 处理失败后,是否重试
|
||||||
|
* 一般开启
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isRetry() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 消费失败是否抛出异常,抛出异常后就不再消费了
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean throwException() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "LN_Topic",
|
topic = "LN_Topic",
|
||||||
consumerGroup = "ln_consumer",
|
consumerGroup = "ln_consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Heart_Beat_Topic",
|
topic = "Heart_Beat_Topic",
|
||||||
consumerGroup = "Heartb_Beat_Topic_Consumer",
|
consumerGroup = "Heartb_Beat_Topic_Consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Real_Time_Data_Topic",
|
topic = "Real_Time_Data_Topic",
|
||||||
consumerGroup = "real_time_consumer",
|
consumerGroup = "real_time_consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "log_Topic",
|
topic = "log_Topic",
|
||||||
consumerGroup = "Log_Topic_Consumer",
|
consumerGroup = "Log_Topic_Consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import java.util.Objects;
|
|||||||
@RocketMQMessageListener(
|
@RocketMQMessageListener(
|
||||||
topic = "Topic_Reply_Topic",
|
topic = "Topic_Reply_Topic",
|
||||||
consumerGroup = "Topic_Reply_Topic_Consumer",
|
consumerGroup = "Topic_Reply_Topic_Consumer",
|
||||||
selectorExpression = "Test_Tag||Test_Keys",
|
selectorExpression = "*",
|
||||||
consumeThreadNumber = 10,
|
consumeThreadNumber = 10,
|
||||||
enableMsgTrace = true
|
enableMsgTrace = true
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
import com.njcn.message.message.DeviceRebootMessage;
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.message.message.ProcessRebootMessage;
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.message.message.RecallMessage;
|
import com.njcn.message.message.RecallMessage;
|
||||||
|
import com.njcn.message.produce.template.AskFileSysMessaggeTemplate;
|
||||||
import com.njcn.message.produce.template.DeviceRebootMessageTemplate;
|
import com.njcn.message.produce.template.DeviceRebootMessageTemplate;
|
||||||
import com.njcn.message.produce.template.ProcessRebootMessageTemplate;
|
import com.njcn.message.produce.template.ProcessRebootMessageTemplate;
|
||||||
import com.njcn.message.produce.template.RecallMessaggeTemplate;
|
import com.njcn.message.produce.template.RecallMessaggeTemplate;
|
||||||
@@ -40,6 +42,7 @@ public class ProduceController extends BaseController {
|
|||||||
|
|
||||||
private final ProcessRebootMessageTemplate processRebootMessageTemplate;
|
private final ProcessRebootMessageTemplate processRebootMessageTemplate;
|
||||||
|
|
||||||
|
private final AskFileSysMessaggeTemplate askFileSysMessaggeTemplate;
|
||||||
|
|
||||||
@PostMapping("/recall")
|
@PostMapping("/recall")
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@@ -76,4 +79,14 @@ public class ProduceController extends BaseController {
|
|||||||
processRebootMessageTemplate.sendMember(baseMessage,message.getNodeId());
|
processRebootMessageTemplate.sendMember(baseMessage,message.getNodeId());
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/askFileSys")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@ApiOperation("请求文件系统")
|
||||||
|
@ApiImplicitParam(name = "message", value = "参数", required = true)
|
||||||
|
public HttpResult<String> askFileSys(@RequestBody AskFileSysMessage message){
|
||||||
|
String methodDescribe = getMethodDescribe("askFileSys");
|
||||||
|
SendResult sendResult = askFileSysMessaggeTemplate.sendMember(message);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,message.getGuid() , methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.njcn.message.constant.BusinessResource;
|
||||||
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
|
import com.njcn.message.message.AskFileSysMessage;
|
||||||
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2024/12/13 15:15【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class AskFileSysMessaggeTemplate extends RocketMQEnhanceTemplate {
|
||||||
|
public AskFileSysMessaggeTemplate(RocketMQTemplate template) {
|
||||||
|
super(template);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SendResult sendMember(AskFileSysMessage askRealDataMessage) {
|
||||||
|
BaseMessage baseMessage = new BaseMessage();
|
||||||
|
baseMessage.setMessageBody(JSONObject.toJSONString(askRealDataMessage));
|
||||||
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
|
baseMessage.setKey(askRealDataMessage.getGuid());
|
||||||
|
return send(BusinessTopic.FILE_TOPIC,askRealDataMessage.getNodeId() , baseMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
|
import com.njcn.message.message.AskRealDataMessage;
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -24,7 +26,8 @@ public class AskRealDataMessaggeTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage askRealDataMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage askRealDataMessage,String nodeId) {
|
||||||
askRealDataMessage.setSource(BusinessResource.WEB_RESOURCE);
|
askRealDataMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
askRealDataMessage.setKey("Test_Keys");
|
AskRealDataMessage dto = JSON.parseObject(askRealDataMessage.getMessageBody(), AskRealDataMessage.class);
|
||||||
return send(nodeId+"_"+BusinessTopic.ASK_REAL_DATA_TOPIC,"Test_Tag" , askRealDataMessage);
|
askRealDataMessage.setKey(dto.getLine());
|
||||||
|
return send(BusinessTopic.ASK_REAL_DATA_TOPIC,nodeId , askRealDataMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
|
import com.njcn.message.message.AskRealDataMessage;
|
||||||
|
import com.njcn.message.message.DeviceRebootMessage;
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -24,7 +27,6 @@ public class DeviceRebootMessageTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
||||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
baseMessage.setKey("Test_Keys");
|
return send(BusinessTopic.CONTROL_TOPIC,nodeId, baseMessage);
|
||||||
return send(nodeId+"_"+BusinessTopic.CONTROL_TOPIC,"Test_Tag", baseMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.njcn.message.produce.template;
|
package com.njcn.message.produce.template;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.njcn.message.constant.BusinessResource;
|
import com.njcn.message.constant.BusinessResource;
|
||||||
import com.njcn.message.constant.BusinessTopic;
|
import com.njcn.message.constant.BusinessTopic;
|
||||||
|
import com.njcn.message.message.AskRealDataMessage;
|
||||||
|
import com.njcn.message.message.ProcessRebootMessage;
|
||||||
import com.njcn.middle.rocket.domain.BaseMessage;
|
import com.njcn.middle.rocket.domain.BaseMessage;
|
||||||
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate;
|
||||||
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.client.producer.SendResult;
|
||||||
@@ -24,7 +27,8 @@ public class ProcessRebootMessageTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage baseMessage,String nodeId) {
|
||||||
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
baseMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
baseMessage.setKey("Test_Keys");
|
ProcessRebootMessage dto = JSON.parseObject(baseMessage.getMessageBody(), ProcessRebootMessage.class);
|
||||||
return send(nodeId+"_"+BusinessTopic.PROCESS_TOPIC,"Test_Tag", baseMessage);
|
baseMessage.setKey(dto.getIndex()+"");
|
||||||
|
return send(BusinessTopic.PROCESS_TOPIC,nodeId, baseMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ public class RecallMessaggeTemplate extends RocketMQEnhanceTemplate {
|
|||||||
|
|
||||||
public SendResult sendMember(BaseMessage recallMessage,String nodeId) {
|
public SendResult sendMember(BaseMessage recallMessage,String nodeId) {
|
||||||
recallMessage.setSource(BusinessResource.WEB_RESOURCE);
|
recallMessage.setSource(BusinessResource.WEB_RESOURCE);
|
||||||
recallMessage.setKey("Test_Keys");
|
return send(BusinessTopic.RECALL_TOPIC,nodeId , recallMessage);
|
||||||
return send(nodeId+"_"+BusinessTopic.RECALL_TOPIC,"Test_Tag" , recallMessage);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class WebSocketServer {
|
|||||||
baseMessage.setMessageBody(JSONObject.toJSONString(askRealDataMessage));
|
baseMessage.setMessageBody(JSONObject.toJSONString(askRealDataMessage));
|
||||||
// 发送消息到topic1
|
// 发送消息到topic1
|
||||||
askRealDataMessaggeTemplate.sendMember(baseMessage,data.getNodeId());
|
askRealDataMessaggeTemplate.sendMember(baseMessage,data.getNodeId());
|
||||||
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.ASK_REAL_DATA.concat(split[1]),RedisKeyPrefix.ASK_REAL_DATA.concat(split[1]),20L);
|
redisUtil.saveByKeyWithExpire(RedisKeyPrefix.ASK_REAL_DATA.concat(split[1]),RedisKeyPrefix.ASK_REAL_DATA.concat(split[1]),25L);
|
||||||
log.info("监测点连接:" + userIdAndLineIdAndDevId + ",当前在线监测点数为:" + getOnlineCount());
|
log.info("监测点连接:" + userIdAndLineIdAndDevId + ",当前在线监测点数为:" + getOnlineCount());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
54
message/message-boot/src/main/resources/bootstrap-jb.yml
Normal file
54
message/message-boot/src/main/resources/bootstrap-jb.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10407
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
config:
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: data-platform.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
57
message/message-boot/src/main/resources/bootstrap-sjzx.yml
Normal file
57
message/message-boot/src/main/resources/bootstrap-sjzx.yml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#当前服务的基本信息
|
||||||
|
microservice:
|
||||||
|
ename: @artifactId@
|
||||||
|
name: '@name@'
|
||||||
|
version: @version@
|
||||||
|
sentinel:
|
||||||
|
url: @sentinel.url@
|
||||||
|
gateway:
|
||||||
|
url: @gateway.url@
|
||||||
|
server:
|
||||||
|
port: 10407
|
||||||
|
#feign接口开启服务熔断降级处理
|
||||||
|
feign:
|
||||||
|
sentinel:
|
||||||
|
enabled: true
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: @artifactId@
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
ip: @service.server.url@
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
config:
|
||||||
|
server-addr: @nacos.url@
|
||||||
|
namespace: @nacos.namespace@
|
||||||
|
username: @nacos.username@
|
||||||
|
password: @nacos.password@
|
||||||
|
file-extension: yaml
|
||||||
|
shared-configs:
|
||||||
|
- data-id: share-config.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: share-config-datasource-db.yaml
|
||||||
|
refresh: true
|
||||||
|
- data-id: data-platform.yaml
|
||||||
|
refresh: true
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
|
|
||||||
|
|
||||||
|
#项目日志的配置
|
||||||
|
logging:
|
||||||
|
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||||
|
level:
|
||||||
|
root: info
|
||||||
|
|
||||||
|
|
||||||
|
#mybatis配置信息
|
||||||
|
mybatis-plus:
|
||||||
|
#别名扫描
|
||||||
|
type-aliases-package: com.njcn.harmonic.pojo
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
client-id: @artifactId@${random.value}
|
||||||
@@ -1,53 +1,3 @@
|
|||||||
#当前服务的基本信息
|
|
||||||
microservice:
|
|
||||||
ename: @artifactId@
|
|
||||||
name: '@name@'
|
|
||||||
version: @version@
|
|
||||||
sentinel:
|
|
||||||
url: @sentinel.url@
|
|
||||||
gateway:
|
|
||||||
url: @gateway.url@
|
|
||||||
server:
|
|
||||||
port: 10407
|
|
||||||
#feign接口开启服务熔断降级处理
|
|
||||||
feign:
|
|
||||||
sentinel:
|
|
||||||
enabled: true
|
|
||||||
spring:
|
spring:
|
||||||
application:
|
profiles:
|
||||||
name: @artifactId@
|
active: @spring.profiles.active@
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
ip: @service.server.url@
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
config:
|
|
||||||
server-addr: @nacos.url@
|
|
||||||
namespace: @nacos.namespace@
|
|
||||||
file-extension: yaml
|
|
||||||
shared-configs:
|
|
||||||
- data-id: share-config.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: share-config-datasource-db.yaml
|
|
||||||
refresh: true
|
|
||||||
- data-Id: data-platform.yaml
|
|
||||||
refresh: true
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
|
||||||
logging:
|
|
||||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
|
||||||
level:
|
|
||||||
root: info
|
|
||||||
|
|
||||||
|
|
||||||
#mybatis配置信息
|
|
||||||
mybatis-plus:
|
|
||||||
#别名扫描
|
|
||||||
type-aliases-package: com.njcn.harmonic.pojo
|
|
||||||
|
|
||||||
mqtt:
|
|
||||||
client-id: @artifactId@${random.value}
|
|
||||||
@@ -31,7 +31,7 @@ public class InsertDataHarmRateIImpl implements InsertIDataHarmRateI {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmrateI> listDataHarmrateI(LineCountEvaluateParam lineParam) {
|
public List<DataHarmrateI> listDataHarmrateI(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmrateI::getLineId)
|
.select(DataHarmrateI::getLineId)
|
||||||
.select(DataHarmrateI::getPhasicType)
|
.select(DataHarmrateI::getPhasicType)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class InsertDataHarmRateVImpl implements InsertIDataHarmRateV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmrateV> listDataHarmrateV(LineCountEvaluateParam lineParam) {
|
public List<DataHarmrateV> listDataHarmrateV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmrateV::getLineId)
|
.select(DataHarmrateV::getLineId)
|
||||||
.select(DataHarmrateV::getPhasicType)
|
.select(DataHarmrateV::getPhasicType)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class InsertDataHarmphasicIImpl implements InsertIDataHarmphasicI {
|
|||||||
public List<DataHarmphasicI> listDataHarmphasicI(LineCountEvaluateParam lineParam) {
|
public List<DataHarmphasicI> listDataHarmphasicI(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmphasicI> result = new ArrayList<>();
|
List<DataHarmphasicI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmphasicI::getLineId)
|
.select(DataHarmphasicI::getLineId)
|
||||||
.select(DataHarmphasicI::getPhasicType)
|
.select(DataHarmphasicI::getPhasicType)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class InsertDataHarmphasicVImpl implements InsertIDataHarmphasicV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmphasicV> listDataHarmphasicV(LineCountEvaluateParam lineParam) {
|
public List<DataHarmphasicV> listDataHarmphasicV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmphasicV::getLineId)
|
.select(DataHarmphasicV::getLineId)
|
||||||
.select(DataHarmphasicV::getPhasicType)
|
.select(DataHarmphasicV::getPhasicType)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class InsertDataHarmpowerPImpl implements InsertIDataHarmpowerP {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmpowerP> listDataHarmpowerP(LineCountEvaluateParam lineParam) {
|
public List<DataHarmpowerP> listDataHarmpowerP(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerP.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.P, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.P, InfluxDbSqlConstant.P, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmpowerP::getLineId)
|
.select(DataHarmpowerP::getLineId)
|
||||||
.select(DataHarmpowerP::getPhasicType)
|
.select(DataHarmpowerP::getPhasicType)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class InsertDataHarmpowerQImpl implements InsertIDataHarmpowerQ {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmpowerQ> listDataHarmpowerQ(LineCountEvaluateParam lineParam) {
|
public List<DataHarmpowerQ> listDataHarmpowerQ(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerQ.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.Q, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.Q, InfluxDbSqlConstant.Q, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmpowerQ::getLineId)
|
.select(DataHarmpowerQ::getLineId)
|
||||||
.select(DataHarmpowerQ::getPhasicType)
|
.select(DataHarmpowerQ::getPhasicType)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class InsertDataHarmpowerSImpl implements InsertIDataHarmpowerS {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmpowerS> listDataHarmpowerS(LineCountEvaluateParam lineParam) {
|
public List<DataHarmpowerS> listDataHarmpowerS(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmpowerS.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.S, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.S, InfluxDbSqlConstant.S, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmpowerS::getLineId)
|
.select(DataHarmpowerS::getLineId)
|
||||||
.select(DataHarmpowerS::getPhasicType)
|
.select(DataHarmpowerS::getPhasicType)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class InsertDataIImpl implements InsertIDataI {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataI> listDataI(LineCountEvaluateParam lineParam) {
|
public List<DataI> listDataI(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataI::getLineId)
|
.select(DataI::getLineId)
|
||||||
.select(DataI::getPhasicType)
|
.select(DataI::getPhasicType)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class InsertDataInharmIImpl implements InsertIDataInharmI {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataInharmI> listDataInharmI(LineCountEvaluateParam lineParam) {
|
public List<DataInharmI> listDataInharmI(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataInharmI::getLineId)
|
.select(DataInharmI::getLineId)
|
||||||
.select(DataInharmI::getPhasicType)
|
.select(DataInharmI::getPhasicType)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class InsertDataInharmVImpl implements InsertIDataInharmV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataInharmV> listDataInharmV(LineCountEvaluateParam lineParam) {
|
public List<DataInharmV> listDataInharmV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataInharmV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataInharmV::getLineId)
|
.select(DataInharmV::getLineId)
|
||||||
.select(DataInharmV::getPhasicType)
|
.select(DataInharmV::getPhasicType)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class InsertDataVImpl implements InsertIDataV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataV> listDataV(LineCountEvaluateParam lineParam) {
|
public List<DataV> listDataV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataV::getLineId)
|
.select(DataV::getLineId)
|
||||||
.select(DataV::getPhasicType)
|
.select(DataV::getPhasicType)
|
||||||
@@ -66,7 +66,7 @@ public class InsertDataVImpl implements InsertIDataV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataV> listDataVDesc(LineCountEvaluateParam lineParam) {
|
public List<DataV> listDataVDesc(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataV::getLineId)
|
.select(DataV::getLineId)
|
||||||
.select(DataV::getPhasicType)
|
.select(DataV::getPhasicType)
|
||||||
|
|||||||
@@ -82,14 +82,14 @@ public class MigrationInfluxDBController {
|
|||||||
long betweenDay = LocalDateTimeUtil.between(startDate, endDate, ChronoUnit.HOURS);
|
long betweenDay = LocalDateTimeUtil.between(startDate, endDate, ChronoUnit.HOURS);
|
||||||
param.setStartTime(startDate.format(dateTimeFormatter));
|
param.setStartTime(startDate.format(dateTimeFormatter));
|
||||||
param.setEndTime(startDate.with(LocalTime.of(startDate.getHour(), 59, 59)).format(dateTimeFormatter));
|
param.setEndTime(startDate.with(LocalTime.of(startDate.getHour(), 59, 59)).format(dateTimeFormatter));
|
||||||
migrationService.hourseLineEventBacthSysc(param);
|
migrationService.hourseDevDataBacthSysc(param);
|
||||||
for (int i = 0; i <betweenDay; i++) {
|
for (int i = 0; i <betweenDay; i++) {
|
||||||
LineCountEvaluateParam countEvaluateParam=new LineCountEvaluateParam();
|
LineCountEvaluateParam countEvaluateParam=new LineCountEvaluateParam();
|
||||||
countEvaluateParam.setIsManual(true);
|
countEvaluateParam.setIsManual(true);
|
||||||
startDate = LocalDateTimeUtil.offset(startDate, 1, ChronoUnit.HOURS);
|
startDate = LocalDateTimeUtil.offset(startDate, 1, ChronoUnit.HOURS);
|
||||||
countEvaluateParam.setStartTime(startDate.format(dateTimeFormatter));
|
countEvaluateParam.setStartTime(startDate.format(dateTimeFormatter));
|
||||||
countEvaluateParam.setEndTime(startDate.with(LocalTime.of(startDate.getHour(), 59, 59)).format(dateTimeFormatter));
|
countEvaluateParam.setEndTime(startDate.with(LocalTime.of(startDate.getHour(), 59, 59)).format(dateTimeFormatter));
|
||||||
migrationService.hourseLineEventBacthSysc(countEvaluateParam);
|
migrationService.hourseDevDataBacthSysc(countEvaluateParam);
|
||||||
}
|
}
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class DataHarmRateIImpl implements IDataHarmRateI {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmrateI> listDataHarmrateI(LineCountEvaluateParam lineParam) {
|
public List<DataHarmrateI> listDataHarmrateI(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmrateI::getLineId)
|
.select(DataHarmrateI::getLineId)
|
||||||
.select(DataHarmrateI::getPhasicType)
|
.select(DataHarmrateI::getPhasicType)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class DataHarmRateVImpl implements IDataHarmRateV {
|
|||||||
@Override
|
@Override
|
||||||
public List<DataHarmrateV> listDataHarmrateV(LineCountEvaluateParam lineParam) {
|
public List<DataHarmrateV> listDataHarmrateV(LineCountEvaluateParam lineParam) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, InfluxDbSqlConstant.V, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmrateV::getLineId)
|
.select(DataHarmrateV::getLineId)
|
||||||
.select(DataHarmrateV::getPhasicType)
|
.select(DataHarmrateV::getPhasicType)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class DataHarmphasicIImpl implements IDataHarmphasicI {
|
|||||||
public List<DataHarmphasicI> listDataHarmphasicI(LineCountEvaluateParam lineParam) {
|
public List<DataHarmphasicI> listDataHarmphasicI(LineCountEvaluateParam lineParam) {
|
||||||
List<DataHarmphasicI> result = new ArrayList<>();
|
List<DataHarmphasicI> result = new ArrayList<>();
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmphasicI.class);
|
||||||
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, "", HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.I, InfluxDbSqlConstant.I, HarmonicTimesUtil.harmonicTimesList(1, 50, 1));
|
||||||
influxQueryWrapper
|
influxQueryWrapper
|
||||||
.select(DataHarmphasicI::getLineId)
|
.select(DataHarmphasicI::getLineId)
|
||||||
.select(DataHarmphasicI::getPhasicType)
|
.select(DataHarmphasicI::getPhasicType)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user