Commit 142c549e authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.对接第三方接口,接入第三方数据,完成Token接口验证,抽取公用方法封装调用工具类;
2.对接第三方接口,完成获取日耗电日产液等信息接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
3.对接第三方接口,完成获取有功功率数据信息接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
4.对接第三方接口,完成获取甘特图数据接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
5.对接第三方接口,完成本日累计数据接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
6.对接第三方接口,完成光伏发电量接口调用,创建数据表,同时生成对应代码,开发定时任务及对外接口,完成第三方数据接入及系统展示功能,添加线上接口文档并完成接口及定时任务冒烟测试;
7.对接第三方接口,完成三叠登录接口调用,添加线上接口文档并完成接口及定时任务冒烟测试;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent afc5480a
...@@ -45,19 +45,9 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService ...@@ -45,19 +45,9 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService
//取生效中的基础间开 //取生效中的基础间开
List<SpaceInstitutionDetailEnt> detailEntList = super.getEffectiveSpaceInstitution(context, date.toString(BusinessConstant.DATE_FORMAT_DAY)); List<SpaceInstitutionDetailEnt> detailEntList = super.getEffectiveSpaceInstitution(context, date.toString(BusinessConstant.DATE_FORMAT_DAY));
SpaceOptimizeLineRelation relation = super.getOptimizeLineRelation(context, detailEntList); SpaceOptimizeLineRelation relation = super.getOptimizeLineRelation(context, detailEntList);
//取年份
int year = date.year();
//月份要加一 //月份要加一
int monthIndex = date.month(); int monthIndex = date.month();
int monthNum = monthIndex + 1; int monthNum = monthIndex + 1;
int lastMonthNum = monthIndex;
int lastYear = year;
if (monthIndex == 0) {
lastMonthNum = 12;
lastYear = year - 1;
}
String month = BaseUtils.getMonthString(monthNum);
String lastMonth = BaseUtils.getMonthString(lastMonthNum);
List<SpaceOptimizePeriodDTO> periodDTOList = new ArrayList<>(32); List<SpaceOptimizePeriodDTO> periodDTOList = new ArrayList<>(32);
List<SpaceOptimizeWellheadDTO> wellheadDTOList = new ArrayList<>(64); List<SpaceOptimizeWellheadDTO> wellheadDTOList = new ArrayList<>(64);
List<SpaceOptimizeDurationDTO> durationDTOList = new ArrayList<>(128); List<SpaceOptimizeDurationDTO> durationDTOList = new ArrayList<>(128);
...@@ -78,8 +68,8 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService ...@@ -78,8 +68,8 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService
relation.getWellheadsByInstitutionIdIdMap().get(detail.getId()), detail, monthNum, periodId, relation.getWellheadsByInstitutionIdIdMap().get(detail.getId()), detail, monthNum, periodId,
DynamicQueryPlantPredictedPowerInput.builder() DynamicQueryPlantPredictedPowerInput.builder()
.plantIds(relation.getPlantIdsByLineIdMap().get(detail.getLineId())) .plantIds(relation.getPlantIdsByLineIdMap().get(detail.getLineId()))
.yearTime(String.valueOf(year)) .startTime(date.toString(BusinessConstant.DATE_FORMAT_DAY))
.monthTime(month) .endTime(optimizeDeadline.toString(BusinessConstant.DATE_FORMAT_DAY))
.dateType(BusinessConstant.ZERO) .dateType(BusinessConstant.ZERO)
.build()); .build());
break; break;
...@@ -89,13 +79,13 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService ...@@ -89,13 +79,13 @@ public class SpaceOptimizeLongCloudServiceImpl extends SpaceOptimizeBaseService
relation.getStorageAvgMap(), detail, periodId, relation.getStorageAvgMap(), detail, periodId,
DynamicQueryStoragePredictedPowerInput.builder() DynamicQueryStoragePredictedPowerInput.builder()
.storageIds(relation.getStorageIdsByLineIdMap().get(detail.getLineId())) .storageIds(relation.getStorageIdsByLineIdMap().get(detail.getLineId()))
.yearTime(String.valueOf(lastYear)) .startTime(DateUtil.offsetDay(date, -10).toString(BusinessConstant.DATE_FORMAT_DAY))
.monthTime(lastMonth) .endTime(DateUtil.offsetDay(optimizeDeadline, -10).toString(BusinessConstant.DATE_FORMAT_DAY))
.build(), .build(),
DynamicQueryPlantPredictedPowerInput.builder() DynamicQueryPlantPredictedPowerInput.builder()
.plantIds(relation.getPlantIdsByLineIdMap().get(detail.getLineId())) .plantIds(relation.getPlantIdsByLineIdMap().get(detail.getLineId()))
.yearTime(String.valueOf(year)) .startTime(date.toString(BusinessConstant.DATE_FORMAT_DAY))
.monthTime(month) .endTime(optimizeDeadline.toString(BusinessConstant.DATE_FORMAT_DAY))
.dateType(BusinessConstant.ZERO) .dateType(BusinessConstant.ZERO)
.build()); .build());
break; break;
......
...@@ -16,9 +16,11 @@ import pps.core.auth.HttpRequestClient; ...@@ -16,9 +16,11 @@ import pps.core.auth.HttpRequestClient;
import pps.core.prediction.constant.ThirdPartyApiConstant; import pps.core.prediction.constant.ThirdPartyApiConstant;
import pps.core.prediction.entity.PlantPredictedPowerDataEnt; import pps.core.prediction.entity.PlantPredictedPowerDataEnt;
import pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt; import pps.core.prediction.entity.PlantPredictedPowerLongTermDataEnt;
import pps.core.prediction.entity.PlantPredictedPowerMidTermEnt;
import pps.core.prediction.entity.WellheadDailyProductionSituationView; import pps.core.prediction.entity.WellheadDailyProductionSituationView;
import pps.core.prediction.mapper.PlantPredictedPowerDataMapper; import pps.core.prediction.mapper.PlantPredictedPowerDataMapper;
import pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper; import pps.core.prediction.mapper.PlantPredictedPowerLongTermDataMapper;
import pps.core.prediction.mapper.PlantPredictedPowerMidTermMapper;
import pps.core.prediction.mapper.WellheadDailyProductionSituationViewMapper; import pps.core.prediction.mapper.WellheadDailyProductionSituationViewMapper;
import pps.core.prediction.service.data.wellhead_daily_production_situation.WellheadDailyProductionSituationJob; import pps.core.prediction.service.data.wellhead_daily_production_situation.WellheadDailyProductionSituationJob;
import pps.core.prediction.utils.ServiceUtil; import pps.core.prediction.utils.ServiceUtil;
...@@ -65,22 +67,16 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower ...@@ -65,22 +67,16 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower
if (CollUtil.isNotEmpty(plantIds)) { if (CollUtil.isNotEmpty(plantIds)) {
switch (dateType) { switch (dateType) {
case 0: case 0:
PlantPredictedPowerLongTermDataMapper longTermDataMapper = context.getBean(PlantPredictedPowerLongTermDataMapper.class); PlantPredictedPowerMidTermMapper longTermDataMapper = context.getBean(PlantPredictedPowerMidTermMapper.class);
list = longTermDataMapper.selectList( longTermDataMapper.selectList(
new QueryWrapper<PlantPredictedPowerLongTermDataEnt>() new QueryWrapper<PlantPredictedPowerMidTermEnt>()
.select("hour_time", .select("power",
"min_time", "data_date AS create_time")
"IFNULL( AVG( power ), 0 ) AS power",
"STR_TO_DATE( CONCAT( hour_time, ':', min_time ), '%H:%i:%s' ) AS create_time")
.lambda() .lambda()
.eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerLongTermDataEnt::getPlantId, plantId) .eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerMidTermEnt::getPlantId, plantId)
.in(PlantPredictedPowerLongTermDataEnt::getPlantId, plantIds) .in(PlantPredictedPowerMidTermEnt::getPlantId, plantIds)
.eq(StringUtils.isNotBlank(yearTime), PlantPredictedPowerLongTermDataEnt::getYearTime, yearTime) .between(!StringUtils.isAnyBlank(startTime, endTime), PlantPredictedPowerMidTermEnt::getDataDate, startTime, endTime)
.eq(StringUtils.isNotBlank(monthTime), PlantPredictedPowerLongTermDataEnt::getMonthTime, monthTime) .orderByAsc(PlantPredictedPowerMidTermEnt::getDataDate)
.between(!StringUtils.isAnyBlank(startTime, endTime), PlantPredictedPowerLongTermDataEnt::getDataDate, startTime, endTime)
.groupBy(PlantPredictedPowerLongTermDataEnt::getHourTime,
PlantPredictedPowerLongTermDataEnt::getMinTime)
.orderByAsc(PlantPredictedPowerLongTermDataEnt::getHourTime, PlantPredictedPowerLongTermDataEnt::getMinTime)
); );
break; break;
case 1: case 1:
...@@ -90,7 +86,7 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower ...@@ -90,7 +86,7 @@ public class PlantPredictedPowerCloudServiceImpl implements IPlantPredictedPower
.select("hour_time", .select("hour_time",
"min_time", "min_time",
"IFNULL( AVG( power ), 0 ) AS power", "IFNULL( AVG( power ), 0 ) AS power",
"STR_TO_DATE( CONCAT( hour_time, ':', min_time ), '%H:%i:%s' ) AS create_time") "data_date AS create_time")
.lambda() .lambda()
.eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerDataEnt::getPlantId, plantId) .eq(StringUtils.isNotBlank(plantId), PlantPredictedPowerDataEnt::getPlantId, plantId)
.in(PlantPredictedPowerDataEnt::getPlantId, plantIds) .in(PlantPredictedPowerDataEnt::getPlantId, plantIds)
......
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