|
|
@ -184,99 +184,6 @@ public class ExcelService implements IExcelService { |
|
|
|
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));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// 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<>(); |
|
|
@ -842,6 +749,7 @@ public class ExcelService implements IExcelService { |
|
|
|
//创建整个excel表格对象
|
|
|
|
Workbook workbook = new XSSFWorkbook(); |
|
|
|
int i = 1; |
|
|
|
int a = 2; |
|
|
|
for (TableVo.CompeteAllCount1 competeAllCount : arrayList) { |
|
|
|
//行对象
|
|
|
|
List<PoiUtil.PoiUtilCell> cells = new ArrayList<>(); |
|
|
@ -858,40 +766,13 @@ public class ExcelService implements IExcelService { |
|
|
|
cells.add(poiUtilCel); |
|
|
|
} |
|
|
|
} |
|
|
|
// PoiUtil.PoiUtilCell poiUtilCel = new PoiUtil.PoiUtilCell("","=SUM(D"+i+":R"+i+")");
|
|
|
|
// 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);
|
|
|
|
PoiUtil.PoiUtilCell poiUtilCell = new PoiUtil.PoiUtilCell(); |
|
|
|
poiUtilCell.setValue(""); |
|
|
|
poiUtilCell.setFunction("sum(C"+a+":Q"+a+")"); |
|
|
|
cells.add(poiUtilCell); |
|
|
|
list.add(cells); |
|
|
|
i++; |
|
|
|
a++; |
|
|
|
} |
|
|
|
//生成excel表格对象,并将数据放入
|
|
|
|
Workbook wbs = PoiUtil.exportWB("比赛报名汇总表", list, workbook); |
|
|
|