| | |
| | | package com.xiaopeng.account.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | } |
| | | |
| | | // 8. 查询角色信息 |
| | | List<XpOperationsRole> xpOperationsRoles = xpOperationsRoleMapper |
| | | .selectList(new LambdaQueryWrapper<XpOperationsRole>().eq(XpOperationsRole::getOperationsUserId, userId)); |
| | | if (CollUtil.isNotEmpty(xpOperationsRoles)) { |
| | | List<Long> roleIds = xpOperationsRoles.stream().map(XpOperationsRole::getRoleId).collect(Collectors.toList()); |
| | | List<SysRole> sysRoles = sysRoleMapper.selectList(Wrappers.lambdaQuery(SysRole.class) |
| | | .in(SysRole::getId, roleIds)); |
| | | List<XpOperationsUserProfileVO.RoleInfoVO> roleVOs = sysRoles.stream() |
| | | .filter(r -> r.getId() != null) |
| | | List<XpOperationsUserWithRoleVO> userWithRoles = xpOperationsRoleMapper.selectUsersWithRoleByIds(Collections.singletonList(userId)); |
| | | if (!CollectionUtils.isEmpty(userWithRoles)) { |
| | | List<XpOperationsUserProfileVO.RoleInfoVO> roleVOs = userWithRoles.stream() |
| | | .filter(r -> r.getRoleId() != null) |
| | | .map(r -> { |
| | | XpOperationsUserProfileVO.RoleInfoVO roleVO = new XpOperationsUserProfileVO.RoleInfoVO(); |
| | | roleVO.setRoleId(r.getId()); |
| | | roleVO.setRoleId(r.getRoleId()); |
| | | roleVO.setRoleName(r.getRoleName()); |
| | | return roleVO; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | vo.setRoles(roleVOs); |
| | | } |
| | | |
| | | return vo; |
| | | } |
| | | |
| | |
| | | //保存审核记录 |
| | | XpQualificationAudit xpQualificationAudit = BeanUtil.copyProperties(dto, XpQualificationAudit.class, "id"); |
| | | xpQualificationAudit.setAuditStatus(1); |
| | | xpQualificationAudit.setOperationsUserId(dto.getId()); |
| | | xpQualificationAuditService.save(xpQualificationAudit); |
| | | } |
| | | |