|
@@ -102,17 +102,18 @@ public class StudentController extends BaseController {
|
|
|
});
|
|
|
|
|
|
|
|
|
- Map<Long, List<TenantActivationCode>> groupByUserId = new HashMap<>();
|
|
|
+ Map<String, List<TenantActivationCode>> groupByPhone = new HashMap<>();
|
|
|
if (!rows.isEmpty() && query.getTenantAlbumPurchaseId() != null) {
|
|
|
- List<String> studentPhones = rows.stream().map(StudentVo::getPhone).collect(Collectors.toList());
|
|
|
- groupByUserId = tenantActivationCodeService.lambdaQuery()
|
|
|
+ List<String> studentPhones =
|
|
|
+ rows.stream().map(StudentVo::getPhone).filter(StringUtils::isNotEmpty).collect(Collectors.toList());
|
|
|
+ groupByPhone = tenantActivationCodeService.lambdaQuery()
|
|
|
.eq(TenantActivationCode::getId, query.getTenantAlbumPurchaseId())
|
|
|
.in(TenantActivationCode::getActivationPhone, studentPhones)
|
|
|
- .list().stream().collect(Collectors.groupingBy(TenantActivationCode::getActivationUserId));
|
|
|
+ .list().stream().collect(Collectors.groupingBy(TenantActivationCode::getActivationPhone));
|
|
|
}
|
|
|
|
|
|
for (StudentVo vo : rows) {
|
|
|
- vo.setSendActiveCodeNum(groupByUserId.getOrDefault(vo.getUserId(), new ArrayList<>()).size());
|
|
|
+ vo.setSendActiveCodeNum(groupByPhone.getOrDefault(vo.getPhone(), new ArrayList<>()).size());
|
|
|
if (StringUtils.isNotEmpty(vo.getPhone())) {
|
|
|
vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
|
|
|
}
|