(update)find-module-list 增加根据menuSort来判断是否启用后端排序

yun-zuoyi
nies 4 years ago
parent 3c95407292
commit 798c964211

@ -155,15 +155,18 @@ public class AuthController extends CoreBaseController {
*/
@GetMapping(value = "/menu/find-module-list/{parentId}")
@ApiOperation(value = "获取登录用户功能权限信息", notes = "获取首页权限信息")
public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId) {
public ResultBean findMenuModuleList(@PathVariable("parentId") String parentId, Integer menuSort) {
try {
ValidatorBean.checkIsNumber(parentId, "父节点不能为空");
List<SysMenu> result = memTreeService.packTreeSysMenuByUserIdAndParentId(getSessionUser().getUser().getId(), Long.parseLong(parentId));
for (SysMenu sysMenu : result) {
sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()));
//如果menuSort为0,则不用通过menuSort字段进行排序
if (menuSort != 0) {
for (SysMenu sysMenu : result) {
sysMenu.setChildList(sysMenu.getChildList().stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList()));
}
result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList());
}
result = result.stream().sorted(Comparator.comparing(SysMenu::getMenuSort)).collect(Collectors.toList());
result = sysMenuService.setLanguageSysMenuName(AuthUtil.getSessionUser().getLanguageCode(), result);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(result);
} catch (ImppBusiException busExcep) {

Loading…
Cancel
Save