Commit fda6a763 authored by duanruiming's avatar duanruiming

[add] 优化监测优化次数更新

parent d3bbe9c0
......@@ -212,7 +212,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
log.error("优化策略查询失败:", e);
JsonViewObject.newInstance().fail("优化策略查询失败");
}
List<StrategyControlHistVO> sorted = results.stream().sorted(Comparator.comparing(StrategyControlHistVO::getOptTime).reversed()).collect(Collectors.toList());
List<StrategyControlHistVO> sorted = results.stream().sorted(Comparator.comparing(StrategyControlHistVO::getOptTime).reversed())
.limit(3000).collect(Collectors.toList());
return JsonViewObject.newInstance().success(sorted);
}
......@@ -398,21 +399,15 @@ public class StrategyControlServiceImpl implements StrategyControlService {
List<StrategyOptTimesDTO.Detail> content = dto.getContent();
if (!CollectionUtils.isEmpty(content)) {
Double totalTime = 0.0;
int count = 0;
for (StrategyOptTimesDTO.Detail item : content) {
totalTime += item.getOptimizeTime();
count += item.getExecuteNum();
}
Double temp = Math.floor(totalTime / 3600);
strategyOptTimesVO.setTimes(temp.intValue());
}
}
String countUrl = "http://37.12.182.29:15020/decisionPage/MonitorRadarIndicatorsInfo/getRadarCountData";
String countResult = OkHttpClientUtil.get(countUrl);
if (StringUtils.isNotBlank(countResult)) {
StrategyOptCountDTO strategyOptCountDTO = mapper.readValue(countResult, StrategyOptCountDTO.class);
StrategyOptCountDTO.Detail content = strategyOptCountDTO.getContent();
int count = content.getCongestionNum() + content.getEmptyPassNum() + content.getSpilloverNum() + content.getUnbalanceNum();
strategyOptTimesVO.setTimes(totalTime.intValue());
strategyOptTimesVO.setCount(count);
}
}
return JsonViewObject.newInstance().success(strategyOptTimesVO);
}
......
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