Commit 16382ef5 authored by ZWT's avatar ZWT

feat(零碳): 长庆

1.修改极短期间开预测定时任务逻辑,解决优化后部分优化结果时间段过短问题;
2.修改心知天气气象数据获取及接收定时任务,解决天气数据通过邮件下载后,部分数据精度丢失问题;
3.修改首页各个接口逻辑,对小数类型字段进行处理,修改首页接口,增加小时保留两位四舍五入逻辑,同时解决线路详情接口部分查询逻辑报错问题;

BREAKING CHANGE: 无

Closes 无

[skip ci]
parent 3cd3f119
......@@ -82,7 +82,7 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
List<SpaceOptimizeDurationDTO> durationDTOList = new ArrayList<>(128);
List<SpaceOptimizeDurationDTO> unOptimizeDurationList = new ArrayList<>(128);
//取当前时间
DateTime startDate = DateUtil.beginOfDay(DateTime.now().offset(DateField.DAY_OF_MONTH, 2));
DateTime startDate = DateUtil.beginOfDay(DateTime.now());
//取生效中的基础间开
List<SpaceInstitutionDetailEnt> detailEntList = this.getEffectiveSpaceInstitution(context, startDate.toString());
//取线路ID和制度ID
......@@ -385,8 +385,11 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
DateTime openTimeWeight = weightDuration.getOpenTime();
DateTime closeTimeWeight = weightDuration.getCloseTime();
long duration = weightDuration.getDuration();
//优化时间段是否包含开井时间段
boolean include = false;
int except = 0;
int includeIndex = 0;
//计算排除次数
int exceptSize = 0;
for (int i = 0; i < closeList.size(); i++) {
SpaceOptimizeDurationDTO close = closeList.get(i);
Date openTime = close.getOpenTime();
......@@ -394,11 +397,12 @@ public class SpaceOptimizeShortPeriodService extends SpaceOptimizeBaseService {
if (DateUtil.compare(openTime, openTimeWeight) <= 0 && DateUtil.compare(closeTime, closeTimeWeight) >= 0) {
//可优化时间段在开井范围内跳过
include = true;
includeIndex = i;
break;
}
if (DateUtil.compare(openTime, closeTimeWeight) >= 0 || DateUtil.compare(closeTime, openTimeWeight) <= 0) {
//判断时间段是否在开井范围之外
except++;
exceptSize++;
continue;
}
if (DateUtil.isIn(openTime, openTimeWeight, closeTimeWeight)) {
......
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