Browse Source

换一种循环

feature/yujt_vim
yujt 5 years ago
parent
commit
76e2ce4f9b
  1. 16
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java

16
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/AppMenuServiceImpl.java

@ -155,14 +155,16 @@ public class AppMenuServiceImpl extends BaseServiceImpl<AppMenuDao, AppMenuEntit
List<AppMenuDTO> dtoList = ConvertUtils.sourceToTarget(getUserMenuList(userDetail), AppMenuDTO.class);
List<AppMenuDTO> workMenuList = Lists.newArrayList();
List<AppMenuDTO> analysisMenuList = Lists.newArrayList();
for (int i = 0; i < dtoList.size(); i++) {
AppMenuDTO dto = dtoList.get(i);
if (AppMenuCategoryEnum.WORK.getValue().equals(dto.getCategory())) {
workMenuList.add(dto);
} else if (AppMenuCategoryEnum.ANALYSIS.getValue().equals(dto.getCategory())) {
analysisMenuList.add(dto);
dtoList.forEach(dto -> {
if (dto != null) {
String category = dto.getCategory();
if (AppMenuCategoryEnum.WORK.getValue().equals(category)) {
workMenuList.add(dto);
} else if (AppMenuCategoryEnum.ANALYSIS.getValue().equals(category)) {
analysisMenuList.add(dto);
}
}
}
});
AppMenuGroupDTO group = new AppMenuGroupDTO();
group.setWorkMenu(TreeUtils.build(workMenuList));
group.setAnalysisMenu(TreeUtils.build(analysisMenuList));

Loading…
Cancel
Save