From 6512fdd9c725c9b6cf5436df958e4fdf81ad82d0 Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期六, 28 二月 2026 18:56:44 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/Robotaxi

---
 xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
index 63fbf3c..0422a79 100644
--- a/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
+++ b/xp-robotaxi-account-boot/src/main/java/com/xiaopeng/account/service/impl/XpOperationsUserServiceImpl.java
@@ -1,6 +1,7 @@
 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;
@@ -158,20 +159,23 @@
         }
 
         // 8. 查询角色信息
-        List<XpOperationsUserWithRoleVO> userWithRoles = xpOperationsRoleMapper.selectUsersWithRoleByIds(Collections.singletonList(userId));
-        if (!CollectionUtils.isEmpty(userWithRoles)) {
-            List<XpOperationsUserProfileVO.RoleInfoVO> roleVOs = userWithRoles.stream()
-                    .filter(r -> r.getRoleId() != null)
+        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)
                     .map(r -> {
                         XpOperationsUserProfileVO.RoleInfoVO roleVO = new XpOperationsUserProfileVO.RoleInfoVO();
-                        roleVO.setRoleId(r.getRoleId());
+                        roleVO.setRoleId(r.getId());
                         roleVO.setRoleName(r.getRoleName());
                         return roleVO;
                     })
                     .collect(Collectors.toList());
             vo.setRoles(roleVOs);
         }
-
         return vo;
     }
 
@@ -183,6 +187,7 @@
         //保存审核记录
         XpQualificationAudit xpQualificationAudit = BeanUtil.copyProperties(dto, XpQualificationAudit.class, "id");
         xpQualificationAudit.setAuditStatus(1);
+        xpQualificationAudit.setOperationsUserId(dto.getId());
         xpQualificationAuditService.save(xpQualificationAudit);
     }
 
@@ -203,7 +208,7 @@
                 .in(XpOperationsRole::getOperationsUserId, operationsUserIds));
 
         if(!CollectionUtils.isEmpty(xpOperationsRoles)){
-            List<Long> roleIds = xpOperationsRoles.stream().map(XpOperationsRole::getRoleId).collect(Collectors.toList());
+            List<Long> roleIds = xpOperationsRoles.stream().map(XpOperationsRole::getRoleId).distinct().collect(Collectors.toList());
             // 查询列表关联的所有角色
             List<SysRole> sysRoles = sysRoleMapper.selectList(Wrappers.lambdaQuery(SysRole.class)
                     .in(SysRole::getId, roleIds));
@@ -213,6 +218,10 @@
                 Map<Long, List<SysRole>> map = new HashMap<>();
                 for (XpOperationsRole xpOperationsRole : xpOperationsRoles) {
                     List<SysRole> sysRoleList = sysRoles.stream().filter(sysRole -> sysRole.getId().equals(xpOperationsRole.getRoleId())).collect(Collectors.toList());
+                    List<SysRole> roleList = map.get(xpOperationsRole.getOperationsUserId());
+                    if(!CollectionUtils.isEmpty(roleList)){
+                        sysRoleList.addAll(roleList);
+                    }
                     map.put(xpOperationsRole.getOperationsUserId(), sysRoleList);
                 }
                 // 角色名称匹配

--
Gitblit v1.7.1