完成监测点稳态指标合格率(天、月、季和年)
This commit is contained in:
@@ -25,7 +25,7 @@ public class DeviceExecutor extends BaseExecutor {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 算法名: 暂无-----终端在线率_日表(r_stat_onlinerate_d)
|
* 算法名: 终端在线率_日表(r_stat_onlinerate_d)
|
||||||
*
|
*
|
||||||
* @param bindCmp
|
* @param bindCmp
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -358,6 +358,7 @@ public class MeasurementExecutor extends BaseExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataLimitRate", nodeType = NodeTypeEnum.COMMON)
|
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataLimitRate", nodeType = NodeTypeEnum.COMMON)
|
||||||
public boolean dataLimitRateAccess(NodeComponent bindCmp) {
|
public boolean dataLimitRateAccess(NodeComponent bindCmp) {
|
||||||
return isAccess(bindCmp);
|
return isAccess(bindCmp);
|
||||||
@@ -378,6 +379,22 @@ public class MeasurementExecutor extends BaseExecutor {
|
|||||||
dataCrossingService.limitTargetHandler(bindCmp.getRequestData());
|
dataCrossingService.limitTargetHandler(bindCmp.getRequestData());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataLimitQualified", nodeType = NodeTypeEnum.COMMON)
|
||||||
|
public boolean dataLimitQualifiedAccess(NodeComponent bindCmp) {
|
||||||
|
return isAccess(bindCmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "dataLimitQualified", nodeType = NodeTypeEnum.COMMON)
|
||||||
|
public void dataLimitQualifiedProcess(NodeComponent bindCmp) {
|
||||||
|
dataCrossingService.limitQualifiedDayHandler(bindCmp.getRequestData());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点数据完整性
|
||||||
|
* @param bindCmp
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataIntegrity", nodeType = NodeTypeEnum.COMMON)
|
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataIntegrity", nodeType = NodeTypeEnum.COMMON)
|
||||||
public boolean dataIntegrityAccess(NodeComponent bindCmp) {
|
public boolean dataIntegrityAccess(NodeComponent bindCmp) {
|
||||||
return isAccess(bindCmp);
|
return isAccess(bindCmp);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package com.njcn.algorithm.service.line;
|
|||||||
|
|
||||||
|
|
||||||
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
import com.njcn.algorithm.pojo.bo.CalculatedParam;
|
||||||
import com.njcn.dataProcess.pojo.dto.QualifiedDetail;
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ public interface IDataCrossingService {
|
|||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2025/3/12 16:03
|
* @Date: 2025/3/12 16:03
|
||||||
*/
|
*/
|
||||||
List<QualifiedDetail> limitQualifiedDayHandler(CalculatedParam calculatedParam);
|
void limitQualifiedDayHandler(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,5 +42,27 @@ public interface IDataCrossingService {
|
|||||||
* @Author: wr
|
* @Author: wr
|
||||||
* @Date: 2025/3/12 16:03
|
* @Date: 2025/3/12 16:03
|
||||||
*/
|
*/
|
||||||
List<QualifiedDetail> limitQualifiedMonthHandler(CalculatedParam calculatedParam);
|
List<DataQualifiedDetail> limitQualifiedMonthHandler(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点稳态指标合格率(季)
|
||||||
|
* @param calculatedParam
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/12 16:03
|
||||||
|
*/
|
||||||
|
List<DataQualifiedDetail> limitQualifiedQuarterHandler(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点稳态指标合格率(年)
|
||||||
|
* @param calculatedParam
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/12 16:03
|
||||||
|
*/
|
||||||
|
List<DataQualifiedDetail> limitQualifiedYearHandler(CalculatedParam calculatedParam);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ 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.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -71,6 +72,8 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
|
||||||
@Resource
|
@Resource
|
||||||
private DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
private DataLimitTargetFeignClient dataLimitTargetFeignClient;
|
||||||
|
@Resource
|
||||||
|
private DataLimitQualifiedFeignClient dataLimitQualifiedFeignClient;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -260,33 +263,20 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<QualifiedDetail> limitQualifiedDayHandler(CalculatedParam calculatedParam) {
|
public void limitQualifiedDayHandler(CalculatedParam calculatedParam) {
|
||||||
|
logger.info("{},r_stat_limit_qualified_d算法开始=====》", LocalDateTime.now());
|
||||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
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();
|
||||||
return getQualifiedDetails(calculatedParam, lineParam, lineIdList);
|
List<DataQualifiedDetail> info = new ArrayList<>();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<QualifiedDetail> limitQualifiedMonthHandler(CalculatedParam calculatedParam) {
|
|
||||||
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
|
||||||
lineParam.setStartTime(TimeUtils.getBeginOfMonth(calculatedParam.getDataDate()));
|
|
||||||
lineParam.setEndTime(TimeUtils.getEndOfMonth(calculatedParam.getDataDate()));
|
|
||||||
List<String> lineIdList = calculatedParam.getIdList();
|
|
||||||
return getQualifiedDetails(calculatedParam, lineParam, lineIdList);
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<QualifiedDetail> getQualifiedDetails(CalculatedParam calculatedParam, LineCountEvaluateParam lineParam, List<String> lineIdList) {
|
|
||||||
List<QualifiedDetail> info = new ArrayList<>();
|
|
||||||
List<List<String>> pendingIds = ListUtils.partition(lineIdList, NUM);
|
List<List<String>> pendingIds = ListUtils.partition(lineIdList, NUM);
|
||||||
for (List<String> pendingId : pendingIds) {
|
for (List<String> pendingId : pendingIds) {
|
||||||
lineParam.setLineId(pendingId);
|
lineParam.setLineId(pendingId);
|
||||||
List<DataLimitRateDto> data = dataLimitRateFeignClient.getRawData(lineParam).getData();
|
List<DataLimitRateDto> data = dataLimitRateFeignClient.getRawData(lineParam).getData();
|
||||||
Map<String, List<DataLimitRateDto>> limitRateMap = data.stream().collect(Collectors.groupingBy(DataLimitRateDto::getLineId));
|
Map<String, List<DataLimitRateDto>> limitRateMap = data.stream().collect(Collectors.groupingBy(DataLimitRateDto::getLineId));
|
||||||
limitRateMap.forEach((key, value) -> {
|
limitRateMap.forEach((key, value) -> {
|
||||||
QualifiedDetail qualified = new QualifiedDetail();
|
DataQualifiedDetail qualified = new DataQualifiedDetail();
|
||||||
qualified.setLineId(key);
|
qualified.setLineId(key);
|
||||||
qualified.setTime(calculatedParam.getDataDate());
|
qualified.setTime(calculatedParam.getDataDate());
|
||||||
int all = value.stream().mapToInt(DataLimitRateDto::getAllTime).sum();
|
int all = value.stream().mapToInt(DataLimitRateDto::getAllTime).sum();
|
||||||
@@ -309,7 +299,61 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (CollUtil.isNotEmpty(info)) {
|
if (CollUtil.isNotEmpty(info)) {
|
||||||
|
dataLimitQualifiedFeignClient.batchInsertion(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataQualifiedDetail> limitQualifiedMonthHandler(CalculatedParam calculatedParam) {
|
||||||
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
|
lineParam.setStartTime(TimeUtils.getBeginOfMonth(calculatedParam.getDataDate()));
|
||||||
|
lineParam.setEndTime(TimeUtils.getEndOfMonth(calculatedParam.getDataDate()));
|
||||||
|
List<String> lineIdList = calculatedParam.getIdList();
|
||||||
|
return getDataQualifiedDetails(lineParam, lineIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataQualifiedDetail> limitQualifiedQuarterHandler(CalculatedParam calculatedParam) {
|
||||||
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
|
lineParam.setStartTime(TimeUtils.getBeginOfQuarter(calculatedParam.getDataDate()));
|
||||||
|
lineParam.setEndTime(TimeUtils.getEndOfQuarter(calculatedParam.getDataDate()));
|
||||||
|
List<String> lineIdList = calculatedParam.getIdList();
|
||||||
|
return getDataQualifiedDetails(lineParam, lineIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataQualifiedDetail> limitQualifiedYearHandler(CalculatedParam calculatedParam) {
|
||||||
|
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
|
||||||
|
lineParam.setStartTime(TimeUtils.getBeginOfYear(calculatedParam.getDataDate()));
|
||||||
|
lineParam.setEndTime(TimeUtils.getEndOfYear(calculatedParam.getDataDate()));
|
||||||
|
List<String> lineIdList = calculatedParam.getIdList();
|
||||||
|
return getDataQualifiedDetails(lineParam, lineIdList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private List<DataQualifiedDetail> getDataQualifiedDetails(LineCountEvaluateParam lineParam, List<String> lineIdList) {
|
||||||
|
List<DataQualifiedDetail> info = new ArrayList<>();
|
||||||
|
List<List<String>> pendingIds = ListUtils.partition(lineIdList, NUM);
|
||||||
|
for (List<String> pendingId : pendingIds) {
|
||||||
|
lineParam.setLineId(pendingId);
|
||||||
|
List<DataQualifiedDetail> data = dataLimitQualifiedFeignClient.getRawData(lineParam).getData();
|
||||||
|
Map<String, List<DataQualifiedDetail>> limitRateMap = data.stream().collect(Collectors.groupingBy(DataQualifiedDetail::getLineId));
|
||||||
|
for (Map.Entry<String, List<DataQualifiedDetail>> entry : limitRateMap.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
|
List<DataQualifiedDetail> value = entry.getValue();
|
||||||
|
DataQualifiedDetail qualified = new DataQualifiedDetail();
|
||||||
|
qualified.setLineId(key);
|
||||||
|
qualified.setTime(lineParam.getStartTime());
|
||||||
|
qualified.setFreqDevOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getFreqDevOvertime).average().getAsDouble()));
|
||||||
|
qualified.setVoltageDevOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getVoltageDevOvertime).average().getAsDouble()));
|
||||||
|
qualified.setUbalanceOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getUbalanceOvertime).average().getAsDouble()));
|
||||||
|
qualified.setUaberranceOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getUaberranceOvertime).average().getAsDouble()));
|
||||||
|
qualified.setINegOvertime(PubUtils.doubleRound(2, value.stream().mapToDouble(DataQualifiedDetail::getINegOvertime).average().getAsDouble()));
|
||||||
|
setOverTime(2, 25, "uharm", value, qualified);
|
||||||
|
setOverTime(2, 25, "iharm", value, qualified);
|
||||||
|
setOverTime(1, 16, "inuharm", value, qualified);
|
||||||
|
info.add(qualified);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
@@ -317,8 +361,31 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
private double getaDouble(double value, int all) {
|
private double getaDouble(double value, int all) {
|
||||||
return value * 100.0 / all;
|
return value * 100.0 / all;
|
||||||
}
|
}
|
||||||
|
private void setOverTime(Integer start, Integer end, String targetName, List<DataQualifiedDetail> value, DataQualifiedDetail qualified) {
|
||||||
private void setOverTime(Integer start, Integer end, String targetName, List<DataLimitRateDto> value, QualifiedDetail qualified, int all) {
|
for (int i = start; i <= end; i++) {
|
||||||
|
// 构造方法名
|
||||||
|
String methodName = targetName + i + "Overtime";
|
||||||
|
try {
|
||||||
|
Field finalField = DataLimitRateDto.class.getDeclaredField(methodName);
|
||||||
|
finalField.setAccessible(true);
|
||||||
|
double v = PubUtils.doubleRound(2, value.stream().mapToDouble(temp -> {
|
||||||
|
Double o;
|
||||||
|
try {
|
||||||
|
o = (Double) finalField.get(temp);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
return o.doubleValue();
|
||||||
|
}).average().getAsDouble());
|
||||||
|
Field declared = DataQualifiedDetail.class.getDeclaredField(methodName);
|
||||||
|
declared.setAccessible(true);
|
||||||
|
declared.set(qualified, v);
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void setOverTime(Integer start, Integer end, String targetName, List<DataLimitRateDto> value, DataQualifiedDetail qualified, int all) {
|
||||||
for (int i = start; i <= end; i++) {
|
for (int i = start; i <= end; i++) {
|
||||||
// 构造方法名
|
// 构造方法名
|
||||||
String methodName = targetName + i + "Overtime";
|
String methodName = targetName + i + "Overtime";
|
||||||
@@ -334,7 +401,7 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
|
|||||||
}
|
}
|
||||||
return o.intValue();
|
return o.intValue();
|
||||||
}).sum() * 100.0, all));
|
}).sum() * 100.0, all));
|
||||||
Field declared = QualifiedDetail.class.getDeclaredField(methodName);
|
Field declared = DataQualifiedDetail.class.getDeclaredField(methodName);
|
||||||
declared.setAccessible(true);
|
declared.setAccessible(true);
|
||||||
declared.set(qualified, v);
|
declared.set(qualified, v);
|
||||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
|||||||
@@ -33,4 +33,7 @@ public interface DataFlickerFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/addList")
|
@PostMapping("/addList")
|
||||||
HttpResult<String> addList(@RequestBody List<DataFlickerDto> data);
|
HttpResult<String> addList(@RequestBody List<DataFlickerDto> data);
|
||||||
|
|
||||||
|
@PostMapping("/getColumnNameCountRawData")
|
||||||
|
HttpResult<Integer> getColumnNameCountRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.DataLimitQualifiedFeignClientClientFallbackFactory;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
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 = "/dataLimitQualified", fallbackFactory = DataLimitQualifiedFeignClientClientFallbackFactory.class, contextId = "dataLimitQualified")
|
||||||
|
public interface DataLimitQualifiedFeignClient {
|
||||||
|
|
||||||
|
@PostMapping("/batchInsertion")
|
||||||
|
HttpResult<String> batchInsertion(@RequestBody List<DataQualifiedDetail> dataIDTOList);
|
||||||
|
|
||||||
|
@PostMapping("/getRawData")
|
||||||
|
HttpResult<List<DataQualifiedDetail>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
|
}
|
||||||
@@ -39,6 +39,9 @@ public interface DataVFeignClient {
|
|||||||
@PostMapping("/getCountRawData")
|
@PostMapping("/getCountRawData")
|
||||||
HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam);
|
HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
@PostMapping("/getColumnNameCountRawData")
|
||||||
|
HttpResult<Integer> getColumnNameCountRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
//获取算法基础数据
|
//获取算法基础数据
|
||||||
@PostMapping("/getBaseData")
|
@PostMapping("/getBaseData")
|
||||||
HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam);
|
HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam);
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ public class DataFlickerFeignClientFallbackFactory implements FallbackFactory<Da
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Integer> getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","闪变 时间分组获取条目数量",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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.DataLimitQualifiedFeignClient;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
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 DataLimitQualifiedFeignClientClientFallbackFactory implements FallbackFactory<DataLimitQualifiedFeignClient> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输出远程请求接口异常日志
|
||||||
|
* @param cause RPC请求异常
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DataLimitQualifiedFeignClient 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 DataLimitQualifiedFeignClient() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<String> batchInsertion(List<DataQualifiedDetail> dataIDTOList) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<DataQualifiedDetail>> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","获取原始数据",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -69,6 +69,12 @@ public class DataVFeignClientFallbackFactory implements FallbackFactory<DataVFei
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Integer> getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","时间分组获取条目数量",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<List<CommonMinuteDto>> getBaseData(LineCountEvaluateParam lineParam) {
|
public HttpResult<List<CommonMinuteDto>> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
log.error("{}异常,降级处理,异常为:{}","获取算法基础数据",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","获取算法基础数据",cause.toString());
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点有效数值统计数据评估入参
|
* 监测点有效数值统计数据评估入参
|
||||||
|
*
|
||||||
* @author hongawen
|
* @author hongawen
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @data 2024/11/6 20:36
|
* @data 2024/11/6 20:36
|
||||||
@@ -39,6 +40,22 @@ public class LineCountEvaluateParam extends BaseParam implements Serializable {
|
|||||||
* 异常数据时间集合
|
* 异常数据时间集合
|
||||||
* Map<String,List<String>> key:监测点id value:异常时间集合
|
* Map<String,List<String>> key:监测点id value:异常时间集合
|
||||||
*/
|
*/
|
||||||
private Map<String,List<String>> abnormalTime;
|
private Map<String, List<String>> abnormalTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列名
|
||||||
|
*/
|
||||||
|
private String columnName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最小值 >=
|
||||||
|
*/
|
||||||
|
private String ge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最大值 <=
|
||||||
|
*/
|
||||||
|
private String lt;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.njcn.dataProcess.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/18 13:54
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataComassesDPO implements Serializable {
|
||||||
|
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
private Double freqDev1;
|
||||||
|
|
||||||
|
private Double freqDev2;
|
||||||
|
|
||||||
|
private Double freqDev3;
|
||||||
|
|
||||||
|
private Double freqDev4;
|
||||||
|
|
||||||
|
private Double freqDev5;
|
||||||
|
|
||||||
|
private Double vuDev1;
|
||||||
|
|
||||||
|
private Double vuDev2;
|
||||||
|
|
||||||
|
private Double vuDev3;
|
||||||
|
|
||||||
|
private Double vuDev4;
|
||||||
|
|
||||||
|
private Double vuDev5;
|
||||||
|
|
||||||
|
private Double dataPst1;
|
||||||
|
|
||||||
|
private Double dataPst2;
|
||||||
|
|
||||||
|
private Double dataPst3;
|
||||||
|
|
||||||
|
private Double dataPst4;
|
||||||
|
|
||||||
|
private Double dataPst5;
|
||||||
|
|
||||||
|
private Double vUnbalance1;
|
||||||
|
|
||||||
|
private Double vUnbalance2;
|
||||||
|
|
||||||
|
private Double vUnbalance3;
|
||||||
|
|
||||||
|
private Double vUnbalance4;
|
||||||
|
|
||||||
|
private Double vUnbalance5;
|
||||||
|
|
||||||
|
private Double vThd1;
|
||||||
|
|
||||||
|
private Double vThd2;
|
||||||
|
|
||||||
|
private Double vThd3;
|
||||||
|
|
||||||
|
private Double vThd4;
|
||||||
|
|
||||||
|
private Double vThd5;
|
||||||
|
|
||||||
|
private Double event1;
|
||||||
|
|
||||||
|
private Double event2;
|
||||||
|
|
||||||
|
private Double event3;
|
||||||
|
|
||||||
|
private Double event4;
|
||||||
|
|
||||||
|
private Double event5;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import lombok.Data;
|
|||||||
* @Date: 2025/3/12 19:16
|
* @Date: 2025/3/12 19:16
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class QualifiedDetail {
|
public class DataQualifiedDetail {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点ID合格率的变电站/装置/母线/线路序号
|
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
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.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/3/27 15:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "r_stat_comasses_d")
|
||||||
|
public class RStatComassesDPO implements Serializable {
|
||||||
|
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time_id")
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "line_id")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
@TableField(value = "freq_dev1")
|
||||||
|
private Double freqDev1;
|
||||||
|
|
||||||
|
@TableField(value = "freq_dev2")
|
||||||
|
private Double freqDev2;
|
||||||
|
|
||||||
|
@TableField(value = "freq_dev3")
|
||||||
|
private Double freqDev3;
|
||||||
|
|
||||||
|
@TableField(value = "freq_dev4")
|
||||||
|
private Double freqDev4;
|
||||||
|
|
||||||
|
@TableField(value = "freq_dev5")
|
||||||
|
private Double freqDev5;
|
||||||
|
|
||||||
|
@TableField(value = "vu_dev1")
|
||||||
|
private Double vuDev1;
|
||||||
|
|
||||||
|
@TableField(value = "vu_dev2")
|
||||||
|
private Double vuDev2;
|
||||||
|
|
||||||
|
@TableField(value = "vu_dev3")
|
||||||
|
private Double vuDev3;
|
||||||
|
|
||||||
|
@TableField(value = "vu_dev4")
|
||||||
|
private Double vuDev4;
|
||||||
|
|
||||||
|
@TableField(value = "vu_dev5")
|
||||||
|
private Double vuDev5;
|
||||||
|
|
||||||
|
@TableField(value = "data_plt1")
|
||||||
|
private Double dataPst1;
|
||||||
|
|
||||||
|
@TableField(value = "data_plt2")
|
||||||
|
private Double dataPst2;
|
||||||
|
|
||||||
|
@TableField(value = "data_plt3")
|
||||||
|
private Double dataPst3;
|
||||||
|
|
||||||
|
@TableField(value = "data_plt4")
|
||||||
|
private Double dataPst4;
|
||||||
|
|
||||||
|
@TableField(value = "data_plt5")
|
||||||
|
private Double dataPst5;
|
||||||
|
|
||||||
|
@TableField(value = "v_unbalance1")
|
||||||
|
private Double vUnbalance1;
|
||||||
|
|
||||||
|
@TableField(value = "v_unbalance2")
|
||||||
|
private Double vUnbalance2;
|
||||||
|
|
||||||
|
@TableField(value = "v_unbalance3")
|
||||||
|
private Double vUnbalance3;
|
||||||
|
|
||||||
|
@TableField(value = "v_unbalance4")
|
||||||
|
private Double vUnbalance4;
|
||||||
|
|
||||||
|
@TableField(value = "v_unbalance5")
|
||||||
|
private Double vUnbalance5;
|
||||||
|
|
||||||
|
@TableField(value = "v_thd1")
|
||||||
|
private Double vThd1;
|
||||||
|
|
||||||
|
@TableField(value = "v_thd2")
|
||||||
|
private Double vThd2;
|
||||||
|
|
||||||
|
@TableField(value = "v_thd3")
|
||||||
|
private Double vThd3;
|
||||||
|
|
||||||
|
@TableField(value = "v_thd4")
|
||||||
|
private Double vThd4;
|
||||||
|
|
||||||
|
@TableField(value = "v_thd5")
|
||||||
|
private Double vThd5;
|
||||||
|
|
||||||
|
@TableField(value = "event1")
|
||||||
|
private Double event1;
|
||||||
|
|
||||||
|
@TableField(value = "event2")
|
||||||
|
private Double event2;
|
||||||
|
|
||||||
|
@TableField(value = "event3")
|
||||||
|
private Double event3;
|
||||||
|
|
||||||
|
@TableField(value = "event4")
|
||||||
|
private Double event4;
|
||||||
|
|
||||||
|
@TableField(value = "event5")
|
||||||
|
private Double event5;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,451 @@
|
|||||||
|
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_qualified_d")
|
||||||
|
public class RStatLimitQualifiedD implements Serializable {
|
||||||
|
/**
|
||||||
|
* 监测点ID合格率的变电站/装置/母线/线路序号
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "my_index")
|
||||||
|
private String lineId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合格率时间
|
||||||
|
*/
|
||||||
|
@MppMultiId
|
||||||
|
@TableField(value = "time_id")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private LocalDate time;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 闪变越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "flicker_overtime")
|
||||||
|
private Integer flickerOvertime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 频率偏差越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "freq_dev_overtime")
|
||||||
|
private Integer freqDevOvertime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压偏差越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "voltage_dev_overtime")
|
||||||
|
private Integer voltageDevOvertime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 三相电压不平衡度越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "ubalance_overtime")
|
||||||
|
private Integer ubalanceOvertime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压谐波畸变率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uaberrance_overtime")
|
||||||
|
private Integer uaberranceOvertime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负序电流限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "i_neg_overtime")
|
||||||
|
private Integer iNegOvertime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_2_overtime")
|
||||||
|
private Integer uharm2Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_3_overtime")
|
||||||
|
private Integer uharm3Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_4_overtime")
|
||||||
|
private Integer uharm4Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_5_overtime")
|
||||||
|
private Integer uharm5Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_6_overtime")
|
||||||
|
private Integer uharm6Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_7_overtime")
|
||||||
|
private Integer uharm7Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_8_overtime")
|
||||||
|
private Integer uharm8Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_9_overtime")
|
||||||
|
private Integer uharm9Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_10_overtime")
|
||||||
|
private Integer uharm10Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_11_overtime")
|
||||||
|
private Integer uharm11Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_12_overtime")
|
||||||
|
private Integer uharm12Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_13_overtime")
|
||||||
|
private Integer uharm13Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_14_overtime")
|
||||||
|
private Integer uharm14Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_15_overtime")
|
||||||
|
private Integer uharm15Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_16_overtime")
|
||||||
|
private Integer uharm16Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_17_overtime")
|
||||||
|
private Integer uharm17Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_18_overtime")
|
||||||
|
private Integer uharm18Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_19_overtime")
|
||||||
|
private Integer uharm19Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_20_overtime")
|
||||||
|
private Integer uharm20Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_21_overtime")
|
||||||
|
private Integer uharm21Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_22_overtime")
|
||||||
|
private Integer uharm22Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_23_overtime")
|
||||||
|
private Integer uharm23Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_24_overtime")
|
||||||
|
private Integer uharm24Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次电压谐波含有率越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "uharm_25_overtime")
|
||||||
|
private Integer uharm25Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_2_overtime")
|
||||||
|
private Integer iharm2Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_3_overtime")
|
||||||
|
private Integer iharm3Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_4_overtime")
|
||||||
|
private Integer iharm4Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_5_overtime")
|
||||||
|
private Integer iharm5Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_6_overtime")
|
||||||
|
private Integer iharm6Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_7_overtime")
|
||||||
|
private Integer iharm7Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_8_overtime")
|
||||||
|
private Integer iharm8Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_9_overtime")
|
||||||
|
private Integer iharm9Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_10_overtime")
|
||||||
|
private Integer iharm10Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_11_overtime")
|
||||||
|
private Integer iharm11Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_12_overtime")
|
||||||
|
private Integer iharm12Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_13_overtime")
|
||||||
|
private Integer iharm13Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_14_overtime")
|
||||||
|
private Integer iharm14Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_15_overtime")
|
||||||
|
private Integer iharm15Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 16次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_16_overtime")
|
||||||
|
private Integer iharm16Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 17次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_17_overtime")
|
||||||
|
private Integer iharm17Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 18次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_18_overtime")
|
||||||
|
private Integer iharm18Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 19次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_19_overtime")
|
||||||
|
private Integer iharm19Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 20次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_20_overtime")
|
||||||
|
private Integer iharm20Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 21次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_21_overtime")
|
||||||
|
private Integer iharm21Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 22次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_22_overtime")
|
||||||
|
private Integer iharm22Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 23次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_23_overtime")
|
||||||
|
private Integer iharm23Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 24次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_24_overtime")
|
||||||
|
private Integer iharm24Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 25次电流谐波幅值越限次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "iharm_25_overtime")
|
||||||
|
private Integer iharm25Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_1_overtime")
|
||||||
|
private Integer inuharm1Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_2_overtime")
|
||||||
|
private Integer inuharm2Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 2.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_3_overtime")
|
||||||
|
private Integer inuharm3Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_4_overtime")
|
||||||
|
private Integer inuharm4Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 4.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_5_overtime")
|
||||||
|
private Integer inuharm5Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_6_overtime")
|
||||||
|
private Integer inuharm6Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 6.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_7_overtime")
|
||||||
|
private Integer inuharm7Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 7.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_8_overtime")
|
||||||
|
private Integer inuharm8Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 8.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_9_overtime")
|
||||||
|
private Integer inuharm9Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 9.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_10_overtime")
|
||||||
|
private Integer inuharm10Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 10.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_11_overtime")
|
||||||
|
private Integer inuharm11Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 11.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_12_overtime")
|
||||||
|
private Integer inuharm12Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 12.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_13_overtime")
|
||||||
|
private Integer inuharm13Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 13.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_14_overtime")
|
||||||
|
private Integer inuharm14Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 14.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_15_overtime")
|
||||||
|
private Integer inuharm15Overtime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 15.5次间谐波电压限值次数
|
||||||
|
*/
|
||||||
|
@TableField(value = "inuharm_16_overtime")
|
||||||
|
private Integer inuharm16Overtime;
|
||||||
|
}
|
||||||
@@ -66,6 +66,15 @@ public class DataFlickerController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getColumnNameCountRawData")
|
||||||
|
@ApiOperation("时间分组获取条目数量")
|
||||||
|
public HttpResult<Integer> getColumnNameCountRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getColumnNameCountRawData");
|
||||||
|
Integer data = dataFlickerQuery.getColumnNameCountRawData(lineParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||||
@PostMapping("/getBaseData")
|
@PostMapping("/getBaseData")
|
||||||
@ApiOperation("获取算法基础数据")
|
@ApiOperation("获取算法基础数据")
|
||||||
|
|||||||
@@ -0,0 +1,66 @@
|
|||||||
|
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.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
import com.njcn.dataProcess.service.IDataLimitQualified;
|
||||||
|
import com.njcn.dataProcess.service.IDataLimitRate;
|
||||||
|
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("/dataLimitQualified")
|
||||||
|
@Api(tags = "监测点稳态指标合格率获取")
|
||||||
|
public class DataLimitQualifiedController extends BaseController {
|
||||||
|
|
||||||
|
@QueryBean
|
||||||
|
private IDataLimitQualified limitQualifiedQuery;
|
||||||
|
|
||||||
|
@InsertBean
|
||||||
|
private IDataLimitQualified limitQualifiedInsert;
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/batchInsertion")
|
||||||
|
@ApiOperation("批量插入")
|
||||||
|
public HttpResult<String> batchInsertion(@RequestBody List<DataQualifiedDetail> dataVDTOList) {
|
||||||
|
String methodDescribe = getMethodDescribe("batchInsertion");
|
||||||
|
limitQualifiedInsert.batchInsertion(dataVDTOList);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getRawData")
|
||||||
|
@ApiOperation("获取原始数据")
|
||||||
|
public HttpResult<List<DataQualifiedDetail>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getRawData");
|
||||||
|
List<DataQualifiedDetail> rawData = limitQualifiedInsert.getRawData(lineParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rawData, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -96,7 +96,7 @@ public class DataVController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getCountRawData")
|
@PostMapping("/getCountRawData")
|
||||||
@ApiOperation("获取总条目数量")
|
@ApiOperation("获取总条目数量")
|
||||||
public HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
public HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
@@ -105,7 +105,16 @@ public class DataVController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getColumnNameCountRawData")
|
||||||
|
@ApiOperation("时间分组获取条目数量")
|
||||||
|
public HttpResult<Integer> getColumnNameCountRawData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getColumnNameCountRawData");
|
||||||
|
Integer data = dataVQuery.getColumnNameCountRawData(lineParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getBaseData")
|
@PostMapping("/getBaseData")
|
||||||
@ApiOperation("获取算法基础数据")
|
@ApiOperation("获取算法基础数据")
|
||||||
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
public HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam) {
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.njcn.dataProcess.dao.relation.mapper;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitQualifiedD;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
* @author web2023
|
||||||
|
*/
|
||||||
|
public interface RStatLimitQualifiedRelationMapper extends MppBaseMapper<RStatLimitQualifiedD> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.dataProcess.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataComassesDPO;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatComassesDPO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/6 10:22
|
||||||
|
*/
|
||||||
|
public interface IDataComAss extends IMppService<RStatComassesDPO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入数据
|
||||||
|
* @param limitQualifiedList
|
||||||
|
*/
|
||||||
|
void batchInsertion(List<DataComassesDPO> limitQualifiedList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -36,4 +36,11 @@ public interface IDataFlicker extends IMppService<RStatDataFlickerD> {
|
|||||||
* 批量插入数据
|
* 批量插入数据
|
||||||
*/
|
*/
|
||||||
void addList(List<DataFlickerDto> dataIDtoList);
|
void addList(List<DataFlickerDto> dataIDtoList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间分组获取条目数量
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.njcn.dataProcess.service;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitQualifiedD;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitRateD;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/6 10:22
|
||||||
|
*/
|
||||||
|
public interface IDataLimitQualified extends IMppService<RStatLimitQualifiedD> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量插入数据
|
||||||
|
* @param limitQualifiedList
|
||||||
|
*/
|
||||||
|
void batchInsertion(List<DataQualifiedDetail> limitQualifiedList);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取原始数据
|
||||||
|
* @param lineParam
|
||||||
|
*/
|
||||||
|
List<DataQualifiedDetail> getRawData(LineCountEvaluateParam lineParam);
|
||||||
|
}
|
||||||
@@ -46,6 +46,13 @@ public interface IDataV extends IMppService<RStatDataVD> {
|
|||||||
*/
|
*/
|
||||||
Integer getCountRawData(LineCountEvaluateParam lineParam);
|
Integer getCountRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间分组获取条目数量
|
||||||
|
* @param lineParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取监测点原始数据
|
* 获取监测点原始数据
|
||||||
* @param lineParam 监测点参数
|
* @param lineParam 监测点参数
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package com.njcn.dataProcess.service.impl.influxdb;
|
package com.njcn.dataProcess.service.impl.influxdb;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.dataProcess.dao.imapper.DataFlickerMapper;
|
import com.njcn.dataProcess.dao.imapper.DataFlickerMapper;
|
||||||
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
import com.njcn.dataProcess.dao.relation.mapper.RStatDataFlickerRelationMapper;
|
||||||
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
import com.njcn.dataProcess.dto.DataFlickerDTO;
|
||||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
import com.njcn.dataProcess.po.influx.DataFlicker;
|
import com.njcn.dataProcess.po.influx.DataFlicker;
|
||||||
|
import com.njcn.dataProcess.po.influx.DataV;
|
||||||
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
|
||||||
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
import com.njcn.dataProcess.pojo.dto.DataFlickerDto;
|
||||||
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
import com.njcn.dataProcess.pojo.po.RStatDataFlickerD;
|
||||||
@@ -122,6 +125,29 @@ public class InfluxdbDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataFlicker.class);
|
||||||
|
influxQueryWrapper
|
||||||
|
.count(lineParam.getColumnName())
|
||||||
|
.regular(DataFlicker::getLineId, lineParam.getLineId())
|
||||||
|
.groupBy("time(1m) fill(none)")
|
||||||
|
.eq(DataFlicker::getQualityFlag, "0")
|
||||||
|
.between(DataFlicker::getTime, lineParam.getStartTime(), lineParam.getEndTime());
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
||||||
|
influxQueryWrapper.regular(DataFlicker::getPhasicType, lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(lineParam.getGe())) {
|
||||||
|
influxQueryWrapper.ge(lineParam.getColumnName(), lineParam.getGe());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(lineParam.getLt())) {
|
||||||
|
influxQueryWrapper.lt(lineParam.getColumnName(), lineParam.getLt());
|
||||||
|
}
|
||||||
|
List<DataFlicker> dataFlickers = dataFlickerMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
return dataFlickers.size();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按监测点集合、时间条件获取分钟数据
|
* 按监测点集合、时间条件获取分钟数据
|
||||||
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.njcn.dataProcess.service.impl.influxdb;
|
||||||
|
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitQualifiedRelationMapper;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitQualifiedD;
|
||||||
|
import com.njcn.dataProcess.service.IDataLimitQualified;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: wr
|
||||||
|
* @Date: 2025/3/7 10:13
|
||||||
|
*/
|
||||||
|
@Service("InfluxdbDataLimitQualifiedImpl")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class InfluxdbDataLimitQualifiedImpl extends MppServiceImpl<RStatLimitQualifiedRelationMapper, RStatLimitQualifiedD> implements IDataLimitQualified {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchInsertion(List<DataQualifiedDetail> limitQualifiedList) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataQualifiedDetail> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.njcn.dataProcess.service.impl.influxdb;
|
|||||||
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.collection.ListUtil;
|
import cn.hutool.core.collection.ListUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
import com.njcn.common.utils.HarmonicTimesUtil;
|
import com.njcn.common.utils.HarmonicTimesUtil;
|
||||||
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
|
||||||
@@ -49,6 +50,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 注意:influxdb不推荐采用in函数的方式批量查询监测点的数据,效率很低,容易造成崩溃,故每次单测点查询
|
* 注意:influxdb不推荐采用in函数的方式批量查询监测点的数据,效率很低,容易造成崩溃,故每次单测点查询
|
||||||
|
*
|
||||||
* @param lineParam 监测点参数
|
* @param lineParam 监测点参数
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@@ -56,28 +58,28 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
Map<String, List<DataVFiveItemDTO>> result = new HashMap<>();
|
Map<String, List<DataVFiveItemDTO>> result = new HashMap<>();
|
||||||
List<String> lineId = lineParam.getLineId();
|
List<String> lineId = lineParam.getLineId();
|
||||||
InfluxQueryWrapper dataVQueryWrapper = new InfluxQueryWrapper(DataV.class, LineDataVFiveItemDTO.class);
|
InfluxQueryWrapper dataVQueryWrapper = new InfluxQueryWrapper(DataV.class, LineDataVFiveItemDTO.class);
|
||||||
if(CollectionUtil.isNotEmpty(lineId)){
|
if (CollectionUtil.isNotEmpty(lineId)) {
|
||||||
for (String line : lineId) {
|
for (String line : lineId) {
|
||||||
List<DataVFiveItemDTO> dataVFiveItemDTOS = new ArrayList<>();
|
List<DataVFiveItemDTO> dataVFiveItemDTOS = new ArrayList<>();
|
||||||
// 准备查freq,v_thd,v_unbalance 取T项数据
|
// 准备查freq,v_thd,v_unbalance 取T项数据
|
||||||
dataVQueryWrapper.initSql();
|
dataVQueryWrapper.initSql();
|
||||||
dataVQueryWrapper
|
dataVQueryWrapper
|
||||||
.select(DataV::getTime,DataV::getFreq,DataV::getVThd,DataV::getVUnbalance,DataV::getValueType)
|
.select(DataV::getTime, DataV::getFreq, DataV::getVThd, DataV::getVUnbalance, DataV::getValueType)
|
||||||
.between(DataV::getTime,lineParam.getStartTime(),lineParam.getEndTime())
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
.eq(DataV::getLineId,line)
|
.eq(DataV::getLineId, line)
|
||||||
.eq(DataV::getPhasicType, PhaseType.PHASE_T)
|
.eq(DataV::getPhasicType, PhaseType.PHASE_T)
|
||||||
.or(DataV::getValueType, ListUtil.of(InfluxDBTableConstant.MAX,InfluxDBTableConstant.MIN));
|
.or(DataV::getValueType, ListUtil.of(InfluxDBTableConstant.MAX, InfluxDBTableConstant.MIN));
|
||||||
List<LineDataVFiveItemDTO> lineDataVFiveItemDTOSByT = dataVMapper.queryDataValue(dataVQueryWrapper);
|
List<LineDataVFiveItemDTO> lineDataVFiveItemDTOSByT = dataVMapper.queryDataValue(dataVQueryWrapper);
|
||||||
|
|
||||||
|
|
||||||
// 准备查rms,rms_lvr 取ABC项数据任意一个数据
|
// 准备查rms,rms_lvr 取ABC项数据任意一个数据
|
||||||
dataVQueryWrapper.initSql();
|
dataVQueryWrapper.initSql();
|
||||||
dataVQueryWrapper
|
dataVQueryWrapper
|
||||||
.select(DataV::getTime,DataV::getRms,DataV::getRmsLvr)
|
.select(DataV::getTime, DataV::getRms, DataV::getRmsLvr)
|
||||||
.between(DataV::getTime,lineParam.getStartTime(),lineParam.getEndTime())
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
.eq(DataV::getLineId,line)
|
.eq(DataV::getLineId, line)
|
||||||
.eq(DataV::getPhasicType,PhaseType.PHASE_A)
|
.eq(DataV::getPhasicType, PhaseType.PHASE_A)
|
||||||
.or(DataV::getValueType, ListUtil.of(InfluxDBTableConstant.MAX,InfluxDBTableConstant.MIN));
|
.or(DataV::getValueType, ListUtil.of(InfluxDBTableConstant.MAX, InfluxDBTableConstant.MIN));
|
||||||
List<LineDataVFiveItemDTO> lineDataVFiveItemDTOSByA = dataVMapper.queryDataValue(dataVQueryWrapper);
|
List<LineDataVFiveItemDTO> lineDataVFiveItemDTOSByA = dataVMapper.queryDataValue(dataVQueryWrapper);
|
||||||
|
|
||||||
System.out.println(123);
|
System.out.println(123);
|
||||||
@@ -90,8 +92,6 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("InfluxdbDataVImpl");
|
System.out.println("InfluxdbDataVImpl");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -99,7 +99,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public void batchInsertion(List<DataVDTO> dataVDTOList) {
|
public void batchInsertion(List<DataVDTO> dataVDTOList) {
|
||||||
int totalCount = dataVDTOList.size();
|
int totalCount = dataVDTOList.size();
|
||||||
if(totalCount<=0){
|
if (totalCount <= 0) {
|
||||||
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());
|
||||||
@@ -117,12 +117,12 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public List<LocalDateTime> monitoringTime(String lineId, String localData) {
|
public List<LocalDateTime> monitoringTime(String lineId, String localData) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
String startTime = localData+ InfluxDBTableConstant.START_TIME;
|
String startTime = localData + InfluxDBTableConstant.START_TIME;
|
||||||
String endTime = localData+ InfluxDBTableConstant.END_TIME;
|
String endTime = localData + InfluxDBTableConstant.END_TIME;
|
||||||
influxQueryWrapper.eq(DataV::getLineId,lineId).between(DataV::getTime, startTime, endTime);
|
influxQueryWrapper.eq(DataV::getLineId, lineId).between(DataV::getTime, startTime, endTime);
|
||||||
|
|
||||||
List<DataV> dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
List<DataV> dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
List<LocalDateTime> result = dataVS.stream().map(temp->{
|
List<LocalDateTime> result = dataVS.stream().map(temp -> {
|
||||||
return LocalDateTime.ofInstant(temp.getTime(), ZoneId.systemDefault());
|
return LocalDateTime.ofInstant(temp.getTime(), ZoneId.systemDefault());
|
||||||
}).distinct().collect(Collectors.toList());
|
}).distinct().collect(Collectors.toList());
|
||||||
return result;
|
return result;
|
||||||
@@ -132,9 +132,9 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
public List<DataVDto> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
List<DataVDto> result = new ArrayList<>();
|
List<DataVDto> result = new ArrayList<>();
|
||||||
List<DataV> list = getMinuteDataV(lineParam);
|
List<DataV> list = getMinuteDataV(lineParam);
|
||||||
list.forEach(item->{
|
list.forEach(item -> {
|
||||||
DataVDto dto = new DataVDto();
|
DataVDto dto = new DataVDto();
|
||||||
BeanUtils.copyProperties(item,dto);
|
BeanUtils.copyProperties(item, dto);
|
||||||
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
|
||||||
result.add(dto);
|
result.add(dto);
|
||||||
});
|
});
|
||||||
@@ -145,7 +145,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
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, "", 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)
|
||||||
.select(DataV::getValueType)
|
.select(DataV::getValueType)
|
||||||
@@ -161,6 +161,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
.select(DataV::getVlDev)
|
.select(DataV::getVlDev)
|
||||||
.select(DataV::getVuDev)
|
.select(DataV::getVuDev)
|
||||||
.select(DataV::getQualityFlag)
|
.select(DataV::getQualityFlag)
|
||||||
|
.eq(DataV::getQualityFlag, "0")
|
||||||
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime())
|
||||||
.limit(1)
|
.limit(1)
|
||||||
;
|
;
|
||||||
@@ -168,6 +169,32 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return dataVS.size();
|
return dataVS.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
|
||||||
|
influxQueryWrapper
|
||||||
|
.count(lineParam.getColumnName())
|
||||||
|
.regular(DataV::getLineId, lineParam.getLineId())
|
||||||
|
.groupBy("time(1m) fill(none)")
|
||||||
|
.eq(DataV::getQualityFlag, "0")
|
||||||
|
.between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime());
|
||||||
|
|
||||||
|
if (CollUtil.isNotEmpty(lineParam.getPhasicType())) {
|
||||||
|
influxQueryWrapper.regular(DataV::getPhasicType, lineParam.getPhasicType());
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(lineParam.getValueType())) {
|
||||||
|
influxQueryWrapper.regular(DataV::getValueType, lineParam.getValueType());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(lineParam.getGe())) {
|
||||||
|
influxQueryWrapper.ge(lineParam.getColumnName(), lineParam.getGe());
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(lineParam.getLt())) {
|
||||||
|
influxQueryWrapper.lt(lineParam.getColumnName(), lineParam.getLt());
|
||||||
|
}
|
||||||
|
List<DataV> dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
|
return dataVS.size();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
List<CommonMinuteDto> result = new ArrayList<>();
|
List<CommonMinuteDto> result = new ArrayList<>();
|
||||||
@@ -175,22 +202,22 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
if (CollectionUtil.isNotEmpty(dataVList)) {
|
if (CollectionUtil.isNotEmpty(dataVList)) {
|
||||||
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
String time = TimeUtils.StringTimeToString(lineParam.getStartTime());
|
||||||
//以监测点分组
|
//以监测点分组
|
||||||
Map<String,List<DataV>> lineMap = dataVList.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
Map<String, List<DataV>> lineMap = dataVList.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||||
lineMap.forEach((line,lineList)->{
|
lineMap.forEach((line, lineList) -> {
|
||||||
CommonMinuteDto dto = new CommonMinuteDto();
|
CommonMinuteDto dto = new CommonMinuteDto();
|
||||||
dto.setLineId(line);
|
dto.setLineId(line);
|
||||||
dto.setTime(time);
|
dto.setTime(time);
|
||||||
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
dto.setQualityFlag(lineList.get(0).getQualityFlag());
|
||||||
//以相别分组
|
//以相别分组
|
||||||
Map<String,List<DataV>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataV::getPhasicType));
|
Map<String, List<DataV>> phasicTypeMap = lineList.stream().collect(Collectors.groupingBy(DataV::getPhasicType));
|
||||||
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
List<CommonMinuteDto.PhasicType> phasicTypes = new ArrayList<>();
|
||||||
phasicTypeMap.forEach((phasicType,phasicTypeList)->{
|
phasicTypeMap.forEach((phasicType, phasicTypeList) -> {
|
||||||
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
CommonMinuteDto.PhasicType type = new CommonMinuteDto.PhasicType();
|
||||||
type.setPhasicType(phasicType);
|
type.setPhasicType(phasicType);
|
||||||
//以数据类型分组
|
//以数据类型分组
|
||||||
Map<String,List<DataV>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataV::getValueType));
|
Map<String, List<DataV>> valueTypeMap = phasicTypeList.stream().collect(Collectors.groupingBy(DataV::getValueType));
|
||||||
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
List<CommonMinuteDto.ValueType> valueTypes = new ArrayList<>();
|
||||||
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);
|
||||||
//规定好集合指标参数
|
//规定好集合指标参数
|
||||||
@@ -257,13 +284,13 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
List<Double> data60 = valueTypeList.stream().map(DataV::getV49).collect(Collectors.toList());
|
List<Double> data60 = valueTypeList.stream().map(DataV::getV49).collect(Collectors.toList());
|
||||||
List<Double> data61 = valueTypeList.stream().map(DataV::getV50).collect(Collectors.toList());
|
List<Double> data61 = valueTypeList.stream().map(DataV::getV50).collect(Collectors.toList());
|
||||||
|
|
||||||
List<List<Double>> lists = Arrays.asList(data1,data2,data3,data4,data5,data6,data7,data8,data9,data10
|
List<List<Double>> lists = Arrays.asList(data1, data2, data3, data4, data5, data6, data7, data8, data9, data10
|
||||||
,data11,data12,data13,data14,data15,data16,data17,data18,data19,data20
|
, data11, data12, data13, data14, data15, data16, data17, data18, data19, data20
|
||||||
,data21,data22,data23,data24,data25,data26,data27,data28,data29,data30
|
, data21, data22, data23, data24, data25, data26, data27, data28, data29, data30
|
||||||
,data31,data32,data33,data34,data35,data36,data37,data38,data39,data40
|
, data31, data32, data33, data34, data35, data36, data37, data38, data39, data40
|
||||||
,data41,data42,data43,data44,data45,data46,data47,data48,data49,data50
|
, data41, data42, data43, data44, data45, data46, data47, data48, data49, data50
|
||||||
,data51,data52,data53,data54,data55,data56,data57,data58,data59,data60
|
, data51, data52, data53, data54, data55, data56, data57, data58, data59, data60
|
||||||
,data61);
|
, data61);
|
||||||
value.setValueList(lists);
|
value.setValueList(lists);
|
||||||
valueTypes.add(value);
|
valueTypes.add(value);
|
||||||
});
|
});
|
||||||
@@ -285,7 +312,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public void addInfluxDbList(List<DataVDto> dataVList) {
|
public void addInfluxDbList(List<DataVDto> dataVList) {
|
||||||
List<DataV> result = new ArrayList<>();
|
List<DataV> result = new ArrayList<>();
|
||||||
dataVList.forEach(item->{
|
dataVList.forEach(item -> {
|
||||||
DataV dataV = new DataV();
|
DataV dataV = new DataV();
|
||||||
BeanUtils.copyProperties(item, dataV);
|
BeanUtils.copyProperties(item, dataV);
|
||||||
dataV.setTime(LocalDateTime.parse(item.getMinTime(), DATE_TIME_FORMATTER).atZone(ZoneId.systemDefault()).toInstant());
|
dataV.setTime(LocalDateTime.parse(item.getMinTime(), DATE_TIME_FORMATTER).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
@@ -297,13 +324,13 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
@Override
|
@Override
|
||||||
public void batchInsertionCvtDTO(List<DataVCvtDto> cvtDTOList) {
|
public void batchInsertionCvtDTO(List<DataVCvtDto> cvtDTOList) {
|
||||||
int totalCount = cvtDTOList.size();
|
int totalCount = cvtDTOList.size();
|
||||||
if(totalCount<=0){
|
if (totalCount <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
List<DataV> collect = cvtDTOList.stream().map(temp ->
|
List<DataV> collect = cvtDTOList.stream().map(temp ->
|
||||||
{
|
{
|
||||||
DataV dataV = new DataV();
|
DataV dataV = new DataV();
|
||||||
BeanUtils.copyProperties(temp,dataV);
|
BeanUtils.copyProperties(temp, dataV);
|
||||||
dataV.setTime(LocalDateTime.parse(temp.getMinTime(), DATE_TIME_FORMATTER).atZone(ZoneId.systemDefault()).toInstant());
|
dataV.setTime(LocalDateTime.parse(temp.getMinTime(), DATE_TIME_FORMATTER).atZone(ZoneId.systemDefault()).toInstant());
|
||||||
|
|
||||||
return dataV;
|
return dataV;
|
||||||
@@ -322,7 +349,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MeasurementCountDTO> getMeasurementCount(List<String> lineIndex, String startTime, String endTime) {
|
public List<MeasurementCountDTO> getMeasurementCount(List<String> lineIndex, String startTime, String endTime) {
|
||||||
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class,MeasurementCountDTO.class);
|
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class, MeasurementCountDTO.class);
|
||||||
influxQueryWrapper.regular(DataV::getLineId, lineIndex)
|
influxQueryWrapper.regular(DataV::getLineId, lineIndex)
|
||||||
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
.eq(DataV::getValueType, InfluxDbSqlConstant.MAX)
|
||||||
.eq(DataV::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_A)
|
.eq(DataV::getPhasicType, InfluxDBTableConstant.PHASE_TYPE_A)
|
||||||
@@ -349,7 +376,7 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
List<DataV> result = new ArrayList<>();
|
List<DataV> result = new ArrayList<>();
|
||||||
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, "", 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)
|
||||||
.select(DataV::getValueType)
|
.select(DataV::getValueType)
|
||||||
@@ -366,15 +393,15 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
.select(DataV::getVuDev)
|
.select(DataV::getVuDev)
|
||||||
.select(DataV::getQualityFlag)
|
.select(DataV::getQualityFlag)
|
||||||
.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());
|
||||||
}
|
}
|
||||||
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
List<DataV> list = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
|
||||||
Map<String,List<DataV>> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
Map<String, List<DataV>> lineMap = list.stream().collect(Collectors.groupingBy(DataV::getLineId));
|
||||||
//有异常数据
|
//有异常数据
|
||||||
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
if (CollectionUtil.isNotEmpty(lineParam.getAbnormalTime())) {
|
||||||
lineMap.forEach((k,v)->{
|
lineMap.forEach((k, v) -> {
|
||||||
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
List<String> timeList = lineParam.getAbnormalTime().get(k);
|
||||||
//有异常数据,是自身异常数据
|
//有异常数据,是自身异常数据
|
||||||
if (CollectionUtil.isNotEmpty(timeList)) {
|
if (CollectionUtil.isNotEmpty(timeList)) {
|
||||||
|
|||||||
@@ -89,4 +89,9 @@ public class RelationDataFlickerImpl extends MppServiceImpl<RStatDataFlickerRela
|
|||||||
});
|
});
|
||||||
dataFlicker.saveOrUpdateBatchByMultiId(result);
|
dataFlicker.saveOrUpdateBatchByMultiId(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.njcn.dataProcess.service.impl.relation;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||||
|
import com.njcn.dataProcess.dao.relation.mapper.RStatLimitQualifiedRelationMapper;
|
||||||
|
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||||
|
import com.njcn.dataProcess.pojo.dto.DataQualifiedDetail;
|
||||||
|
import com.njcn.dataProcess.pojo.po.RStatLimitQualifiedD;
|
||||||
|
import com.njcn.dataProcess.service.IDataLimitQualified;
|
||||||
|
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("RelationDataLimitQualifiedImpl")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RelationDataLimitQualifiedImpl extends MppServiceImpl<RStatLimitQualifiedRelationMapper, RStatLimitQualifiedD> implements IDataLimitQualified {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchInsertion(List<DataQualifiedDetail> limitQualifiedList) {
|
||||||
|
List<RStatLimitQualifiedD> result = new ArrayList<>();
|
||||||
|
limitQualifiedList.forEach(item->{
|
||||||
|
RStatLimitQualifiedD limitRate = new RStatLimitQualifiedD();
|
||||||
|
BeanUtils.copyProperties(item, limitRate);
|
||||||
|
result.add(limitRate);
|
||||||
|
});
|
||||||
|
this.saveOrUpdateBatchByMultiId(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataQualifiedDetail> getRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
List<DataQualifiedDetail> result = new ArrayList<>();
|
||||||
|
LambdaQueryWrapper<RStatLimitQualifiedD> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(CollUtil.isNotEmpty(lineParam.getLineId()),RStatLimitQualifiedD::getLineId,lineParam.getLineId())
|
||||||
|
.ge(RStatLimitQualifiedD::getTime,lineParam.getStartTime())
|
||||||
|
.le(RStatLimitQualifiedD::getTime,lineParam.getEndTime());
|
||||||
|
List<RStatLimitQualifiedD> list = this.list(lambdaQueryWrapper);
|
||||||
|
|
||||||
|
list.forEach(item->{
|
||||||
|
DataQualifiedDetail dto = new DataQualifiedDetail();
|
||||||
|
BeanUtils.copyProperties(item,dto);
|
||||||
|
result.add(dto);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -105,6 +105,13 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer getColumnNameCountRawData(LineCountEvaluateParam lineParam) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
public List<CommonMinuteDto> getBaseData(LineCountEvaluateParam lineParam) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ data:
|
|||||||
source:
|
source:
|
||||||
query: Influxdb
|
query: Influxdb
|
||||||
# insert: Influxdb
|
# insert: Influxdb
|
||||||
insert: Influxdb
|
insert: Relation
|
||||||
#mybatis配置信息
|
#mybatis配置信息
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@@ -33,10 +33,10 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<!--内网-->
|
<!--内网-->
|
||||||
<middle.server.url>192.168.1.22</middle.server.url>
|
<middle.server.url>192.168.1.22</middle.server.url>
|
||||||
<service.server.url>192.168.1.130</service.server.url>
|
<service.server.url>192.168.1.121</service.server.url>
|
||||||
<docker.server.url>192.168.1.22</docker.server.url>
|
<docker.server.url>192.168.1.22</docker.server.url>
|
||||||
<nacos.url>${middle.server.url}:18848</nacos.url>
|
<nacos.url>${middle.server.url}:18848</nacos.url>
|
||||||
<nacos.namespace>c2cbedf1-14e9-42c8-98ec-4ffa96e68c0e</nacos.namespace>
|
<nacos.namespace>07ec981d-1377-4920-8760-b5a98ff7e668</nacos.namespace>
|
||||||
<!--sentinel:port-->
|
<!--sentinel:port-->
|
||||||
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
<sentinel.url>${middle.server.url}:8080</sentinel.url>
|
||||||
<!--网关地址,主要用于配置swagger中认证token-->
|
<!--网关地址,主要用于配置swagger中认证token-->
|
||||||
|
|||||||
Reference in New Issue
Block a user