1.代码提交

This commit is contained in:
wr
2023-12-01 08:48:50 +08:00
parent 71ed4ffe12
commit 1129cee5b3
12 changed files with 600 additions and 37 deletions

View File

@@ -567,11 +567,11 @@ public class PubUtils {
.head(ZhangDistributionAreaExcel.class)
.doReadAllSync();
listZhang = listZhang.stream()
.filter(t -> StrUtil.isNotBlank(t.getId()))
.filter(StreamUtil.distinctByKey(ZhangDistributionAreaExcel::getId))
.filter(t -> !"#N/A".equals(t.getPmsID()))
.filter(t -> StrUtil.isNotBlank(t.getPmsID()))
.collect(Collectors.toList());
.filter(t -> StrUtil.isNotBlank(t.getId()))
.filter(StreamUtil.distinctByKey(ZhangDistributionAreaExcel::getId))
.filter(t -> !"#N/A".equals(t.getPmsID()))
.filter(t -> StrUtil.isNotBlank(t.getPmsID()))
.collect(Collectors.toList());
//读取所有没数据的用户号
FileReader fileReader = new FileReader("D:\\test\\all.txt");
@@ -609,7 +609,23 @@ public class PubUtils {
.replaceAll("PhV_phsB", "B相电压")
.replaceAll("PhV_phsC", "C相电压")
.replaceAll("TotW", "有功")
.replaceAll("TotVar", "无功");
.replaceAll("TotVar", "无功")
.replaceAll("HphV2_phsA", "A相电压2次谐波值")
.replaceAll("HphV2_phsB", "B相电压2次谐波值")
.replaceAll("HphV2_phsC", "C相电压2次谐波值")
.replaceAll("HphV3_phsA", "A相电压3次谐波值")
.replaceAll("HphV3_phsB", "B相电压3次谐波值")
.replaceAll("HphV3_phsC", "C相电压3次谐波值")
.replaceAll("HphV5_phsA", "A相电压5次谐波值")
.replaceAll("HphV5_phsB", "B相电压5次谐波值")
.replaceAll("HphV7_phsC", "C相电压7次谐波值")
.replaceAll("HphV7_phsA", "A相电压7次谐波值")
.replaceAll("HphV7_phsB", "B相电压7次谐波值")
.replaceAll("HphV5_phsC", "C相电压5次谐波值")
.replaceAll("HphV9_phsA", "A相电压9次谐波值")
.replaceAll("HphV9_phsB", "B相电压9次谐波值")
.replaceAll("HphV9_phsC", "C相电压9次谐波值")
;
disPhotovoltaic10Excel.setTypes(info);
final10kVUserData.add(disPhotovoltaic10Excel);
}
@@ -633,22 +649,47 @@ public class PubUtils {
for (String userId : keyedSet) {
disPhotovoltaic380ExcelList = all380VMap.get(userId);
if (CollectionUtil.isNotEmpty(disPhotovoltaic380ExcelList)) {
disPhotovoltaic380Excel = disPhotovoltaic380ExcelList.get(0);
info = noPartDataMap.get(userId).get(0);
info = info.substring(info.indexOf(StrPool.COMMA) + 1);
info = info.replaceAll(StrPool.AT, "||")
.replaceAll("A_phsA", "A相电流")
.replaceAll("A_phsB", "B相电流")
.replaceAll("A_phsC", "C相电流")
.replaceAll("PhV_phsA", "A相电")
.replaceAll("PhV_phsB", "B相电")
.replaceAll("PhV_phsC", "C相电压")
.replaceAll("TotW", "有功")
.replaceAll("TotVar", "无功");
disPhotovoltaic380Excel.setTypes(info);
final380VUserData.add(disPhotovoltaic380Excel);
List<ZhangDistributionAreaExcel> collect1 = disPhotovoltaic380ExcelList.stream().distinct().collect(Collectors.toList());
for (ZhangDistributionAreaExcel zhangDistributionAreaExcel : collect1) {
disPhotovoltaic380Excel=zhangDistributionAreaExcel;
info = zhangDistributionAreaExcel.getPmsID();
info = info.substring(info.indexOf(StrPool.COMMA) + 1);
info = info.replaceAll(StrPool.AT, "||")
.replaceAll("A_phsA", "A相电流")
.replaceAll("A_phsB", "B相电")
.replaceAll("A_phsC", "C相电")
.replaceAll("PhV_phsA", "A相电压")
.replaceAll("PhV_phsB", "B相电压")
.replaceAll("PhV_phsC", "C相电压")
.replaceAll("TotW", "有功")
.replaceAll("TotVar", "无功")
.replaceAll("HphV2_phsA", "A相电压2次谐波值")
.replaceAll("HphV2_phsB", "B相电压2次谐波值")
.replaceAll("HphV2_phsC", "C相电压2次谐波值")
.replaceAll("HphV3_phsA", "A相电压3次谐波值")
.replaceAll("HphV3_phsB", "B相电压3次谐波值")
.replaceAll("HphV3_phsC", "C相电压3次谐波值")
.replaceAll("HphV5_phsA", "A相电压5次谐波值")
.replaceAll("HphV5_phsB", "B相电压5次谐波值")
.replaceAll("HphV7_phsC", "C相电压7次谐波值")
.replaceAll("HphV7_phsA", "A相电压7次谐波值")
.replaceAll("HphV7_phsB", "B相电压7次谐波值")
.replaceAll("HphV5_phsC", "C相电压5次谐波值")
.replaceAll("HphV9_phsA", "A相电压9次谐波值")
.replaceAll("HphV9_phsB", "B相电压9次谐波值")
.replaceAll("HphV9_phsC", "C相电压9次谐波值")
;
disPhotovoltaic380Excel.setTypes(info);
final380VUserData.add(disPhotovoltaic380Excel);
}
}
}
List<String> collect1 = final380VUserData.stream().map(ZhangDistributionAreaExcel::getId).collect(Collectors.toList());
List<String> collect2 = collect4.stream().map(ZhangDistributionAreaExcel::getId).collect(Collectors.toList());
listZhang= listZhang.stream().filter(t -> !collect1.contains(t.getId())).collect(Collectors.toList());
listZhang= listZhang.stream().filter(t -> !collect2.contains(t.getId())).collect(Collectors.toList());
EasyExcel.write("D:\\test\\张家口部分没有数据的.xlsx", ZhangDistributionAreaExcel.class).sheet("张家口部分没有数据的").doWrite(final380VUserData);
long millis4 = System.currentTimeMillis();
System.out.println("张家口部分没有数据的:" + (millis4 - millis3));