|
@@ -53,6 +53,7 @@ import com.yonge.toolset.utils.idcard.IdcardInfoExtractor;
|
|
|
import com.yonge.toolset.utils.string.ValueUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.kafka.common.protocol.types.Field;
|
|
|
import org.redisson.api.RMap;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -665,8 +666,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(updateUsers)) {
|
|
|
sysUserMapper.batchUpdate(updateUsers);
|
|
|
}
|
|
|
+ List<SysUser> userByPhones = sysUserMapper.findUserByPhones(studentImports.stream()
|
|
|
+ .map(StudentImportWrapper.StudentImport::getPhone).collect(Collectors.toList()));
|
|
|
+ Map<String, Long> userByPhoneMap = userByPhones.stream().collect(Collectors.toMap(SysUser::getPhone, SysUser::getId));
|
|
|
//获取所有用户编号
|
|
|
- List<Long> userIds = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
|
|
+ List<Long> userIds = userByPhones.stream().map(SysUser::getId).collect(Collectors.toList());
|
|
|
//机构学员添加机构绑定记录
|
|
|
List<UserTenantBindRecord> userTenantBindRecords = userTenantBindRecordService.lambdaQuery().in(UserTenantBindRecord::getUserId, userIds).list();
|
|
|
Map<Long, UserTenantBindRecord> userTenantBindRecordMap = userTenantBindRecords.stream().collect(Collectors.toMap(UserTenantBindRecord::getUserId, o -> o));
|
|
@@ -676,9 +680,11 @@ public class StudentServiceImpl extends ServiceImpl<StudentDao, Student> impleme
|
|
|
.collect(Collectors.toMap(StudentImportWrapper.StudentImport::getPhone, o -> o));
|
|
|
List<Student> students = new ArrayList<>();
|
|
|
for (SysUser sysUser : sysUsers) {
|
|
|
+ Long userId = userByPhoneMap.get(sysUser.getPhone());
|
|
|
+ sysUser.setId(userId);
|
|
|
StudentImportWrapper.StudentImport studentImport = studentImportMap.get(sysUser.getPhone());
|
|
|
Student student = new Student();
|
|
|
- student.setUserId(sysUser.getId());
|
|
|
+ student.setUserId(userId);
|
|
|
student.setTenantId(sysUser.getTenantId());
|
|
|
student.setSubjectId(studentImport.getSubjectId().toString());
|
|
|
student.setAvatar(sysUser.getAvatar());
|