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-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java
index c0a1e41..7b3ba86 100644
--- a/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java
+++ b/xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java
@@ -169,6 +169,7 @@
         } else {
             xpClockIn.setClockInResult(1);
         }
+        xpClockIn.setAppUserId(null);
         this.updateById(xpClockIn);
         return R.ok();
     }
@@ -253,12 +254,16 @@
         List<Long> ids = appUserIdList.stream().map(Long::parseLong).collect(Collectors.toList());
         List<XpOperationsUserWithRoleVO> data = xpOperationUserClient.listByIdsWithRole(ids).getData();
         //将查询结果组装成map对象,用于循环中提取数据
-        Map<Long,XpOperationsUserWithRoleVO> map = data.stream().collect(Collectors.toMap(XpOperationsUserWithRoleVO::getId, item->item));
         for (ClockInStatisticsDto clockInStatistic : clockInStatistics) {
             String appUserId = clockInStatistic.getAppUserId();
-            XpOperationsUserWithRoleVO xpOperationsUserWithRoleVO = map.get(Long.parseLong(appUserId));
-            clockInStatistic.setName(xpOperationsUserWithRoleVO.getNickName());
-            clockInStatistic.setRoleName(xpOperationsUserWithRoleVO.getRoleName());
+            //运维账号可以拥有多个角色
+            List<XpOperationsUserWithRoleVO> collect = data.stream().filter(x->x.getId().equals(Long.parseLong(appUserId))).collect(Collectors.toList());
+            if(!collect.isEmpty()){
+                XpOperationsUserWithRoleVO xpOperationsUserWithRoleVO = collect.get(0);
+                clockInStatistic.setName(xpOperationsUserWithRoleVO.getNickName());
+            }
+            String roleName = collect.stream().map(XpOperationsUserWithRoleVO::getRoleName).collect(Collectors.joining(";"));
+            clockInStatistic.setRoleName(roleName);
             Integer shouldClockInDays = clockInStatistic.getShouldClockInDays();
             Integer clockInDays = clockInStatistic.getClockInDays();
             clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays);
@@ -306,13 +311,16 @@
         List<String> appUserIdList = clockInStatistics.stream().map(ClockInStatisticsDto::getAppUserId).collect(Collectors.toList());
         List<Long> ids = appUserIdList.stream().map(Long::parseLong).collect(Collectors.toList());
         List<XpOperationsUserWithRoleVO> data = xpOperationUserClient.listByIdsWithRole(ids).getData();
-        //将查询结果组装成map对象,用于循环中提取数据
-        Map<Long,XpOperationsUserWithRoleVO> map = data.stream().collect(Collectors.toMap(XpOperationsUserWithRoleVO::getId, item->item));
         for (ClockInStatisticsDto clockInStatistic : clockInStatistics) {
             String appUserId = clockInStatistic.getAppUserId();
-            XpOperationsUserWithRoleVO xpOperationsUserWithRoleVO = map.get(Long.parseLong(appUserId));
-            clockInStatistic.setName(xpOperationsUserWithRoleVO.getNickName());
-            clockInStatistic.setRoleName(xpOperationsUserWithRoleVO.getRoleName());
+            //运维账号可以拥有多个角色
+            List<XpOperationsUserWithRoleVO> collect = data.stream().filter(x->x.getId().equals(Long.parseLong(appUserId))).collect(Collectors.toList());
+            if(!collect.isEmpty()){
+                XpOperationsUserWithRoleVO xpOperationsUserWithRoleVO = collect.get(0);
+                clockInStatistic.setName(xpOperationsUserWithRoleVO.getNickName());
+            }
+            String roleName = collect.stream().map(XpOperationsUserWithRoleVO::getRoleName).collect(Collectors.joining(";"));
+            clockInStatistic.setRoleName(roleName);
             Integer shouldClockInDays = clockInStatistic.getShouldClockInDays();
             Integer clockInDays = clockInStatistic.getClockInDays();
             clockInStatistic.setNotClockInDays(shouldClockInDays - clockInDays);

--
Gitblit v1.7.1