|
@@ -103,8 +103,8 @@ public class StudentController extends BaseController {
|
|
|
}
|
|
|
|
|
|
//如果真实姓名字段为空 把真实姓名赋值给昵称
|
|
|
- rows.stream().forEach(r->{
|
|
|
- if (StringUtils.isEmpty(r.getRealName())){
|
|
|
+ rows.stream().forEach(r -> {
|
|
|
+ if (StringUtils.isEmpty(r.getRealName())) {
|
|
|
if (StringUtils.isNotEmpty(r.getUsername()))
|
|
|
r.setRealName(r.getUsername());
|
|
|
}
|
|
@@ -123,7 +123,7 @@ public class StudentController extends BaseController {
|
|
|
List<Long> tenantGroupIds = rows.stream().map(Student::getTenantGroupId)
|
|
|
.filter(next -> next != null && next != -1L).distinct().collect(Collectors.toList());
|
|
|
Map<Long, String> tenantGroupIdNameMap = new HashMap<>();
|
|
|
- if(!tenantGroupIds.isEmpty()){
|
|
|
+ if (!tenantGroupIds.isEmpty()) {
|
|
|
Map<Long, String> tenantGroupMap = tenantGroupService.lambdaQuery()
|
|
|
.eq(TenantGroup::getTenantId, tenantInfo.getId())
|
|
|
.in(TenantGroup::getId, tenantGroupIds)
|
|
@@ -169,12 +169,23 @@ public class StudentController extends BaseController {
|
|
|
throw new BizException("没有可导出数据");
|
|
|
}
|
|
|
|
|
|
+ List<Long> tenantGroupIds = rows.stream().map(Student::getTenantGroupId)
|
|
|
+ .filter(next -> next != null && next != -1L).distinct().collect(Collectors.toList());
|
|
|
+ Map<Long, String> tenantGroupIdNameMap = new HashMap<>();
|
|
|
+ if (!tenantGroupIds.isEmpty()) {
|
|
|
+ Map<Long, String> tenantGroupMap = tenantGroupService.lambdaQuery()
|
|
|
+ .eq(TenantGroup::getTenantId, tenantInfo.getId())
|
|
|
+ .in(TenantGroup::getId, tenantGroupIds)
|
|
|
+ .list().stream().collect(Collectors.toMap(TenantGroup::getId, TenantGroup::getName));
|
|
|
+ tenantGroupIdNameMap.putAll(tenantGroupMap);
|
|
|
+ }
|
|
|
+
|
|
|
List<StudentWrapper.ExportStudentTemplate> templateList = rows.stream().map(next -> {
|
|
|
StudentWrapper.ExportStudentTemplate template = new StudentWrapper.ExportStudentTemplate();
|
|
|
template.setUserName(next.getUsername());
|
|
|
template.setPhone(next.getPhone());
|
|
|
template.setSubjectName(next.getSubjectName());
|
|
|
- template.setTenantGroupName(next.getTenantGroupName());
|
|
|
+ template.setTenantGroupName(tenantGroupIdNameMap.getOrDefault(next.getTenantGroupId(), ""));
|
|
|
return template;
|
|
|
}).collect(Collectors.toList());
|
|
|
|