添加电压含有率

This commit is contained in:
hzj
2025-02-28 16:32:16 +08:00
parent 798f09b9e1
commit 15716878cc
42 changed files with 1086 additions and 357 deletions

View File

@@ -1,6 +1,7 @@
package com.njcn.algorithm.executor;
import com.njcn.algorithm.service.line.IDataCleanService;
import com.njcn.algorithm.service.line.IDataVCvtService;
import com.njcn.algorithm.service.line.IDayDataService;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
@@ -28,6 +29,9 @@ public class MeasurementExecutor extends BaseExecutor {
@Resource
private IDataCleanService dataCleanService;
@Resource
private IDataVCvtService dataVCvtService;
/**
* 数据清洗 电压表
* dataV表
@@ -231,4 +235,17 @@ public class MeasurementExecutor extends BaseExecutor {
dayDataService.dataHarmPowerQHandler(bindCmp.getRequestData());
}
/**
* 监测点cvt转换算法()
* @author hzj
*/
@LiteflowMethod(value = LiteFlowMethodEnum.IS_ACCESS, nodeId = "dataVCvt", nodeType = NodeTypeEnum.COMMON)
public boolean dataVCvtAccess(NodeComponent bindCmp) {
return isAccess(bindCmp);
}
@LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "dataVCvt", nodeType = NodeTypeEnum.COMMON)
public void dataVCvtProcess(NodeComponent bindCmp) {
dataVCvtService.dataVCvtHandler(bindCmp.getRequestData());
}
}

View File

@@ -0,0 +1,14 @@
package com.njcn.algorithm.service.line;
import com.njcn.algorithm.pojo.bo.CalculatedParam;
/**
* Description:
* Date: 2025/02/24 上午 9:10【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface IDataVCvtService {
void dataVCvtHandler(CalculatedParam requestData);
}

View File

@@ -0,0 +1,148 @@
package com.njcn.algorithm.serviceimpl.line;
import com.njcn.algorithm.pojo.bo.CalculatedParam;
import com.njcn.algorithm.service.line.IDataVCvtService;
import com.njcn.dataProcess.api.DataVCvtFeignClient;
import com.njcn.dataProcess.api.DataVFeignClient;
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.util.TimeUtils;
import com.njcn.device.pq.api.CvtRelationFeignClient;
import com.njcn.device.pq.pojo.dto.CvtHarmonicCorrectionFactorsDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2025/02/24 上午 9:11【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class DataVCvtServiceImpl implements IDataVCvtService {
@Resource
private CvtRelationFeignClient cvtRelationFeignClient;
@Resource
private DataVCvtFeignClient dataVCvtFeignClient;
@Resource
private DataVFeignClient dataVFeignClient;
@Override
public void dataVCvtHandler(CalculatedParam calculatedParam) {
LineCountEvaluateParam lineParam = new LineCountEvaluateParam();
lineParam.setStartTime(TimeUtils.getBeginOfDay(calculatedParam.getDataDate()));
lineParam.setEndTime(TimeUtils.getEndOfDay(calculatedParam.getDataDate()));
List idList = calculatedParam.getIdList();
LineCountEvaluateParam lineCountEvaluateParam = new LineCountEvaluateParam();
lineCountEvaluateParam.setLineId(calculatedParam.getIdList());
lineCountEvaluateParam.setEndTime(calculatedParam.getDataDate()+ InfluxDBTableConstant.END_TIME);
lineCountEvaluateParam.setStartTime(calculatedParam.getDataDate()+ InfluxDBTableConstant.START_TIME);
List<DataVCvt> data = dataVCvtFeignClient.getRawData(lineCountEvaluateParam).getData();
Map<String, List<DataVCvt>> collect = data.stream().collect(Collectors.groupingBy(DataVCvt::getLineId));
List<DataVCvtDTO> result = new ArrayList<>();
collect.forEach((k,v)->{
CvtHarmonicCorrectionFactorsDTO cvtHarmonicCorrectionFactorsDTO = cvtRelationFeignClient.queryByLineId(k).getData();
if(Objects.nonNull(cvtHarmonicCorrectionFactorsDTO)&&
StringUtils.isNotEmpty(cvtHarmonicCorrectionFactorsDTO.getId())){
v = cvtChange(v,cvtHarmonicCorrectionFactorsDTO);
}
List<DataVCvtDTO> dataVCvtDTOList = v.stream().map(temp -> {
DataVCvtDTO dataVCvtDTO = new DataVCvtDTO();
BeanUtils.copyProperties(temp, dataVCvtDTO);
return dataVCvtDTO;
}).collect(Collectors.toList());
result.addAll(dataVCvtDTOList);
});
dataVFeignClient.batchInsertionCvtDTO(result);
}
private List<DataVCvt> cvtChange(List<DataVCvt> v, CvtHarmonicCorrectionFactorsDTO cvtHarmonicCorrectionFactorsDTO) {
v.stream().forEach(temp->{
//目前知道的只有v2到v50乘以系数
// temp.setLineId();
// temp.setPhasicType();
// temp.setValueType();
// temp.setQualityFlag();
// temp.setAbnormalFlag();
// temp.setFreq();
// temp.setFreqDev();
// temp.setRms();
// temp.setRmsLvr();
// temp.setVlDev();
// temp.setVuDev();
// temp.setVNeg();
// temp.setVPos();
// temp.setVThd();
// temp.setVUnbalance();
// temp.setVZero();
// temp.setV1();
temp.setV2(cvtHarmonicCorrectionFactorsDTO.getH2().doubleValue()*temp.getV2());
temp.setV3(cvtHarmonicCorrectionFactorsDTO.getH3().doubleValue()*temp.getV3());
temp.setV4(cvtHarmonicCorrectionFactorsDTO.getH4().doubleValue()*temp.getV4());
temp.setV5(cvtHarmonicCorrectionFactorsDTO.getH5().doubleValue()*temp.getV5());
temp.setV6(cvtHarmonicCorrectionFactorsDTO.getH6().doubleValue()*temp.getV6());
temp.setV7(cvtHarmonicCorrectionFactorsDTO.getH7().doubleValue()*temp.getV7());
temp.setV8(cvtHarmonicCorrectionFactorsDTO.getH8().doubleValue()*temp.getV8());
temp.setV9(cvtHarmonicCorrectionFactorsDTO.getH9().doubleValue()*temp.getV9());
temp.setV10(cvtHarmonicCorrectionFactorsDTO.getH10().doubleValue()*temp.getV10());
temp.setV11(cvtHarmonicCorrectionFactorsDTO.getH11().doubleValue()*temp.getV11());
temp.setV12(cvtHarmonicCorrectionFactorsDTO.getH12().doubleValue()*temp.getV12());
temp.setV13(cvtHarmonicCorrectionFactorsDTO.getH13().doubleValue()*temp.getV13());
temp.setV14(cvtHarmonicCorrectionFactorsDTO.getH14().doubleValue()*temp.getV14());
temp.setV15(cvtHarmonicCorrectionFactorsDTO.getH15().doubleValue()*temp.getV15());
temp.setV16(cvtHarmonicCorrectionFactorsDTO.getH16().doubleValue()*temp.getV16());
temp.setV17(cvtHarmonicCorrectionFactorsDTO.getH17().doubleValue()*temp.getV17());
temp.setV18(cvtHarmonicCorrectionFactorsDTO.getH18().doubleValue()*temp.getV18());
temp.setV19(cvtHarmonicCorrectionFactorsDTO.getH19().doubleValue()*temp.getV19());
temp.setV20(cvtHarmonicCorrectionFactorsDTO.getH20().doubleValue()*temp.getV20());
temp.setV21(cvtHarmonicCorrectionFactorsDTO.getH21().doubleValue()*temp.getV21());
temp.setV22(cvtHarmonicCorrectionFactorsDTO.getH22().doubleValue()*temp.getV22());
temp.setV23(cvtHarmonicCorrectionFactorsDTO.getH23().doubleValue()*temp.getV23());
temp.setV24(cvtHarmonicCorrectionFactorsDTO.getH24().doubleValue()*temp.getV24());
temp.setV25(cvtHarmonicCorrectionFactorsDTO.getH25().doubleValue()*temp.getV25());
temp.setV26(cvtHarmonicCorrectionFactorsDTO.getH26().doubleValue()*temp.getV26());
temp.setV27(cvtHarmonicCorrectionFactorsDTO.getH27().doubleValue()*temp.getV27());
temp.setV28(cvtHarmonicCorrectionFactorsDTO.getH28().doubleValue()*temp.getV28());
temp.setV29(cvtHarmonicCorrectionFactorsDTO.getH29().doubleValue()*temp.getV29());
temp.setV30(cvtHarmonicCorrectionFactorsDTO.getH30().doubleValue()*temp.getV30());
temp.setV31(cvtHarmonicCorrectionFactorsDTO.getH31().doubleValue()*temp.getV31());
temp.setV32(cvtHarmonicCorrectionFactorsDTO.getH32().doubleValue()*temp.getV32());
temp.setV33(cvtHarmonicCorrectionFactorsDTO.getH33().doubleValue()*temp.getV33());
temp.setV34(cvtHarmonicCorrectionFactorsDTO.getH34().doubleValue()*temp.getV34());
temp.setV35(cvtHarmonicCorrectionFactorsDTO.getH35().doubleValue()*temp.getV35());
temp.setV36(cvtHarmonicCorrectionFactorsDTO.getH36().doubleValue()*temp.getV36());
temp.setV37(cvtHarmonicCorrectionFactorsDTO.getH37().doubleValue()*temp.getV37());
temp.setV38(cvtHarmonicCorrectionFactorsDTO.getH38().doubleValue()*temp.getV38());
temp.setV39(cvtHarmonicCorrectionFactorsDTO.getH39().doubleValue()*temp.getV39());
temp.setV40(cvtHarmonicCorrectionFactorsDTO.getH40().doubleValue()*temp.getV40());
temp.setV41(cvtHarmonicCorrectionFactorsDTO.getH41().doubleValue()*temp.getV41());
temp.setV42(cvtHarmonicCorrectionFactorsDTO.getH42().doubleValue()*temp.getV42());
temp.setV43(cvtHarmonicCorrectionFactorsDTO.getH43().doubleValue()*temp.getV43());
temp.setV44(cvtHarmonicCorrectionFactorsDTO.getH44().doubleValue()*temp.getV44());
temp.setV45(cvtHarmonicCorrectionFactorsDTO.getH45().doubleValue()*temp.getV45());
temp.setV46(cvtHarmonicCorrectionFactorsDTO.getH46().doubleValue()*temp.getV46());
temp.setV47(cvtHarmonicCorrectionFactorsDTO.getH47().doubleValue()*temp.getV47());
temp.setV48(cvtHarmonicCorrectionFactorsDTO.getH48().doubleValue()*temp.getV48());
temp.setV49(cvtHarmonicCorrectionFactorsDTO.getH49().doubleValue()*temp.getV49());
temp.setV50(cvtHarmonicCorrectionFactorsDTO.getH50().doubleValue()*temp.getV50());
});
return v;
}
}

View File

@@ -41,234 +41,240 @@ public class BeanVConverter {
// dataV.setRmscaCp95();
//根据电压偏差正负赋值
if (Objects.nonNull(messageDataV.getDeltaV())&&messageDataV.getDeltaV() >= 0) {
dataVRelation.setVlDev(messageDataV.getDeltaV());
} else {
//修改电压偏差都存在vu_dev方便查询
// if (Objects.nonNull(messageDataV.getDeltaV())&&messageDataV.getDeltaV() >= 0) {
// dataVRelation.setVlDev(messageDataV.getDeltaV());
// } else {
// dataVRelation.setVuDev(messageDataV.getDeltaV());
// }
// if (Objects.nonNull(messageDataV.getGDeltaV())&&messageDataV.getGDeltaV() >= 0) {
// dataVRelation.setVlDevCp95(messageDataV.getGDeltaV());
// } else {
// dataVRelation.setVuDevCp95(messageDataV.getGDeltaV());
// }
// if (Objects.nonNull(messageDataV.getMaxDeltaV())&&messageDataV.getMaxDeltaV() >= 0) {
// dataVRelation.setVlDevMax(messageDataV.getDeltaV());
// } else {
// dataVRelation.setVuDevMax(messageDataV.getDeltaV());
// }
// if (Objects.nonNull(messageDataV.getMinDeltaV())&&messageDataV.getMinDeltaV() >= 0) {
// dataVRelation.setVlDevMin(messageDataV.getDeltaV());
// } else {
// dataVRelation.setVuDevMin(messageDataV.getDeltaV());
// }
dataVRelation.setVuDev(messageDataV.getDeltaV());
}
if (Objects.nonNull(messageDataV.getGDeltaV())&&messageDataV.getGDeltaV() >= 0) {
dataVRelation.setVlDevCp95(messageDataV.getGDeltaV());
} else {
dataVRelation.setVuDevCp95(messageDataV.getGDeltaV());
}
if (Objects.nonNull(messageDataV.getMaxDeltaV())&&messageDataV.getMaxDeltaV() >= 0) {
dataVRelation.setVlDevMax(messageDataV.getDeltaV());
} else {
dataVRelation.setVuDevMax(messageDataV.getDeltaV());
}
if (Objects.nonNull(messageDataV.getMinDeltaV())&&messageDataV.getMinDeltaV() >= 0) {
dataVRelation.setVlDevMin(messageDataV.getDeltaV());
} else {
dataVRelation.setVuDevMin(messageDataV.getDeltaV());
}
dataVRelation.setV1(messageDataV.getV1());
dataVRelation.setV2(messageDataV.getV2());
dataVRelation.setV3(messageDataV.getV3());
dataVRelation.setV4(messageDataV.getV4());
dataVRelation.setV5(messageDataV.getV5());
dataVRelation.setV6(messageDataV.getV6());
dataVRelation.setV7(messageDataV.getV7());
dataVRelation.setV8(messageDataV.getV8());
dataVRelation.setV9(messageDataV.getV9());
dataVRelation.setV10(messageDataV.getV10());
dataVRelation.setV11(messageDataV.getV11());
dataVRelation.setV12(messageDataV.getV12());
dataVRelation.setV13(messageDataV.getV13());
dataVRelation.setV14(messageDataV.getV14());
dataVRelation.setV15(messageDataV.getV15());
dataVRelation.setV16(messageDataV.getV16());
dataVRelation.setV17(messageDataV.getV17());
dataVRelation.setV18(messageDataV.getV18());
dataVRelation.setV19(messageDataV.getV19());
dataVRelation.setV20(messageDataV.getV20());
dataVRelation.setV21(messageDataV.getV21());
dataVRelation.setV22(messageDataV.getV22());
dataVRelation.setV23(messageDataV.getV23());
dataVRelation.setV24(messageDataV.getV24());
dataVRelation.setV25(messageDataV.getV25());
dataVRelation.setV26(messageDataV.getV26());
dataVRelation.setV27(messageDataV.getV27());
dataVRelation.setV28(messageDataV.getV28());
dataVRelation.setV29(messageDataV.getV29());
dataVRelation.setV30(messageDataV.getV30());
dataVRelation.setV31(messageDataV.getV31());
dataVRelation.setV32(messageDataV.getV32());
dataVRelation.setV33(messageDataV.getV33());
dataVRelation.setV34(messageDataV.getV34());
dataVRelation.setV35(messageDataV.getV35());
dataVRelation.setV36(messageDataV.getV36());
dataVRelation.setV37(messageDataV.getV37());
dataVRelation.setV38(messageDataV.getV38());
dataVRelation.setV39(messageDataV.getV39());
dataVRelation.setV40(messageDataV.getV40());
dataVRelation.setV41(messageDataV.getV41());
dataVRelation.setV42(messageDataV.getV42());
dataVRelation.setV43(messageDataV.getV43());
dataVRelation.setV44(messageDataV.getV44());
dataVRelation.setV45(messageDataV.getV45());
dataVRelation.setV46(messageDataV.getV46());
dataVRelation.setV47(messageDataV.getV47());
dataVRelation.setV48(messageDataV.getV48());
dataVRelation.setV49(messageDataV.getV49());
dataVRelation.setV50(messageDataV.getV50());
//谐波电压幅值目前前置不上送,暂时注释掉
// dataVRelation.setV1(messageDataV.getV1());
// dataVRelation.setV2(messageDataV.getV2());
// dataVRelation.setV3(messageDataV.getV3());
// dataVRelation.setV4(messageDataV.getV4());
// dataVRelation.setV5(messageDataV.getV5());
// dataVRelation.setV6(messageDataV.getV6());
// dataVRelation.setV7(messageDataV.getV7());
// dataVRelation.setV8(messageDataV.getV8());
// dataVRelation.setV9(messageDataV.getV9());
// dataVRelation.setV10(messageDataV.getV10());
// dataVRelation.setV11(messageDataV.getV11());
// dataVRelation.setV12(messageDataV.getV12());
// dataVRelation.setV13(messageDataV.getV13());
// dataVRelation.setV14(messageDataV.getV14());
// dataVRelation.setV15(messageDataV.getV15());
// dataVRelation.setV16(messageDataV.getV16());
// dataVRelation.setV17(messageDataV.getV17());
// dataVRelation.setV18(messageDataV.getV18());
// dataVRelation.setV19(messageDataV.getV19());
// dataVRelation.setV20(messageDataV.getV20());
// dataVRelation.setV21(messageDataV.getV21());
// dataVRelation.setV22(messageDataV.getV22());
// dataVRelation.setV23(messageDataV.getV23());
// dataVRelation.setV24(messageDataV.getV24());
// dataVRelation.setV25(messageDataV.getV25());
// dataVRelation.setV26(messageDataV.getV26());
// dataVRelation.setV27(messageDataV.getV27());
// dataVRelation.setV28(messageDataV.getV28());
// dataVRelation.setV29(messageDataV.getV29());
// dataVRelation.setV30(messageDataV.getV30());
// dataVRelation.setV31(messageDataV.getV31());
// dataVRelation.setV32(messageDataV.getV32());
// dataVRelation.setV33(messageDataV.getV33());
// dataVRelation.setV34(messageDataV.getV34());
// dataVRelation.setV35(messageDataV.getV35());
// dataVRelation.setV36(messageDataV.getV36());
// dataVRelation.setV37(messageDataV.getV37());
// dataVRelation.setV38(messageDataV.getV38());
// dataVRelation.setV39(messageDataV.getV39());
// dataVRelation.setV40(messageDataV.getV40());
// dataVRelation.setV41(messageDataV.getV41());
// dataVRelation.setV42(messageDataV.getV42());
// dataVRelation.setV43(messageDataV.getV43());
// dataVRelation.setV44(messageDataV.getV44());
// dataVRelation.setV45(messageDataV.getV45());
// dataVRelation.setV46(messageDataV.getV46());
// dataVRelation.setV47(messageDataV.getV47());
// dataVRelation.setV48(messageDataV.getV48());
// dataVRelation.setV49(messageDataV.getV49());
// dataVRelation.setV50(messageDataV.getV50());
dataVRelation.setV1Max(messageDataV.getMaxV1());
dataVRelation.setV2Max(messageDataV.getMaxV2());
dataVRelation.setV3Max(messageDataV.getMaxV3());
dataVRelation.setV4Max(messageDataV.getMaxV4());
dataVRelation.setV5Max(messageDataV.getMaxV5());
dataVRelation.setV6Max(messageDataV.getMaxV6());
dataVRelation.setV7Max(messageDataV.getMaxV7());
dataVRelation.setV8Max(messageDataV.getMaxV8());
dataVRelation.setV9Max(messageDataV.getMaxV9());
dataVRelation.setV10Max(messageDataV.getMaxV10());
dataVRelation.setV11Max(messageDataV.getMaxV11());
dataVRelation.setV12Max(messageDataV.getMaxV12());
dataVRelation.setV13Max(messageDataV.getMaxV13());
dataVRelation.setV14Max(messageDataV.getMaxV14());
dataVRelation.setV15Max(messageDataV.getMaxV15());
dataVRelation.setV16Max(messageDataV.getMaxV16());
dataVRelation.setV17Max(messageDataV.getMaxV17());
dataVRelation.setV18Max(messageDataV.getMaxV18());
dataVRelation.setV19Max(messageDataV.getMaxV19());
dataVRelation.setV20Max(messageDataV.getMaxV20());
dataVRelation.setV21Max(messageDataV.getMaxV21());
dataVRelation.setV22Max(messageDataV.getMaxV22());
dataVRelation.setV23Max(messageDataV.getMaxV23());
dataVRelation.setV24Max(messageDataV.getMaxV24());
dataVRelation.setV25Max(messageDataV.getMaxV25());
dataVRelation.setV26Max(messageDataV.getMaxV26());
dataVRelation.setV27Max(messageDataV.getMaxV27());
dataVRelation.setV28Max(messageDataV.getMaxV28());
dataVRelation.setV29Max(messageDataV.getMaxV29());
dataVRelation.setV30Max(messageDataV.getMaxV30());
dataVRelation.setV31Max(messageDataV.getMaxV31());
dataVRelation.setV32Max(messageDataV.getMaxV32());
dataVRelation.setV33Max(messageDataV.getMaxV33());
dataVRelation.setV34Max(messageDataV.getMaxV34());
dataVRelation.setV35Max(messageDataV.getMaxV35());
dataVRelation.setV36Max(messageDataV.getMaxV36());
dataVRelation.setV37Max(messageDataV.getMaxV37());
dataVRelation.setV38Max(messageDataV.getMaxV38());
dataVRelation.setV39Max(messageDataV.getMaxV39());
dataVRelation.setV40Max(messageDataV.getMaxV40());
dataVRelation.setV41Max(messageDataV.getMaxV41());
dataVRelation.setV42Max(messageDataV.getMaxV42());
dataVRelation.setV43Max(messageDataV.getMaxV43());
dataVRelation.setV44Max(messageDataV.getMaxV44());
dataVRelation.setV45Max(messageDataV.getMaxV45());
dataVRelation.setV46Max(messageDataV.getMaxV46());
dataVRelation.setV47Max(messageDataV.getMaxV47());
dataVRelation.setV48Max(messageDataV.getMaxV48());
dataVRelation.setV49Max(messageDataV.getMaxV49());
dataVRelation.setV50Max(messageDataV.getMaxV50());
// dataVRelation.setV1Max(messageDataV.getMaxV1());
// dataVRelation.setV2Max(messageDataV.getMaxV2());
// dataVRelation.setV3Max(messageDataV.getMaxV3());
// dataVRelation.setV4Max(messageDataV.getMaxV4());
// dataVRelation.setV5Max(messageDataV.getMaxV5());
// dataVRelation.setV6Max(messageDataV.getMaxV6());
// dataVRelation.setV7Max(messageDataV.getMaxV7());
// dataVRelation.setV8Max(messageDataV.getMaxV8());
// dataVRelation.setV9Max(messageDataV.getMaxV9());
// dataVRelation.setV10Max(messageDataV.getMaxV10());
// dataVRelation.setV11Max(messageDataV.getMaxV11());
// dataVRelation.setV12Max(messageDataV.getMaxV12());
// dataVRelation.setV13Max(messageDataV.getMaxV13());
// dataVRelation.setV14Max(messageDataV.getMaxV14());
// dataVRelation.setV15Max(messageDataV.getMaxV15());
// dataVRelation.setV16Max(messageDataV.getMaxV16());
// dataVRelation.setV17Max(messageDataV.getMaxV17());
// dataVRelation.setV18Max(messageDataV.getMaxV18());
// dataVRelation.setV19Max(messageDataV.getMaxV19());
// dataVRelation.setV20Max(messageDataV.getMaxV20());
// dataVRelation.setV21Max(messageDataV.getMaxV21());
// dataVRelation.setV22Max(messageDataV.getMaxV22());
// dataVRelation.setV23Max(messageDataV.getMaxV23());
// dataVRelation.setV24Max(messageDataV.getMaxV24());
// dataVRelation.setV25Max(messageDataV.getMaxV25());
// dataVRelation.setV26Max(messageDataV.getMaxV26());
// dataVRelation.setV27Max(messageDataV.getMaxV27());
// dataVRelation.setV28Max(messageDataV.getMaxV28());
// dataVRelation.setV29Max(messageDataV.getMaxV29());
// dataVRelation.setV30Max(messageDataV.getMaxV30());
// dataVRelation.setV31Max(messageDataV.getMaxV31());
// dataVRelation.setV32Max(messageDataV.getMaxV32());
// dataVRelation.setV33Max(messageDataV.getMaxV33());
// dataVRelation.setV34Max(messageDataV.getMaxV34());
// dataVRelation.setV35Max(messageDataV.getMaxV35());
// dataVRelation.setV36Max(messageDataV.getMaxV36());
// dataVRelation.setV37Max(messageDataV.getMaxV37());
// dataVRelation.setV38Max(messageDataV.getMaxV38());
// dataVRelation.setV39Max(messageDataV.getMaxV39());
// dataVRelation.setV40Max(messageDataV.getMaxV40());
// dataVRelation.setV41Max(messageDataV.getMaxV41());
// dataVRelation.setV42Max(messageDataV.getMaxV42());
// dataVRelation.setV43Max(messageDataV.getMaxV43());
// dataVRelation.setV44Max(messageDataV.getMaxV44());
// dataVRelation.setV45Max(messageDataV.getMaxV45());
// dataVRelation.setV46Max(messageDataV.getMaxV46());
// dataVRelation.setV47Max(messageDataV.getMaxV47());
// dataVRelation.setV48Max(messageDataV.getMaxV48());
// dataVRelation.setV49Max(messageDataV.getMaxV49());
// dataVRelation.setV50Max(messageDataV.getMaxV50());
dataVRelation.setV1Min( messageDataV.getMinV1());
dataVRelation.setV2Min( messageDataV.getMinV2());
dataVRelation.setV3Min( messageDataV.getMinV3());
dataVRelation.setV4Min( messageDataV.getMinV4());
dataVRelation.setV5Min( messageDataV.getMinV5());
dataVRelation.setV6Min( messageDataV.getMinV6());
dataVRelation.setV7Min( messageDataV.getMinV7());
dataVRelation.setV8Min( messageDataV.getMinV8());
dataVRelation.setV9Min( messageDataV.getMinV9());
dataVRelation.setV10Min( messageDataV.getMinV10());
dataVRelation.setV11Min( messageDataV.getMinV11());
dataVRelation.setV12Min( messageDataV.getMinV12());
dataVRelation.setV13Min( messageDataV.getMinV13());
dataVRelation.setV14Min( messageDataV.getMinV14());
dataVRelation.setV15Min( messageDataV.getMinV15());
dataVRelation.setV16Min( messageDataV.getMinV16());
dataVRelation.setV17Min( messageDataV.getMinV17());
dataVRelation.setV18Min( messageDataV.getMinV18());
dataVRelation.setV19Min( messageDataV.getMinV19());
dataVRelation.setV20Min( messageDataV.getMinV20());
dataVRelation.setV21Min( messageDataV.getMinV21());
dataVRelation.setV22Min( messageDataV.getMinV22());
dataVRelation.setV23Min( messageDataV.getMinV23());
dataVRelation.setV24Min( messageDataV.getMinV24());
dataVRelation.setV25Min( messageDataV.getMinV25());
dataVRelation.setV26Min( messageDataV.getMinV26());
dataVRelation.setV27Min( messageDataV.getMinV27());
dataVRelation.setV28Min( messageDataV.getMinV28());
dataVRelation.setV29Min( messageDataV.getMinV29());
dataVRelation.setV30Min( messageDataV.getMinV30());
dataVRelation.setV31Min( messageDataV.getMinV31());
dataVRelation.setV32Min( messageDataV.getMinV32());
dataVRelation.setV33Min( messageDataV.getMinV33());
dataVRelation.setV34Min( messageDataV.getMinV34());
dataVRelation.setV35Min( messageDataV.getMinV35());
dataVRelation.setV36Min( messageDataV.getMinV36());
dataVRelation.setV37Min( messageDataV.getMinV37());
dataVRelation.setV38Min( messageDataV.getMinV38());
dataVRelation.setV39Min( messageDataV.getMinV39());
dataVRelation.setV40Min( messageDataV.getMinV40());
dataVRelation.setV41Min( messageDataV.getMinV41());
dataVRelation.setV42Min( messageDataV.getMinV42());
dataVRelation.setV43Min( messageDataV.getMinV43());
dataVRelation.setV44Min( messageDataV.getMinV44());
dataVRelation.setV45Min( messageDataV.getMinV45());
dataVRelation.setV46Min( messageDataV.getMinV46());
dataVRelation.setV47Min( messageDataV.getMinV47());
dataVRelation.setV48Min( messageDataV.getMinV48());
dataVRelation.setV49Min( messageDataV.getMinV49());
dataVRelation.setV50Min( messageDataV.getMinV50());
// dataVRelation.setV1Min( messageDataV.getMinV1());
// dataVRelation.setV2Min( messageDataV.getMinV2());
// dataVRelation.setV3Min( messageDataV.getMinV3());
// dataVRelation.setV4Min( messageDataV.getMinV4());
// dataVRelation.setV5Min( messageDataV.getMinV5());
// dataVRelation.setV6Min( messageDataV.getMinV6());
// dataVRelation.setV7Min( messageDataV.getMinV7());
// dataVRelation.setV8Min( messageDataV.getMinV8());
// dataVRelation.setV9Min( messageDataV.getMinV9());
// dataVRelation.setV10Min( messageDataV.getMinV10());
// dataVRelation.setV11Min( messageDataV.getMinV11());
// dataVRelation.setV12Min( messageDataV.getMinV12());
// dataVRelation.setV13Min( messageDataV.getMinV13());
// dataVRelation.setV14Min( messageDataV.getMinV14());
// dataVRelation.setV15Min( messageDataV.getMinV15());
// dataVRelation.setV16Min( messageDataV.getMinV16());
// dataVRelation.setV17Min( messageDataV.getMinV17());
// dataVRelation.setV18Min( messageDataV.getMinV18());
// dataVRelation.setV19Min( messageDataV.getMinV19());
// dataVRelation.setV20Min( messageDataV.getMinV20());
// dataVRelation.setV21Min( messageDataV.getMinV21());
// dataVRelation.setV22Min( messageDataV.getMinV22());
// dataVRelation.setV23Min( messageDataV.getMinV23());
// dataVRelation.setV24Min( messageDataV.getMinV24());
// dataVRelation.setV25Min( messageDataV.getMinV25());
// dataVRelation.setV26Min( messageDataV.getMinV26());
// dataVRelation.setV27Min( messageDataV.getMinV27());
// dataVRelation.setV28Min( messageDataV.getMinV28());
// dataVRelation.setV29Min( messageDataV.getMinV29());
// dataVRelation.setV30Min( messageDataV.getMinV30());
// dataVRelation.setV31Min( messageDataV.getMinV31());
// dataVRelation.setV32Min( messageDataV.getMinV32());
// dataVRelation.setV33Min( messageDataV.getMinV33());
// dataVRelation.setV34Min( messageDataV.getMinV34());
// dataVRelation.setV35Min( messageDataV.getMinV35());
// dataVRelation.setV36Min( messageDataV.getMinV36());
// dataVRelation.setV37Min( messageDataV.getMinV37());
// dataVRelation.setV38Min( messageDataV.getMinV38());
// dataVRelation.setV39Min( messageDataV.getMinV39());
// dataVRelation.setV40Min( messageDataV.getMinV40());
// dataVRelation.setV41Min( messageDataV.getMinV41());
// dataVRelation.setV42Min( messageDataV.getMinV42());
// dataVRelation.setV43Min( messageDataV.getMinV43());
// dataVRelation.setV44Min( messageDataV.getMinV44());
// dataVRelation.setV45Min( messageDataV.getMinV45());
// dataVRelation.setV46Min( messageDataV.getMinV46());
// dataVRelation.setV47Min( messageDataV.getMinV47());
// dataVRelation.setV48Min( messageDataV.getMinV48());
// dataVRelation.setV49Min( messageDataV.getMinV49());
// dataVRelation.setV50Min( messageDataV.getMinV50());
dataVRelation.setV1Cp95(messageDataV.getGv1());
dataVRelation.setV2Cp95(messageDataV.getGv2());
dataVRelation.setV3Cp95(messageDataV.getGv3());
dataVRelation.setV4Cp95(messageDataV.getGv4());
dataVRelation.setV5Cp95(messageDataV.getGv5());
dataVRelation.setV6Cp95(messageDataV.getGv6());
dataVRelation.setV7Cp95(messageDataV.getGv7());
dataVRelation.setV8Cp95(messageDataV.getGv8());
dataVRelation.setV9Cp95(messageDataV.getGv9());
dataVRelation.setV10Cp95(messageDataV.getGv10());
dataVRelation.setV11Cp95(messageDataV.getGv11());
dataVRelation.setV12Cp95(messageDataV.getGv12());
dataVRelation.setV13Cp95(messageDataV.getGv13());
dataVRelation.setV14Cp95(messageDataV.getGv14());
dataVRelation.setV15Cp95(messageDataV.getGv15());
dataVRelation.setV16Cp95(messageDataV.getGv16());
dataVRelation.setV17Cp95(messageDataV.getGv17());
dataVRelation.setV18Cp95(messageDataV.getGv18());
dataVRelation.setV19Cp95(messageDataV.getGv19());
dataVRelation.setV20Cp95(messageDataV.getGv20());
dataVRelation.setV21Cp95(messageDataV.getGv21());
dataVRelation.setV22Cp95(messageDataV.getGv22());
dataVRelation.setV23Cp95(messageDataV.getGv23());
dataVRelation.setV24Cp95(messageDataV.getGv24());
dataVRelation.setV25Cp95(messageDataV.getGv25());
dataVRelation.setV26Cp95(messageDataV.getGv26());
dataVRelation.setV27Cp95(messageDataV.getGv27());
dataVRelation.setV28Cp95(messageDataV.getGv28());
dataVRelation.setV29Cp95(messageDataV.getGv29());
dataVRelation.setV30Cp95(messageDataV.getGv30());
dataVRelation.setV31Cp95(messageDataV.getGv31());
dataVRelation.setV32Cp95(messageDataV.getGv32());
dataVRelation.setV33Cp95(messageDataV.getGv33());
dataVRelation.setV34Cp95(messageDataV.getGv34());
dataVRelation.setV35Cp95(messageDataV.getGv35());
dataVRelation.setV36Cp95(messageDataV.getGv36());
dataVRelation.setV37Cp95(messageDataV.getGv37());
dataVRelation.setV38Cp95(messageDataV.getGv38());
dataVRelation.setV39Cp95(messageDataV.getGv39());
dataVRelation.setV40Cp95(messageDataV.getGv40());
dataVRelation.setV41Cp95(messageDataV.getGv41());
dataVRelation.setV42Cp95(messageDataV.getGv42());
dataVRelation.setV43Cp95(messageDataV.getGv43());
dataVRelation.setV44Cp95(messageDataV.getGv44());
dataVRelation.setV45Cp95(messageDataV.getGv45());
dataVRelation.setV46Cp95(messageDataV.getGv46());
dataVRelation.setV47Cp95(messageDataV.getGv47());
dataVRelation.setV48Cp95(messageDataV.getGv48());
dataVRelation.setV49Cp95(messageDataV.getGv49());
dataVRelation.setV50Cp95(messageDataV.getGv50());
// dataVRelation.setV1Cp95(messageDataV.getGv1());
// dataVRelation.setV2Cp95(messageDataV.getGv2());
// dataVRelation.setV3Cp95(messageDataV.getGv3());
// dataVRelation.setV4Cp95(messageDataV.getGv4());
// dataVRelation.setV5Cp95(messageDataV.getGv5());
// dataVRelation.setV6Cp95(messageDataV.getGv6());
// dataVRelation.setV7Cp95(messageDataV.getGv7());
// dataVRelation.setV8Cp95(messageDataV.getGv8());
// dataVRelation.setV9Cp95(messageDataV.getGv9());
// dataVRelation.setV10Cp95(messageDataV.getGv10());
// dataVRelation.setV11Cp95(messageDataV.getGv11());
// dataVRelation.setV12Cp95(messageDataV.getGv12());
// dataVRelation.setV13Cp95(messageDataV.getGv13());
// dataVRelation.setV14Cp95(messageDataV.getGv14());
// dataVRelation.setV15Cp95(messageDataV.getGv15());
// dataVRelation.setV16Cp95(messageDataV.getGv16());
// dataVRelation.setV17Cp95(messageDataV.getGv17());
// dataVRelation.setV18Cp95(messageDataV.getGv18());
// dataVRelation.setV19Cp95(messageDataV.getGv19());
// dataVRelation.setV20Cp95(messageDataV.getGv20());
// dataVRelation.setV21Cp95(messageDataV.getGv21());
// dataVRelation.setV22Cp95(messageDataV.getGv22());
// dataVRelation.setV23Cp95(messageDataV.getGv23());
// dataVRelation.setV24Cp95(messageDataV.getGv24());
// dataVRelation.setV25Cp95(messageDataV.getGv25());
// dataVRelation.setV26Cp95(messageDataV.getGv26());
// dataVRelation.setV27Cp95(messageDataV.getGv27());
// dataVRelation.setV28Cp95(messageDataV.getGv28());
// dataVRelation.setV29Cp95(messageDataV.getGv29());
// dataVRelation.setV30Cp95(messageDataV.getGv30());
// dataVRelation.setV31Cp95(messageDataV.getGv31());
// dataVRelation.setV32Cp95(messageDataV.getGv32());
// dataVRelation.setV33Cp95(messageDataV.getGv33());
// dataVRelation.setV34Cp95(messageDataV.getGv34());
// dataVRelation.setV35Cp95(messageDataV.getGv35());
// dataVRelation.setV36Cp95(messageDataV.getGv36());
// dataVRelation.setV37Cp95(messageDataV.getGv37());
// dataVRelation.setV38Cp95(messageDataV.getGv38());
// dataVRelation.setV39Cp95(messageDataV.getGv39());
// dataVRelation.setV40Cp95(messageDataV.getGv40());
// dataVRelation.setV41Cp95(messageDataV.getGv41());
// dataVRelation.setV42Cp95(messageDataV.getGv42());
// dataVRelation.setV43Cp95(messageDataV.getGv43());
// dataVRelation.setV44Cp95(messageDataV.getGv44());
// dataVRelation.setV45Cp95(messageDataV.getGv45());
// dataVRelation.setV46Cp95(messageDataV.getGv46());
// dataVRelation.setV47Cp95(messageDataV.getGv47());
// dataVRelation.setV48Cp95(messageDataV.getGv48());
// dataVRelation.setV49Cp95(messageDataV.getGv49());
// dataVRelation.setV50Cp95(messageDataV.getGv50());
}

View File

@@ -0,0 +1,31 @@
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.DataVCvtFeignClientFallbackFactory;
import com.njcn.dataProcess.api.fallback.DataVFeignClientFallbackFactory;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.time.LocalDateTime;
import java.util.List;
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataVCvt", fallbackFactory = DataVCvtFeignClientFallbackFactory.class, contextId = "dataVCvt")
public interface DataVCvtFeignClient {
//获取原始数据
@PostMapping("/getRawData")
HttpResult<List<DataVCvt>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
}

View File

@@ -5,9 +5,10 @@ import com.njcn.common.pojo.response.HttpResult;
import com.njcn.dataProcess.api.fallback.DataVFeignClientFallbackFactory;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataV;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -46,4 +47,7 @@ public interface DataVFeignClient {
@PostMapping("/addInfluxDbList")
HttpResult<String> addInfluxDbList(@RequestBody List<DataVDto> list);
@PostMapping("/batchInsertionCvtDTO")
HttpResult<String> batchInsertionCvtDTO(@RequestBody List<DataVCvtDTO> cvtDTOList);
}

View File

@@ -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.DataVCvtFeignClient;
import com.njcn.dataProcess.api.DataVFeignClient;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022年01月05日 15:08
*/
@Slf4j
@Component
public class DataVCvtFeignClientFallbackFactory implements FallbackFactory<DataVCvtFeignClient> {
/**
* 输出远程请求接口异常日志
* @param cause RPC请求异常
*/
@Override
public DataVCvtFeignClient 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 DataVCvtFeignClient() {
@Override
public HttpResult<List<DataVCvt>> getRawData(LineCountEvaluateParam lineParam) {
log.error("{}异常,降级处理,异常为:{}","获取原始数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -8,6 +8,7 @@ import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataV;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
import feign.hystrix.FallbackFactory;
@@ -77,6 +78,12 @@ public class DataVFeignClientFallbackFactory implements FallbackFactory<DataVFei
log.error("{}异常,降级处理,异常为:{}","时序数据库插入数据",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<String> batchInsertionCvtDTO(List<DataVCvtDTO> cvtDTOList) {
log.error("{}异常,降级处理,异常为:{}","cvt数据插入DataV",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -43,7 +43,7 @@ public class DataFlicker {
private Double pst=0.00;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag ="0";
public static DataFlicker relationToInfluxDB(DataFlickerDTO dataFlicker) {

View File

@@ -41,7 +41,7 @@ public class DataFluc {
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
public static DataFluc relationToInfluxDB(DataFlucDTO dataFluc) {
if (dataFluc == null) {

View File

@@ -38,7 +38,7 @@ public class DataHarmphasicI {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataHarmphasicV {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataHarmpowerP {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataHarmpowerQ {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataHarmpowerS {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -38,7 +38,7 @@ public class DataHarmrateI {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -38,7 +38,7 @@ public class DataHarmrateV {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataI {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataInharmI {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -39,7 +39,7 @@ public class DataInharmV {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "value_type",tag = true)
private String valueType;

View File

@@ -35,7 +35,7 @@ public class DataPlt {
private String phasicType;
@Column(name = "quality_flag",tag = true)
private String qualityFlag;
private String qualityFlag="0";
@Column(name = "plt")
private Double plt;

View File

@@ -43,7 +43,7 @@ public class DataV {
private String valueType;
@Column(name = "quality_flag", tag = true)
private String qualityFlag;
private String qualityFlag="0";
//是否是异常指标数据0否1是
@Column(name = "abnormal_flag")

View File

@@ -0,0 +1,32 @@
package com.njcn.dataProcess.po.influx;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.dataProcess.dto.DataVDTO;
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 org.springframework.beans.BeanUtils;
import java.time.Instant;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* 类的介绍:
*
* @author xuyang
* @version 1.0.0
* @createTime 2022/4/7 10:00
*/
@Data
@Measurement(name = "data_v_cvt")
public class DataVCvt extends DataV{
}

View File

@@ -0,0 +1,159 @@
package com.njcn.dataProcess.pojo.dto;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.njcn.influx.utils.InstantDateSerializer;
import lombok.Data;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.TimeColumn;
import java.time.Instant;
/**
* Description:
* Date: 2025/02/27 上午 8:53【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Data
public class DataVCvtDTO {
private Instant time;
private String lineId;
private String phasicType;
private String valueType;
private String qualityFlag="0";
//是否是异常指标数据0否1是
private Integer abnormalFlag;
private Double freq;
private Double freqDev;
private Double rms;
private Double rmsLvr;
private Double vlDev;
private Double vuDev;
private Double vNeg;
private Double vPos;
private Double vThd;
private Double vUnbalance;
private Double vZero;
private Double v1;
private Double v2;
private Double v3;
private Double v4;
private Double v5;
private Double v6;
private Double v7;
private Double v8;
private Double v9;
private Double v10;
private Double v11;
private Double v12;
private Double v13;
private Double v14;
private Double v15;
private Double v16;
private Double v17;
private Double v18;
private Double v19;
private Double v20;
private Double v21;
private Double v22;
private Double v23;
private Double v24;
private Double v25;
private Double v26;
private Double v27;
private Double v28;
private Double v29;
private Double v30;
private Double v31;
private Double v32;
private Double v33;
private Double v34;
private Double v35;
private Double v36;
private Double v37;
private Double v38;
private Double v39;
private Double v40;
private Double v41;
private Double v42;
private Double v43;
private Double v44;
private Double v45;
private Double v46;
private Double v47;
private Double v48;
private Double v49;
private Double v50;
}

View File

@@ -8,11 +8,9 @@ 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.dto.DataHarmphasicIDTO;
import com.njcn.dataProcess.dto.DataHarmrateVDTO;
import com.njcn.dataProcess.po.influx.DataHarmrateV;
import com.njcn.dataProcess.service.IDataHarmphasicI;
import com.njcn.dataProcess.service.IDataHarmrateV;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
import com.njcn.dataProcess.service.IDataHarmRateV;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -35,30 +33,23 @@ import java.util.List;
@Slf4j
@Controller
@RestController
@RequestMapping("/dataHarmratev")
@Api(tags = "谐波电流角度数据")
public class DataHarmrateVController extends BaseController {
@RequestMapping("/dataHarmRateV")
@Api(tags = "谐波电压含有率")
public class DataHarmRateVController extends BaseController {
@QueryBean
private IDataHarmrateV dataHarmrateVQuery;
private IDataHarmRateV dataHarmRateVQuery;
@InsertBean
private IDataHarmrateV dataHarmrateVInsert;
private IDataHarmRateV dataHarmRateVInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertion")
@ApiOperation("批量插入")
public HttpResult<String> batchInsertion(@RequestBody List<DataHarmrateVDTO> dataHarmrateVDTOList) {
String methodDescribe = getMethodDescribe("batchInsertion");
dataHarmrateVInsert.batchInsertion(dataHarmrateVDTOList);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
@PostMapping("/getRawData")
@ApiOperation("获取原始数据")
public HttpResult<List<DataHarmDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawData");
List<DataHarmDto> data = dataHarmRateVQuery.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
}
}

View File

@@ -12,6 +12,7 @@ import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.dto.DataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.service.IDataV;
import com.njcn.web.controller.BaseController;
@@ -65,6 +66,16 @@ public class DataVController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/batchInsertionCvtDTO")
@ApiOperation("批量插入cvtDto")
public HttpResult<String> batchInsertionCvtDTO(@RequestBody List<DataVCvtDTO> cvtDTOList) {
String methodDescribe = getMethodDescribe("batchInsertion");
dataVInsert.batchInsertionCvtDTO(cvtDTOList);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
@PostMapping("/monitoringTime")
@ApiOperation("获取监测点数据时间点(补招使用)")
@@ -111,4 +122,6 @@ public class DataVController extends BaseController {
dataVQuery.addInfluxDbList(dataVList);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, "", methodDescribe);
}
}

View File

@@ -0,0 +1,62 @@
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.dto.DataVDTO;
import com.njcn.dataProcess.dto.DataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.service.IDataV;
import com.njcn.dataProcess.service.IDataVCvt;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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.*;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* @author hongawen
* @version 1.0
* @data 2024/11/6 19:48
*/
@Validated
@Slf4j
@Controller
@RestController
@RequestMapping("/dataVCvt")
@Api(tags = "电压类数(cvt表)据获取")
public class DataVCvtController extends BaseController {
@QueryBean
private IDataVCvt dataVCvtQuery;
@InsertBean
private IDataVCvt dataVCvtInsert;
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
@PostMapping("/getRawData")
@ApiOperation("获取原始数据")
public HttpResult<List<DataVCvt>> getRawData(@RequestBody LineCountEvaluateParam lineParam) {
String methodDescribe = getMethodDescribe("getRawData");
List<DataVCvt> data = dataVCvtQuery.getRawData(lineParam);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, data, methodDescribe);
}
}

View File

@@ -1,18 +1,14 @@
package com.njcn.dataProcess.dao.imapper;
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
import com.njcn.dataProcess.po.influx.DataHarmrateV;
import com.njcn.influx.base.InfluxDbBaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author hongawen
* @since 2023-12-28
* @author xy
*/
public interface DataHarmrateVMapper extends InfluxDbBaseMapper<DataHarmrateV> {
public interface DataHarmRateVMapper extends InfluxDbBaseMapper<DataHarmrateV> {
}

View File

@@ -0,0 +1,19 @@
package com.njcn.dataProcess.dao.imapper;
import com.njcn.dataProcess.dto.LineDataVFiveItemDTO;
import com.njcn.dataProcess.po.influx.DataV;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.influx.base.InfluxDbBaseMapper;
import com.njcn.influx.query.InfluxQueryWrapper;
import java.util.List;
/**
* @author hongawen
* @version 1.0
* @data 2024/11/7 18:49
*/
public interface DataVCvtMapper extends InfluxDbBaseMapper<DataVCvt> {
}

View File

@@ -1,17 +1,19 @@
package com.njcn.dataProcess.service;
import com.njcn.dataProcess.dto.DataHarmphasicIDTO;
import com.njcn.dataProcess.dto.DataHarmrateVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
import java.util.List;
/**
* Description:
* Date: 2024/11/18 11:17【需求编号】
*
* @author clam
* @version V1.0.0
* @author xy
*/
public interface IDataHarmrateV {
void batchInsertion(List<DataHarmrateVDTO> dataHarmrateVDTOList);
public interface IDataHarmRateV {
/**
* 获取原始数据
* @param lineParam
* @return
*/
List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -5,6 +5,7 @@ import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.dto.DataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.pojo.po.RStatDataVD;
@@ -49,4 +50,6 @@ public interface IDataV extends IMppService<RStatDataVD> {
void addList(List<DataVDto> dataVDtoList);
void addInfluxDbList(List<DataVDto> dataVList);
void batchInsertionCvtDTO(List<DataVCvtDTO> cvtDTOList);
}

View File

@@ -0,0 +1,25 @@
package com.njcn.dataProcess.service;
import com.github.jeffreyning.mybatisplus.service.IMppService;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.dto.DataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.pojo.po.RStatDataVD;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
/**
* @author hongawen
* @version 1.0
* @data 2024/11/7 10:54
*/
public interface IDataVCvt {
List<DataVCvt> getRawData(LineCountEvaluateParam lineParam);
}

View File

@@ -1,51 +1,98 @@
package com.njcn.dataProcess.service.impl.influxdb;
import com.njcn.dataProcess.dao.imapper.DataHarmphasicVMapper;
import com.njcn.dataProcess.dao.imapper.DataHarmrateVMapper;
import com.njcn.dataProcess.dto.DataHarmphasicVDTO;
import com.njcn.dataProcess.dto.DataHarmrateVDTO;
import com.njcn.dataProcess.po.influx.DataHarmphasicV;
import cn.hutool.core.collection.CollectionUtil;
import com.njcn.common.utils.HarmonicTimesUtil;
import com.njcn.dataProcess.dao.imapper.DataHarmRateVMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataHarmrateV;
import com.njcn.dataProcess.service.IDataHarmphasicV;
import com.njcn.dataProcess.service.IDataHarmrateV;
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
import com.njcn.dataProcess.service.IDataHarmRateV;
import com.njcn.influx.constant.InfluxDbSqlConstant;
import com.njcn.influx.query.InfluxQueryWrapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2024/11/18 14:33【需求编号】
*
* @author clam
* @version V1.0.0
* @author xy
*/
@Service("InfluxdbDataHarmrateVImpl")
@Service("InfluxdbDataHarmRateVImpl")
@RequiredArgsConstructor
public class InfluxdbDataHarmrateVImpl implements IDataHarmrateV {
public class InfluxdbDataHarmRateVImpl implements IDataHarmRateV {
private final DataHarmrateVMapper dataHarmrateVMapper;
private final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.systemDefault());
private final DataHarmRateVMapper dataHarmRateVMapper;
@Override
public void batchInsertion(List<DataHarmrateVDTO> dataHarmrateVDTOList) {
int totalCount = dataHarmrateVDTOList.size();
if(totalCount<=0){
return;
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
List<DataHarmDto> result = new ArrayList<>();
List<DataHarmrateV> list = getMinuteDataI(lineParam.getLineId(), lineParam.getStartTime(), lineParam.getEndTime(), lineParam.getAbnormalTime());
list.forEach(item->{
DataHarmDto dto = new DataHarmDto();
BeanUtils.copyProperties(item,dto);
dto.setMinTime(DATE_TIME_FORMATTER.format(item.getTime()));
result.add(dto);
});
return result;
}
List<DataHarmrateV> collect = dataHarmrateVDTOList.stream().flatMap(temp -> DataHarmrateV.relationToInfluxDB(temp).stream()).collect(Collectors.toList());
int minSize = Math.min(1200000, collect.size());
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, minSize);
for (List<DataHarmrateV> dataHarmrateVList : partition) {
List<DataHarmrateV> sublistAsOriginalListType = new ArrayList<>(dataHarmrateVList);
dataHarmrateVMapper.insertBatch(sublistAsOriginalListType);
/**
* 按监测点集合、时间条件获取dataI分钟数据
* timeMap参数来判断是否进行数据处理 timeMap为空则不进行数据处理
* 需要进行剔除异常数据时,这里会有三种情况判断
* 1.无异常数据,则直接返回集合;
* 2.异常数据和无异常数据参杂,剔除异常数据,只计算正常数据;
* 3.全是异常数据,则使用异常数据进行计算,但是日表中需要标记出来,此数据有异常
*/
public List<DataHarmrateV> getMinuteDataI(List<String> lineList, String startTime, String endTime, Map<String,List<String>> timeMap) {
List<DataHarmrateV> result = new ArrayList<>();
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataHarmrateV.class);
influxQueryWrapper.samePrefixAndSuffix(InfluxDbSqlConstant.V, "", HarmonicTimesUtil.harmonicTimesList(2, 50, 1));
influxQueryWrapper.regular(DataHarmrateV::getLineId, lineList)
.select(DataHarmrateV::getLineId)
.select(DataHarmrateV::getPhasicType)
.select(DataHarmrateV::getValueType)
.select(DataHarmrateV::getQualityFlag)
.between(DataHarmrateV::getTime, startTime, endTime)
.eq(DataHarmrateV::getQualityFlag,"0");
List<DataHarmrateV> list = dataHarmRateVMapper.selectByQueryWrapper(influxQueryWrapper);
Map<String,List<DataHarmrateV>> lineMap = list.stream().collect(Collectors.groupingBy(DataHarmrateV::getLineId));
//有异常数据
if (CollectionUtil.isNotEmpty(timeMap)) {
lineMap.forEach((k,v)->{
List<String> timeList = timeMap.get(k);
//有异常数据,当前监测点自身的异常数据
if (CollectionUtil.isNotEmpty(timeList)) {
List<DataHarmrateV> filterList = v.stream().filter(item -> !timeList.contains(DATE_TIME_FORMATTER.format(item.getTime()))).collect(Collectors.toList());
//1.过滤掉异常数据后还有正常数据,则用正常数据计算
if (CollectionUtil.isNotEmpty(filterList)) {
result.addAll(filterList);
}
//2.过滤掉异常数据后没有正常数据,则用所有异常数据计算,但是需要标记数据为异常的
else {
v.parallelStream().forEach(item -> item.setQualityFlag("1"));
result.addAll(v);
}
}
//没有异常数据,则使用原数据
else {
result.addAll(v);
}
});
}
//没有异常数据,则使用原数据
else {
result.addAll(list);
}
return result;
}
}

View File

@@ -0,0 +1,56 @@
package com.njcn.dataProcess.service.impl.influxdb;
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
import com.njcn.dataProcess.dao.imapper.DataVCvtMapper;
import com.njcn.dataProcess.dao.imapper.DataVMapper;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataV;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.service.IDataVCvt;
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.LocalDateTime;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2025/02/24 下午 3:34【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service("InfluxdbDataVCvtImpl")
@RequiredArgsConstructor
public class InfluxdbDataVCvtImpl implements IDataVCvt {
@Resource
private DataVCvtMapper dataVCvtMapper;
/**
* @Description: 获取时间段内的数据
* @Param:
* @return: java.util.List<com.njcn.dataProcess.dto.DataVDTO>
* @Author: clam
* @Date: 2025/02/24
*/
@Override
public List<DataVCvt> getRawData(LineCountEvaluateParam lineParam) {
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataVCvt.class);
influxQueryWrapper.regular(DataV::getLineId,lineParam.getLineId()).between(DataV::getTime, lineParam.getStartTime(), lineParam.getEndTime());
List<DataVCvt> dataVCvts = dataVCvtMapper.selectByQueryWrapper(influxQueryWrapper);
return dataVCvts;
}
}

View File

@@ -2,6 +2,7 @@ package com.njcn.dataProcess.service.impl.influxdb;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
import com.njcn.common.utils.HarmonicTimesUtil;
import com.njcn.dataProcess.constant.InfluxDBTableConstant;
@@ -14,6 +15,7 @@ import com.njcn.dataProcess.dto.LineDataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataV;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.pojo.po.RStatDataVD;
import com.njcn.dataProcess.service.IDataV;
@@ -114,7 +116,16 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
@Override
public List<LocalDateTime> monitoringTime(String lineId, String localData) {
return null;
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(DataV.class);
String startTime = localData+ InfluxDBTableConstant.START_TIME;
String endTime = localData+ InfluxDBTableConstant.END_TIME;
influxQueryWrapper.eq(DataV::getLineId,lineId).between(DataV::getTime, startTime, endTime);
List<DataV> dataVS = dataVMapper.selectByQueryWrapper(influxQueryWrapper);
List<LocalDateTime> result = dataVS.stream().map(temp->{
return LocalDateTime.ofInstant(temp.getTime(), ZoneId.systemDefault());
}).distinct().collect(Collectors.toList());
return result;
}
@Override
@@ -256,6 +267,30 @@ public class InfluxdbDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
dataVMapper.insertBatch(result);
}
@Override
public void batchInsertionCvtDTO(List<DataVCvtDTO> cvtDTOList) {
int totalCount = cvtDTOList.size();
if(totalCount<=0){
return;
}
List<DataV> collect = cvtDTOList.stream().map(temp ->
{
DataV dataV = new DataV();
BeanUtils.copyProperties(temp,dataV);
return dataV;
}).collect(Collectors.toList());
int minSize = Math.min(1200000, collect.size());
List<List<DataV>> partition = ListUtils.partition(collect, minSize);
for (List<DataV> dataVList : partition) {
List<DataV> sublistAsOriginalListType = new ArrayList<>(dataVList);
dataVMapper.insertBatch(sublistAsOriginalListType);
}
}
/**
* 按监测点集合、时间条件获取dataV分钟数据
* timeMap参数来判断是否进行数据出来 timeMap为空则不进行数据处理

View File

@@ -1,56 +1,28 @@
package com.njcn.dataProcess.service.impl.relation;
import com.njcn.dataProcess.dao.relation.mapper.DataHarmphasicVRelationMapper;
import com.njcn.dataProcess.dao.relation.mapper.DataHarmrateVRelationMapper;
import com.njcn.dataProcess.dto.DataHarmrateVDTO;
import com.njcn.dataProcess.po.relation.DataHarmphasicV;
import com.njcn.dataProcess.po.relation.DataHarmrateV;
import com.njcn.dataProcess.service.IDataHarmrateV;
import com.njcn.dataProcess.util.BeanFeildUtils;
import com.njcn.dataProcess.dao.relation.mapper.DataIRelationMapper;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.pojo.dto.DataHarmDto;
import com.njcn.dataProcess.service.IDataHarmRateV;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* Description:
* Date: 2025/02/21 下午 3:15【需求编号】
*
* @author clam
* @version V1.0.0
* @author xy
*/
@Service("RelationDataHarmrateVImpl")
@Service("RelationDataHarmRateVImpl")
@RequiredArgsConstructor
public class RelationDataHarmrateVImpl implements IDataHarmrateV {
private final DataHarmrateVRelationMapper dataHarmrateVRelationMapper;
public class RelationDataHarmRateVImpl implements IDataHarmRateV {
@Resource
private DataIRelationMapper dataIRelationMapper;
@Override
public void batchInsertion(List<DataHarmrateVDTO> dataHarmrateVDTOList) {
int totalCount = dataHarmrateVDTOList.size();
int minSize = Math.min(120, totalCount);
if(totalCount<=0){
return;
}
List<DataHarmrateV> collect = dataHarmrateVDTOList.stream().map(temp -> {
DataHarmrateV dataHarmrateV = new DataHarmrateV();
BeanUtils.copyProperties(temp, dataHarmrateV, BeanFeildUtils.getNullPropertyNames(temp));
return dataHarmrateV;
}).collect(Collectors.toList());
collect = collect.stream().collect(Collectors.toMap(
temp -> temp.getTimeid() + temp.getLineid() + temp.getPhasicType(),
temp -> temp,
(exist, replace) -> exist
)).values().stream().collect(Collectors.toList());
List<List<DataHarmrateV>> partition = ListUtils.partition(collect, minSize);
for (List<DataHarmrateV> dataHarmphasicVList : partition) {
dataHarmrateVRelationMapper.insertBatchSomeColumn(dataHarmphasicVList);
}
public List<DataHarmDto> getRawData(LineCountEvaluateParam lineParam) {
return Collections.emptyList();
}
}

View File

@@ -0,0 +1,26 @@
package com.njcn.dataProcess.service.impl.relation;
import com.njcn.dataProcess.dto.DataVDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.influx.DataVCvt;
import com.njcn.dataProcess.service.IDataVCvt;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Description:
* Date: 2025/02/24 下午 3:34【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service("RelationDataVCvtImpl")
@RequiredArgsConstructor
public class RelationDataVCvtImpl implements IDataVCvt {
@Override
public List<DataVCvt> getRawData(LineCountEvaluateParam lineParam) {
return null;
}
}

View File

@@ -10,6 +10,7 @@ import com.njcn.dataProcess.dto.DataVFiveItemDTO;
import com.njcn.dataProcess.param.LineCountEvaluateParam;
import com.njcn.dataProcess.po.relation.DataV;
import com.njcn.dataProcess.pojo.dto.CommonMinuteDto;
import com.njcn.dataProcess.pojo.dto.DataVCvtDTO;
import com.njcn.dataProcess.pojo.dto.DataVDto;
import com.njcn.dataProcess.pojo.po.RStatDataVD;
import com.njcn.dataProcess.service.IDataV;
@@ -116,5 +117,10 @@ public class RelationDataVImpl extends MppServiceImpl<RStatDataVRelationMapper,
}
@Override
public void batchInsertionCvtDTO(List<DataVCvtDTO> cvtDTOList) {
}
}

View File

@@ -56,7 +56,7 @@ data:
source:
query: Influxdb
# insert: Influxdb
insert: Relation
insert: Influxdb
#mybatis配置信息
mybatis-plus:
configuration:

View File

@@ -14,8 +14,9 @@ import java.util.List;
@Data
public class DeviceRebootMessage {
private String code;
private Integer index;
private DeviceInfo data;
private List<DeviceInfo> data;
@Data
public static class DeviceInfo {

View File

@@ -10,6 +10,8 @@
//import com.njcn.common.utils.HttpResultUtil;
//
//import com.njcn.dataProcess.api.DataVFeignClient;
//import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
//import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
//import com.njcn.message.message.RecallMessage;
//import com.njcn.message.produce.template.RecallMessaggeTemplate;
//import com.njcn.middle.rocket.domain.BaseMessage;
@@ -84,13 +86,13 @@
// if(!CollectionUtils.isEmpty(recallDTOList)){
//
// message.setData(recallDTOList);
// baseMessage.setMessageBoy(JSONObject.toJSONString(message));
// baseMessage.setMessageBody(JSONObject.toJSONString(message));
//
// recallMessaggeTemplate.sendMember(baseMessage);
// }
// }else {
// message.setData(param);
// baseMessage.setMessageBoy(JSONObject.toJSONString(message));
// baseMessage.setMessageBody(JSONObject.toJSONString(message));
// recallMessaggeTemplate.sendMember(baseMessage);
// }
//

View File

@@ -33,10 +33,10 @@
<properties>
<!--内网-->
<middle.server.url>192.168.1.22</middle.server.url>
<service.server.url>127.0.0.1</service.server.url>
<service.server.url>192.168.1.130</service.server.url>
<docker.server.url>192.168.1.22</docker.server.url>
<nacos.url>${middle.server.url}:18848</nacos.url>
<nacos.namespace>415a1c87-33aa-47bd-8e25-13cc456c87ed</nacos.namespace>
<nacos.namespace>c2cbedf1-14e9-42c8-98ec-4ffa96e68c0e</nacos.namespace>
<!--sentinel:port-->
<sentinel.url>${middle.server.url}:8080</sentinel.url>
<!--网关地址主要用于配置swagger中认证token-->