|
@@ -2,6 +2,7 @@ package com.yonge.cooleshow.tenant.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
|
|
import com.yonge.cooleshow.biz.dal.dto.search.StudentSearch;
|
|
@@ -45,6 +46,7 @@ import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Optional;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@@ -81,17 +83,17 @@ public class StudentController extends BaseController {
|
|
IPage<StudentVo> pages = studentService.selectPage(PageUtil.getPage(query), query);
|
|
IPage<StudentVo> pages = studentService.selectPage(PageUtil.getPage(query), query);
|
|
List<StudentVo> rows = pages.getRecords();
|
|
List<StudentVo> rows = pages.getRecords();
|
|
|
|
|
|
- Map<Long, List<TenantActivationCode>> groupByUserId = new HashMap<>();
|
|
|
|
|
|
+ Map<String, List<TenantActivationCode>> groupByUserId = new HashMap<>();
|
|
if (!rows.isEmpty() && query.getTenantAlbumPurchaseId() != null) {
|
|
if (!rows.isEmpty() && query.getTenantAlbumPurchaseId() != null) {
|
|
- List<Long> studentIdList = rows.stream().map(Student::getUserId).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> studentIdList = rows.stream().map(StudentVo::getPhone).collect(Collectors.toList());
|
|
groupByUserId = tenantActivationCodeService.lambdaQuery()
|
|
groupByUserId = tenantActivationCodeService.lambdaQuery()
|
|
.eq(TenantActivationCode::getTenantAlbumPurchaseId, query.getTenantAlbumPurchaseId())
|
|
.eq(TenantActivationCode::getTenantAlbumPurchaseId, query.getTenantAlbumPurchaseId())
|
|
- .in(TenantActivationCode::getActivationUserId, studentIdList)
|
|
|
|
- .list().stream().collect(Collectors.groupingBy(TenantActivationCode::getActivationUserId));
|
|
|
|
|
|
+ .in(TenantActivationCode::getActivationPhone, studentIdList)
|
|
|
|
+ .list().stream().collect(Collectors.groupingBy(TenantActivationCode::getActivationPhone));
|
|
}
|
|
}
|
|
|
|
|
|
for (StudentVo vo : rows) {
|
|
for (StudentVo vo : rows) {
|
|
- vo.setSendActiveCodeNum(groupByUserId.getOrDefault(vo.getUserId(), new ArrayList<>()).size());
|
|
|
|
|
|
+ vo.setSendActiveCodeNum(groupByUserId.getOrDefault(Optional.ofNullable(vo.getPhone()).orElse(""), Lists.newArrayList()).size());
|
|
if (StringUtils.isNotEmpty(vo.getPhone())) {
|
|
if (StringUtils.isNotEmpty(vo.getPhone())) {
|
|
vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
|
|
vo.setPhone(vo.getPhone().replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2"));
|
|
}
|
|
}
|