Commit b80c78c3 authored by ZWT's avatar ZWT

feat(零碳): 长庆演示系统新增功能

1.修改第三方日累计数据推送表表结构,增加日累计储能放电量字段,同时修改代码对应实体及mapper文件,修改相关接口增加储能日累计放电量接收逻辑;
2.修改首页井场收益分析模块接口,修改获取储能累计放电量逻辑;
3.设计并创建井口日用电趋势表,生成对应实体类及mapper文件;
4.统计分析模块,新增本月累计节电经济效益查询接口,添加线上接口文档并完成接口冒烟测试;
5.统计分析模块,新增本月累计减碳量查询接口,添加线上接口文档并完成接口冒烟测试;
6.统计分析模块,新增光伏发电趋势查询接口,添加线上接口文档并完成接口冒烟测试;
7.统计分析模块,新增月度总览查询接口,添加线上接口文档并完成接口冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent b702602f
......@@ -26,7 +26,7 @@ public class ConfigShowEnt implements Serializable {
@XText("是否启用(1_否,0_是)")
@TableField
private Boolean isEnable;
private Integer isEnable;
@XText("日期选择")
@TableField
......
......@@ -24,7 +24,7 @@ public class ConfigShowView implements Serializable {
@XText("是否启用(1_否,0_是)")
@TableField
private Boolean isEnable;
private Integer isEnable;
@XText("日期选择")
@TableField
......
......@@ -7,6 +7,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import pps.cloud.base.service.BasePhotovoltaicPlantCloudService;
import pps.cloud.base.service.IBaseEnergyStorageCloudService;
......@@ -339,7 +340,7 @@ public class HomePageService {
* @return {@link XSingleResult}<{@link GetPowerPredictionOutput}>
*/
@XText("首页模块--光伏实时监控")
@XApiGet(anonymous = true)
@XApiGet
public XListResult<GetPowerPredictionOutput> getPowerPrediction(XContext context, GetStationViewInput input) {
String plantId = input.getPlantId();
List<GetBasePhotovoltaicPlantCloudOutput> plantList;
......@@ -353,7 +354,17 @@ public class HomePageService {
plantIds = plantList.stream()
.map(GetBasePhotovoltaicPlantCloudOutput::getId)
.collect(Collectors.toList());
DateTime day = DateUtil.beginOfDay(DateUtil.date());
DateTime date = DateUtil.date();
DateTime day = DateUtil.beginOfDay(date);
//判断是否需要启用演示配置
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
Date showTime = null;
if (ObjectUtil.isNotNull(configShowEnt)) {
day = ObjectUtil.isNotNull(configShowEnt.getIsEnable()) && configShowEnt.getIsEnable().equals(0) ? DateUtil.date(configShowEnt.getChoiceDate()) : day;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + date.toString(BusinessConstant.TIME_FORMAT));
}
//预测发电量
PredictedPowerViewMapper mapper = context.getBean(PredictedPowerViewMapper.class);
Map<String, BigDecimal> shortPowerMap = mapper.selectShortPowerHourList(PredictedPowerView.builder()
......@@ -368,6 +379,7 @@ public class HomePageService {
.stationIds(plantIds)
.stationId(plantId)
.saveDate(day)
.createDate(showTime)
.build()).stream()
.collect(Collectors.toMap(ThirdActivePowerDailyUpdateView::getHourNumber, Function.identity()));
//封装结果
......
......@@ -101,6 +101,9 @@
<if test="saveDate != null">
AND save_date = #{saveDate}
</if>
<if test="createDate != null">
AND create_date &lt;= #{createDate}
</if>
<if test="stationIds != null">
AND station_id IN
<foreach collection="stationIds" item="item" open="(" separator="," close=")">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment