Commit f7a3a3f3 authored by ZWT's avatar ZWT

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

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

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 9392f642
......@@ -81,6 +81,54 @@ public class ServiceUtil {
return token;
}
/**
* 获得预测功率输出
*
* @param context 上下文
* @param inputTimeStr 输入时间str
* @param stationId 工作站id
* @param offsetDay 偏移日
* @param cycle 周期
* @return {@link List }<{@link GetPredictedPowerOutput }>
*/
public static List<GetPredictedPowerOutput> getPredictedPowerOutput(XContext context, String inputTimeStr, String stationId, int offsetDay, int cycle) {
//判断是否需要启用演示配置
DateTime date = DateUtil.date();
DateTime inputTime;
if (CharSequenceUtil.isBlank(inputTimeStr)) {
inputTime = DateUtil.beginOfDay(date);
} else {
inputTime = DateUtil.parse(inputTimeStr, BusinessConstant.DATE_FORMAT_DAY);
}
//时间出力截至时间
Date showTime = date;
DateTime day = inputTime;
int betweenDay = 0;
//输入时间等于当日时间时,进行演示开关校验
if (0 == DateUtil.compare(DateUtil.beginOfDay(date), inputTime)) {
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
if (ObjectUtil.isAllNotEmpty(configShowEnt, configShowEnt.getIsEnable(), configShowEnt.getChoiceDate())) {
day = configShowEnt.getIsEnable().equals(0) ? DateUtil.date(configShowEnt.getChoiceDate()) : inputTime;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + date.toString(BusinessConstant.TIME_FORMAT));
//计算偏移
betweenDay = (int) DateUtil.betweenDay(inputTime, day, false);
if (DateUtil.compare(day, inputTime) > 0) {
betweenDay = -betweenDay;
}
}
}
DateTime beginTime = DateUtil.offsetMinute(day, -1);
DateTime endTime = DateUtil.offsetDay(day, offsetDay);
showTime = DateUtil.offsetDay(showTime, offsetDay);
//查预测功率
Map<Date, BigDecimal> predictedMap = getPredictedPowerMap15(context, cycle, stationId, beginTime, endTime);
//查实际功率
Map<Date, BigDecimal> powerMap = getActivePowerMap15(context, stationId, beginTime, showTime);
return getPowerOutput(day, endTime, betweenDay, date, predictedMap, powerMap);
}
/**
* 查15分钟电站预测功率
*
......@@ -198,54 +246,6 @@ public class ServiceUtil {
return outputs;
}
/**
* 获得预测功率输出
*
* @param context 上下文
* @param inputTimeStr 输入时间str
* @param stationId 工作站id
* @param offsetDay 偏移日
* @param cycle 周期
* @return {@link List }<{@link GetPredictedPowerOutput }>
*/
public static List<GetPredictedPowerOutput> getPredictedPowerOutput(XContext context, String inputTimeStr, String stationId, int offsetDay, int cycle) {
//判断是否需要启用演示配置
DateTime date = DateUtil.date();
DateTime inputTime;
if (CharSequenceUtil.isBlank(inputTimeStr)) {
inputTime = DateUtil.beginOfDay(date);
} else {
inputTime = DateUtil.parse(inputTimeStr, BusinessConstant.DATE_FORMAT_DAY);
}
//时间出力截至时间
Date showTime = date;
DateTime day = inputTime;
int betweenDay = 0;
//输入时间等于当日时间时,进行演示开关校验
if (0 == DateUtil.compare(DateUtil.beginOfDay(date), inputTime)) {
ConfigShowMapper configMapper = context.getBean(ConfigShowMapper.class);
ConfigShowEnt configShowEnt = configMapper.selectOne(new LambdaQueryWrapper<ConfigShowEnt>()
.last("LIMIT 1"));
if (ObjectUtil.isAllNotEmpty(configShowEnt, configShowEnt.getIsEnable(), configShowEnt.getChoiceDate())) {
day = configShowEnt.getIsEnable().equals(0) ? DateUtil.date(configShowEnt.getChoiceDate()) : inputTime;
showTime = DateUtil.parse(day.toString(BusinessConstant.DATE_FORMAT_DAY) + " " + date.toString(BusinessConstant.TIME_FORMAT));
//计算偏移
betweenDay = (int) DateUtil.betweenDay(inputTime, day, false);
if (DateUtil.compare(day, inputTime) > 0) {
betweenDay = -betweenDay;
}
}
}
DateTime beginTime = DateUtil.offsetMinute(day, -1);
DateTime endTime = DateUtil.offsetDay(day, offsetDay);
showTime = DateUtil.offsetDay(showTime, offsetDay);
//查预测功率
Map<Date, BigDecimal> predictedMap = getPredictedPowerMap15(context, cycle, stationId, beginTime, endTime);
//查实际功率
Map<Date, BigDecimal> powerMap = getActivePowerMap15(context, stationId, beginTime, showTime);
return getPowerOutput(day, endTime, betweenDay, date, predictedMap, powerMap);
}
/*----------------------------------- 私有方法 -----------------------------------*/
/**
......
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