Commit e4681840 authored by duanruiming's avatar duanruiming

[add] 策略库查询优化;AI绿波优化列表查询

parent 8b4fb5d5
......@@ -594,8 +594,8 @@ public class StrategyControlServiceImpl implements StrategyControlService {
}
}
}
results.stream().distinct().sorted(Comparator.comparing(StrategyControlDataExt::getStatus).reversed()).collect(Collectors.toList());
Collections.sort(results, Comparator.comparingInt(StrategyControlDataExt::getStatus).reversed());
results.stream().distinct().collect(Collectors.toList());
return results;
}
......@@ -619,10 +619,11 @@ public class StrategyControlServiceImpl implements StrategyControlService {
currentAlgo = null;
}
if (Objects.isNull(currentAlgo)) {
// 0无策略
if (Objects.isNull(currentAlgo) || Objects.equals(0, currentAlgo)) {
ext.setOptStatus("正常");
ext.setOptMethod("畅通");
} else if (Objects.equals(1, currentAlgo)) {
} else if (Objects.equals(2, currentAlgo)) {
ext.setOptStatus("优化中");
ext.setOptMethod("均衡调控");
} else {
......@@ -1044,6 +1045,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
LambdaQueryWrapper<StrategyFactoryEntity> queryWrapper = new LambdaQueryWrapper<>();
if (Objects.isNull(vo)) {
queryWrapper.orderByDesc(StrategyFactoryEntity::getId);
List<StrategyFactoryEntity> result = strategyFactoryMapper.selectList(queryWrapper);
jsonViewObject.success(result);
} else {
......@@ -1063,6 +1065,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if (StringUtils.isNotBlank(vo.getCompany())) {
queryWrapper.eq(StrategyFactoryEntity::getCompany, vo.getCompany());
}
queryWrapper.orderByDesc(StrategyFactoryEntity::getId);
Page<StrategyFactoryEntity> result = strategyFactoryMapper.selectPage(page, queryWrapper);
jsonViewObject.success(result);
}
......@@ -1080,7 +1083,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
queryWrapper.eq(StrategyFactoryEntity::getStrategyNo, entity.getStrategyNo());
List<StrategyFactoryEntity> entities = strategyFactoryMapper.selectList(queryWrapper);
if (Objects.nonNull(entities) && entities.size() > 0) {
return jsonViewObject.fail("策略编号重复");
return jsonViewObject.success("策略编号重复, 请修改策略编号");
}
strategyFactoryMapper.insert(entity);
}
......
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