dzx преди 3 седмици
родител
ревизия
8a4c7c2fc1

+ 3 - 0
src/main/java/com/xjrsoft/module/system/dto/MenuTreeDto.java

@@ -36,4 +36,7 @@ public class MenuTreeDto {
 
     @ApiModelProperty("是否显示在服务中心(0:否 1:是)")
     private Integer isShowServce;
+
+    @ApiModelProperty("学生userId")
+    private Long studentUserId;
 }

+ 5 - 1
src/main/java/com/xjrsoft/module/system/service/impl/MenuServiceImpl.java

@@ -270,9 +270,13 @@ public class MenuServiceImpl extends MPJBaseServiceImpl<MenuMapper, Menu> implem
             List<XjrMenuGroup> xjrMenuGroupMenu = xjrMenuGroupSetService.getXjrMenuGroupMenu();
             Set<Long> menuIds = xjrMenuGroupMenu.stream().map(XjrMenuGroup::getXjrMenuId).collect(Collectors.toSet());
             menuGroupMap.putAll(xjrMenuGroupMenu.stream().collect(Collectors.toMap(XjrMenuGroup::getXjrMenuId, XjrMenuGroup::getXjrMenuGroupSetId)));
+            Long userId = StpUtil.getLoginIdAsLong();
+            if(dto.getStudentUserId() != null && roleIds.contains(RoleEnum.PARENT.getCode())){
+                userId = dto.getStudentUserId();
+            }
             List<WhitelistManagement> managementList = whitelistManagementService.list(
                     new QueryWrapper<WhitelistManagement>().lambda()
-                            .eq(WhitelistManagement::getUserId, StpUtil.getLoginIdAsLong())
+                            .eq(WhitelistManagement::getUserId, userId)
             );
             for (XjrMenuGroup menuGroupMenu : xjrMenuGroupMenu) {
                 menuDisabledMap.put(menuGroupMenu.getXjrMenuId(), 0);