Commit 1e35da49 authored by wangxl's avatar wangxl

1

parent 6e0db94e
...@@ -182,11 +182,11 @@ public class AuthorizationController { ...@@ -182,11 +182,11 @@ public class AuthorizationController {
ComUnit comUnit = comUnitService.getById(SecurityUserHolder.getUnitId()); ComUnit comUnit = comUnitService.getById(SecurityUserHolder.getUnitId());
user.setUnitComplete(comUnitService.isComplete(comUnit)); user.setUnitComplete(comUnitService.isComplete(comUnit));
} }
List<UserMenuDTO> menuList = systemMenuService.findByRoleId(SecurityUserHolder.getRoles()); // List<UserMenuDTO> menuList = systemMenuService.findByRoleId(SecurityUserHolder.getRoles());
Map<String, Object> userInfo = new HashMap<String, Object>(3) { Map<String, Object> userInfo = new HashMap<String, Object>(3) {
{ {
put("userInfo", user); put("userInfo", user);
put("menuList", menuList); // put("menuList", menuList);
} }
}; };
return ResponseDataModel.ok(userInfo); return ResponseDataModel.ok(userInfo);
...@@ -195,8 +195,8 @@ public class AuthorizationController { ...@@ -195,8 +195,8 @@ public class AuthorizationController {
@ApiOperation(value = "获取菜单", httpMethod = "GET", notes = "获取菜单") @ApiOperation(value = "获取菜单", httpMethod = "GET", notes = "获取菜单")
@RequestMapping(value = "/getMenu") @RequestMapping(value = "/getMenu")
@GetMapping @GetMapping
public ResponseDataModel<List<UserMenuDTO>> getMenu() { public ResponseDataModel<List<UserMenuDTO>> getMenu(Integer systemType) {
List<UserMenuDTO> menuList = systemMenuService.findByRoleId(SecurityUserHolder.getRoles()); List<UserMenuDTO> menuList = systemMenuService.findByRoleId(SecurityUserHolder.getRoles(), systemType);
return ResponseDataModel.ok(menuList); return ResponseDataModel.ok(menuList);
} }
......
...@@ -20,7 +20,7 @@ public interface SystemMenuService extends BaseService<SystemMenuQueryVO, System ...@@ -20,7 +20,7 @@ public interface SystemMenuService extends BaseService<SystemMenuQueryVO, System
* @param roleId * @param roleId
* @return * @return
*/ */
List<UserMenuDTO> findByRoleId(String roleId); List<UserMenuDTO> findByRoleId(String roleId,Integer systemType);
/** 获取菜单树 /** 获取菜单树
* *
* @param * @param
......
...@@ -70,13 +70,14 @@ public class SystemMenuServiceImpl extends BaseServiceImpl<SystemMenuDAO, System ...@@ -70,13 +70,14 @@ public class SystemMenuServiceImpl extends BaseServiceImpl<SystemMenuDAO, System
} }
@Override @Override
public List<UserMenuDTO> findByRoleId(String roleId) { public List<UserMenuDTO> findByRoleId(String roleId,Integer systemType) {
QueryWrapper<SystemMenu> wrapper = new QueryWrapper<SystemMenu>(); QueryWrapper<SystemMenu> wrapper = new QueryWrapper<SystemMenu>();
List<String> resultList = new ArrayList<>(); List<String> resultList = new ArrayList<>();
String[] arr = roleId.split(","); String[] arr = roleId.split(",");
for (int i = 0; i < arr.length; i++) { for (int i = 0; i < arr.length; i++) {
resultList.add(arr[i]); resultList.add(arr[i]);
} }
wrapper.like("a.system_type", systemType);
wrapper.in("b.role_id", resultList); wrapper.in("b.role_id", resultList);
List<SystemMenuDTO> list = systemMenuDAO.findByRoleId(wrapper); List<SystemMenuDTO> list = systemMenuDAO.findByRoleId(wrapper);
//父级菜单 //父级菜单
......
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