xiaoyong931011
2022-07-07 bc43681f185af1edf833cf6c94833cb1cdd44a8e
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java
@@ -401,8 +401,22 @@
    @Override
    public Result viewHomePage() {
        UserEntity loginUser = LoginUserUtil.getLoginUser();
        Long companyId = LoginUserUtil.getCompanyId();
        AdminHomePageInfoVo adminHomePageInfoVo = new AdminHomePageInfoVo();
        QueryWrapper<UserRoleEntity> userRoleQueryWrapper = new QueryWrapper<>();
        userRoleQueryWrapper.eq("user_id",loginUser.getId());
        List<UserRoleEntity> userRoleEntities = userRoleMapper.selectList(userRoleQueryWrapper);
        if(CollUtil.isNotEmpty(userRoleEntities)){
            List<String> roleNames = new ArrayList<>();
            for(UserRoleEntity userRoleEntity : userRoleEntities){
                RoleEntity roleEntity = roleMapper.selectById(userRoleEntity.getRoleId());
                roleNames.add(roleEntity.getRoleName());
            }
            adminHomePageInfoVo.setRoleNames(roleNames);
        }
        QueryWrapper<ColumnEntity> columnQueryWrapper = new QueryWrapper<>();
        columnQueryWrapper.eq("company_id",companyId);
@@ -410,6 +424,7 @@
        QueryWrapper<ArticleEntity> articleQueryWrapper = new QueryWrapper<>();
        articleQueryWrapper.eq("company_id",companyId);
        articleQueryWrapper.eq("del_status",ArticleEntity.DELETE_STATUS_NO);
        adminHomePageInfoVo.setArticleNum(articleMapper.selectCount(articleQueryWrapper));
        QueryWrapper<MessageBoardEntity> messageQueryWrapper = new QueryWrapper<>();