|
|
|
@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
|
|
import com.tz.platform.common.core.base.Result;
|
|
|
|
|
import com.tz.platform.common.core.bo.MemberImport;
|
|
|
|
|
import com.tz.platform.common.core.bo.MemberInfo;
|
|
|
|
|
import com.tz.platform.common.core.tools.BeanUtils;
|
|
|
|
|
import com.tz.platform.competitiion.pc.bo.PersonImport;
|
|
|
|
|
import com.tz.platform.competitiion.pc.bo.TeamImport;
|
|
|
|
|
import com.tz.platform.competitiion.pc.bo.TeamInfo;
|
|
|
|
@ -158,8 +159,18 @@ public class TeamMemberImportBiz {
|
|
|
|
|
teamList = excelAnalysisHelper.getList(file.getInputStream(), TeamImport.class, 0, 1);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户校验
|
|
|
|
|
assert teamList != null;
|
|
|
|
|
List<String> collect = teamList.stream().map(TeamImport::getStudentNo).collect(Collectors.toList());
|
|
|
|
|
List<User> studentNoList = userDao.findAllByStudentNoIn(collect);
|
|
|
|
|
System.out.println(studentNoList);
|
|
|
|
|
if (studentNoList == null || studentNoList.isEmpty()
|
|
|
|
|
|| studentNoList.size() < teamList.size()) {
|
|
|
|
|
return Result.error("用户不存在!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MemberImport> neesSave = new ArrayList<>();
|
|
|
|
|
String temName = "";
|
|
|
|
|
List<String> teamNameList = new ArrayList<>();
|
|
|
|
@ -233,7 +244,10 @@ public class TeamMemberImportBiz {
|
|
|
|
|
temName = teamName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<MemberInfo> mList = user.batchInsert(neesSave);
|
|
|
|
|
//售卖版不做新增操作,大赛版本直接新增用户
|
|
|
|
|
// List<MemberInfo> mList = user.batchInsert(neesSave);
|
|
|
|
|
|
|
|
|
|
List<MemberInfo> mList = BeanUtils.copyProperties(studentNoList, MemberInfo.class);
|
|
|
|
|
|
|
|
|
|
temamList.forEach(team -> {
|
|
|
|
|
try {
|
|
|
|
|