组件管理加排序
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
line_index id,
|
||||
LEAST(ROUND(SUM(real_time) / SUM(due_time), 2) * 100,100) integrityData
|
||||
FROM
|
||||
`r_stat_integrity_d`
|
||||
r_stat_integrity_d
|
||||
WHERE time_id between #{startTime} and #{endTime}
|
||||
GROUP BY line_index
|
||||
</select>
|
||||
@@ -35,9 +35,9 @@
|
||||
100
|
||||
) integrityData
|
||||
FROM
|
||||
`r_stat_onlinerate_d`
|
||||
r_stat_onlinerate_d
|
||||
WHERE time_id between #{startTime} and #{endTime}
|
||||
GROUP BY dev_index
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -26,10 +26,7 @@ import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -110,6 +107,7 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
||||
ComponentVO componentVO = new ComponentVO();
|
||||
componentVO.setId(dictData.getId());
|
||||
componentVO.setName(dictData.getName());
|
||||
componentVO.setSort(dictData.getSort());
|
||||
componentVO.setChildren(
|
||||
v.stream()
|
||||
.filter(fun -> Objects.equals(ComponentState.FATHER_PID, fun.getPid()))
|
||||
@@ -117,6 +115,7 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
||||
.collect(Collectors.toList()));
|
||||
result.add(componentVO);
|
||||
});
|
||||
result.sort(Comparator.comparing(ComponentVO::getSort));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -182,7 +181,7 @@ public class ComponentServiceImpl extends ServiceImpl<ComponentMapper, Component
|
||||
*/
|
||||
private List<ComponentVO> getChildCategoryList(ComponentVO currMenu, List<ComponentVO> categories) {
|
||||
return categories.stream().filter(o -> Objects.equals(o.getPid(), currMenu.getId()))
|
||||
.peek(o -> o.setChildren(getChildCategoryList(o, categories)))
|
||||
.peek(o -> o.setChildren(getChildCategoryList(o, categories))).sorted(Comparator.comparing(ComponentVO::getSort))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user