puzhibing
2026-02-28 03095792c6a0ee4bae4cd7052b89a763b3d7ed3e
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);