监测点稳态指标越限次数统计
终端数据统计
This commit is contained in:
@@ -192,45 +192,45 @@ public class ExecutionCenter extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @ApiOperation("装置算法执行链")
|
||||
// @PostMapping("/deviceExecutor")
|
||||
// @Async("asyncExecutor")
|
||||
// public void deviceExecutor(@RequestBody BaseParam baseParam) {
|
||||
// String methodDescribe = getMethodDescribe("deviceExecutor");
|
||||
// //手动判断参数是否合法,
|
||||
// CalculatedParam calculatedParam = judgeExecuteParam(baseParam);
|
||||
// DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
// // 设备索引
|
||||
// if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
|
||||
// Dept data = deptFeignClient.getRootDept().getData();
|
||||
// deptGetLineParam.setDeptId(data.getId());
|
||||
// List<DeptGetDeviceDTO> list = commTerminalGeneralClient.deptGetDevice(deptGetLineParam).getData();
|
||||
// DeptGetDeviceDTO dto = list.stream().filter(po -> Objects.equals(po.getUnitId(), data.getId())).collect(Collectors.toList()).get(0);
|
||||
// List<LineDevGetDTO> devList = dto.getDeviceList();
|
||||
// calculatedParam.setIdList(devList.stream().map(LineDevGetDTO::getDevId).distinct().collect(Collectors.toList()));
|
||||
// }
|
||||
// LiteflowResponse liteflowResponse;
|
||||
// if (baseParam.isRepair()) {
|
||||
// //补招时,起始日期、截止日期必填
|
||||
// DateTime startDate = DateUtil.parse(baseParam.getBeginTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
// DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
// long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||
// //递增日期执行算法链
|
||||
// for (int i = 0; i < betweenDay; i++) {
|
||||
// if (i != 0) {
|
||||
// startDate = DateUtil.offsetDay(startDate, 1);
|
||||
// }
|
||||
// calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
||||
// liteflowResponse = flowExecutor.execute2Resp("device", calculatedParam);
|
||||
// dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||
// }
|
||||
// } else {
|
||||
// //非补招
|
||||
// liteflowResponse = flowExecutor.execute2Resp("device", calculatedParam);
|
||||
// dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||
// }
|
||||
// }
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("装置算法执行链")
|
||||
@PostMapping("/deviceExecutor")
|
||||
@Async("asyncExecutor")
|
||||
public void deviceExecutor(@RequestBody BaseParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("deviceExecutor");
|
||||
//手动判断参数是否合法,
|
||||
CalculatedParam calculatedParam = judgeExecuteParam(baseParam);
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
// 设备索引
|
||||
if (CollectionUtils.isEmpty(calculatedParam.getIdList())) {
|
||||
Dept data = deptFeignClient.getRootDept().getData();
|
||||
deptGetLineParam.setDeptId(data.getId());
|
||||
List<DeptGetDeviceDTO> list = commTerminalGeneralClient.deptGetDevice(deptGetLineParam).getData();
|
||||
DeptGetDeviceDTO dto = list.stream().filter(po -> Objects.equals(po.getUnitId(), data.getId())).collect(Collectors.toList()).get(0);
|
||||
List<LineDevGetDTO> devList = dto.getDeviceList();
|
||||
calculatedParam.setIdList(devList.stream().map(LineDevGetDTO::getDevId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
LiteflowResponse liteflowResponse;
|
||||
if (baseParam.isRepair()) {
|
||||
//补招时,起始日期、截止日期必填
|
||||
DateTime startDate = DateUtil.parse(baseParam.getBeginTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
DateTime endDate = DateUtil.parse(baseParam.getEndTime(), DatePattern.NORM_DATE_FORMAT);
|
||||
long betweenDay = DateUtil.betweenDay(startDate, endDate, true);
|
||||
//递增日期执行算法链
|
||||
for (int i = 0; i < betweenDay; i++) {
|
||||
if (i != 0) {
|
||||
startDate = DateUtil.offsetDay(startDate, 1);
|
||||
}
|
||||
calculatedParam.setDataDate(DateUtil.format(startDate, DatePattern.NORM_DATE_PATTERN));
|
||||
liteflowResponse = flowExecutor.execute2Resp("device", calculatedParam);
|
||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||
}
|
||||
} else {
|
||||
//非补招
|
||||
liteflowResponse = flowExecutor.execute2Resp("device", calculatedParam);
|
||||
dealResponse(calculatedParam, liteflowResponse, methodDescribe);
|
||||
}
|
||||
}
|
||||
//
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @ApiOperation("单位监测点算法执行链")
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.njcn.algorithm.executor;
|
||||
|
||||
import com.njcn.algorithm.service.line.IDataOnlineRateService;
|
||||
import com.yomahub.liteflow.annotation.LiteflowComponent;
|
||||
import com.yomahub.liteflow.annotation.LiteflowMethod;
|
||||
import com.yomahub.liteflow.core.NodeComponent;
|
||||
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
|
||||
import com.yomahub.liteflow.enums.NodeTypeEnum;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2023年11月06日 15:59
|
||||
*/
|
||||
@LiteflowComponent
|
||||
@RequiredArgsConstructor
|
||||
public class DeviceExecutor extends BaseExecutor {
|
||||
|
||||
private final IDataOnlineRateService onlineRateService;
|
||||
|
||||
|
||||
/**
|
||||
* 算法名: 暂无-----终端在线率_日表(r_stat_onlinerate_d)
|
||||
*
|
||||
* @author xuyang
|
||||
* @date 2023年11月30日 10:25
|
||||
*/
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "deviceOnlineRate", nodeType = NodeTypeEnum.COMMON)
|
||||
public boolean deviceOnlineRateAccess(NodeComponent bindCmp) {
|
||||
return isAccess(bindCmp);
|
||||
}
|
||||
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "deviceOnlineRate", nodeType = NodeTypeEnum.COMMON)
|
||||
public void deviceOnlineRateProcess(NodeComponent bindCmp) {
|
||||
onlineRateService.dataOnlineRate(bindCmp.getRequestData());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.algorithm.service.line;
|
||||
|
||||
|
||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:19
|
||||
*/
|
||||
public interface IDataOnlineRateService {
|
||||
|
||||
/***
|
||||
* 装置数据在线率_日表
|
||||
* @author xuyang
|
||||
* @date 2023/11/09 10:08
|
||||
* @param calculatedParam 查询条件
|
||||
*/
|
||||
void dataOnlineRate(CalculatedParam<String> calculatedParam);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,150 @@
|
||||
package com.njcn.algorithm.serviceimpl.line;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||
import com.njcn.algorithm.service.line.IDataOnlineRateService;
|
||||
import com.njcn.dataProcess.api.PqsCommunicateFeignClient;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.util.TimeUtils;
|
||||
import com.njcn.device.pq.pojo.po.RStatOnlinerateD;
|
||||
import com.njcn.influx.deprecated.InfluxDBPublicParam;
|
||||
import com.njcn.influx.pojo.po.PqsCommunicate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:19
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class IDataOnlineRateServiceImpl implements IDataOnlineRateService {
|
||||
private final static Integer NUM = 100;
|
||||
private final Integer online = 1;
|
||||
private final Integer offline = 0;
|
||||
@Resource
|
||||
private PqsCommunicateFeignClient communicateFeignClient;
|
||||
|
||||
@Override
|
||||
public void dataOnlineRate(CalculatedParam<String> calculatedParam) {
|
||||
|
||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||
lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate()));
|
||||
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
|
||||
List<String> devList = calculatedParam.getIdList();
|
||||
|
||||
List<List<String>> pendingIds = ListUtils.partition(devList, 1);
|
||||
List<PqsCommunicateDto> outCommunicateData = new ArrayList<>();
|
||||
for (List<String> dev : pendingIds) {
|
||||
lineParam.setLineId(dev);
|
||||
List<PqsCommunicateDto> data = communicateFeignClient.getRawDataLatest(lineParam).getData();
|
||||
outCommunicateData.addAll(data);
|
||||
}
|
||||
List<RStatOnlineRateDto.Detail> list = new ArrayList<>();
|
||||
Date dateOut = DateUtil.parse(calculatedParam.getDataDate());
|
||||
for (PqsCommunicateDto pqsCommunicate : outCommunicateData) {
|
||||
RStatOnlineRateDto.Detail onlineRateDpo = new RStatOnlineRateDto.Detail();
|
||||
Date newDate = DateUtil.parse(pqsCommunicate.getTime());
|
||||
lineParam.setLineId(Arrays.asList(pqsCommunicate.getDevId()));
|
||||
RStatOnlineRateDto onLineRate = onLineMinute(newDate, dateOut, pqsCommunicate.getType(), lineParam);
|
||||
onlineRateDpo.setTimeId(calculatedParam.getDataDate());
|
||||
onlineRateDpo.setDevIndex(pqsCommunicate.getDevId());
|
||||
onlineRateDpo.setOnlineMin(onLineRate.getOnlineMin());
|
||||
onlineRateDpo.setOfflineMin(onLineRate.getOfflineMin());
|
||||
list.add(onlineRateDpo);
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(list)) {
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* new的时间和当前统计时间 不是/是 同一天
|
||||
*/
|
||||
private RStatOnlineRateDto onLineMinute(Date newDate, Date date, Integer type, LineCountEvaluateParam lineParam) {
|
||||
RStatOnlineRateDto onLineRate = new RStatOnlineRateDto();
|
||||
Integer minute = 0;
|
||||
/*new的时间和当前统计时间是同一天*/
|
||||
if (DateUtil.isSameDay(newDate, date)) {
|
||||
minute = processData(newDate, date, type, lineParam);
|
||||
} else {
|
||||
/*new的时间和当前统计时间不是同一天*/
|
||||
Date nowDate = new Date();
|
||||
/*数据补招的情况下*/
|
||||
if (DateUtil.between(date, nowDate, DateUnit.DAY) > DateUtil.between(newDate, nowDate, DateUnit.DAY)) {
|
||||
minute = processData(newDate, date, null, lineParam);
|
||||
} else {
|
||||
if (online.equals(type)) {
|
||||
minute = InfluxDBPublicParam.DAY_MINUTE;
|
||||
}
|
||||
}
|
||||
}
|
||||
onLineRate.setOnlineMin(minute);
|
||||
onLineRate.setOfflineMin(InfluxDBPublicParam.DAY_MINUTE - minute);
|
||||
return onLineRate;
|
||||
}
|
||||
|
||||
private Integer processData(Date newDate, Date date, Integer type,LineCountEvaluateParam lineParam) {
|
||||
int minute = 0;
|
||||
List<PqsCommunicateDto> communicateData = communicateFeignClient.getRawData(lineParam).getData();
|
||||
/*当前统计时间内存在多条数据*/
|
||||
if (communicateData.size() > 1) {
|
||||
Date lastTime = null;
|
||||
long onlineTime = 0;
|
||||
long offlineTime = 0;
|
||||
for (int i = 0; i < communicateData.size(); i++) {
|
||||
long differ;
|
||||
if (i == 0) {
|
||||
/*首次比较取统计时间*/
|
||||
differ = DateUtil.between(date, DateUtil.parse(communicateData.get(i).getTime()), DateUnit.MINUTE);
|
||||
} else {
|
||||
/*后续取上一次数据时间*/
|
||||
differ = DateUtil.between(lastTime, DateUtil.parse(communicateData.get(i).getTime()), DateUnit.MINUTE);
|
||||
}
|
||||
if (online.equals(communicateData.get(i).getType())) {
|
||||
offlineTime = offlineTime + differ;
|
||||
} else {
|
||||
onlineTime = onlineTime + differ;
|
||||
}
|
||||
lastTime = DateUtil.parse(communicateData.get(i).getTime());
|
||||
}
|
||||
if (online.equals(communicateData.get(communicateData.size() - 1).getType())) {
|
||||
minute = InfluxDBPublicParam.DAY_MINUTE - (int) offlineTime;
|
||||
} else {
|
||||
minute = (int) onlineTime;
|
||||
}
|
||||
} else {
|
||||
if (type != null) {
|
||||
/*当前统计时间内仅有一条数据*/
|
||||
long differ = DateUtil.between(date, newDate, DateUnit.MINUTE);
|
||||
if (online.equals(type)) {
|
||||
minute = InfluxDBPublicParam.DAY_MINUTE - (int) differ;
|
||||
}
|
||||
} else {
|
||||
List<PqsCommunicateDto> communicateDataOld = communicateFeignClient.getRawDataEnd(lineParam).getData();
|
||||
if (communicateDataOld.size() > 0) {
|
||||
if (online.equals(communicateDataOld.get(0).getType())) {
|
||||
minute = InfluxDBPublicParam.DAY_MINUTE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return minute;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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.DataLimitRateDetailFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 9:30
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataLimitRateDetail", fallbackFactory = DataLimitRateDetailFeignClientFallbackFactory.class, contextId = "dataLimitRateDetail")
|
||||
public interface DataLimitRateDetailFeignClient {
|
||||
|
||||
@PostMapping("/batchInsertion")
|
||||
HttpResult<String> batchInsertion(@RequestBody List<DataLimitRateDetailDto> dataIDTOList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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.DataInharmVFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:23
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/pqsCommunicate", fallbackFactory = DataInharmVFeignClientFallbackFactory.class, contextId = "pqsCommunicate")
|
||||
public interface PqsCommunicateFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 获取取出最新装置数据
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:25
|
||||
*/
|
||||
@PostMapping("/getRawDataLatest")
|
||||
HttpResult<List<PqsCommunicateDto>> getRawDataLatest(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取原始数据
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:23
|
||||
*/
|
||||
@PostMapping("/getRawData")
|
||||
HttpResult<List<PqsCommunicateDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取是否有当天最后一条数据
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:23
|
||||
*/
|
||||
@PostMapping("/getRawDataEnd")
|
||||
HttpResult<List<PqsCommunicateDto>> getRawDataEnd(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
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.DataLimitRateDetailFeignClient;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 9:30
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DataLimitRateDetailFeignClientFallbackFactory implements FallbackFactory<DataLimitRateDetailFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public DataLimitRateDetailFeignClient 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 DataLimitRateDetailFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<String> batchInsertion(List<DataLimitRateDetailDto> dataIDTOList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
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.PqsCommunicateFeignClient;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
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 denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PqsCommunicateFeignClientFallbackFactory implements FallbackFactory<PqsCommunicateFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public PqsCommunicateFeignClient 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 PqsCommunicateFeignClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataLatest(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取取出最新装置数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawData(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取原始数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataEnd(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取是否有当天最后一条数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.njcn.dataProcess.po.influx;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.dataProcess.dto.DataFlucDTO;
|
||||
import com.njcn.influx.utils.InstantDateSerializer;
|
||||
import lombok.Data;
|
||||
import org.influxdb.annotation.Column;
|
||||
import org.influxdb.annotation.Measurement;
|
||||
import org.influxdb.annotation.TimeColumn;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@Measurement(name = "pqs_communicate")
|
||||
public class PqsCommunicate {
|
||||
|
||||
@TimeColumn
|
||||
@Column(name = "time",tag = true)
|
||||
@JsonSerialize(using = InstantDateSerializer.class)
|
||||
private Instant time;
|
||||
|
||||
@Column(name = "id",tag = true)
|
||||
private String devId;
|
||||
|
||||
@Column(name = "description")
|
||||
private String description;
|
||||
|
||||
@Column(name = "type")
|
||||
private Integer type;
|
||||
|
||||
|
||||
|
||||
public static PqsCommunicate relationToInfluxDB(PqsCommunicate pqsCommunicate) {
|
||||
if (pqsCommunicate == null) {
|
||||
return null;
|
||||
}
|
||||
PqsCommunicate influxDBDataFluc = new PqsCommunicate();
|
||||
Instant instant = pqsCommunicate.getTime().atZone(ZoneId.systemDefault()).toInstant();
|
||||
influxDBDataFluc.setTime(instant);
|
||||
influxDBDataFluc.setDevId(pqsCommunicate.devId);
|
||||
influxDBDataFluc.setDescription(pqsCommunicate.getDescription());
|
||||
influxDBDataFluc.setType(pqsCommunicate.type);
|
||||
return influxDBDataFluc;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2025/3/7 13:32
|
||||
*/
|
||||
@Data
|
||||
public class AbnormalData {
|
||||
|
||||
/**
|
||||
* 超标时间
|
||||
*/
|
||||
private String time;
|
||||
|
||||
/**
|
||||
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||
*/
|
||||
private String valueType;
|
||||
/**
|
||||
* 异常值
|
||||
*/
|
||||
private Double value;
|
||||
|
||||
/**
|
||||
* 限值
|
||||
*/
|
||||
private float overLimitValue;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
* @date 2025/3/7 13:32
|
||||
*/
|
||||
@Data
|
||||
public class DataLimitDetailDto {
|
||||
|
||||
|
||||
private DataLimitRateDto dataLimitRate;
|
||||
private DataLimitRateDetailDto dataLimitRateDetail;
|
||||
}
|
||||
@@ -0,0 +1,385 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author web2023
|
||||
*/
|
||||
@Data
|
||||
public class DataLimitRateDetailDto implements Serializable {
|
||||
/**
|
||||
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’’M’表示ABC三项总和,T’表示总
|
||||
*/
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
private Integer allTime;
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
private Integer flickerAllTime;
|
||||
/**
|
||||
* 闪变越限次数
|
||||
*/
|
||||
private String flickerOvertime;
|
||||
|
||||
/**
|
||||
* 频率偏差越限次数
|
||||
*/
|
||||
private String freqDevOvertime;
|
||||
|
||||
/**
|
||||
* 电压偏差越限次数
|
||||
*/
|
||||
private String voltageDevOvertime;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度越限次数
|
||||
*/
|
||||
private String ubalanceOvertime;
|
||||
|
||||
/**
|
||||
* 电压谐波畸变率越限次数
|
||||
*/
|
||||
private String uaberranceOvertime;
|
||||
|
||||
/**
|
||||
* 负序电流限值次数
|
||||
*/
|
||||
private String iNegOvertime;
|
||||
|
||||
/**
|
||||
* 2次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电压谐波含有率越限次数
|
||||
*/
|
||||
private String uharm25Overtime;
|
||||
|
||||
/**
|
||||
* 2次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电流谐波幅值越限次数
|
||||
*/
|
||||
private String iharm25Overtime;
|
||||
|
||||
/**
|
||||
* 0.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm1Overtime;
|
||||
|
||||
/**
|
||||
* 1.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm2Overtime;
|
||||
|
||||
/**
|
||||
* 2.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm3Overtime;
|
||||
|
||||
/**
|
||||
* 3.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm4Overtime;
|
||||
|
||||
/**
|
||||
* 4.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm5Overtime;
|
||||
|
||||
/**
|
||||
* 5.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm6Overtime;
|
||||
|
||||
/**
|
||||
* 6.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm7Overtime;
|
||||
|
||||
/**
|
||||
* 7.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm8Overtime;
|
||||
|
||||
/**
|
||||
* 8.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm9Overtime;
|
||||
|
||||
/**
|
||||
* 9.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm10Overtime;
|
||||
|
||||
/**
|
||||
* 10.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm11Overtime;
|
||||
|
||||
/**
|
||||
* 11.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm12Overtime;
|
||||
|
||||
/**
|
||||
* 12.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm13Overtime;
|
||||
|
||||
/**
|
||||
* 13.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm14Overtime;
|
||||
|
||||
/**
|
||||
* 14.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm15Overtime;
|
||||
|
||||
/**
|
||||
* 15.5次间谐波电压限值次数
|
||||
*/
|
||||
private String inuharm16Overtime;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 10:01
|
||||
*/
|
||||
@Data
|
||||
public class PqsCommunicateDto {
|
||||
|
||||
private String time;
|
||||
|
||||
private String devId;
|
||||
|
||||
private String description;
|
||||
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 在线率日表
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:28
|
||||
*/
|
||||
@Data
|
||||
public class RStatOnlineRateDto {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 在线条数
|
||||
*/
|
||||
private Integer onlineMin;
|
||||
|
||||
/**
|
||||
* 离线条数
|
||||
*/
|
||||
private Integer offlineMin;
|
||||
|
||||
@Data
|
||||
public static class Detail extends RStatOnlineRateDto{
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
private String timeId;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
private String devIndex;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,469 @@
|
||||
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.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
|
||||
@Data
|
||||
@TableName(value = "r_stat_limit_rate_detail_d")
|
||||
public class RStatLimitRateDetailD implements Serializable {
|
||||
/**
|
||||
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "my_index")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’’M’表示ABC三项总和,T’表示总
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "phasic_type")
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
@TableField(value = "all_time")
|
||||
private Integer allTime;
|
||||
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
@TableField(value = "flicker_all_time")
|
||||
private Integer flickerAllTime;
|
||||
|
||||
/**
|
||||
* 闪变越限次数
|
||||
*/
|
||||
@TableField(value = "flicker_overtime")
|
||||
private String flickerOvertime;
|
||||
|
||||
|
||||
/**
|
||||
* 频率偏差越限次数
|
||||
*/
|
||||
@TableField(value = "freq_dev_overtime")
|
||||
private String freqDevOvertime;
|
||||
|
||||
/**
|
||||
* 电压偏差越限次数
|
||||
*/
|
||||
@TableField(value = "voltage_dev_overtime")
|
||||
private String voltageDevOvertime;
|
||||
|
||||
/**
|
||||
* 三相电压不平衡度越限次数
|
||||
*/
|
||||
@TableField(value = "ubalance_overtime")
|
||||
private String ubalanceOvertime;
|
||||
|
||||
/**
|
||||
* 电压谐波畸变率越限次数
|
||||
*/
|
||||
@TableField(value = "uaberrance_overtime")
|
||||
private String uaberranceOvertime;
|
||||
|
||||
/**
|
||||
* 负序电流限值次数
|
||||
*/
|
||||
@TableField(value = "i_neg_overtime")
|
||||
private String iNegOvertime;
|
||||
|
||||
/**
|
||||
* 2次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_2_overtime")
|
||||
private String uharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_3_overtime")
|
||||
private String uharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_4_overtime")
|
||||
private String uharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_5_overtime")
|
||||
private String uharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_6_overtime")
|
||||
private String uharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_7_overtime")
|
||||
private String uharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_8_overtime")
|
||||
private String uharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_9_overtime")
|
||||
private String uharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_10_overtime")
|
||||
private String uharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_11_overtime")
|
||||
private String uharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_12_overtime")
|
||||
private String uharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_13_overtime")
|
||||
private String uharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_14_overtime")
|
||||
private String uharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_15_overtime")
|
||||
private String uharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_16_overtime")
|
||||
private String uharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_17_overtime")
|
||||
private String uharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_18_overtime")
|
||||
private String uharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_19_overtime")
|
||||
private String uharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_20_overtime")
|
||||
private String uharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_21_overtime")
|
||||
private String uharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_22_overtime")
|
||||
private String uharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_23_overtime")
|
||||
private String uharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_24_overtime")
|
||||
private String uharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电压谐波含有率越限次数
|
||||
*/
|
||||
@TableField(value = "uharm_25_overtime")
|
||||
private String uharm25Overtime;
|
||||
|
||||
/**
|
||||
* 2次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_2_overtime")
|
||||
private String iharm2Overtime;
|
||||
|
||||
/**
|
||||
* 3次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_3_overtime")
|
||||
private String iharm3Overtime;
|
||||
|
||||
/**
|
||||
* 4次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_4_overtime")
|
||||
private String iharm4Overtime;
|
||||
|
||||
/**
|
||||
* 5次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_5_overtime")
|
||||
private String iharm5Overtime;
|
||||
|
||||
/**
|
||||
* 6次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_6_overtime")
|
||||
private String iharm6Overtime;
|
||||
|
||||
/**
|
||||
* 7次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_7_overtime")
|
||||
private String iharm7Overtime;
|
||||
|
||||
/**
|
||||
* 8次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_8_overtime")
|
||||
private String iharm8Overtime;
|
||||
|
||||
/**
|
||||
* 9次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_9_overtime")
|
||||
private String iharm9Overtime;
|
||||
|
||||
/**
|
||||
* 10次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_10_overtime")
|
||||
private String iharm10Overtime;
|
||||
|
||||
/**
|
||||
* 11次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_11_overtime")
|
||||
private String iharm11Overtime;
|
||||
|
||||
/**
|
||||
* 12次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_12_overtime")
|
||||
private String iharm12Overtime;
|
||||
|
||||
/**
|
||||
* 13次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_13_overtime")
|
||||
private String iharm13Overtime;
|
||||
|
||||
/**
|
||||
* 14次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_14_overtime")
|
||||
private String iharm14Overtime;
|
||||
|
||||
/**
|
||||
* 15次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_15_overtime")
|
||||
private String iharm15Overtime;
|
||||
|
||||
/**
|
||||
* 16次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_16_overtime")
|
||||
private String iharm16Overtime;
|
||||
|
||||
/**
|
||||
* 17次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_17_overtime")
|
||||
private String iharm17Overtime;
|
||||
|
||||
/**
|
||||
* 18次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_18_overtime")
|
||||
private String iharm18Overtime;
|
||||
|
||||
/**
|
||||
* 19次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_19_overtime")
|
||||
private String iharm19Overtime;
|
||||
|
||||
/**
|
||||
* 20次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_20_overtime")
|
||||
private String iharm20Overtime;
|
||||
|
||||
/**
|
||||
* 21次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_21_overtime")
|
||||
private String iharm21Overtime;
|
||||
|
||||
/**
|
||||
* 22次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_22_overtime")
|
||||
private String iharm22Overtime;
|
||||
|
||||
/**
|
||||
* 23次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_23_overtime")
|
||||
private String iharm23Overtime;
|
||||
|
||||
/**
|
||||
* 24次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_24_overtime")
|
||||
private String iharm24Overtime;
|
||||
|
||||
/**
|
||||
* 25次电流谐波幅值越限次数
|
||||
*/
|
||||
@TableField(value = "iharm_25_overtime")
|
||||
private String iharm25Overtime;
|
||||
|
||||
/**
|
||||
* 0.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_1_overtime")
|
||||
private String inuharm1Overtime;
|
||||
|
||||
/**
|
||||
* 1.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_2_overtime")
|
||||
private String inuharm2Overtime;
|
||||
|
||||
/**
|
||||
* 2.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_3_overtime")
|
||||
private String inuharm3Overtime;
|
||||
|
||||
/**
|
||||
* 3.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_4_overtime")
|
||||
private String inuharm4Overtime;
|
||||
|
||||
/**
|
||||
* 4.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_5_overtime")
|
||||
private String inuharm5Overtime;
|
||||
|
||||
/**
|
||||
* 5.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_6_overtime")
|
||||
private String inuharm6Overtime;
|
||||
|
||||
/**
|
||||
* 6.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_7_overtime")
|
||||
private String inuharm7Overtime;
|
||||
|
||||
/**
|
||||
* 7.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_8_overtime")
|
||||
private String inuharm8Overtime;
|
||||
|
||||
/**
|
||||
* 8.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_9_overtime")
|
||||
private String inuharm9Overtime;
|
||||
|
||||
/**
|
||||
* 9.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_10_overtime")
|
||||
private String inuharm10Overtime;
|
||||
|
||||
/**
|
||||
* 10.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_11_overtime")
|
||||
private String inuharm11Overtime;
|
||||
|
||||
/**
|
||||
* 11.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_12_overtime")
|
||||
private String inuharm12Overtime;
|
||||
|
||||
/**
|
||||
* 12.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_13_overtime")
|
||||
private String inuharm13Overtime;
|
||||
|
||||
/**
|
||||
* 13.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_14_overtime")
|
||||
private String inuharm14Overtime;
|
||||
|
||||
/**
|
||||
* 14.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_15_overtime")
|
||||
private String inuharm15Overtime;
|
||||
|
||||
/**
|
||||
* 15.5次间谐波电压限值次数
|
||||
*/
|
||||
@TableField(value = "inuharm_16_overtime")
|
||||
private String inuharm16Overtime;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.dataProcess.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 在线率日表
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 11:28
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_stat_onlinerate_d")
|
||||
public class RStatOnlineRateD {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 日期
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
private LocalDateTime timeId;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "dev_index")
|
||||
private String devIndex;
|
||||
|
||||
/**
|
||||
* 在线条数
|
||||
*/
|
||||
@TableField(value = "online_min")
|
||||
private Integer onlineMin;
|
||||
|
||||
/**
|
||||
* 离线条数
|
||||
*/
|
||||
@TableField(value = "offline_min")
|
||||
private Integer offlineMin;
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import java.util.List;
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/dataLimitRate")
|
||||
@Api(tags = "电压类数据获取")
|
||||
@Api(tags = "监测点稳态指标越限次数获取")
|
||||
public class DataLimitRateController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
|
||||
@@ -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.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.service.ILimitRate;
|
||||
import com.njcn.dataProcess.service.ILimitRateDetail;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 19:48
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/dataLimitRateDetail")
|
||||
@Api(tags = "监测点稳态指标越限详情获取")
|
||||
public class DataLimitRateDetailController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
private ILimitRateDetail limitRateDetailQuery;
|
||||
|
||||
@InsertBean
|
||||
private ILimitRateDetail limitRateDetailInsert;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/batchInsertion")
|
||||
@ApiOperation("批量插入")
|
||||
public HttpResult<String> batchInsertion(@RequestBody List<DataLimitRateDetailDto> dataVDTOList) {
|
||||
String methodDescribe = getMethodDescribe("batchInsertion");
|
||||
limitRateDetailInsert.batchInsertion(dataVDTOList);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.njcn.dataProcess.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.dataProcess.annotation.InsertBean;
|
||||
import com.njcn.dataProcess.annotation.QueryBean;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.dataProcess.service.IPqsCommunicate;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/6 19:48
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RestController
|
||||
@RequestMapping("/pqsCommunicate")
|
||||
@Api(tags = "装置在线原始获取")
|
||||
public class PqsCommunicateController extends BaseController {
|
||||
|
||||
@QueryBean
|
||||
private IPqsCommunicate pqsCommunicateCvtQuery;
|
||||
|
||||
@InsertBean
|
||||
private IPqsCommunicate pqsCommunicateInsert;
|
||||
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawDataLatest")
|
||||
@ApiOperation("获取取出最新装置数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataLatest(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawDataLatest");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawDataLatest(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawData")
|
||||
@ApiOperation("获取原始数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawData(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getRawDataEnd")
|
||||
@ApiOperation("获取是否有当天最后一条数据")
|
||||
public HttpResult<List<PqsCommunicateDto>> getRawDataEnd(@RequestBody LineCountEvaluateParam lineParam) {
|
||||
String methodDescribe = getMethodDescribe("getRawData");
|
||||
List<PqsCommunicateDto> rawData = pqsCommunicateCvtQuery.getRawDataEnd(lineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.dataProcess.dao.imapper;
|
||||
|
||||
import com.njcn.dataProcess.po.influx.PqsCommunicate;
|
||||
import com.njcn.influx.base.InfluxDbBaseMapper;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/10 9:49
|
||||
*/
|
||||
public interface PqsCommunicateMapper extends InfluxDbBaseMapper<PqsCommunicate> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.njcn.dataProcess.dao.relation.mapper;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
* @author web2023
|
||||
*/
|
||||
public interface RStatLimitRateDetailRelationMapper extends MppBaseMapper<RStatLimitRateDetailD> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
public interface ILimitRateDetail extends IMppService<RStatLimitRateDetailD> {
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
* @param limitRateDetailList
|
||||
*/
|
||||
void batchInsertion(List<DataLimitRateDetailDto> limitRateDetailList);
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.dataProcess.service;
|
||||
|
||||
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/6 10:22
|
||||
*/
|
||||
public interface IPqsCommunicate {
|
||||
|
||||
/**
|
||||
* 取出最新装置数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawDataLatest(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
* 获取时间范围数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawData(LineCountEvaluateParam lineParam);
|
||||
|
||||
/**
|
||||
*是否有当天最后一条数据
|
||||
* @param lineParam
|
||||
* @return
|
||||
*/
|
||||
List<PqsCommunicateDto> getRawDataEnd(LineCountEvaluateParam lineParam);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitRateDetailRelationMapper;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
||||
import com.njcn.dataProcess.service.ILimitRateDetail;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 10:13
|
||||
*/
|
||||
@Service("InfluxdbLimitRateDetailImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbLimitRateDetailImpl extends MppServiceImpl<RStatLimitRateDetailRelationMapper, RStatLimitRateDetailD> implements ILimitRateDetail {
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataLimitRateDetailDto> limitRateList) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.njcn.dataProcess.service.impl.influxdb;
|
||||
|
||||
import com.njcn.dataProcess.dao.imapper.PqsCommunicateMapper;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.po.influx.DataV;
|
||||
import com.njcn.dataProcess.po.influx.PqsCommunicate;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.dataProcess.service.IPqsCommunicate;
|
||||
import com.njcn.influx.query.InfluxQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 10:13
|
||||
*/
|
||||
@Service("InfluxdbPqsCommunicateImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class InfluxdbPqsCommunicateImpl implements IPqsCommunicate {
|
||||
|
||||
@Resource
|
||||
private PqsCommunicateMapper pqsCommunicateMapper;
|
||||
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
|
||||
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawDataLatest(LineCountEvaluateParam lineParam) {
|
||||
List<PqsCommunicateDto> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PqsCommunicate.class);
|
||||
influxQueryWrapper.regular(PqsCommunicate::getDevId, lineParam.getLineId())
|
||||
.select(PqsCommunicate::getTime)
|
||||
.select(PqsCommunicate::getDevId)
|
||||
.select(PqsCommunicate::getDescription)
|
||||
.select(PqsCommunicate::getType)
|
||||
.timeDesc()
|
||||
.limit(1);
|
||||
List<PqsCommunicate> list = pqsCommunicateMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
list.forEach(item -> {
|
||||
PqsCommunicateDto dto = new PqsCommunicateDto();
|
||||
BeanUtils.copyProperties(item, dto);
|
||||
dto.setTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 获取时间段内的数据
|
||||
* @Param:
|
||||
* @return: java.util.List<com.njcn.dataProcess.dto.DataVDTO>
|
||||
* @Author: clam
|
||||
* @Date: 2025/02/24
|
||||
*/
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
List<PqsCommunicateDto> result = new ArrayList<>();
|
||||
List<PqsCommunicate> list = getMinuteDataV(lineParam);
|
||||
list.forEach(item -> {
|
||||
PqsCommunicateDto dto = new PqsCommunicateDto();
|
||||
BeanUtils.copyProperties(item, dto);
|
||||
dto.setTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawDataEnd(LineCountEvaluateParam lineParam) {
|
||||
List<PqsCommunicateDto> result = new ArrayList<>();
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PqsCommunicate.class);
|
||||
influxQueryWrapper.regular(PqsCommunicate::getDevId, lineParam.getLineId())
|
||||
.select(PqsCommunicate::getTime)
|
||||
.select(PqsCommunicate::getDevId)
|
||||
.select(PqsCommunicate::getDescription)
|
||||
.select(PqsCommunicate::getType)
|
||||
.le(PqsCommunicate::getTime, lineParam.getEndTime())
|
||||
.timeDesc()
|
||||
.limit(1);
|
||||
List<PqsCommunicate> list = pqsCommunicateMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
list.forEach(item -> {
|
||||
PqsCommunicateDto dto = new PqsCommunicateDto();
|
||||
BeanUtils.copyProperties(item, dto);
|
||||
dto.setTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||
result.add(dto);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按监测点集合、时间条件获取dataV分钟数据
|
||||
* timeMap参数来判断是否进行数据出来 timeMap为空则不进行数据处理
|
||||
* 剔除异常数据,这里会有三种情况判断
|
||||
* 1.无异常数据,则直接返回集合;
|
||||
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
|
||||
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
|
||||
*/
|
||||
public List<PqsCommunicate> getMinuteDataV(LineCountEvaluateParam lineParam) {
|
||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PqsCommunicate.class);
|
||||
influxQueryWrapper.regular(PqsCommunicate::getDevId, lineParam.getLineId())
|
||||
.select(PqsCommunicate::getTime)
|
||||
.select(PqsCommunicate::getDevId)
|
||||
.select(PqsCommunicate::getDescription)
|
||||
.select(PqsCommunicate::getType)
|
||||
.between(PqsCommunicate::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||
.timeAsc();
|
||||
return pqsCommunicateMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitRateDetailRelationMapper;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.po.RStatLimitRateDetailD;
|
||||
import com.njcn.dataProcess.service.ILimitRateDetail;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 10:13
|
||||
*/
|
||||
@Service("RelationLimitRateDetailImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationLimitRateDetailImpl extends MppServiceImpl<RStatLimitRateDetailRelationMapper, RStatLimitRateDetailD> implements ILimitRateDetail {
|
||||
|
||||
|
||||
@Override
|
||||
public void batchInsertion(List<DataLimitRateDetailDto> limitRateList) {
|
||||
List<RStatLimitRateDetailD> result = new ArrayList<>();
|
||||
limitRateList.forEach(item->{
|
||||
RStatLimitRateDetailD limitRate = new RStatLimitRateDetailD();
|
||||
BeanUtils.copyProperties(item, limitRate);
|
||||
result.add(limitRate);
|
||||
});
|
||||
this.saveOrUpdateBatchByMultiId(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.dataProcess.service.impl.relation;
|
||||
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.PqsCommunicateDto;
|
||||
import com.njcn.dataProcess.service.IPqsCommunicate;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0
|
||||
* @data 2024/11/7 11:02
|
||||
*/
|
||||
@Service("RelationPqsCommunicateImpl")
|
||||
@RequiredArgsConstructor
|
||||
public class RelationPqsCommunicateImpl implements IPqsCommunicate {
|
||||
|
||||
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawDataLatest(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PqsCommunicateDto> getRawDataEnd(LineCountEvaluateParam lineParam) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user