Commit 22facbbd authored by ZWT's avatar ZWT

feat(吉林演示): 松原

1.排查并修复各时段间开优化功能执行异常导致未执行间开优化问题;
2.排查并修复15天间开优化功能执行后,优化结果时间段展示错乱问题;
3.排查并修复光伏功率预测展示功能,实际功率未展示问题;
4.排查并修复天气数据获取服务,数据处理后入库缺少数据问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 144175cf
......@@ -137,12 +137,13 @@ public class PlantPredictedPowerDataService {
@XText("test")
@XApiPost(anonymous = true)
public XServiceResult test(XContext context, DoPlantPredictedPowerDataInput input) {
ThirdDataAccessCloudServiceImpl bean = context.getBean(ThirdDataAccessCloudServiceImpl.class);
bean.test(context);
bean.test2(context);
PlantPredictedPowerCloudServiceImpl bean1 = context.getBean(PlantPredictedPowerCloudServiceImpl.class);
bean1.test(context);
StationDailyCloudServiceImpl bean2 = context.getBean(StationDailyCloudServiceImpl.class);
bean2.test(context);
ThirdDataAccessCloudServiceImpl bean = context.getBean(ThirdDataAccessCloudServiceImpl.class);
bean.test(context);
return XServiceResult.OK;
}
......
......@@ -289,6 +289,43 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
});
}
/**
* 第三方光伏日发电量定时任务
*
* @param context 上下文
* @return {@link XServiceResult}
*/
public XServiceResult test2(XContext context) {
IThirdPhotovoltaicPowerCloudService service = context.getBean(IThirdPhotovoltaicPowerCloudService.class);
XListResult<GetThirdPhotovoltaicPowerOutput> result = service.getPhotovoltaicPowerList(context, GetThirdPhotovoltaicPowerInput.builder()
.createDate(DateUtil.beginOfDay(DateUtil.yesterday()))
.build());
result.throwIfFail();
List<GetThirdPhotovoltaicPowerViewOutput> outputs = XCopyUtils.copyNewList(result.getResult(), GetThirdPhotovoltaicPowerViewOutput.class);
if (CollUtil.isEmpty(outputs)) {
return XServiceResult.OK;
}
BigDecimal photovoltaicPower;
List<ThirdPhotovoltaicPowerView> dtoList = new ArrayList<>(outputs.size());
for (GetThirdPhotovoltaicPowerViewOutput output : outputs) {
photovoltaicPower = Optional.ofNullable(output.getPhotovoltaicPower()).orElse(BigDecimal.ZERO);
photovoltaicPower = photovoltaicPower.compareTo(BigDecimal.ZERO) < 0 ? BigDecimal.ZERO : photovoltaicPower;
dtoList.add(
ThirdPhotovoltaicPowerView.builder()
.stationName(output.getStationName())
.createDate(output.getCreateDate())
.photovoltaicPower(photovoltaicPower)
.systemSource("SY")
.build()
);
}
return XTransactionHelper.begin(context, () -> {
ThirdPhotovoltaicPowerViewMapper mapper = context.getBean(ThirdPhotovoltaicPowerViewMapper.class);
mapper.batchInsertList(dtoList);
return XServiceResult.OK;
});
}
/**
* 第三方光伏日发电量定时任务
*
......@@ -303,7 +340,9 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
switch (oilFieldCode) {
case BusinessConstant.ENV_SY:
IThirdPhotovoltaicPowerCloudService service = context.getBean(IThirdPhotovoltaicPowerCloudService.class);
XListResult<GetThirdPhotovoltaicPowerOutput> result = service.getPhotovoltaicPowerList(context, new GetThirdPhotovoltaicPowerInput());
XListResult<GetThirdPhotovoltaicPowerOutput> result = service.getPhotovoltaicPowerList(context, GetThirdPhotovoltaicPowerInput.builder()
.createDate(DateUtil.beginOfDay(DateUtil.yesterday()))
.build());
result.throwIfFail();
outputs = XCopyUtils.copyNewList(result.getResult(), GetThirdPhotovoltaicPowerViewOutput.class);
break;
......
package pps.cloud.middle.service.data.third_photovoltaic_power;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import xstartup.annotation.XText;
import java.math.BigDecimal;
......@@ -13,6 +16,9 @@ import java.util.Date;
* @date 2024/10/19
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GetThirdPhotovoltaicPowerInput {
@XText("ID")
private Long id;
......
package pps.core.middle.service;
import cn.hutool.core.date.DateUtil;
import pps.cloud.middle.service.IThirdPhotovoltaicPowerCloudService;
import pps.cloud.middle.service.data.third_photovoltaic_power.GetThirdPhotovoltaicPowerInput;
import pps.cloud.middle.service.data.third_photovoltaic_power.GetThirdPhotovoltaicPowerOutput;
......@@ -26,7 +25,7 @@ public class ThirdPhotovoltaicPowerCloudServiceImpl implements IThirdPhotovoltai
public XListResult<GetThirdPhotovoltaicPowerOutput> getPhotovoltaicPowerList(XContext context, GetThirdPhotovoltaicPowerInput input) {
ThirdPhotovoltaicPowerViewMapper viewMapper = context.getBean(ThirdPhotovoltaicPowerViewMapper.class);
List<ThirdPhotovoltaicPowerView> list = viewMapper.selectPhotovoltaicPowerList(ThirdPhotovoltaicPowerView.builder()
.createDate(DateUtil.beginOfDay(DateUtil.yesterday()))
.createDate(input.getCreateDate())
.build());
return XListResult.success(XCopyUtils.copyNewList(list, GetThirdPhotovoltaicPowerOutput.class));
}
......
......@@ -34,10 +34,15 @@
<select id="selectPhotovoltaicPowerList" parameterType="pps.core.middle.entity.ThirdPhotovoltaicPowerView" resultMap="BaseResultMap">
SELECT S.SYSTEM_STATION_NAME AS STATION_NAME,
AVG(T.PHOTOVOLTAIC_POWER) AS PHOTOVOLTAIC_POWER,
#{createDate} AS CREATE_DATE
TRUNC( T.CREATE_DATE ) AS CREATE_DATE
FROM STATION_MAPPING S
JOIN THIRD_PHOTOVOLTAIC_POWER T ON S.WELL_SITE_NAME = T.STATION_NAME
WHERE TRUNC(CREATE_DATE) = #{createDate}
GROUP BY S.SYSTEM_STATION_NAME
<where>
<if test="createDate != null">
AND TRUNC(CREATE_DATE) = #{createDate}
</if>
</where>
GROUP BY S.SYSTEM_STATION_NAME,
T.CREATE_DATE
</select>
</mapper>
\ No newline at end of file
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