|
|
@ -323,167 +323,187 @@ public class ExcelService implements IExcelService { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<TableVo.CompeteJoin> getCompeteJoin(CompeteDto.CompeteTime params) { |
|
|
|
List<TableVo.CompeteJoin> competeJoinList = new ArrayList<>(); |
|
|
|
Long competeTimeId = params.getCompeteTimeId(); |
|
|
|
CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(competeTimeId); |
|
|
|
int type = competeTime.getType(); |
|
|
|
Byte type = competeTime.getType(); |
|
|
|
Byte level = 2; |
|
|
|
CompeteProjectExample competeProjectExample = new CompeteProjectExample(); |
|
|
|
competeProjectExample.createCriteria().andTypeEqualTo((byte) type).andLevelEqualTo(level); |
|
|
|
//获取参赛项目集合
|
|
|
|
List<CompeteProject> competeProjectList = competeProjectMapper.selectByExample(competeProjectExample); |
|
|
|
for (CompeteProject competeProject : competeProjectList) { |
|
|
|
String projectName = competeProject.getName(); |
|
|
|
if (competeProject.getTeam() == 0) { |
|
|
|
//如果不是团队项目,查询该项目下报名人数集合
|
|
|
|
CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample(); |
|
|
|
competeProjectPlayerExample.createCriteria().andProjectIdEqualTo(competeProject.getId()); |
|
|
|
List<CompeteProjectPlayer> competeProjectPlayerList = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample); |
|
|
|
for (CompeteProjectPlayer competeProjectPlayer : competeProjectPlayerList) { |
|
|
|
//查询每个报名人的详细信息下
|
|
|
|
CompetePlayer competePlayer = competePlayerDao.selectByPrimaryKey(competeProjectPlayer.getPlayerId()); |
|
|
|
if(ObjectUtil.isNotNull(competePlayer)){ |
|
|
|
//个人项目名报名
|
|
|
|
List<TableVo.CompeteJoin> playerForSingleList = competeProjectDao.getPlayerForSingle(level, type); |
|
|
|
playerForSingleList.forEach(mes->{ |
|
|
|
competeJoinList.add(mes); |
|
|
|
}); |
|
|
|
//团队项目报名
|
|
|
|
List<TableVo.CompeteJoin> playerForTeamList = competeProjectDao.getPlayerForTeam(level, type); |
|
|
|
playerForTeamList.forEach(mes->{ |
|
|
|
competeJoinList.add(mes); |
|
|
|
}); |
|
|
|
return competeJoinList; |
|
|
|
} |
|
|
|
|
|
|
|
TableVo.CompeteJoin competeJoin = new TableVo.CompeteJoin(); |
|
|
|
//姓名
|
|
|
|
competeJoin.setName(competePlayer.getName()); |
|
|
|
//身份证号
|
|
|
|
competeJoin.setIdCard(competePlayer.getIdCard()); |
|
|
|
//根据身份证获取选手年龄并赋值
|
|
|
|
String idCard = competeJoin.getIdCard(); |
|
|
|
int ageByIdCard = IdcardUtil.getAgeByIdCard(idCard); |
|
|
|
competeJoin.setAge(ageByIdCard); |
|
|
|
Byte gender = competePlayer.getGender(); |
|
|
|
if (gender == 0) { |
|
|
|
competeJoin.setGender("女"); |
|
|
|
} else { |
|
|
|
competeJoin.setGender("男"); |
|
|
|
} |
|
|
|
//查询单位,并赋值
|
|
|
|
CompeteCompany competeCompany = competeCompanyMapper.selectByPrimaryKey(competePlayer.getCompanyId()); |
|
|
|
if (ObjectUtil.isNotNull(competeCompany)) { |
|
|
|
competeJoin.setJoinTeam(competeCompany.getName()); |
|
|
|
} |
|
|
|
//查询组别,并赋值
|
|
|
|
CompeteGroup competeGroup = competeGroupMapper.selectByPrimaryKey(competePlayer.getCompeteGroupId()); |
|
|
|
if (ObjectUtil.isNotNull(competeGroup)) { |
|
|
|
competeJoin.setCompeteGroup(competeGroup.getGroupName()); |
|
|
|
} |
|
|
|
// //身份证明查询,并赋值
|
|
|
|
// CommonFile commonFile = commonFileMapper.selectByPrimaryKey(competePlayer.getIdCardFrontFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile)) {
|
|
|
|
// competeJoin.setIdCardPromise(commonFile.getVisitLocation());
|
|
|
|
// }
|
|
|
|
// //一寸证件照查询赋值
|
|
|
|
// CommonFile commonFile1 = commonFileMapper.selectByPrimaryKey(competePlayer.getIdPhotoFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile1)) {
|
|
|
|
// competeJoin.setPicture(commonFile1.getVisitLocation());
|
|
|
|
|
|
|
|
|
|
|
|
// private List<TableVo.CompeteJoin> getCompeteJoin(CompeteDto.CompeteTime params) {
|
|
|
|
// List<TableVo.CompeteJoin> competeJoinList = new ArrayList<>();
|
|
|
|
// Long competeTimeId = params.getCompeteTimeId();
|
|
|
|
// CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(competeTimeId);
|
|
|
|
// int type = competeTime.getType();
|
|
|
|
// Byte level = 2;
|
|
|
|
// Byte recStatus = 0;
|
|
|
|
// CompeteProjectExample competeProjectExample = new CompeteProjectExample();
|
|
|
|
// competeProjectExample.createCriteria().andTypeEqualTo((byte) type).andLevelEqualTo(level).andRecStatusEqualTo(recStatus);
|
|
|
|
// //获取参赛项目集合
|
|
|
|
// List<CompeteProject> competeProjectList = competeProjectMapper.selectByExample(competeProjectExample);
|
|
|
|
// for (CompeteProject competeProject : competeProjectList) {
|
|
|
|
// String projectName = competeProject.getName();
|
|
|
|
// if (competeProject.getTeam() == 0) {
|
|
|
|
// //如果不是团队项目,查询该项目下报名人数集合
|
|
|
|
// CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample();
|
|
|
|
// competeProjectPlayerExample.createCriteria().andProjectIdEqualTo(competeProject.getId()).andRecStatusEqualTo(recStatus);
|
|
|
|
// List<CompeteProjectPlayer> competeProjectPlayerList = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample);
|
|
|
|
// for (CompeteProjectPlayer competeProjectPlayer : competeProjectPlayerList) {
|
|
|
|
// //查询每个报名人的详细信息下
|
|
|
|
// CompetePlayer competePlayer = competePlayerDao.selectByPrimaryKey(competeProjectPlayer.getPlayerId());
|
|
|
|
// if(ObjectUtil.isNotNull(competePlayer)){
|
|
|
|
//
|
|
|
|
// TableVo.CompeteJoin competeJoin = new TableVo.CompeteJoin();
|
|
|
|
// //姓名
|
|
|
|
// competeJoin.setName(competePlayer.getName());
|
|
|
|
// //身份证号
|
|
|
|
// competeJoin.setIdCard(competePlayer.getIdCard());
|
|
|
|
// //根据身份证获取选手年龄并赋值
|
|
|
|
// String idCard = competeJoin.getIdCard();
|
|
|
|
// int ageByIdCard = IdcardUtil.getAgeByIdCard(idCard);
|
|
|
|
// competeJoin.setAge(ageByIdCard);
|
|
|
|
// Byte gender = competePlayer.getGender();
|
|
|
|
// if (gender == 0) {
|
|
|
|
// competeJoin.setGender("女");
|
|
|
|
// } else {
|
|
|
|
// competeJoin.setGender("男");
|
|
|
|
// }
|
|
|
|
// //学籍证明/俱乐部证明
|
|
|
|
// CommonFile commonFile2 = commonFileMapper.selectByPrimaryKey(competePlayer.getStudentRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile2)) {
|
|
|
|
// competeJoin.setStudentPromise(commonFile2.getVisitLocation());
|
|
|
|
// //查询单位,并赋值
|
|
|
|
// CompeteCompany competeCompany = competeCompanyMapper.selectByPrimaryKey(competePlayer.getCompanyId());
|
|
|
|
// if (ObjectUtil.isNotNull(competeCompany)) {
|
|
|
|
// competeJoin.setJoinTeam(competeCompany.getName());
|
|
|
|
// }
|
|
|
|
// //体检证明
|
|
|
|
// CommonFile commonFile3 = commonFileMapper.selectByPrimaryKey(competePlayer.getHealthRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile3)) {
|
|
|
|
// competeJoin.setBodyTest(commonFile3.getVisitLocation());
|
|
|
|
// //查询组别,并赋值
|
|
|
|
// CompeteGroup competeGroup = competeGroupMapper.selectByPrimaryKey(competePlayer.getCompeteGroupId());
|
|
|
|
// if (ObjectUtil.isNotNull(competeGroup)) {
|
|
|
|
// competeJoin.setCompeteGroup(competeGroup.getGroupName());
|
|
|
|
// }
|
|
|
|
// //人身意外伤害保险证明
|
|
|
|
// CommonFile commonFile4 = commonFileMapper.selectByPrimaryKey(competePlayer.getInsuranceRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile4)) {
|
|
|
|
// competeJoin.setBodyProtect(commonFile4.getVisitLocation());
|
|
|
|
//// //身份证明查询,并赋值
|
|
|
|
//// CommonFile commonFile = commonFileMapper.selectByPrimaryKey(competePlayer.getIdCardFrontFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile)) {
|
|
|
|
//// competeJoin.setIdCardPromise(commonFile.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //一寸证件照查询赋值
|
|
|
|
//// CommonFile commonFile1 = commonFileMapper.selectByPrimaryKey(competePlayer.getIdPhotoFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile1)) {
|
|
|
|
//// competeJoin.setPicture(commonFile1.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //学籍证明/俱乐部证明
|
|
|
|
//// CommonFile commonFile2 = commonFileMapper.selectByPrimaryKey(competePlayer.getStudentRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile2)) {
|
|
|
|
//// competeJoin.setStudentPromise(commonFile2.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //体检证明
|
|
|
|
//// CommonFile commonFile3 = commonFileMapper.selectByPrimaryKey(competePlayer.getHealthRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile3)) {
|
|
|
|
//// competeJoin.setBodyTest(commonFile3.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //人身意外伤害保险证明
|
|
|
|
//// CommonFile commonFile4 = commonFileMapper.selectByPrimaryKey(competePlayer.getInsuranceRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile4)) {
|
|
|
|
//// competeJoin.setBodyProtect(commonFile4.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
// //参赛项目名赋值
|
|
|
|
// competeJoin.setCompeteProject(projectName);
|
|
|
|
// //项目id
|
|
|
|
// competeJoin.setProjectId(competeProject.getId());
|
|
|
|
// competeJoinList.add(competeJoin);
|
|
|
|
// }
|
|
|
|
//参赛项目名赋值
|
|
|
|
competeJoin.setCompeteProject(projectName); |
|
|
|
//项目id
|
|
|
|
competeJoin.setProjectId(competeProject.getId()); |
|
|
|
competeJoinList.add(competeJoin); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { //团队项目
|
|
|
|
//获取参赛队伍集合
|
|
|
|
CompeteTeamExample competeTeamExample = new CompeteTeamExample(); |
|
|
|
competeTeamExample.createCriteria().andProjectIdEqualTo(competeProject.getId()); |
|
|
|
List<CompeteTeam> competeTeamList = competeTeamDao.selectByExample(competeTeamExample); |
|
|
|
for (CompeteTeam competeTeam : competeTeamList) { |
|
|
|
//获取队伍下的成员集合
|
|
|
|
CompeteTeamMemberExample competeTeamMemberExample = new CompeteTeamMemberExample(); |
|
|
|
competeTeamMemberExample.createCriteria().andCompeteTeamIdEqualTo(competeTeam.getId()); |
|
|
|
List<CompeteTeamMember> competeTeamMemberList = competeTeamMemberMapper.selectByExample(competeTeamMemberExample); |
|
|
|
for (CompeteTeamMember competeTeamMember : competeTeamMemberList) { |
|
|
|
//查询成员详细信息
|
|
|
|
CompetePlayer competePlayer = competePlayerDao.selectByPrimaryKey(competeTeamMember.getPlayerId()); |
|
|
|
if(ObjectUtil.isNotNull(competePlayer)){ |
|
|
|
|
|
|
|
TableVo.CompeteJoin competeJoin = new TableVo.CompeteJoin(); |
|
|
|
//姓名
|
|
|
|
competeJoin.setName(competePlayer.getName()); |
|
|
|
//身份证号
|
|
|
|
competeJoin.setIdCard(competePlayer.getIdCard()); |
|
|
|
//根据身份证获取选手年龄并赋值
|
|
|
|
String idCard = competeJoin.getIdCard(); |
|
|
|
int ageByIdCard = IdcardUtil.getAgeByIdCard(idCard); |
|
|
|
competeJoin.setAge(ageByIdCard); |
|
|
|
//性别
|
|
|
|
Byte gender = competePlayer.getGender(); |
|
|
|
if (gender == 0) { |
|
|
|
competeJoin.setGender("女"); |
|
|
|
} else { |
|
|
|
competeJoin.setGender("男"); |
|
|
|
} |
|
|
|
|
|
|
|
//查询单位,并赋值
|
|
|
|
CompeteCompany competeCompany = competeCompanyMapper.selectByPrimaryKey(competePlayer.getCompanyId()); |
|
|
|
if (ObjectUtil.isNotNull(competeCompany)) { |
|
|
|
competeJoin.setJoinTeam(competeCompany.getName()); |
|
|
|
} |
|
|
|
//查询组别,并赋值
|
|
|
|
CompeteGroup competeGroup = competeGroupMapper.selectByPrimaryKey(competePlayer.getCompeteGroupId()); |
|
|
|
if (ObjectUtil.isNotNull(competeGroup)) { |
|
|
|
competeJoin.setCompeteGroup(competePlayer.getName()); |
|
|
|
} |
|
|
|
// //身份证明查询,并赋值
|
|
|
|
// CommonFile commonFile = commonFileMapper.selectByPrimaryKey(competePlayer.getIdCardFrontFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile)){
|
|
|
|
// competeJoin.setIdCardPromise(commonFile.getVisitLocation());
|
|
|
|
// }
|
|
|
|
// //一寸证件照查询赋值
|
|
|
|
// CommonFile commonFile1 = commonFileMapper.selectByPrimaryKey(competePlayer.getIdPhotoFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile1)){
|
|
|
|
// competeJoin.setPicture(commonFile1.getVisitLocation());
|
|
|
|
// }
|
|
|
|
// //学籍证明/俱乐部证明
|
|
|
|
// CommonFile commonFile2 = commonFileMapper.selectByPrimaryKey(competePlayer.getStudentRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile2)){
|
|
|
|
// competeJoin.setStudentPromise(commonFile2.getVisitLocation());
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// } else { //团队项目
|
|
|
|
// //获取参赛队伍集合
|
|
|
|
// CompeteTeamExample competeTeamExample = new CompeteTeamExample();
|
|
|
|
// competeTeamExample.createCriteria().andProjectIdEqualTo(competeProject.getId()).andRecStatusEqualTo(recStatus);
|
|
|
|
// List<CompeteTeam> competeTeamList = competeTeamDao.selectByExample(competeTeamExample);
|
|
|
|
// for (CompeteTeam competeTeam : competeTeamList) {
|
|
|
|
// //获取队伍下的成员集合
|
|
|
|
// CompeteTeamMemberExample competeTeamMemberExample = new CompeteTeamMemberExample();
|
|
|
|
// competeTeamMemberExample.createCriteria().andCompeteTeamIdEqualTo(competeTeam.getId());
|
|
|
|
// List<CompeteTeamMember> competeTeamMemberList = competeTeamMemberMapper.selectByExample(competeTeamMemberExample);
|
|
|
|
// for (CompeteTeamMember competeTeamMember : competeTeamMemberList) {
|
|
|
|
// //查询成员详细信息
|
|
|
|
// CompetePlayer competePlayer = competePlayerDao.selectByPrimaryKey(competeTeamMember.getPlayerId());
|
|
|
|
// if(ObjectUtil.isNotNull(competePlayer)){
|
|
|
|
//
|
|
|
|
// TableVo.CompeteJoin competeJoin = new TableVo.CompeteJoin();
|
|
|
|
// //姓名
|
|
|
|
// competeJoin.setName(competePlayer.getName());
|
|
|
|
// //身份证号
|
|
|
|
// competeJoin.setIdCard(competePlayer.getIdCard());
|
|
|
|
// //根据身份证获取选手年龄并赋值
|
|
|
|
// String idCard = competeJoin.getIdCard();
|
|
|
|
// int ageByIdCard = IdcardUtil.getAgeByIdCard(idCard);
|
|
|
|
// competeJoin.setAge(ageByIdCard);
|
|
|
|
// //性别
|
|
|
|
// Byte gender = competePlayer.getGender();
|
|
|
|
// if (gender == 0) {
|
|
|
|
// competeJoin.setGender("女");
|
|
|
|
// } else {
|
|
|
|
// competeJoin.setGender("男");
|
|
|
|
// }
|
|
|
|
// //体检证明
|
|
|
|
// CommonFile commonFile3 = commonFileMapper.selectByPrimaryKey(competePlayer.getHealthRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile3)){
|
|
|
|
// competeJoin.setBodyTest(commonFile3.getVisitLocation());
|
|
|
|
//
|
|
|
|
// //查询单位,并赋值
|
|
|
|
// CompeteCompany competeCompany = competeCompanyMapper.selectByPrimaryKey(competePlayer.getCompanyId());
|
|
|
|
// if (ObjectUtil.isNotNull(competeCompany)) {
|
|
|
|
// competeJoin.setJoinTeam(competeCompany.getName());
|
|
|
|
// }
|
|
|
|
// //人身意外伤害保险证明
|
|
|
|
// CommonFile commonFile4 = commonFileMapper.selectByPrimaryKey(competePlayer.getInsuranceRecordFile());
|
|
|
|
// if (ObjectUtil.isNotNull(commonFile4)){
|
|
|
|
// competeJoin.setBodyProtect(commonFile4.getVisitLocation());
|
|
|
|
// //查询组别,并赋值
|
|
|
|
// CompeteGroup competeGroup = competeGroupMapper.selectByPrimaryKey(competePlayer.getCompeteGroupId());
|
|
|
|
// if (ObjectUtil.isNotNull(competeGroup)) {
|
|
|
|
// competeJoin.setCompeteGroup(competePlayer.getName());
|
|
|
|
// }
|
|
|
|
//参赛项目名赋值
|
|
|
|
competeJoin.setCompeteProject(projectName); |
|
|
|
//项目id
|
|
|
|
competeJoin.setProjectId(competeProject.getId()); |
|
|
|
competeJoinList.add(competeJoin); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return competeJoinList; |
|
|
|
} |
|
|
|
//// //身份证明查询,并赋值
|
|
|
|
//// CommonFile commonFile = commonFileMapper.selectByPrimaryKey(competePlayer.getIdCardFrontFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile)){
|
|
|
|
//// competeJoin.setIdCardPromise(commonFile.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //一寸证件照查询赋值
|
|
|
|
//// CommonFile commonFile1 = commonFileMapper.selectByPrimaryKey(competePlayer.getIdPhotoFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile1)){
|
|
|
|
//// competeJoin.setPicture(commonFile1.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //学籍证明/俱乐部证明
|
|
|
|
//// CommonFile commonFile2 = commonFileMapper.selectByPrimaryKey(competePlayer.getStudentRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile2)){
|
|
|
|
//// competeJoin.setStudentPromise(commonFile2.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //体检证明
|
|
|
|
//// CommonFile commonFile3 = commonFileMapper.selectByPrimaryKey(competePlayer.getHealthRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile3)){
|
|
|
|
//// competeJoin.setBodyTest(commonFile3.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
//// //人身意外伤害保险证明
|
|
|
|
//// CommonFile commonFile4 = commonFileMapper.selectByPrimaryKey(competePlayer.getInsuranceRecordFile());
|
|
|
|
//// if (ObjectUtil.isNotNull(commonFile4)){
|
|
|
|
//// competeJoin.setBodyProtect(commonFile4.getVisitLocation());
|
|
|
|
//// }
|
|
|
|
// //参赛项目名赋值
|
|
|
|
// competeJoin.setCompeteProject(projectName);
|
|
|
|
// //项目id
|
|
|
|
// competeJoin.setProjectId(competeProject.getId());
|
|
|
|
// competeJoinList.add(competeJoin);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// return competeJoinList;
|
|
|
|
// }
|
|
|
|
|
|
|
|
private String getExcelFilePathForCompeteJoin(List<TableVo.CompeteJoin> arrayList) throws IOException { |
|
|
|
//创建excle表格对象
|
|
|
|