From fc43cf5d8bfae44fa58b7398e54a21857987aae0 Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期六, 28 二月 2026 16:03:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpClockInServiceImpl.java | 25 ++++++++++++++++---------
1 files changed, 16 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..a924bc0 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
@@ -253,12 +253,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 +310,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