|
@@ -1287,21 +1287,20 @@ public class WindPowerInfo1Service {
|
|
|
|
|
|
|
|
|
public void writeGf(Date date) throws Exception {
|
|
|
- LocalDate localDate = LocalDateTime.now().toLocalDate();
|
|
|
QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
|
|
|
- qwf.lambda().eq(ProBaseBackfill::getType, "AI0004");
|
|
|
+ qwf.lambda().eq(ProBaseBackfill::getType, "CUSTOM_NDGFZB");
|
|
|
List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
|
|
|
List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
|
|
|
List<PointData> realData = edosUtil.getRealData(str);
|
|
|
QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
|
|
|
- qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, localDate);
|
|
|
+ qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, date);
|
|
|
List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
|
|
|
- List<ProEconAnalysisSubtableBottom> ls = null;
|
|
|
- if (null == sel || sel.isEmpty()) {
|
|
|
- ls = new ArrayList<>();
|
|
|
+ List<ProEconAnalysisSubtableBottom> collect = sel.stream().filter(peasb -> str.contains(peasb.getMeterId())).collect(Collectors.toList());
|
|
|
+ List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
+ if (collect.isEmpty()) {
|
|
|
for (PointData real : realData) {
|
|
|
ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
- pb.setRecordDate(new Date(real.getPointTime()));
|
|
|
+ pb.setRecordDate(date);
|
|
|
String[] split1 = real.getPointName().split("\\.");
|
|
|
if ("曙光储能电站".equals(split1[2]) || "宁东33光伏场站".equals(split1[2])) {
|
|
|
pb.setWpid("GJNY_NXGS_SGB_GDC_STA");
|
|
@@ -1317,7 +1316,6 @@ public class WindPowerInfo1Service {
|
|
|
ls.add(pb);
|
|
|
}
|
|
|
} else {
|
|
|
- ls = new ArrayList<>();
|
|
|
for (PointData real : realData) {
|
|
|
for (ProEconAnalysisSubtableBottom s : sel) {
|
|
|
if (real.getPointName().equals(s.getMeterId())) {
|
|
@@ -1341,6 +1339,39 @@ public class WindPowerInfo1Service {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void writeGfHistory(Date date) throws Exception {
|
|
|
+ QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
|
|
|
+ qwf.lambda().eq(ProBaseBackfill::getType, "CUSTOM_NDGFZB");
|
|
|
+ List<ProBaseBackfill> list = iProBaseBackfillService.list(qwf);
|
|
|
+ List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
|
|
|
+ List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
+ String join = String.join(",", str);
|
|
|
+ Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), join, date.getTime());
|
|
|
+ for (String s : str) {
|
|
|
+ ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
+ pb.setRecordDate(date);
|
|
|
+ String[] split1 = s.split("\\.");
|
|
|
+ if ("曙光储能电站".equals(split1[2]) || "宁东33光伏场站".equals(split1[2])) {
|
|
|
+ pb.setWpid("GJNY_NXGS_SGB_GDC_STA");
|
|
|
+ } else if ("霞光储能电站".equals(split1[2]) || "宁东32光伏场站".equals(split1[2])) {
|
|
|
+ pb.setWpid("GJNY_NXGS_XGB_GDC_STA");
|
|
|
+ } else {
|
|
|
+ pb.setWpid("GJNY_NXGS_QZB_GDC_STA");
|
|
|
+ }
|
|
|
+ pb.setMeterId(s);
|
|
|
+ pb.setMeterName(s);
|
|
|
+ pb.setStopCode(historySection.get(s).getDoubleValue());
|
|
|
+ pb.setStopCodeModify(historySection.get(s).getDoubleValue());
|
|
|
+ ls.add(pb);
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ boolean b = iProEconAnalysisSubtableBottomService.batchAdd(ls);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public void writeHaWindturbine(Date date) throws Exception {
|
|
|
QueryWrapper<ProBaseBackfill> qwf = new QueryWrapper<>();
|
|
@@ -1351,9 +1382,9 @@ public class WindPowerInfo1Service {
|
|
|
QueryWrapper<ProEconAnalysisSubtableBottom> qw = new QueryWrapper<>();
|
|
|
qw.lambda().eq(ProEconAnalysisSubtableBottom::getRecordDate, date);
|
|
|
List<ProEconAnalysisSubtableBottom> sel = iProEconAnalysisSubtableBottomService.sel(qw);
|
|
|
- List<ProEconAnalysisSubtableBottom> ls = null;
|
|
|
- if (null == sel || sel.isEmpty()) {
|
|
|
- ls = new ArrayList<>();
|
|
|
+ List<ProEconAnalysisSubtableBottom> collect = sel.stream().filter(peasb -> str.contains(peasb.getMeterId())).collect(Collectors.toList());
|
|
|
+ List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
+ if (collect.isEmpty()) {
|
|
|
for (PointData real : realData) {
|
|
|
ProEconAnalysisSubtableBottom pb = new ProEconAnalysisSubtableBottom();
|
|
|
pb.setRecordDate(date);
|
|
@@ -1365,7 +1396,6 @@ public class WindPowerInfo1Service {
|
|
|
ls.add(pb);
|
|
|
}
|
|
|
} else {
|
|
|
- ls = new ArrayList<>();
|
|
|
for (PointData real : realData) {
|
|
|
for (ProEconAnalysisSubtableBottom s : sel) {
|
|
|
if (real.getPointName().equals(s.getMeterId())) {
|
|
@@ -1373,7 +1403,7 @@ public class WindPowerInfo1Service {
|
|
|
pb.setId(s.getId());
|
|
|
pb.setStopCode(real.getPointValueInDouble());
|
|
|
pb.setStopCodeModify(real.getPointValueInDouble());
|
|
|
- pb.setRecordDate(new Date(real.getPointTime()));
|
|
|
+ pb.setRecordDate(date);
|
|
|
pb.setMeterName(real.getPointName());
|
|
|
pb.setMeterId(real.getPointName());
|
|
|
ls.add(pb);
|
|
@@ -1397,7 +1427,7 @@ public class WindPowerInfo1Service {
|
|
|
List<String> str = list.stream().map(ProBaseBackfill::getCode).collect(Collectors.toList());
|
|
|
long time = date.getTime();
|
|
|
|
|
|
- for (long i = time; i < 1742778000000L; i += 86400000) {
|
|
|
+ for (long i = time; i < 1742518800000L; i += 86400000) {
|
|
|
List<ProEconAnalysisSubtableBottom> ls = new ArrayList<>();
|
|
|
for (String s : str) {
|
|
|
Map<String, PointData2> historySection = adapter.getHistorySection(goldenUri(), s, i);
|