|
@@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -58,6 +59,7 @@ public class GetWindStationInfo {
|
|
|
//赋值
|
|
|
if (oneFDL != null) {
|
|
|
rfdl = oneFDL.getValue();
|
|
|
+
|
|
|
}
|
|
|
if (oneSWDL != null) {
|
|
|
rswdl = oneSWDL.getValue();
|
|
@@ -115,6 +117,9 @@ public class GetWindStationInfo {
|
|
|
BigDecimal yfdl = BigDecimal.valueOf(0);
|
|
|
BigDecimal nfdl = BigDecimal.valueOf(0);
|
|
|
BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal ylyxs = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal nlyxs = BigDecimal.valueOf(0);
|
|
|
+
|
|
|
|
|
|
//赋值
|
|
|
if (dayFDL != null) {
|
|
@@ -122,9 +127,11 @@ public class GetWindStationInfo {
|
|
|
}
|
|
|
if (monthFDL != null) {
|
|
|
yfdl = monthFDL.getValue();
|
|
|
+ ylyxs=yfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
}
|
|
|
if (yearFDL != null) {
|
|
|
nfdl = yearFDL.getValue();
|
|
|
+ nlyxs=nfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
}
|
|
|
if (oneSWDL != null) {
|
|
|
rswdl = oneSWDL.getValue();
|
|
@@ -137,6 +144,261 @@ public class GetWindStationInfo {
|
|
|
meterVO.setNfdl(nfdl);
|
|
|
meterVO.setSwdl(rswdl);
|
|
|
meterVO.setZjrl(zjrl);
|
|
|
+ meterVO.setYlyxs(ylyxs);
|
|
|
+ meterVO.setNlyxs(nlyxs);
|
|
|
+
|
|
|
+ return meterVO;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public List<MeterVO> getMeterInfoGDC_Day() {
|
|
|
+
|
|
|
+ //当前时间
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ //当月开始时间
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
|
+ //当前日为当月第几天
|
|
|
+ int days = DateUtil.dayOfMonth(now);
|
|
|
+
|
|
|
+ //创建一个MeterInfoVO的list集合
|
|
|
+ List<MeterVO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ //循环遍历每一天,取每天的数据
|
|
|
+ for (int i = 1; i <= days; i++) {
|
|
|
+ //开始时间
|
|
|
+ DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
|
|
|
+
|
|
|
+ //根据时间和code查询总风场日发电量,日上网电量,日购网电量
|
|
|
+ MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_DAY").eq("date", dateTime1));
|
|
|
+ MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFSWDL_DAY").eq("date", dateTime1));
|
|
|
+
|
|
|
+ //初始化
|
|
|
+ BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rgwdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal speed = BigDecimal.valueOf(0);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+ if (oneFDL != null) {
|
|
|
+ rfdl = oneFDL.getValue();
|
|
|
+ }
|
|
|
+ if (oneSWDL != null) {
|
|
|
+ rswdl = oneSWDL.getValue();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //VO对象设置属性值
|
|
|
+ MeterVO meterVO = new MeterVO();
|
|
|
+ meterVO.setTimestr(String.valueOf(i));
|
|
|
+ meterVO.setDate(dateTime1);
|
|
|
+ meterVO.setValue1(rfdl);
|
|
|
+ meterVO.setValue2(rswdl);
|
|
|
+ meterVO.setValue3(rgwdl);
|
|
|
+ meterVO.setSpeed(speed);
|
|
|
+
|
|
|
+ //加入集合
|
|
|
+ list.add(meterVO);
|
|
|
+
|
|
|
+ }
|
|
|
+ //返回VO对象集合
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public MeterVO getMeterInfoGDCFDL_DayMonthYear() {
|
|
|
+ //当前时间
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ //当天开始时间
|
|
|
+ DateTime beginOfDay = DateUtil.beginOfDay(now);
|
|
|
+ //当月开始时间
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
|
+ //当年开始时间
|
|
|
+ DateTime beginOfYear = DateUtil.beginOfYear(now);
|
|
|
+ //当前日为当月第几天
|
|
|
+ int days = DateUtil.dayOfMonth(now);
|
|
|
+
|
|
|
+ //根据时间和code查询日发电量,日上网电量,月发电量,年发电量
|
|
|
+ MeterInfoCalculating dayFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_DAY").eq("date", beginOfDay));
|
|
|
+ MeterInfoCalculating monthFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_MONTH").eq("date", beginOfMonth));
|
|
|
+ MeterInfoCalculating yearFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_YEAR").eq("date", beginOfYear));
|
|
|
+ MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFSWDL_DAY").eq("date", beginOfDay));
|
|
|
+
|
|
|
+ //装机容量
|
|
|
+ List<PowerStation> windCapacity = powerStationService.list(new QueryWrapper<PowerStation>().ne("capacity", 0));
|
|
|
+
|
|
|
+ BigDecimal zjrl = BigDecimal.valueOf(0);
|
|
|
+ if (null != windCapacity) {
|
|
|
+ for (PowerStation powerStation : windCapacity) {
|
|
|
+ zjrl = zjrl.add(powerStation.getCapacity());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //初始化
|
|
|
+ BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal yfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal nfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal ylyxs = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal nlyxs = BigDecimal.valueOf(0);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+ if (dayFDL != null) {
|
|
|
+ rfdl = dayFDL.getValue();
|
|
|
+ }
|
|
|
+ if (monthFDL != null) {
|
|
|
+ yfdl = monthFDL.getValue();
|
|
|
+ ylyxs=yfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
+ }
|
|
|
+ if (yearFDL != null) {
|
|
|
+ nfdl = yearFDL.getValue();
|
|
|
+ nlyxs=nfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
+ }
|
|
|
+ if (oneSWDL != null) {
|
|
|
+ rswdl = oneSWDL.getValue();
|
|
|
+ }
|
|
|
+
|
|
|
+ //VO对象属性设置值
|
|
|
+ MeterVO meterVO = new MeterVO();
|
|
|
+ meterVO.setRfdl(rfdl);
|
|
|
+ meterVO.setYfdl(yfdl);
|
|
|
+ meterVO.setNfdl(nfdl);
|
|
|
+ meterVO.setSwdl(rswdl);
|
|
|
+ meterVO.setZjrl(zjrl);
|
|
|
+ meterVO.setYlyxs(ylyxs);
|
|
|
+ meterVO.setNlyxs(nlyxs);
|
|
|
+
|
|
|
+ return meterVO;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public List<MeterVO> getMeterInfo_FDC_GDC_Day() {
|
|
|
+
|
|
|
+ //当前时间
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ //当月开始时间
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
|
+ //当前日为当月第几天
|
|
|
+ int days = DateUtil.dayOfMonth(now);
|
|
|
+
|
|
|
+ //创建一个MeterInfoVO的list集合
|
|
|
+ List<MeterVO> list = new ArrayList<>();
|
|
|
+
|
|
|
+ //循环遍历每一天,取每天的数据
|
|
|
+ for (int i = 1; i <= days; i++) {
|
|
|
+ //开始时间
|
|
|
+ DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
|
|
|
+
|
|
|
+ //根据时间和code查询总日发电量,日上网电量,日购网电量
|
|
|
+ MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_DAY").eq("date", dateTime1));
|
|
|
+ MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFSWDL_DAY").eq("date", dateTime1));
|
|
|
+ MeterInfoCalculating oneFDL_FC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", dateTime1));
|
|
|
+ MeterInfoCalculating oneSWDL_FC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", dateTime1));
|
|
|
+
|
|
|
+ //初始化
|
|
|
+ BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rgwdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal speed = BigDecimal.valueOf(0);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+ if (oneFDL != null && oneFDL_FC != null) {
|
|
|
+ rfdl = oneFDL.getValue().add(oneFDL_FC.getValue());
|
|
|
+ }
|
|
|
+ if (oneFDL != null && oneSWDL_FC != null) {
|
|
|
+ rswdl = oneSWDL.getValue().add(oneSWDL_FC.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //VO对象设置属性值
|
|
|
+ MeterVO meterVO = new MeterVO();
|
|
|
+ meterVO.setTimestr(String.valueOf(i));
|
|
|
+ meterVO.setDate(dateTime1);
|
|
|
+ meterVO.setValue1(rfdl);
|
|
|
+ meterVO.setValue2(rswdl);
|
|
|
+ meterVO.setValue3(rgwdl);
|
|
|
+ meterVO.setSpeed(speed);
|
|
|
+
|
|
|
+ //加入集合
|
|
|
+ list.add(meterVO);
|
|
|
+
|
|
|
+ }
|
|
|
+ //返回VO对象集合
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public MeterVO getMeterInfo_FDC_GDC_FDLDayMonthYear() {
|
|
|
+ //当前时间
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ //当天开始时间
|
|
|
+ DateTime beginOfDay = DateUtil.beginOfDay(now);
|
|
|
+ //当月开始时间
|
|
|
+ DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
|
+ //当年开始时间
|
|
|
+ DateTime beginOfYear = DateUtil.beginOfYear(now);
|
|
|
+ //当前日为当月第几天
|
|
|
+ int days = DateUtil.dayOfMonth(now);
|
|
|
+
|
|
|
+ //根据时间和code查询日发电量,日上网电量,月发电量,年发电量
|
|
|
+ MeterInfoCalculating dayFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_DAY").eq("date", beginOfDay));
|
|
|
+ MeterInfoCalculating monthFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_MONTH").eq("date", beginOfMonth));
|
|
|
+ MeterInfoCalculating yearFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFFDL_YEAR").eq("date", beginOfYear));
|
|
|
+ MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_GFSWDL_DAY").eq("date", beginOfDay));
|
|
|
+ //装机容量
|
|
|
+ List<PowerStation> windCapacity = powerStationService.list(new QueryWrapper<PowerStation>().ne("capacity", 0));
|
|
|
+
|
|
|
+ //根据时间和code查询日发电量,日上网电量,月发电量,年发电量
|
|
|
+ MeterInfoCalculating dayFDL_FDC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", beginOfDay));
|
|
|
+ MeterInfoCalculating monthFDL_FDC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_MONTH").eq("date", beginOfMonth));
|
|
|
+ MeterInfoCalculating yearFDL_FDC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_YEAR").eq("date", beginOfYear));
|
|
|
+ MeterInfoCalculating oneSWDL_FDC = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", beginOfDay));
|
|
|
+
|
|
|
+ //装机容量
|
|
|
+ List<PowerStation> windCapacity_FDC = powerStationService.list(new QueryWrapper<PowerStation>().ne("wind_capacity", 0));
|
|
|
+
|
|
|
+ BigDecimal zjrl = BigDecimal.valueOf(0);
|
|
|
+ if (null != windCapacity && null != windCapacity_FDC) {
|
|
|
+ for (PowerStation powerStation : windCapacity) {
|
|
|
+ zjrl = zjrl.add(powerStation.getCapacity());
|
|
|
+ }
|
|
|
+ for (PowerStation powerStation : windCapacity_FDC) {
|
|
|
+ zjrl = zjrl.add(powerStation.getWindCapacity());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //初始化
|
|
|
+ BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal yfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal nfdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal ylyxs = BigDecimal.valueOf(0);
|
|
|
+ BigDecimal nlyxs = BigDecimal.valueOf(0);
|
|
|
+
|
|
|
+ //赋值
|
|
|
+ if (dayFDL != null && dayFDL_FDC != null) {
|
|
|
+ rfdl = dayFDL.getValue().add(dayFDL_FDC.getValue());
|
|
|
+ }
|
|
|
+ if (monthFDL != null && monthFDL_FDC != null) {
|
|
|
+ yfdl = monthFDL.getValue().add(monthFDL_FDC.getValue());
|
|
|
+ ylyxs=yfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
+ }
|
|
|
+ if (yearFDL != null && yearFDL_FDC != null) {
|
|
|
+ nfdl = yearFDL.getValue().add(yearFDL_FDC.getValue());
|
|
|
+ nlyxs=nfdl.divide(BigDecimal.valueOf(664), 1, RoundingMode.HALF_EVEN);
|
|
|
+ }
|
|
|
+ if (oneSWDL != null && oneSWDL_FDC != null) {
|
|
|
+ rswdl = oneSWDL.getValue().add(oneSWDL_FDC.getValue());
|
|
|
+ }
|
|
|
+
|
|
|
+ //VO对象属性设置值
|
|
|
+ MeterVO meterVO = new MeterVO();
|
|
|
+ meterVO.setRfdl(rfdl);
|
|
|
+ meterVO.setYfdl(yfdl);
|
|
|
+ meterVO.setNfdl(nfdl);
|
|
|
+ meterVO.setSwdl(rswdl);
|
|
|
+ meterVO.setZjrl(zjrl);
|
|
|
+ meterVO.setYlyxs(ylyxs);
|
|
|
+ meterVO.setNlyxs(nlyxs);
|
|
|
|
|
|
return meterVO;
|
|
|
|