Commit f40d31e4 authored by duanruiming's avatar duanruiming

[add] 绿波优化监测数据结束优化

parent 1f7be484
......@@ -138,11 +138,12 @@ public class GreenBeltServiceImpl implements GreenBeltInfoService {
detail.setStartTime(dirDataHistPO.getStartTime());
detail.setGreenTimeRatio(greenTimeRatio);
for (GreenBeltKeyCrossFlowTimeVO.Detail optResult : optResults) {
Integer curDir = GreenBeltDirEnum.getInDir(optResult.getDir());
if (StringUtils.equalsIgnoreCase("cancel", optResult.getDir()) && Objects.equals(curDir, dirType)
if (StringUtils.equalsIgnoreCase("cancel", optResult.getDir())
&& dirDataHistPO.getStartTime().getTime() == optResult.getStartTime().getTime()) {
greenTimeRatio = 0.0;
}
Integer curDir = GreenBeltDirEnum.getInDir(optResult.getDir());
if (StringUtils.equalsIgnoreCase(crossId, optResult.getCrossId()) && Objects.equals(curDir, dirType)
&& dirDataHistPO.getStartTime().getTime() == optResult.getStartTime().getTime()) {
detail.setGreenTimeRatio(optResult.getGreenTimeRatio() * 100);
......@@ -262,7 +263,6 @@ public class GreenBeltServiceImpl implements GreenBeltInfoService {
LambdaQueryWrapper<StrategyGreenOptHistEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(StrategyGreenOptHistEntity::getGreenId, greenId);
queryWrapper.ge(StrategyGreenOptHistEntity::getControlTime, startOfDay);
queryWrapper.ge(StrategyGreenOptHistEntity::getControlMethod, 1);
List<StrategyGreenOptHistEntity> entities = strategyGreenOptHistMapper.selectList(queryWrapper);
if (!CollectionUtils.isEmpty(greenwaveHistPOS)) {
Map<String, List<GreenwaveHistPO>> greenDirMap = greenwaveHistPOS.stream().collect(Collectors.groupingBy(GreenwaveHistPO::getRoadDirection));
......@@ -289,7 +289,7 @@ public class GreenBeltServiceImpl implements GreenBeltInfoService {
&& minuteDate.getTime() == startTimeminuteDate.getTime()) {
greenWidthTime = entity.getGreenWidthTime();
}
if (entity.getControlMethod() <= 0) {
if (entity.getControlMethod() < 0 && minuteDate.getTime() == startTimeminuteDate.getTime()) {
greenWidthTime = 0.0;
}
}
......
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