|
@@ -4,8 +4,10 @@ import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.gyee.gaia.meter.entity.MeterInfoCalculating;
|
|
import com.gyee.gaia.meter.entity.MeterInfoCalculating;
|
|
|
|
+import com.gyee.gaia.meter.entity.PowerStation;
|
|
import com.gyee.gaia.meter.entity.vo.MeterInfoVO;
|
|
import com.gyee.gaia.meter.entity.vo.MeterInfoVO;
|
|
import com.gyee.gaia.meter.service.impl.MeterInfoCalculatingServiceImpl;
|
|
import com.gyee.gaia.meter.service.impl.MeterInfoCalculatingServiceImpl;
|
|
|
|
+import com.gyee.gaia.meter.service.impl.PowerStationServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
@@ -22,8 +24,8 @@ import java.util.List;
|
|
public class GetWindStationInfo {
|
|
public class GetWindStationInfo {
|
|
@Resource
|
|
@Resource
|
|
MeterInfoCalculatingServiceImpl meterInfoCalculatingService;
|
|
MeterInfoCalculatingServiceImpl meterInfoCalculatingService;
|
|
-
|
|
|
|
- //查询当月天数,返回当月每天的数据,日发电量,日上网电量,日购网电量
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ PowerStationServiceImpl powerStationService;
|
|
|
|
|
|
public List<MeterInfoVO> getMeterInfoFDC_Day() {
|
|
public List<MeterInfoVO> getMeterInfoFDC_Day() {
|
|
|
|
|
|
@@ -31,7 +33,7 @@ public class GetWindStationInfo {
|
|
DateTime now = DateTime.now();
|
|
DateTime now = DateTime.now();
|
|
//当月开始时间
|
|
//当月开始时间
|
|
DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
- //当月天数
|
|
|
|
|
|
+ //当前日为当月第几天
|
|
int days = DateUtil.dayOfMonth(now);
|
|
int days = DateUtil.dayOfMonth(now);
|
|
|
|
|
|
//创建一个MeterInfoVO的list集合
|
|
//创建一个MeterInfoVO的list集合
|
|
@@ -42,16 +44,18 @@ public class GetWindStationInfo {
|
|
//开始时间
|
|
//开始时间
|
|
DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
|
|
DateTime dateTime1 = DateUtil.offsetDay(beginOfMonth, i - 1);
|
|
|
|
|
|
- //根据时间和code查询风场日发电量,日上网电量
|
|
|
|
|
|
+ //根据时间和code查询总风场日发电量,日上网电量,日购网电量
|
|
MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", dateTime1));
|
|
MeterInfoCalculating oneFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", dateTime1));
|
|
MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", dateTime1));
|
|
MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", dateTime1));
|
|
MeterInfoCalculating oneGWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONGWDL_DAY").eq("date", dateTime1));
|
|
MeterInfoCalculating oneGWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONGWDL_DAY").eq("date", dateTime1));
|
|
|
|
|
|
|
|
+ //初始化
|
|
BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
BigDecimal rgwdl = BigDecimal.valueOf(0);
|
|
BigDecimal rgwdl = BigDecimal.valueOf(0);
|
|
BigDecimal speed = BigDecimal.valueOf(0);
|
|
BigDecimal speed = BigDecimal.valueOf(0);
|
|
|
|
|
|
|
|
+ //赋值
|
|
if (oneFDL != null) {
|
|
if (oneFDL != null) {
|
|
rfdl = oneFDL.getValue();
|
|
rfdl = oneFDL.getValue();
|
|
}
|
|
}
|
|
@@ -62,6 +66,7 @@ public class GetWindStationInfo {
|
|
rgwdl = oneGWDL.getValue();
|
|
rgwdl = oneGWDL.getValue();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //VO对象设置属性值
|
|
MeterInfoVO meterInfoVO = new MeterInfoVO();
|
|
MeterInfoVO meterInfoVO = new MeterInfoVO();
|
|
meterInfoVO.setTimestr(String.valueOf(i));
|
|
meterInfoVO.setTimestr(String.valueOf(i));
|
|
meterInfoVO.setDate(dateTime1);
|
|
meterInfoVO.setDate(dateTime1);
|
|
@@ -70,10 +75,11 @@ public class GetWindStationInfo {
|
|
meterInfoVO.setValue3(rgwdl);
|
|
meterInfoVO.setValue3(rgwdl);
|
|
meterInfoVO.setSpeed(speed);
|
|
meterInfoVO.setSpeed(speed);
|
|
|
|
|
|
|
|
+ //加入集合
|
|
list.add(meterInfoVO);
|
|
list.add(meterInfoVO);
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //返回VO对象集合
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -86,22 +92,31 @@ public class GetWindStationInfo {
|
|
DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
DateTime beginOfMonth = DateUtil.beginOfMonth(now);
|
|
//当年开始时间
|
|
//当年开始时间
|
|
DateTime beginOfYear = DateUtil.beginOfYear(now);
|
|
DateTime beginOfYear = DateUtil.beginOfYear(now);
|
|
- //当月天数
|
|
|
|
|
|
+ //当前日为当月第几天
|
|
int days = DateUtil.dayOfMonth(now);
|
|
int days = DateUtil.dayOfMonth(now);
|
|
|
|
|
|
- //根据时间和code查询风场日发电量,日上网电量
|
|
|
|
|
|
+ //根据时间和code查询日发电量,日上网电量,月发电量,年发电量
|
|
MeterInfoCalculating dayFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", beginOfDay));
|
|
MeterInfoCalculating dayFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_DAY").eq("date", beginOfDay));
|
|
MeterInfoCalculating monthFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_MONTH").eq("date", beginOfMonth));
|
|
MeterInfoCalculating monthFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_MONTH").eq("date", beginOfMonth));
|
|
MeterInfoCalculating yearFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_YEAR").eq("date", beginOfYear));
|
|
MeterInfoCalculating yearFDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONFDL_YEAR").eq("date", beginOfYear));
|
|
MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", beginOfDay));
|
|
MeterInfoCalculating oneSWDL = meterInfoCalculatingService.getOne(new QueryWrapper<MeterInfoCalculating>().eq("code", "DL.NX_GD_WINDSTATIONSWDL_DAY").eq("date", beginOfDay));
|
|
|
|
|
|
|
|
+ //装机容量
|
|
|
|
+ List<PowerStation> windCapacity = powerStationService.list(new QueryWrapper<PowerStation>().ne("wind_capacity", 0));
|
|
|
|
+ BigDecimal zjrl = BigDecimal.valueOf(0);
|
|
|
|
+ if (null != windCapacity) {
|
|
|
|
+ for (PowerStation powerStation : windCapacity) {
|
|
|
|
+ zjrl = zjrl.add(powerStation.getWindCapacity());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //初始化
|
|
BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
BigDecimal rfdl = BigDecimal.valueOf(0);
|
|
BigDecimal yfdl = BigDecimal.valueOf(0);
|
|
BigDecimal yfdl = BigDecimal.valueOf(0);
|
|
BigDecimal nfdl = BigDecimal.valueOf(0);
|
|
BigDecimal nfdl = BigDecimal.valueOf(0);
|
|
BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
BigDecimal rswdl = BigDecimal.valueOf(0);
|
|
|
|
|
|
|
|
+ //赋值
|
|
if (dayFDL != null) {
|
|
if (dayFDL != null) {
|
|
rfdl = dayFDL.getValue();
|
|
rfdl = dayFDL.getValue();
|
|
}
|
|
}
|
|
@@ -115,12 +130,14 @@ public class GetWindStationInfo {
|
|
rswdl = oneSWDL.getValue();
|
|
rswdl = oneSWDL.getValue();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+ //VO对象属性设置值
|
|
MeterInfoVO meterInfoVO = new MeterInfoVO();
|
|
MeterInfoVO meterInfoVO = new MeterInfoVO();
|
|
meterInfoVO.setDayFDL(rfdl);
|
|
meterInfoVO.setDayFDL(rfdl);
|
|
meterInfoVO.setMonthFDL(yfdl);
|
|
meterInfoVO.setMonthFDL(yfdl);
|
|
meterInfoVO.setYearFDL(nfdl);
|
|
meterInfoVO.setYearFDL(nfdl);
|
|
meterInfoVO.setValue2(rswdl);
|
|
meterInfoVO.setValue2(rswdl);
|
|
|
|
+ meterInfoVO.setZjrl(zjrl);
|
|
|
|
+
|
|
return meterInfoVO;
|
|
return meterInfoVO;
|
|
|
|
|
|
}
|
|
}
|