| | |
| | | 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); |
| | |
| | | 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); |