|
|
@ -7,10 +7,7 @@ import com.ccsens.mt.bean.dto.CompeteDto; |
|
|
|
import com.ccsens.mt.bean.dto.ProvinceCompeteDto; |
|
|
|
import com.ccsens.mt.bean.dto.ScoreDto; |
|
|
|
import com.ccsens.mt.bean.po.*; |
|
|
|
import com.ccsens.mt.bean.vo.CompeteExcelVo; |
|
|
|
import com.ccsens.mt.bean.vo.CompeteVo; |
|
|
|
import com.ccsens.mt.bean.vo.ScoreVo; |
|
|
|
import com.ccsens.mt.bean.vo.TableVo; |
|
|
|
import com.ccsens.mt.bean.vo.*; |
|
|
|
import com.ccsens.mt.persist.dao.*; |
|
|
|
import com.ccsens.mt.persist.mapper.*; |
|
|
|
import com.ccsens.mt.util.Constant; |
|
|
@ -41,6 +38,7 @@ import java.io.OutputStream; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Comparator; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.LinkedList; |
|
|
|
import java.util.List; |
|
|
@ -79,43 +77,43 @@ public class ExcelService implements IExcelService { |
|
|
|
@Resource |
|
|
|
private ICompeteService competeService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public String dasaiduiwuxinxiWPS(QueryDto<CompeteDto.CompeteTime> params) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//这个里面包含联系人得信息
|
|
|
|
List<CompeteCompany> competeCompanyListSel= competeCompanyDao.selectByCompeteTimeId(params.getParam().getCompeteTimeId()); |
|
|
|
List<CompeteCompany> competeCompanyList= new ArrayList<>(); |
|
|
|
for (CompeteCompany com:competeCompanyListSel) { |
|
|
|
CompetePlayerExample competePlayerExample = new CompetePlayerExample(); |
|
|
|
competePlayerExample.createCriteria().andCompanyIdEqualTo(com.getId()).andRecStatusEqualTo((byte) 0); |
|
|
|
//运动员list
|
|
|
|
List<CompetePlayer> competePlayerList = competePlayerMapper.selectByExample(competePlayerExample); |
|
|
|
List<CompetePlayer> competePlayerList1=new ArrayList<>(); |
|
|
|
for (int i = 0; i < competePlayerList.size(); i++) { |
|
|
|
CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample(); |
|
|
|
CompeteTeamMemberExample competeTeamMemberExample = new CompeteTeamMemberExample(); |
|
|
|
competeProjectPlayerExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte) 0); |
|
|
|
competeTeamMemberExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte) 0); |
|
|
|
List<CompeteProjectPlayer> competeProjectPlayers = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample); |
|
|
|
List<CompeteTeamMember> competeTeamMembers = competeTeamMemberMapper.selectByExample(competeTeamMemberExample); |
|
|
|
if (competeProjectPlayers.size() > 0 || competeTeamMembers.size() > 0) { |
|
|
|
competeCompanyList.add(com); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<CompeteCoach> competeCoachList =new ArrayList<CompeteCoach>(); |
|
|
|
for (CompeteCompany com:competeCompanyList) { |
|
|
|
//再根据单位id查询,领队和教练信息,返回list集合
|
|
|
|
competeCoachList.addAll(competeCompanyDao.selectByCompanyId(com.getId())); |
|
|
|
} |
|
|
|
List<CompeteVo.MesBiao> mesBiaos = competeScoreDao.selCanSaiDuiWuMes(); |
|
|
|
//
|
|
|
|
//
|
|
|
|
// //这个里面包含联系人得信息
|
|
|
|
// List<CompeteCompany> competeCompanyListSel= competeCompanyDao.selectByCompeteTimeId(params.getParam().getCompeteTimeId());
|
|
|
|
// List<CompeteCompany> competeCompanyList= new ArrayList<>();
|
|
|
|
// for (CompeteCompany com:competeCompanyListSel) {
|
|
|
|
// CompetePlayerExample competePlayerExample = new CompetePlayerExample();
|
|
|
|
// competePlayerExample.createCriteria().andCompanyIdEqualTo(com.getId()).andRecStatusEqualTo((byte) 0);
|
|
|
|
// //运动员list
|
|
|
|
// List<CompetePlayer> competePlayerList = competePlayerMapper.selectByExample(competePlayerExample);
|
|
|
|
//
|
|
|
|
// for (int i = 0; i < competePlayerList.size(); i++) {
|
|
|
|
// CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample();
|
|
|
|
// CompeteTeamMemberExample competeTeamMemberExample = new CompeteTeamMemberExample();
|
|
|
|
// competeProjectPlayerExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte) 0);
|
|
|
|
// competeTeamMemberExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte) 0);
|
|
|
|
// List<CompeteProjectPlayer> competeProjectPlayers = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample);
|
|
|
|
// List<CompeteTeamMember> competeTeamMembers = competeTeamMemberMapper.selectByExample(competeTeamMemberExample);
|
|
|
|
// if (competeProjectPlayers.size() > 0 || competeTeamMembers.size() > 0) {
|
|
|
|
// competeCompanyList.add(com);
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// List<CompeteCoach> competeCoachList =new ArrayList<CompeteCoach>();
|
|
|
|
// for (CompeteCompany com:competeCompanyList) {
|
|
|
|
// //再根据单位id查询,领队和教练信息,返回list集合
|
|
|
|
// competeCoachList.addAll(competeCompanyDao.selectByCompanyId(com.getId()));
|
|
|
|
// }
|
|
|
|
List<List<PoiUtil.PoiUtilCell>> biao = new ArrayList<>(); |
|
|
|
//先把联系人的都添加进去
|
|
|
|
List<PoiUtil.PoiUtilCell> biaotou=new ArrayList<>(); |
|
|
@ -149,69 +147,97 @@ public class ExcelService implements IExcelService { |
|
|
|
beizhuTou.setValue("备注"); |
|
|
|
hangTou.add(beizhuTou); |
|
|
|
biao.add(hangTou); |
|
|
|
int i=1; |
|
|
|
for(CompeteCompany competeCompany:competeCompanyList){ |
|
|
|
for (int i = 0; i < mesBiaos.size(); i++) { |
|
|
|
List<PoiUtil.PoiUtilCell> hang=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell xuhao=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
xuhao.setValue(String.valueOf(i++)); |
|
|
|
xuhao.setValue(String.valueOf(i)); |
|
|
|
hang.add(xuhao); |
|
|
|
PoiUtil.PoiUtilCell cansaiduiwu=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
cansaiduiwu.setValue(competeCompany.getName()); |
|
|
|
cansaiduiwu.setValue(mesBiaos.get(i).getCompanyName()); |
|
|
|
hang.add(cansaiduiwu); |
|
|
|
PoiUtil.PoiUtilCell renyuanleibei=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
renyuanleibei.setValue("联系人"); |
|
|
|
renyuanleibei.setValue(mesBiaos.get(i).getIdentity()); |
|
|
|
hang.add(renyuanleibei); |
|
|
|
PoiUtil.PoiUtilCell name=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
name.setValue(competeCompany.getContactsName()); |
|
|
|
name.setValue(mesBiaos.get(i).getName()); |
|
|
|
hang.add(name); |
|
|
|
PoiUtil.PoiUtilCell sex=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
sex.setValue("/"); |
|
|
|
sex.setValue(mesBiaos.get(i).getGender()); |
|
|
|
hang.add(sex); |
|
|
|
PoiUtil.PoiUtilCell pho=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
pho.setValue(String.valueOf(competeCompany.getContactsPhone())); |
|
|
|
pho.setValue(String.valueOf(mesBiaos.get(i).getPhone())); |
|
|
|
hang.add(pho); |
|
|
|
PoiUtil.PoiUtilCell idCardNum=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
idCardNum.setValue("/"); |
|
|
|
idCardNum.setValue(mesBiaos.get(i).getIdCard()); |
|
|
|
hang.add(idCardNum); |
|
|
|
PoiUtil.PoiUtilCell beizhu=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
beizhu.setValue("无"); |
|
|
|
hang.add(beizhu); |
|
|
|
biao.add(hang); |
|
|
|
for (CompeteCoach competeCoach:competeCoachList){ |
|
|
|
if(competeCoach.getCompanyId().equals(competeCompany.getId())){ |
|
|
|
List<PoiUtil.PoiUtilCell> hanghou=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell xuhaoCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
xuhaoCach.setValue(String.valueOf(i++)); |
|
|
|
hanghou.add(xuhaoCach); |
|
|
|
PoiUtil.PoiUtilCell cansaiduiwuCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
cansaiduiwuCach.setValue(competeCompany.getName()); |
|
|
|
hanghou.add(cansaiduiwuCach); |
|
|
|
PoiUtil.PoiUtilCell renyuanleibeiCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
if (competeCoach.getIdentity().equals((byte) 0)){ |
|
|
|
renyuanleibeiCach.setValue("领队"); |
|
|
|
}else { |
|
|
|
renyuanleibeiCach.setValue("教练"); |
|
|
|
} |
|
|
|
hanghou.add(renyuanleibeiCach); |
|
|
|
PoiUtil.PoiUtilCell nameCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
nameCach.setValue(competeCoach.getName()); |
|
|
|
hanghou.add(nameCach); |
|
|
|
PoiUtil.PoiUtilCell sexCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
sexCach.setValue(competeCoach.getGender().equals((byte) 0)?"女":"男"); |
|
|
|
hanghou.add(sexCach); |
|
|
|
PoiUtil.PoiUtilCell phoCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
phoCach.setValue(String.valueOf(competeCoach.getPhone())); |
|
|
|
hanghou.add(phoCach); |
|
|
|
PoiUtil.PoiUtilCell idCardNumCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
idCardNumCach.setValue(String.valueOf(competeCoach.getIdPhoto())); |
|
|
|
hanghou.add(idCardNumCach); |
|
|
|
PoiUtil.PoiUtilCell beizhuCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null); |
|
|
|
beizhuCach.setValue("无"); |
|
|
|
hanghou.add(beizhuCach); |
|
|
|
biao.add(hanghou); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// for(CompeteCompany competeCompany:competeCompanyList){
|
|
|
|
// List<PoiUtil.PoiUtilCell> hang=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell xuhao=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// xuhao.setValue(String.valueOf(i++));
|
|
|
|
// hang.add(xuhao);
|
|
|
|
// PoiUtil.PoiUtilCell cansaiduiwu=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// cansaiduiwu.setValue(competeCompany.getName());
|
|
|
|
// hang.add(cansaiduiwu);
|
|
|
|
// PoiUtil.PoiUtilCell renyuanleibei=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// renyuanleibei.setValue("联系人");
|
|
|
|
// hang.add(renyuanleibei);
|
|
|
|
// PoiUtil.PoiUtilCell name=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// name.setValue(competeCompany.getContactsName());
|
|
|
|
// hang.add(name);
|
|
|
|
// PoiUtil.PoiUtilCell sex=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// sex.setValue("/");
|
|
|
|
// hang.add(sex);
|
|
|
|
// PoiUtil.PoiUtilCell pho=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// pho.setValue(String.valueOf(competeCompany.getContactsPhone()));
|
|
|
|
// hang.add(pho);
|
|
|
|
// PoiUtil.PoiUtilCell idCardNum=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// idCardNum.setValue("/");
|
|
|
|
// hang.add(idCardNum);
|
|
|
|
// PoiUtil.PoiUtilCell beizhu=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// beizhu.setValue("无");
|
|
|
|
// hang.add(beizhu);
|
|
|
|
// biao.add(hang);
|
|
|
|
// for (CompeteCoach competeCoach:competeCoachList){
|
|
|
|
// if(competeCoach.getCompanyId().equals(competeCompany.getId())){
|
|
|
|
// List<PoiUtil.PoiUtilCell> hanghou=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell xuhaoCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// xuhaoCach.setValue(String.valueOf(i++));
|
|
|
|
// hanghou.add(xuhaoCach);
|
|
|
|
// PoiUtil.PoiUtilCell cansaiduiwuCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// cansaiduiwuCach.setValue(competeCompany.getName());
|
|
|
|
// hanghou.add(cansaiduiwuCach);
|
|
|
|
// PoiUtil.PoiUtilCell renyuanleibeiCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// if (competeCoach.getIdentity().equals((byte) 0)){
|
|
|
|
// renyuanleibeiCach.setValue("领队");
|
|
|
|
// }else {
|
|
|
|
// renyuanleibeiCach.setValue("教练");
|
|
|
|
// }
|
|
|
|
// hanghou.add(renyuanleibeiCach);
|
|
|
|
// PoiUtil.PoiUtilCell nameCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// nameCach.setValue(competeCoach.getName());
|
|
|
|
// hanghou.add(nameCach);
|
|
|
|
// PoiUtil.PoiUtilCell sexCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// sexCach.setValue(competeCoach.getGender().equals((byte) 0)?"女":"男");
|
|
|
|
// hanghou.add(sexCach);
|
|
|
|
// PoiUtil.PoiUtilCell phoCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// phoCach.setValue(String.valueOf(competeCoach.getPhone()));
|
|
|
|
// hanghou.add(phoCach);
|
|
|
|
// PoiUtil.PoiUtilCell idCardNumCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// idCardNumCach.setValue(String.valueOf(competeCoach.getIdPhoto()));
|
|
|
|
// hanghou.add(idCardNumCach);
|
|
|
|
// PoiUtil.PoiUtilCell beizhuCach=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1, null, null);
|
|
|
|
// beizhuCach.setValue("无");
|
|
|
|
// hanghou.add(beizhuCach);
|
|
|
|
// biao.add(hanghou);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
PoiUtil.exportWB("参赛队伍信息表",biao,workbook); |
|
|
|
//String name = "跳绳比赛报名人数统计表" + ".xlsx";
|
|
|
@ -237,108 +263,164 @@ public class ExcelService implements IExcelService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public String iTeamListService(QueryDto<CompeteDto.CompeteTime> params) { |
|
|
|
|
|
|
|
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis0 = competeScoreDao.selAllDaiBiaoDui((byte) 0); |
|
|
|
List<CompeteVo.DaiBiaoDUi> daiBiaoDUis1 = competeScoreDao.selAllDaiBiaoDui((byte) 1); |
|
|
|
|
|
|
|
//查出所有的单位的id
|
|
|
|
List<CompeteCompany> competeCompanyList= competeCompanyDao.selectByCompeteTimeId(params.getParam().getCompeteTimeId()); |
|
|
|
|
|
|
|
|
|
|
|
List<List<PoiUtil.PoiUtilCell>> biao = new ArrayList<>(); |
|
|
|
List<PoiUtil.PoiUtilCell> biaoti=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell biaotouName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 2, 1, null, null); |
|
|
|
biaotouName.setValue("代表队名单"); |
|
|
|
biaoti.add(biaotouName); |
|
|
|
biao.add(biaoti); |
|
|
|
for (CompeteCompany com:competeCompanyList) { |
|
|
|
//查出教练和领队的list
|
|
|
|
List<CompeteCoach> jLandLD=competeCompanyDao.selectByCompanyId(com.getId()); |
|
|
|
CompetePlayerExample competePlayerExample=new CompetePlayerExample(); |
|
|
|
competePlayerExample.createCriteria().andCompanyIdEqualTo(com.getId()).andRecStatusEqualTo((byte) 0); |
|
|
|
//运动员list
|
|
|
|
List<CompetePlayer> competePlayerList = competePlayerMapper.selectByExample(competePlayerExample); |
|
|
|
|
|
|
|
List<CompetePlayer> competePlayerList1=new ArrayList<>(); |
|
|
|
for(int i=0;i<competePlayerList.size();i++){ |
|
|
|
CompeteProjectPlayerExample competeProjectPlayerExample=new CompeteProjectPlayerExample(); |
|
|
|
CompeteTeamMemberExample competeTeamMemberExample=new CompeteTeamMemberExample(); |
|
|
|
competeProjectPlayerExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte)0); |
|
|
|
competeTeamMemberExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte)0); |
|
|
|
List<CompeteProjectPlayer> competeProjectPlayers = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample); |
|
|
|
List<CompeteTeamMember> competeTeamMembers = competeTeamMemberMapper.selectByExample(competeTeamMemberExample); |
|
|
|
if(competeProjectPlayers.size()>0||competeTeamMembers.size()>0){ |
|
|
|
competePlayerList1.add(competePlayerList.get(i)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// for (CompeteCompany com:competeCompanyList) {
|
|
|
|
// //查出教练和领队的list
|
|
|
|
// List<CompeteCoach> jLandLD=competeCompanyDao.selectByCompanyId(com.getId());
|
|
|
|
// CompetePlayerExample competePlayerExample=new CompetePlayerExample();
|
|
|
|
// competePlayerExample.createCriteria().andCompanyIdEqualTo(com.getId()).andRecStatusEqualTo((byte) 0);
|
|
|
|
// //运动员list
|
|
|
|
// List<CompetePlayer> competePlayerList = competePlayerMapper.selectByExample(competePlayerExample);
|
|
|
|
//
|
|
|
|
// List<CompetePlayer> competePlayerList1=new ArrayList<>();
|
|
|
|
// for(int i=0;i<competePlayerList.size();i++){
|
|
|
|
// CompeteProjectPlayerExample competeProjectPlayerExample=new CompeteProjectPlayerExample();
|
|
|
|
// CompeteTeamMemberExample competeTeamMemberExample=new CompeteTeamMemberExample();
|
|
|
|
// competeProjectPlayerExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte)0);
|
|
|
|
// competeTeamMemberExample.createCriteria().andPlayerIdEqualTo(competePlayerList.get(i).getId()).andRecStatusEqualTo((byte)0);
|
|
|
|
// List<CompeteProjectPlayer> competeProjectPlayers = competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample);
|
|
|
|
// List<CompeteTeamMember> competeTeamMembers = competeTeamMemberMapper.selectByExample(competeTeamMemberExample);
|
|
|
|
// if(competeProjectPlayers.size()>0||competeTeamMembers.size()>0){
|
|
|
|
// competePlayerList1.add(competePlayerList.get(i));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// List<PoiUtil.PoiUtilCell> daibiaodui=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell daibiaoduiName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 2, 1, null, null);
|
|
|
|
// daibiaoduiName.setValue(com.getName());
|
|
|
|
// daibiaodui.add(daibiaoduiName);
|
|
|
|
// biao.add(daibiaodui);
|
|
|
|
// //领队和教练
|
|
|
|
// List<PoiUtil.PoiUtilCell> lingduiList=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell lingdui=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// lingdui.setValue("领 队:");
|
|
|
|
// lingduiList.add(lingdui);
|
|
|
|
//
|
|
|
|
// StringBuffer lingduiName=new StringBuffer("");
|
|
|
|
// StringBuffer jiaolianName=new StringBuffer("");
|
|
|
|
// jLandLD.forEach(jLD->{
|
|
|
|
// if (jLD.getIdentity().equals((byte) 0)) {
|
|
|
|
// lingduiName.append(jLD.getName()+'、');
|
|
|
|
// } else {
|
|
|
|
// jiaolianName.append(jLD.getName()+'、');
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// if(lingduiName.length()>0){
|
|
|
|
// lingduiName.deleteCharAt(lingduiName.length() - 1) ;
|
|
|
|
// }
|
|
|
|
// if(jiaolianName.length()>0){
|
|
|
|
// jiaolianName.deleteCharAt(jiaolianName.length() - 1) ;
|
|
|
|
// }
|
|
|
|
// PoiUtil.PoiUtilCell lingduiNameHang=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// lingduiNameHang.setValue(String.valueOf(lingduiName));
|
|
|
|
// lingduiList.add(lingduiNameHang);
|
|
|
|
//
|
|
|
|
// biao.add(lingduiList);
|
|
|
|
// List<PoiUtil.PoiUtilCell> jiaolianList=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell jiaoling=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// jiaoling.setValue("教 练:");
|
|
|
|
// jiaolianList.add(jiaoling);
|
|
|
|
// PoiUtil.PoiUtilCell jiaolianHang= new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// jiaolianHang.setValue(String.valueOf(jiaolianName));
|
|
|
|
// jiaolianList.add(jiaolianHang);
|
|
|
|
// biao.add(jiaolianList);
|
|
|
|
// //再放运动员
|
|
|
|
// StringBuffer yDYLN=new StringBuffer("");
|
|
|
|
// competePlayerList1.forEach(cpL->{
|
|
|
|
// yDYLN.append(cpL.getName());
|
|
|
|
// yDYLN.append("(");
|
|
|
|
// yDYLN.append(cpL.getGender().equals((byte) 0)?"女":"男");
|
|
|
|
// yDYLN.append(")、");
|
|
|
|
// });
|
|
|
|
// if (yDYLN.length()>0){
|
|
|
|
// yDYLN.deleteCharAt(yDYLN.length()-1);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// List<PoiUtil.PoiUtilCell> yundongyuanList=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell yuandongyuan=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// yuandongyuan.setValue("运动员");
|
|
|
|
// yundongyuanList.add(yuandongyuan);
|
|
|
|
// PoiUtil.PoiUtilCell yuandongyuanName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
|
|
|
|
// yuandongyuanName.setValue(String.valueOf(yDYLN));
|
|
|
|
// yundongyuanList.add(yuandongyuanName);
|
|
|
|
// biao.add(yundongyuanList);
|
|
|
|
//
|
|
|
|
// List<PoiUtil.PoiUtilCell> entryList=new ArrayList<>();
|
|
|
|
// PoiUtil.PoiUtilCell enter= new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 2, 1);
|
|
|
|
// entryList.add(enter);
|
|
|
|
//
|
|
|
|
// biao.add(entryList);
|
|
|
|
// if(competePlayerList1.size()<=0){
|
|
|
|
// for (int i = 0; i < 5; i++) {
|
|
|
|
// biao.remove(biao.size()-1);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
daiBiaoDUis0.forEach(mes->{ |
|
|
|
List<PoiUtil.PoiUtilCell> daibiaodui=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell daibiaoduiName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 2, 1, null, null); |
|
|
|
daibiaoduiName.setValue(com.getName()); |
|
|
|
daibiaoduiName.setValue(mes.getCompanyName()); |
|
|
|
daibiaodui.add(daibiaoduiName); |
|
|
|
biao.add(daibiaodui); |
|
|
|
//领队和教练
|
|
|
|
|
|
|
|
List<PoiUtil.PoiUtilCell> lingduiList=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell lingdui=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
lingdui.setValue("领 队:"); |
|
|
|
lingduiList.add(lingdui); |
|
|
|
|
|
|
|
StringBuffer lingduiName=new StringBuffer(""); |
|
|
|
StringBuffer jiaolianName=new StringBuffer(""); |
|
|
|
jLandLD.forEach(jLD->{ |
|
|
|
if (jLD.getIdentity().equals((byte) 0)) { |
|
|
|
lingduiName.append(jLD.getName()+'、'); |
|
|
|
} else { |
|
|
|
jiaolianName.append(jLD.getName()+'、'); |
|
|
|
PoiUtil.PoiUtilCell lingduiName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
if(mes.getName()!=null){ |
|
|
|
lingduiName.setValue(mes.getName()); |
|
|
|
} |
|
|
|
lingduiList.add(lingduiName); |
|
|
|
biao.add(lingduiList); |
|
|
|
|
|
|
|
List<PoiUtil.PoiUtilCell> jiaolianList=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell jiaolian=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
jiaolian.setValue("教 练:"); |
|
|
|
jiaolianList.add(jiaolian); |
|
|
|
PoiUtil.PoiUtilCell jiaolianName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
for (int i = 0; i < daiBiaoDUis1.size(); i++) { |
|
|
|
if(daiBiaoDUis1.get(i).getId().equals(mes.getId())){ |
|
|
|
if(daiBiaoDUis1.get(i).getName()!=null){ |
|
|
|
jiaolianName.setValue(daiBiaoDUis1.get(i).getName()); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
}); |
|
|
|
if(lingduiName.length()>0){ |
|
|
|
lingduiName.deleteCharAt(lingduiName.length() - 1) ; |
|
|
|
} |
|
|
|
if(jiaolianName.length()>0){ |
|
|
|
jiaolianName.deleteCharAt(jiaolianName.length() - 1) ; |
|
|
|
} |
|
|
|
PoiUtil.PoiUtilCell lingduiNameHang=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
lingduiNameHang.setValue(String.valueOf(lingduiName)); |
|
|
|
lingduiList.add(lingduiNameHang); |
|
|
|
|
|
|
|
biao.add(lingduiList); |
|
|
|
List<PoiUtil.PoiUtilCell> jiaolianList=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell jiaoling=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
jiaoling.setValue("教 练:"); |
|
|
|
jiaolianList.add(jiaoling); |
|
|
|
PoiUtil.PoiUtilCell jiaolianHang= new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
jiaolianHang.setValue(String.valueOf(jiaolianName)); |
|
|
|
jiaolianList.add(jiaolianHang); |
|
|
|
biao.add(jiaolianList); |
|
|
|
//再放运动员
|
|
|
|
StringBuffer yDYLN=new StringBuffer(""); |
|
|
|
competePlayerList1.forEach(cpL->{ |
|
|
|
yDYLN.append(cpL.getName()); |
|
|
|
yDYLN.append("("); |
|
|
|
yDYLN.append(cpL.getGender().equals((byte) 0)?"女":"男"); |
|
|
|
yDYLN.append(")、"); |
|
|
|
}); |
|
|
|
if (yDYLN.length()>0){ |
|
|
|
yDYLN.deleteCharAt(yDYLN.length()-1); |
|
|
|
} |
|
|
|
jiaolianList.add(jiaolianName); |
|
|
|
biao.add(jiaolianList); |
|
|
|
|
|
|
|
List<PoiUtil.PoiUtilCell> yundongyuanList=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell yuandongyuan=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
yuandongyuan.setValue("运动员"); |
|
|
|
yundongyuanList.add(yuandongyuan); |
|
|
|
PoiUtil.PoiUtilCell yuandongyuanName=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
yuandongyuanName.setValue(String.valueOf(yDYLN)); |
|
|
|
yundongyuanList.add(yuandongyuanName); |
|
|
|
PoiUtil.PoiUtilCell yuandongyuanNames=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1); |
|
|
|
yuandongyuanNames.setValue(mes.getNames()); |
|
|
|
yundongyuanList.add(yuandongyuanNames); |
|
|
|
biao.add(yundongyuanList); |
|
|
|
|
|
|
|
List<PoiUtil.PoiUtilCell> entryList=new ArrayList<>(); |
|
|
|
PoiUtil.PoiUtilCell enter= new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 2, 1); |
|
|
|
entryList.add(enter); |
|
|
|
|
|
|
|
biao.add(entryList); |
|
|
|
if(competePlayerList1.size()<=0){ |
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
biao.remove(biao.size()-1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
biao.remove(biaoti.size()-1); |
|
|
|
}); |
|
|
|
|
|
|
|
biao.remove(biao.size()-1); |
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
PoiUtil.exportWB("代表队名单",biao,workbook); |
|
|
|
String filepath = "mt/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".xlsx"; |
|
|
@ -747,7 +829,8 @@ public class ExcelService implements IExcelService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public String competeAllCount(CompeteDto.CompeteTime params) throws IOException { |
|
|
|
List<TableVo.CompeteAllCount> competeAllCountList = competeAllCountList(params); |
|
|
|
// List<TableVo.CompeteAllCount> competeAllCountList = competeAllCountList(params);
|
|
|
|
List<TableVo.CompeteAllCount1> competeAllCountList = competeAllCountList1(params.getCompeteTimeId()); |
|
|
|
String path = getExcelFilePathForCompeteAllCount(competeAllCountList); |
|
|
|
return path; |
|
|
|
} |
|
|
@ -974,24 +1057,26 @@ public class ExcelService implements IExcelService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<TableVo.CompeteAllCount1> competeAllCountList1(int type){ |
|
|
|
// CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(params.getCompeteTimeId());
|
|
|
|
public List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeId){ |
|
|
|
CompeteTime competeTime = competeTimeDao.selectByPrimaryKey(competeTimeId); |
|
|
|
List<TableVo.CompeteAllCount1> competeAllCountList = new ArrayList<>(); |
|
|
|
// if(ObjectUtil.isNotNull(competeTime)) {
|
|
|
|
if(ObjectUtil.isNotNull(competeTime)){ |
|
|
|
//查询个人赛的数量统计
|
|
|
|
competeAllCountList = competePlayerDao.getJoinNumByType((byte) type); |
|
|
|
//查询团体赛的数量统计
|
|
|
|
// List<TableVo.CompeteAllCount1> groupNum = competePlayerDao.getJoinTeamNumByType((byte) type);
|
|
|
|
|
|
|
|
|
|
|
|
List<TableVo.CompeteAllCount1> nums = competePlayerDao.getJoinNumByType(competeTime.getType()); |
|
|
|
competeAllCountList.addAll(nums); |
|
|
|
//查询限制组别的团体赛的统计
|
|
|
|
//查询不限组别团体赛的统计
|
|
|
|
// }
|
|
|
|
List<TableVo.CompeteAllCount1> groupRuleNum = competePlayerDao.getJoinRuleTeamNumByType(competeTime.getType()); |
|
|
|
competeAllCountList.addAll(groupRuleNum); |
|
|
|
//查询团体赛的数量统计
|
|
|
|
List<TableVo.CompeteAllCount1> groupNum = competePlayerDao.getJoinTeamNumByType(competeTime.getType()); |
|
|
|
competeAllCountList.addAll(groupNum); |
|
|
|
} |
|
|
|
CollectionUtil.sort(competeAllCountList,(t1,t2)-> (int)(t1.getProjectId() - t2.getProjectId())); |
|
|
|
return competeAllCountList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount> arrayList) throws IOException { |
|
|
|
private String getExcelFilePathForCompeteAllCount(List<TableVo.CompeteAllCount1> arrayList) throws IOException { |
|
|
|
//创建excle表格对象
|
|
|
|
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>(); |
|
|
|
//创建行对象
|
|
|
@ -1019,43 +1104,52 @@ public class ExcelService implements IExcelService { |
|
|
|
//创建整个excel表格对象
|
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
int i = 1; |
|
|
|
for (TableVo.CompeteAllCount competeAllCount : arrayList) { |
|
|
|
for (TableVo.CompeteAllCount1 competeAllCount : arrayList) { |
|
|
|
//行对象
|
|
|
|
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>(); |
|
|
|
cells.add(new PoiUtil.PoiUtilCell(i + "", 1, 1, 300, 18)); |
|
|
|
//单元格对象
|
|
|
|
PoiUtil.PoiUtilCell poiUtilCel15 = new PoiUtil.PoiUtilCell(competeAllCount.getProjectName()); |
|
|
|
cells.add(poiUtilCel15); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0))); |
|
|
|
cells.add(poiUtilCel); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1))); |
|
|
|
cells.add(poiUtilCell); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2))); |
|
|
|
cells.add(poiUtilCel2); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3))); |
|
|
|
cells.add(poiUtilCel3); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4))); |
|
|
|
cells.add(poiUtilCel4); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5))); |
|
|
|
cells.add(poiUtilCel5); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6))); |
|
|
|
cells.add(poiUtilCel6); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7))); |
|
|
|
cells.add(poiUtilCel7); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8))); |
|
|
|
cells.add(poiUtilCel8); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9))); |
|
|
|
cells.add(poiUtilCel9); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel10 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(10))); |
|
|
|
cells.add(poiUtilCel10); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel11 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(11))); |
|
|
|
cells.add(poiUtilCel11); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel12 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(12))); |
|
|
|
cells.add(poiUtilCel12); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel13 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(13))); |
|
|
|
cells.add(poiUtilCel13); |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel14 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(14))); |
|
|
|
cells.add(poiUtilCel14); |
|
|
|
for (int j = 0; j < competeAllCount.getNums().size(); j++) { |
|
|
|
if((competeAllCount.getTeam() == 1 && competeAllCount.getJoinRule() == 1) || (competeAllCount.getCertificate() == 1)){ |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j),15,1); |
|
|
|
cells.add(poiUtilCel); |
|
|
|
}else { |
|
|
|
PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(competeAllCount.getNums().get(j)); |
|
|
|
cells.add(poiUtilCel); |
|
|
|
} |
|
|
|
} |
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(0)));
|
|
|
|
// cells.add(poiUtilCel);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(1)));
|
|
|
|
// cells.add(poiUtilCell);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel2 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(2)));
|
|
|
|
// cells.add(poiUtilCel2);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel3 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(3)));
|
|
|
|
// cells.add(poiUtilCel3);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel4 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(4)));
|
|
|
|
// cells.add(poiUtilCel4);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel5 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(5)));
|
|
|
|
// cells.add(poiUtilCel5);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel6 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(6)));
|
|
|
|
// cells.add(poiUtilCel6);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel7 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(7)));
|
|
|
|
// cells.add(poiUtilCel7);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel8 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(8)));
|
|
|
|
// cells.add(poiUtilCel8);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel9 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(9)));
|
|
|
|
// cells.add(poiUtilCel9);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel10 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(10)));
|
|
|
|
// cells.add(poiUtilCel10);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel11 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(11)));
|
|
|
|
// cells.add(poiUtilCel11);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel12 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(12)));
|
|
|
|
// cells.add(poiUtilCel12);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel13 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(13)));
|
|
|
|
// cells.add(poiUtilCel13);
|
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel14 = new PoiUtil.PoiUtilCell(String.valueOf(competeAllCount.getNums().get(14)));
|
|
|
|
// cells.add(poiUtilCel14);
|
|
|
|
list.add(cells); |
|
|
|
i++; |
|
|
|
} |
|
|
|