| | |
| | | */ |
| | | @Override |
| | | public List<SalesDetailVO> exportData(HuiminPayQuery query) { |
| | | return baseMapper.exportData(query); |
| | | List<SalesDetailVO> records = baseMapper.exportData(query); |
| | | if (CollUtil.isNotEmpty(records)){ |
| | | List<Integer> appUserIdList = records.stream().map(SalesDetailVO::getAppUserId).collect(Collectors.toList()); |
| | | List<AppUser> appUserList = appUserClient.queryAppUserBatch(appUserIdList); |
| | | Map<Integer, AppUser> appUserMap = appUserList.stream().collect(Collectors.toMap(AppUser::getId, appUser -> appUser)); |
| | | records.forEach(item->{ |
| | | AppUser appUser = appUserMap.get(item.getAppUserId()); |
| | | if (Objects.nonNull(appUser)){ |
| | | item.setUserName(appUser.getName()); |
| | | item.setPhone(appUser.getPhone()); |
| | | } |
| | | List<TStudent> studentList = studentClient.getStudentByIds(item.getStudentId()); |
| | | if (CollUtil.isNotEmpty(studentList)){ |
| | | item.setStudentName(studentList.stream().map(TStudent::getName).collect(Collectors.joining(","))); |
| | | } |
| | | }); |
| | | } |
| | | return records; |
| | | } |
| | | } |