8 Commits

17 changed files with 553 additions and 280 deletions

View File

@@ -4,11 +4,13 @@ import com.njcn.device.biz.pojo.po.Overlimit;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
public interface IDataLimitRateAsync {
/**
* limit_rate多线程算法
*
* @param dataDate
* @param list
* @param phase
@@ -16,10 +18,11 @@ public interface IDataLimitRateAsync {
* @param size
* @param i
* @param type 系统类型
* @return
* @Author: wr
* @Date: 2025/12/17 12:16
*/
void lineDataRate(String dataDate,
CompletableFuture<Void> lineDataRate(String dataDate,
List<String> list,
List<String> phase,
Map<String, Overlimit> overLimitMap,

View File

@@ -22,6 +22,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
@@ -64,9 +65,13 @@ public class DayDataServiceImpl implements IDayDataService {
private DataInharmVFeignClient dataInharmVFeignClient;
@Resource
private DataPltFeignClient dataPltFeignClient;
@Resource
private PqDataVerifyFeignClient pqDataVerifyFeignClient;
/**
* 查询配置 辽宁版本比较特殊没有CP95值采用平均值进行判断
*/
@Value("${version.used:master}")
private String versionUsed;
@Override
public void dataVHandler(CalculatedParam calculatedParam) {
@@ -102,7 +107,8 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataVHandler(item3,valueTypes,dto,true);
//默认CP95值取 CP95的最大值如果有特殊要求可以根据平均值的数据取CP95
channelDataVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -150,7 +156,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataIHandler(item3,valueTypes,dto,true);
channelDataIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -198,7 +204,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item4.toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataFlickerHandler(item3,dto,item4,true);
channelDataFlickerHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -247,7 +253,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item4.toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataFlucHandler(item3,dto,item4,true);
channelDataFlucHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -296,7 +302,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmPhasicIHandler(item3,valueTypes,dto,true);
channelDataHarmPhasicIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -344,7 +350,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmPhasicVHandler(item3,valueTypes,dto,true);
channelDataHarmPhasicVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -392,7 +398,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmPowerPHandler(item3,valueTypes,dto,true);
channelDataHarmPowerPHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -440,7 +446,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmPowerQHandler(item3,valueTypes,dto,true);
channelDataHarmPowerQHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -488,7 +494,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmPowerSHandler(item3,valueTypes,dto,true);
channelDataHarmPowerSHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -536,7 +542,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmRateIHandler(item3,valueTypes,dto,true);
channelDataHarmRateIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -584,7 +590,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataHarmRateVHandler(item3,valueTypes,dto,true);
channelDataHarmRateVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -632,7 +638,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataInHarmIHandler(item3,valueTypes,dto,true);
channelDataInHarmIHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -680,7 +686,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item3.getValueType().toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataInHarmVHandler(item3,valueTypes,dto,true);
channelDataInHarmVHandler(item3,valueTypes,dto,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -728,7 +734,7 @@ public class DayDataServiceImpl implements IDayDataService {
dto.setPhasicType(item2.getPhasicType());
dto.setValueType(item4.toUpperCase());
dto.setQualityFlag(Objects.equals(item.getQualityFlag(),"null") ? "0" : item.getQualityFlag());
channelDataPltHandler(item3,dto,item4,true);
channelDataPltHandler(item3,dto,item4,!Objects.equals(versionUsed, "liaoning"));
result.add(dto);
});
});
@@ -1549,23 +1555,20 @@ public class DayDataServiceImpl implements IDayDataService {
valueType = valueType.toUpperCase();
if (scheme) {
switch (valueType) {
case InfluxDbSqlConstant.MAX:
case InfluxDbSqlConstant.CP95:
case "MAX":
case "CP95":
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
// result = max.orElse(null);
result = max.orElse(0.0);
break;
case InfluxDbSqlConstant.MIN:
case "MIN":
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
// result = min.orElse(null);
result = min.orElse(0.0);
break;
case InfluxDbSqlConstant.AVG_WEB:
case "AVG":
OptionalDouble average = list.stream()
.filter(Objects::nonNull)
.mapToDouble(Double::doubleValue)
.average();
// result = average.isPresent() ? average.getAsDouble() : null;
result = average.isPresent() ? average.getAsDouble() : 0.0;
break;
default:
@@ -1573,29 +1576,42 @@ public class DayDataServiceImpl implements IDayDataService {
}
} else {
switch (valueType) {
case InfluxDbSqlConstant.MAX:
case "MAX":
Optional<Double> max = list.stream().filter(Objects::nonNull).max(Double::compare);
// result = max.orElse(null);
result = max.orElse(0.0);
break;
case InfluxDbSqlConstant.MIN:
case "MIN":
Optional<Double> min = list.stream().filter(Objects::nonNull).min(Double::compare);
// result = min.orElse(null);
result = min.orElse(0.0);
break;
case InfluxDbSqlConstant.AVG_WEB:
case "AVG":
OptionalDouble average = list.stream()
.filter(Objects::nonNull)
.mapToDouble(Double::doubleValue)
.average();
// result = average.isPresent() ? average.getAsDouble() : null;
result = average.isPresent() ? average.getAsDouble() : 0.0;
break;
case InfluxDbSqlConstant.CP95:
list.sort(Collections.reverseOrder());
int discardCount = (int) Math.ceil(list.size() * 0.05);
List<Double> remainingList = list.subList(discardCount, list.size());
// result = remainingList.isEmpty() ? null : remainingList.get(0);
case "CP95":
if (list == null || list.isEmpty()) {
result = 0.0;
break;
}
// 过滤掉 null 元素
List<Double> filteredList = list.stream()
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (filteredList.isEmpty()) {
result = 0.0;
break;
}
filteredList.sort(Collections.reverseOrder());
int discardCount = (int) Math.ceil(filteredList.size() * 0.05);
if (discardCount >= filteredList.size()) {
result = 0.0;
break;
}
List<Double> remainingList = filteredList.subList(discardCount, filteredList.size());
result = remainingList.isEmpty() ? 0.0 : remainingList.get(0);
break;
default:
@@ -1610,4 +1626,28 @@ public class DayDataServiceImpl implements IDayDataService {
return result;
}
/**
* 将平均值赋值给 CP95
*/
public void putCP95ByAvg(List<CommonMinuteDto> list) {
list.forEach(po1->{
List<CommonMinuteDto.PhasicType> phasicTypeList = po1.getPhasicTypeList();
phasicTypeList.forEach(po2 -> {
List<CommonMinuteDto.ValueType> valueTypeList = po2.getValueTypeList();
AtomicReference<List<List<Double>>> valueList = new AtomicReference<>(new ArrayList<>());
valueTypeList.forEach(po3 -> {
if (po3.getValueType().equals(InfluxDbSqlConstant.AVG_WEB)) {
valueList.set(po3.getValueList());
}
if (po3.getValueType().equals(InfluxDbSqlConstant.CP95)) {
po3.setValueList((List<List<Double>>) valueList);
}
});
});
});
}
}

View File

@@ -46,6 +46,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -108,11 +109,26 @@ public class IDataCrossingServiceImpl implements IDataCrossingService {
List<List<String>> pendingIds = ListUtils.partition(lineIds, 1);
ArrayList<String> phase = ListUtil.toList(PhaseType.PHASE_A, PhaseType.PHASE_B, PhaseType.PHASE_C);
MemorySizeUtil.getNowMemory();
List<CompletableFuture<Void>> futures = new ArrayList<>();
for (int i = 0; i < pendingIds.size(); i++) {
logger.info(calculatedParam.getDataDate()+" 总分区数据:" + pendingIds.size() + "=====》当前第"+(i + 1)+"小分区");
List<String> list = pendingIds.get(i);
dataLimitRateAsync.lineDataRate(calculatedParam.getDataDate(), list, phase, overLimitMap, pendingIds.size(), (i + 1), lineParam.getType());
// 获取Future
CompletableFuture<Void> future = dataLimitRateAsync.lineDataRate(
calculatedParam.getDataDate(),
list,
phase,
overLimitMap,
pendingIds.size(),
(i + 1),
lineParam.getType()
);
futures.add(future);
}
// 等待所有任务完成
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
System.gc();
}

View File

@@ -18,6 +18,7 @@ import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -25,6 +26,7 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
/**
@@ -52,11 +54,16 @@ public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
private DataLimitRateFeignClient dataLimitRateFeignClient;
@Resource
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;
/**
* 查询配置 辽宁版本比较特殊没有CP95值采用平均值进行判断
*/
@Value("${version.used:master}")
private String versionUsed;
@Override
@Async("asyncExecutor")
public void lineDataRate(String dataDate,
public CompletableFuture<Void> lineDataRate(String dataDate,
List<String> list,
List<String> phase,
Map<String, Overlimit> overLimitMap,
@@ -79,6 +86,7 @@ public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
List<DataHarmDto> dataVInHarmList = dataInharmVFeignClient.getRawData(lineParam).getData();
//电流数据
List<DataIDto> dataIList = dataIFeignClient.getRawData(lineParam).getData();
/**
* 功能描述:获取influxDB -> data_v ->
* 总计算次数(用data_v中phasic_type=A,value_type=avg,quality_flag=0来参与统计)
@@ -121,53 +129,109 @@ public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
*功能描述:获取influxDB -> data_harmrate_v ->
* 2-25次谐波电压含有率 -> A相||B相||C相的日95%概率值
*/
Map<String, List<DataHarmDto>> harmRateV = dataVHarmList.stream()
Map<String, List<DataHarmDto>> harmRateV;
if (Objects.equals(versionUsed, "liaoning")) {
harmRateV = dataVHarmList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
} else {
harmRateV = dataVHarmList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_i -> 2-25次谐波电流 -> 日95%概率值
*/
Map<String, List<DataIDto>> dataI = dataIList.stream()
Map<String, List<DataIDto>> dataI;
if (Objects.equals(versionUsed, "liaoning")) {
dataI = dataIList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataIDto::getLineId));
} else {
dataI = dataIList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataIDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_inharm_v -> 0.5-15.5次间谐波电压含有率 -> 日95%概率值
*/
Map<String, List<DataHarmDto>> inHarmV = dataVInHarmList.stream()
Map<String, List<DataHarmDto>> inHarmV;
if (Objects.equals(versionUsed, "liaoning")) {
inHarmV = dataVInHarmList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
} else {
inHarmV = dataVInHarmList.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataHarmDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_v -> 电压总谐波畸变率 -> 日95%概率值
*/
Map<String, List<DataVDto>> dataVThd = dataVAllTime.stream()
Map<String, List<DataVDto>> dataVThd;
if (Objects.equals(versionUsed, "liaoning")) {
dataVThd = dataVAllTime.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataVDto::getLineId));
} else {
dataVThd = dataVAllTime.stream()
.filter(x -> phase.contains(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataVDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_v -> 负序电压不平衡度 -> 最大值 && 日95%概率值
*/
Map<String, List<DataVDto>> dataVUnbalance = dataVAllTime.stream()
Map<String, List<DataVDto>> dataVUnbalance;
if (Objects.equals(versionUsed, "liaoning")) {
dataVUnbalance = dataVAllTime.stream()
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()) ||
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataVDto::getLineId));
} else {
dataVUnbalance = dataVAllTime.stream()
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()) ||
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataVDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_i -> 负序电流 -> 最大值 && 日95%概率值
*/
Map<String, List<DataIDto>> dataINeg = dataIList.stream()
Map<String, List<DataIDto>> dataINeg;
if (Objects.equals(versionUsed, "liaoning")) {
dataINeg = dataIList.stream()
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.AVG.equalsIgnoreCase(x.getValueType()) ||
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
.peek(x -> x.setValueType(InfluxDBTableConstant.CP95))
.collect(Collectors.groupingBy(DataIDto::getLineId));
} else {
dataINeg = dataIList.stream()
.filter(x -> InfluxDBTableConstant.PHASE_TYPE_T.equalsIgnoreCase(x.getPhasicType()))
.filter(x -> InfluxDBTableConstant.CP95.equalsIgnoreCase(x.getValueType()) ||
InfluxDBTableConstant.MAX.equalsIgnoreCase(x.getValueType()))
.collect(Collectors.groupingBy(DataIDto::getLineId));
}
/**
* 功能描述:获取influxDB -> data_v -> 频率偏差 -> 最大值 && 最小值
@@ -237,6 +301,8 @@ public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
MemorySizeUtil.getNowMemory();
}
System.gc();
return CompletableFuture.completedFuture(null);
}
/**
@@ -304,9 +370,6 @@ public class IDataLimitRateAsyncImpl implements IDataLimitRateAsync {
result.add(c);
result.add(t);
return result;
}

View File

@@ -27,7 +27,7 @@ import com.njcn.event.api.TransientFeignClient;
import com.njcn.event.file.pojo.dto.WaveDataDTO;
import com.njcn.event.pojo.param.EventCountParam;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.supervision.api.UserLedgerFeignClient;
import com.njcn.supervision.api.UserLedgerOldFeignClient;
import com.njcn.supervision.pojo.vo.user.NewUserReportVO;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.DictTreeFeignClient;
@@ -84,7 +84,7 @@ public class SpecialAnalysisServiceImpl implements ISpecialAnalysisService {
@Resource
private CommLineClient commLineClient;
@Resource
private UserLedgerFeignClient userLedgerFeignClient;
private UserLedgerOldFeignClient userLedgerFeignClient;
@Resource
private DataLimitRateDetailFeignClient dataLimitRateDetailFeignClient;

View File

@@ -0,0 +1,76 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10401
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
compression:
request:
enabled: true
# 配置压缩支持的MIME TYPE
mime-types: text/xml,application/xml,application/json
# 配置压缩数据大小的下限
min-request-size: 1024
response:
# 配置响应GZIP压缩
enabled: true
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
server-addr: @nacos.url@
namespace: @nacos.namespace@
config:
username: @nacos.username@
password: @nacos.password@
server-addr: @nacos.url@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
liteflow:
rule-source-ext-data-map:
serverAddr: @nacos.url@
dataId: prepare_liteflow
group: DEFAULT_GROUP
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
when-max-wait-time: 3600000
print-banner: false
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info
com.alibaba.nacos.client: INFO
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.harmonic.pojo
line:
num: 20
mqtt:
client-id: @artifactId@${random.value}

View File

@@ -0,0 +1,79 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10401
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
compression:
request:
enabled: true
# 配置压缩支持的MIME TYPE
mime-types: text/xml,application/xml,application/json
# 配置压缩数据大小的下限
min-request-size: 1024
response:
# 配置响应GZIP压缩
enabled: true
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
liteflow:
rule-source-ext-data-map:
serverAddr: @nacos.url@
dataId: prepare_liteflow
group: DEFAULT_GROUP
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
when-max-wait-time: 3600000
print-banner: false
#项目日志的配置
logging:
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info
com.alibaba.nacos.client: INFO
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.harmonic.pojo
line:
num: 20
#mqtt:
# client-id: @artifactId@${random.value}

View File

@@ -1,72 +1,3 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10401
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
compression:
request:
enabled: true
# 配置压缩支持的MIME TYPE
mime-types: text/xml,application/xml,application/json
# 配置压缩数据大小的下限
min-request-size: 1024
response:
# 配置响应GZIP压缩
enabled: true
spring:
application:
name: @artifactId@
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
liteflow:
rule-source-ext-data-map:
serverAddr: @nacos.url@
dataId: prepare_liteflow
group: DEFAULT_GROUP
namespace: @nacos.namespace@
when-max-wait-time: 600000
print-banner: false
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: error
#mybatis配置信息
mybatis-plus:
#别名扫描
type-aliases-package: com.njcn.harmonic.pojo
line:
num: 10
mqtt:
client-id: @artifactId@${random.value}
profiles:
active: @spring.profiles.active@

View File

@@ -22,16 +22,20 @@ spring:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
- data-id: share-config-datasource-db.yaml
refresh: true
- data-Id: data-platform.yaml
- data-id: data-platform.yaml
refresh: true
main:
allow-bean-definition-overriding: true
@@ -39,7 +43,7 @@ spring:
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info

View File

@@ -128,7 +128,7 @@ public class InfluxdbDataHarmpowerPImpl extends MppServiceImpl<RStatDataHarmPowe
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
value.setValueType(valueType);
List<List<Double>> lists;
if (Objects.equals(phasicType, "T")) {
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
lists = extractDataLists(valueTypeList, "Tot");
} else {
lists = extractDataLists(valueTypeList, "");

View File

@@ -127,7 +127,7 @@ public class InfluxdbDataHarmpowerQImpl extends MppServiceImpl<RStatDataHarmPowe
value.setValueType(valueType);
List<List<Double>> lists;
if (Objects.equals(phasicType, "T")) {
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
lists = extractDataLists(valueTypeList, "Tot");
} else {
lists = extractDataLists(valueTypeList, "");

View File

@@ -126,7 +126,7 @@ public class InfluxdbDataHarmpowerSImpl extends MppServiceImpl<RStatDataHarmPowe
CommonMinuteDto.ValueType value = new CommonMinuteDto.ValueType();
value.setValueType(valueType);
List<List<Double>> lists;
if (Objects.equals(phasicType, "T")) {
if (Objects.equals(phasicType, "T") && Objects.equals(lineParam.getType(), 2)) {
lists = extractDataLists(valueTypeList, "Tot");
} else {
lists = extractDataLists(valueTypeList, "");

View File

@@ -0,0 +1,78 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10405
compression:
enabled: true
mime-types: application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 1024
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
server-addr: @nacos.url@
namespace: @nacos.namespace@
config:
username: @nacos.username@
password: @nacos.password@
server-addr: @nacos.url@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
jackson:
time-zone: GMT+8
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: error
mqtt:
client-id: @artifactId@${random.value}
data:
source:
query: Influxdb
# insert: Influxdb
insert: Relation
#mybatis配置信息
mybatis-plus:
configuration:
#配置sql日志输出
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
# type-aliases-package: com.njcn.harmonic.pojo
# type-handlers-package: com.njcn.db.handler
# global-config:
# db-config:
# date-format: yyyy-MM-dd HH:mm:ss
# global-config:
# enable-sql-runner: true

View File

@@ -0,0 +1,81 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10405
compression:
enabled: true
mime-types: application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 1024
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
jackson:
time-zone: GMT+8
#项目日志的配置
logging:
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: error
#mqtt:
# client-id: @artifactId@${random.value}
data:
source:
query: Influxdb
# insert: Influxdb
insert: Relation
#mybatis配置信息
mybatis-plus:
configuration:
#配置sql日志输出
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
# type-aliases-package: com.njcn.harmonic.pojo
# type-handlers-package: com.njcn.db.handler
# global-config:
# db-config:
# date-format: yyyy-MM-dd HH:mm:ss
# global-config:
# enable-sql-runner: true

View File

@@ -1,77 +1,3 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10405
compression:
enabled: true
mime-types: application/json,application/xml,text/html,text/xml,text/plain
min-response-size: 1024
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
refresh: true
main:
allow-bean-definition-overriding: true
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
jackson:
time-zone: GMT+8
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: error
mqtt:
client-id: @artifactId@${random.value}
data:
source:
query: Influxdb
# insert: Influxdb
insert: Relation
#mybatis配置信息
mybatis-plus:
configuration:
#配置sql日志输出
log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl
# type-aliases-package: com.njcn.harmonic.pojo
# type-handlers-package: com.njcn.db.handler
# global-config:
# db-config:
# date-format: yyyy-MM-dd HH:mm:ss
# global-config:
# enable-sql-runner: true
profiles:
active: @spring.profiles.active@

View File

@@ -22,16 +22,20 @@ spring:
ip: @service.server.url@
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
config:
server-addr: @nacos.url@
namespace: @nacos.namespace@
username: @nacos.username@
password: @nacos.password@
file-extension: yaml
shared-configs:
- data-id: share-config.yaml
refresh: true
- data-Id: share-config-datasource-db.yaml
- data-id: share-config-datasource-db.yaml
refresh: true
- data-Id: data-platform.yaml
- data-id: data-platform.yaml
refresh: true
main:
allow-bean-definition-overriding: true
@@ -39,7 +43,7 @@ spring:
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
#config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
level:
root: info

54
pom.xml
View File

@@ -15,7 +15,7 @@
<module>algorithm</module>
<module>log</module>
<module>data-processing</module>
<module>migration-influxdb</module>
<!--<module>migration-influxdb</module>-->
</modules>
<distributionManagement>
@@ -32,47 +32,13 @@
</distributionManagement>
<properties>
<spring.profiles.active>sjzx</spring.profiles.active>
<!--内网-->
<!-- <middle.server.url>192.168.1.22</middle.server.url>-->
<!-- <service.server.url>192.168.1.121</service.server.url>-->
<!-- <docker.server.url>192.168.1.22</docker.server.url>-->
<!-- <nacos.url>${middle.server.url}:18848</nacos.url>-->
<!-- <nacos.namespace>07ec981d-1377-4920-8760-b5a98ff7e668</nacos.namespace>-->
<!-- <middle.server.url>192.168.21.129</middle.server.url>-->
<!-- <service.server.url>192.168.21.1</service.server.url>-->
<!-- <docker.server.url>192.168.1.22</docker.server.url>-->
<!-- <nacos.url>${middle.server.url}:18848</nacos.url>-->
<!-- <nacos.namespace>0c19477c-444e-413c-9782-e6ebc2eedac1</nacos.namespace>-->
<!-- <middle.server.url>127.0.0.1</middle.server.url>-->
<!-- &lt;!&ndash;微服务模块发布地址&ndash;&gt;-->
<!-- <service.server.url>127.0.0.1</service.server.url>-->
<!-- &lt;!&ndash;docker仓库地址&ndash;&gt;-->
<!-- <docker.server.url>127.0.0.1</docker.server.url>-->
<!-- &lt;!&ndash;nacos的ip:port&ndash;&gt;-->
<!-- <nacos.url>${middle.server.url}:8848</nacos.url>-->
<!-- <nacos.namespace>37a0e99f-eb96-4d2f-9b47-75bffa765827</nacos.namespace>-->
<!-- <middle.server.url>24.43.102.139</middle.server.url>-->
<!-- <service.server.url>24.43.102.139</service.server.url>-->
<!-- <docker.server.url>24.43.102.139</docker.server.url>-->
<!-- <nacos.url>${middle.server.url}:18848</nacos.url>-->
<!-- <nacos.namespace></nacos.namespace>-->
<middle.server.url>127.0.0.1</middle.server.url>
<service.server.url>127.0.0.1</service.server.url>
<docker.server.url>127.0.0.1</docker.server.url>
<nacos.url>${middle.server.url}:8848</nacos.url>
<nacos.namespace>37a0e99f-eb96-4d2f-9b47-75bffa765827</nacos.namespace>
<!-- <middle.server.url>192.168.21.129</middle.server.url>-->
<!-- &lt;!&ndash;微服务模块发布地址&ndash;&gt;-->
<!-- <service.server.url>192.168.21.1</service.server.url>-->
<!-- &lt;!&ndash;docker仓库地址&ndash;&gt;-->
<!-- <docker.server.url>192.168.1.22</docker.server.url>-->
<!-- <nacos.url>${middle.server.url}:18848</nacos.url>-->
<!-- <nacos.namespace>0c19477c-444e-413c-9782-e6ebc2eedac1</nacos.namespace>-->
<middle.server.url>192.168.1.65</middle.server.url>
<service.server.url>192.168.1.65</service.server.url>
<docker.server.url>192.168.1.22</docker.server.url>
<nacos.url>${middle.server.url}:18848</nacos.url>
<nacos.namespace></nacos.namespace>
<!--sentinel:port-->
<sentinel.url>${middle.server.url}:8080</sentinel.url>
<!--网关地址主要用于配置swagger中认证token-->
@@ -87,6 +53,12 @@
<micro.sdk>common-microservice</micro.sdk>
<!-- <micro.sdk>common-huawei</micro.sdk>-->
<docker.operate>site</docker.operate>
<!--nacos开启鉴权后的用户名-->
<nacos.username>nacos</nacos.username>
<!--nacos的ip:port-->
<nacos.password>njcnpqs</nacos.password>
<java.version>1.8</java.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>