|
@@ -20,7 +20,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.lang.reflect.Field;
|
|
|
-import java.lang.reflect.InvocationTargetException;
|
|
|
import java.net.URI;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
@@ -233,18 +232,18 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
public Map<String, Double> getTurbinePowerLoss(double rfdl, PointInfo piZt, List<PointData> fsList, List<PointData> glList) {
|
|
|
String tbId = piZt.getTurbineId();
|
|
|
-// Map<Double, Long> collect = piZt.getPointDatas().stream().collect(Collectors.groupingBy(PointData::getValue, Collectors.counting()));
|
|
|
+ // Map<Double, Long> collect = piZt.getPointDatas().stream().collect(Collectors.groupingBy(PointData::getValue, Collectors.counting()));
|
|
|
double sum1 = glList.stream().mapToDouble(PointData::getValue).sum();
|
|
|
double xs = 1;
|
|
|
if (rfdl > 0 && sum1 > 0) {
|
|
|
xs = rfdl / (sum1 / 240);
|
|
|
}
|
|
|
-// double sum2 = fsList.stream().mapToDouble(pd -> {
|
|
|
-// Double v = CalcCache.fitcoef.get(tbId).get(pd.getValue());
|
|
|
-// if (v == null) v = 0.0;
|
|
|
-// return v;
|
|
|
-// }).sum();
|
|
|
-// sum2=sum2/240;
|
|
|
+ // double sum2 = fsList.stream().mapToDouble(pd -> {
|
|
|
+ // Double v = CalcCache.fitcoef.get(tbId).get(pd.getValue());
|
|
|
+ // if (v == null) v = 0.0;
|
|
|
+ // return v;
|
|
|
+ // }).sum();
|
|
|
+ // sum2=sum2/240;
|
|
|
|
|
|
List<PointData> collectZt = piZt.getPointDatas();
|
|
|
double jxss = 0, sdtj = 0, gzss = 0, djss = 0, xnss = 0, fdjcl = 0, xdjcl = 0, xdtj = 0;
|
|
@@ -362,6 +361,25 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
lineInfoDayService.saveOrUpdateBatch(lineInfos);
|
|
|
}
|
|
|
|
|
|
+ public void calcLineSwGWCyDlSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+
|
|
|
+ List<StationInfoDay> stationInfos = getStationinfoByDate(time0);
|
|
|
+ Map<String, StationInfoDay> stationMap = stationInfos.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
+ List<LineInfoDay> lineInfos = getLineinfoByDate(time0);
|
|
|
+ StationInfoDay stationInfo;
|
|
|
+ for (LineInfoDay lineInfo : lineInfos) {
|
|
|
+ stationInfo = stationMap.get(lineInfo.getStationId());
|
|
|
+ double xs = (double) lineInfo.getRfdl() / stationInfo.getRfdl();
|
|
|
+ lineInfo.setSwdl(xs * stationInfo.getSwdl());
|
|
|
+ lineInfo.setGwdl(xs * stationInfo.getGwdl());
|
|
|
+ lineInfo.setCydl(xs * stationInfo.getCydl());
|
|
|
+ lineInfo.setZyb(xs * stationInfo.getZyb());
|
|
|
+ }
|
|
|
+ lineInfoDayService.saveOrUpdateBatch(lineInfos);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcLineSwGWCyDl(Date date, String stId) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
@@ -400,6 +418,24 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
+ public void calcStationZhcyRfDlSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+
|
|
|
+ QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,station_id").eq("record_date", time0).groupBy("station_id");
|
|
|
+ List<LineInfoDay> list = lineInfoDayService.list(wrapper);
|
|
|
+ Map<String, Integer> rfdlMap = list.stream().collect(Collectors.toMap(LineInfoDay::getStationId, LineInfoDay::getRfdl));
|
|
|
+ List<StationInfoDay> byDate = getStationinfoByDate(time0);
|
|
|
+
|
|
|
+ for (StationInfoDay day : byDate) {
|
|
|
+ day.setRfdl(rfdlMap.get(day.getStationId()));
|
|
|
+ day.setZhcydl(day.getRfdl() + day.getGwdl() - day.getSwdl());
|
|
|
+ day.setCydl(day.getZhcydl() - day.getZyb());
|
|
|
+ }
|
|
|
+ stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcStationZhcyRfDl(Date date, String stId) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
@@ -457,6 +493,42 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
+ public void calcStationSwGwCyDlSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+
|
|
|
+ List<PointInfo> swdlEt = getEntity("Z-ZXYG-CX", "meter");
|
|
|
+ List<PointInfo> gwdlEt = getEntity("Z-FXYG-CX", "meter");
|
|
|
+ List<PointInfo> cydlEt = getEntity("Z-ZXYG-ZYB", "meter");
|
|
|
+ getZeroNextData(swdlEt, time0);
|
|
|
+ getZeroNextData(gwdlEt, time0);
|
|
|
+ getZeroNextData(cydlEt, time0);
|
|
|
+
|
|
|
+ Map<String, PointInfo> swdlMap = swdlEt.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
+ Map<String, PointInfo> gwdlMap = gwdlEt.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
+ Map<String, PointInfo> cydlMap = cydlEt.stream().collect(Collectors.toMap(PointInfo::getStationId, Function.identity()));
|
|
|
+
|
|
|
+ List<StationInfoDay> byDate = getStationinfoByDate(time0, swdlEt);
|
|
|
+ String stId;
|
|
|
+ PointInfo swdlPi, gwdlPi, cydlPi;
|
|
|
+ for (StationInfoDay info : byDate) {
|
|
|
+ stId = info.getStationId();
|
|
|
+ swdlPi = swdlMap.get(stId);
|
|
|
+ gwdlPi = gwdlMap.get(stId);
|
|
|
+ cydlPi = cydlMap.get(stId);
|
|
|
+ int swdl = (int) ((swdlPi.getPointDatas().get(1).getValue() - swdlPi.getPointDatas().get(0).getValue()) * swdlPi.getCoef());
|
|
|
+ int gwdl = (int) ((gwdlPi.getPointDatas().get(1).getValue() - gwdlPi.getPointDatas().get(0).getValue()) * gwdlPi.getCoef());
|
|
|
+ int cydl = (int) ((cydlPi.getPointDatas().get(1).getValue() - cydlPi.getPointDatas().get(0).getValue()) * cydlPi.getCoef());
|
|
|
+ if (swdl < 0 || swdl > 6000000) swdl = 0;
|
|
|
+ if (gwdl < 0 || gwdl > 6000000) gwdl = 0;
|
|
|
+ if (cydl < 0 || cydl > 6000000) cydl = 0;
|
|
|
+ info.setSwdl(swdl);
|
|
|
+ info.setGwdl(gwdl);
|
|
|
+ info.setZyb(cydl);
|
|
|
+ }
|
|
|
+ stationInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcStationSwGwCyRdl(Date date, String stId) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
@@ -519,6 +591,31 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void getZeroNextData(List<PointInfo> entity, Date start0) {
|
|
|
+ String keys = entity.stream().map(PointInfo::getPointKey).collect(Collectors.joining(","));
|
|
|
+ Map<String, PointData> latest = adapter.getLatest(goldenUri(), keys);
|
|
|
+ List<PointData> snap0;
|
|
|
+ for (PointInfo info : entity) {
|
|
|
+ PointData data0, data;
|
|
|
+ List<PointData> datas = new ArrayList<>();
|
|
|
+ snap0 = adapter.getHistoryRaw(goldenUri(), info.getPointKey(), start0.getTime(), DateUtil.offsetMinute(start0, 90).getTime());
|
|
|
+ if (CollUtil.isEmpty(snap0)) {
|
|
|
+ Map<String, PointData> section = adapter.getHistorySection(goldenUri(), info.getPointKey(), start0.getTime());
|
|
|
+ snap0 = new ArrayList<>(section.values());
|
|
|
+ }
|
|
|
+ data = latest.get(info.getPointKey());
|
|
|
+ if (CollUtil.isEmpty(snap0) || data == null) {
|
|
|
+ data0 = new PointData();
|
|
|
+ data = new PointData();
|
|
|
+ } else {
|
|
|
+ data0 = snap0.get(0);
|
|
|
+ }
|
|
|
+ datas.add(data0);
|
|
|
+ datas.add(data);
|
|
|
+ info.setPointDatas(datas);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void calcStationHourRFDL(Date hour) {
|
|
|
PointInfo pointInfo = new PointInfo();
|
|
|
pointInfo.setInstitutionType("station");
|
|
@@ -567,6 +664,28 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
lineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public void calcLineRfdlSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+
|
|
|
+ List<PointInfo> entity = getEntity("Z-ZXYG-JX", "meter");
|
|
|
+ entity = entity.stream().filter(e -> !"".equals(e.getProjectId())).collect(Collectors.toList());
|
|
|
+ getZeroNextData(entity, time0);
|
|
|
+ Map<String, PointInfo> rfdlMap = entity.stream().collect(Collectors.toMap(PointInfo::getLineId, Function.identity()));
|
|
|
+ List<LineInfoDay> byDate = getLineinfoByDate(time0, entity);
|
|
|
+
|
|
|
+ PointInfo rfdlPi;
|
|
|
+ int v;
|
|
|
+ for (LineInfoDay day : byDate) {
|
|
|
+ rfdlPi = rfdlMap.get(day.getLineId());
|
|
|
+ v = (int) ((rfdlPi.getPointDatas().get(1).getValue() - rfdlPi.getPointDatas().get(0).getValue()) * rfdlPi.getCoef());
|
|
|
+ if (v < 0 || v > 30000000) v = 0;
|
|
|
+ day.setRfdl(v);
|
|
|
+ }
|
|
|
+ lineInfoDayService.saveOrUpdateBatch(byDate);
|
|
|
+ }
|
|
|
+
|
|
|
public void calcLineRfdl(Date date, String stId) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
@@ -1840,9 +1959,9 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<StationInfoDay> yearDays = stationInfoDayService.list(wrapper);
|
|
|
Map<String, StationInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
|
|
|
-// QueryWrapper<ProEconReportIndicatorPool> wrapperrp = new QueryWrapper<>();
|
|
|
-// wrapperrp.eq("record_date", time0).last("and foreign_key_id = windpowerstation_id");
|
|
|
-// List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperrp);
|
|
|
+ // QueryWrapper<ProEconReportIndicatorPool> wrapperrp = new QueryWrapper<>();
|
|
|
+ // wrapperrp.eq("record_date", time0).last("and foreign_key_id = windpowerstation_id");
|
|
|
+ // List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperrp);
|
|
|
|
|
|
QueryWrapper<ProEconReportIndicatorPool> wrapperrp = new QueryWrapper<>();
|
|
|
wrapperrp.eq("record_date", time0).in("foreign_key_id", days.stream().map(StationInfoDay::getStationId).collect(Collectors.toList()));
|
|
@@ -1890,6 +2009,91 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void writeReportPoolSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(time0);
|
|
|
+ DateTime beginOfYear = DateUtil.beginOfYear(time0);
|
|
|
+
|
|
|
+ QueryWrapper<StationInfoDay> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("record_date", time0);
|
|
|
+ List<StationInfoDay> days = stationInfoDayService.list(wrapper);
|
|
|
+ Map<String, StationInfoDay> dayMap = days.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
+ wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfMonth, time0).groupBy("station_id");
|
|
|
+ List<StationInfoDay> monthDays = stationInfoDayService.list(wrapper);
|
|
|
+ Map<String, StationInfoDay> monthMap = monthDays.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
+ wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,sum(zhcydl) zhcydl,station_id").between("record_date", beginOfYear, time0).groupBy("station_id");
|
|
|
+ List<StationInfoDay> yearDays = stationInfoDayService.list(wrapper);
|
|
|
+ Map<String, StationInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(StationInfoDay::getStationId, Function.identity()));
|
|
|
+
|
|
|
+ QueryWrapper<ProEconReportIndicatorPool> wrapperRp = new QueryWrapper<>();
|
|
|
+ wrapperRp.eq("record_date", time0).last("and foreign_key_id = windpowerstation_id");
|
|
|
+ List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperRp);
|
|
|
+
|
|
|
+ StationInfoDay day, month, year;
|
|
|
+ if (pools.isEmpty()) {
|
|
|
+ pools = new ArrayList<>();
|
|
|
+ for (StationInfoDay infoDay : days) {
|
|
|
+ String stationId = infoDay.getStationId();
|
|
|
+ ProEconReportIndicatorPool pool = new ProEconReportIndicatorPool();
|
|
|
+ pool.setRecordDate(time0);
|
|
|
+ pool.setForeignKeyId(stationId);
|
|
|
+ pool.setWindpowerstationId(stationId);
|
|
|
+ month = monthMap.get(stationId);
|
|
|
+ year = yearMap.get(stationId);
|
|
|
+ poolSetValueDl1(pool, infoDay, month, year);
|
|
|
+ pools.add(pool);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (ProEconReportIndicatorPool pool : pools) {
|
|
|
+ String stationId = pool.getWindpowerstationId();
|
|
|
+ day = dayMap.get(stationId);
|
|
|
+ month = monthMap.get(stationId);
|
|
|
+ year = yearMap.get(stationId);
|
|
|
+ poolSetValueDl1(pool, day, month, year);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportIndicatorPoolService.saveOrUpdateBatch(pools);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void poolSetValueDl1(ProEconReportIndicatorPool pool, StationInfoDay day, StationInfoDay month, StationInfoDay year) {
|
|
|
+ pool.setRfdldb(day.getRfdl().doubleValue());
|
|
|
+ pool.setRswdldb(day.getSwdl().doubleValue());
|
|
|
+ pool.setRgwgwdldb(day.getGwdl().doubleValue());
|
|
|
+ pool.setRfdcydldb(day.getCydl().doubleValue());
|
|
|
+ pool.setRzhcydldb(day.getZhcydl().doubleValue());
|
|
|
+ pool.setYfdldb(month.getRfdl().doubleValue());
|
|
|
+ pool.setYswdldb(month.getSwdl().doubleValue());
|
|
|
+ pool.setYgwgwdldb(month.getGwdl().doubleValue());
|
|
|
+ pool.setYfdcydldb(month.getCydl().doubleValue());
|
|
|
+ pool.setYzhcydldb(month.getZhcydl().doubleValue());
|
|
|
+ pool.setNfdldb(year.getRfdl().doubleValue());
|
|
|
+ pool.setNswdldb(year.getSwdl().doubleValue());
|
|
|
+ pool.setNgwgwdldb(year.getGwdl().doubleValue());
|
|
|
+ pool.setNfdcydldb(year.getCydl().doubleValue());
|
|
|
+ pool.setNzhcydldb(year.getZhcydl().doubleValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ public void poolSetValueDl(ProEconReportIndicatorPool pool, LineInfoDay day, LineInfoDay month, LineInfoDay year) {
|
|
|
+ pool.setRfdldb(day.getRfdl().doubleValue());
|
|
|
+ pool.setRswdldb(day.getSwdl());
|
|
|
+ pool.setRgwgwdldb(day.getGwdl());
|
|
|
+ pool.setRfdcydldb(day.getCydl());
|
|
|
+ pool.setRzhcydldb(day.getRfdl().doubleValue() + day.getGwdl() - day.getSwdl());
|
|
|
+ pool.setYfdldb(month.getRfdl().doubleValue());
|
|
|
+ pool.setYswdldb(month.getSwdl());
|
|
|
+ pool.setYgwgwdldb(month.getGwdl());
|
|
|
+ pool.setYfdcydldb(month.getCydl());
|
|
|
+ pool.setYzhcydldb(month.getRfdl().doubleValue() + month.getGwdl() - month.getSwdl());
|
|
|
+ pool.setNfdldb(year.getRfdl().doubleValue());
|
|
|
+ pool.setNswdldb(year.getSwdl());
|
|
|
+ pool.setNgwgwdldb(year.getGwdl());
|
|
|
+ pool.setNfdcydldb(year.getCydl());
|
|
|
+ pool.setNzhcydldb(year.getRfdl().doubleValue() + year.getGwdl() - year.getSwdl());
|
|
|
+ }
|
|
|
+
|
|
|
public void writeReportPoolProject(Date date) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|
|
@@ -1911,9 +2115,9 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
List<LineInfoDay> yearDays = lineInfoDayService.list(wrapper);
|
|
|
Map<String, LineInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(LineInfoDay::getProjectId, Function.identity()));
|
|
|
|
|
|
-// QueryWrapper<ProEconReportIndicatorPool> wrapperrp = new QueryWrapper<>();
|
|
|
-// wrapperrp.eq("record_date", time0).last("and foreign_key_id = project_id");
|
|
|
-// List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperrp);
|
|
|
+ // QueryWrapper<ProEconReportIndicatorPool> wrapperrp = new QueryWrapper<>();
|
|
|
+ // wrapperrp.eq("record_date", time0).last("and foreign_key_id = project_id");
|
|
|
+ // List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperrp);
|
|
|
|
|
|
|
|
|
QueryWrapper<ProEconReportIndicatorPool> wrapperrp2 = new QueryWrapper<>();
|
|
@@ -1961,6 +2165,56 @@ public class JavaFunctionJobHandler extends IJobHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void writeReportPoolProjectSameDay(Date time) {
|
|
|
+ //date当天零点
|
|
|
+ DateTime time0 = DateUtil.beginOfDay(time);
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(time0);
|
|
|
+ DateTime beginOfYear = DateUtil.beginOfYear(time0);
|
|
|
+
|
|
|
+ QueryWrapper<LineInfoDay> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,project_id,station_id").eq("record_date", time0).groupBy("project_id,station_id");
|
|
|
+ List<LineInfoDay> days = lineInfoDayService.list(wrapper);
|
|
|
+ Map<String, LineInfoDay> dayMap = days.stream().collect(Collectors.toMap(LineInfoDay::getProjectId, Function.identity()));
|
|
|
+ wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,project_id,station_id").between("record_date", beginOfMonth, time0).groupBy("project_id,station_id");
|
|
|
+ List<LineInfoDay> monthDays = lineInfoDayService.list(wrapper);
|
|
|
+ Map<String, LineInfoDay> monthMap = monthDays.stream().collect(Collectors.toMap(LineInfoDay::getProjectId, Function.identity()));
|
|
|
+ wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.select("sum(rfdl) rfdl,sum(swdl) swdl,sum(gwdl) gwdl,sum(cydl) cydl,project_id,station_id").between("record_date", beginOfYear, time0).groupBy("project_id,station_id");
|
|
|
+ List<LineInfoDay> yearDays = lineInfoDayService.list(wrapper);
|
|
|
+ Map<String, LineInfoDay> yearMap = yearDays.stream().collect(Collectors.toMap(LineInfoDay::getProjectId, Function.identity()));
|
|
|
+
|
|
|
+ QueryWrapper<ProEconReportIndicatorPool> wrapperRp = new QueryWrapper<>();
|
|
|
+ wrapperRp.eq("record_date", time0).last("and foreign_key_id = project_id");
|
|
|
+ List<ProEconReportIndicatorPool> pools = reportIndicatorPoolService.list(wrapperRp);
|
|
|
+
|
|
|
+ LineInfoDay day, month, year;
|
|
|
+ if (pools.isEmpty()) {
|
|
|
+ pools = new ArrayList<>();
|
|
|
+ for (LineInfoDay infoDay : days) {
|
|
|
+ String projectId = infoDay.getProjectId();
|
|
|
+ ProEconReportIndicatorPool pool = new ProEconReportIndicatorPool();
|
|
|
+ pool.setRecordDate(time0);
|
|
|
+ pool.setForeignKeyId(projectId);
|
|
|
+ pool.setWindpowerstationId(infoDay.getStationId());
|
|
|
+ pool.setProjectId(projectId);
|
|
|
+ month = monthMap.get(projectId);
|
|
|
+ year = yearMap.get(projectId);
|
|
|
+ poolSetValueDl(pool, infoDay, month, year);
|
|
|
+ pools.add(pool);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (ProEconReportIndicatorPool pool : pools) {
|
|
|
+ String projectId = pool.getProjectId();
|
|
|
+ day = dayMap.get(projectId);
|
|
|
+ month = monthMap.get(projectId);
|
|
|
+ year = yearMap.get(projectId);
|
|
|
+ poolSetValueDl(pool, day, month, year);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ reportIndicatorPoolService.saveOrUpdateBatch(pools);
|
|
|
+ }
|
|
|
+
|
|
|
public void writeReportPoolPjfs(Date date) {
|
|
|
//date当天零点
|
|
|
DateTime time = DateUtil.beginOfDay(date);
|