Browse Source

11-24-2

tiaosheng
Lihong@123456 5 years ago
parent
commit
36a3574a08
  1. 5
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java
  2. 143
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java

5
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java

@ -98,5 +98,10 @@ public interface CompeteScoreDao {
List<CompeteVo.TotalScoreDisplay> queryVarietyScore(@Param("projectId") Long projectId); List<CompeteVo.TotalScoreDisplay> queryVarietyScore(@Param("projectId") Long projectId);
List<CompeteVo.DaiBiaoDUi> selAllDaiBiaoDui(@Param("identity") byte identity); List<CompeteVo.DaiBiaoDUi> selAllDaiBiaoDui(@Param("identity") byte identity);
/**
* 查询参赛队伍信息导出表格用
* @return
*/
List<CompeteVo.MesBiao> selCanSaiDuiWuMes(); List<CompeteVo.MesBiao> selCanSaiDuiWuMes();
} }

143
mt/src/main/java/com/ccsens/mt/service/ExcelService.java

@ -82,38 +82,7 @@ public class ExcelService implements IExcelService {
public String dasaiduiwuxinxiWPS(QueryDto<CompeteDto.CompeteTime> params) { public String dasaiduiwuxinxiWPS(QueryDto<CompeteDto.CompeteTime> params) {
List<CompeteVo.MesBiao> mesBiaos = competeScoreDao.selCanSaiDuiWuMes(); 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<List<PoiUtil.PoiUtilCell>> biao = new ArrayList<>();
//先把联系人的都添加进去 //先把联系人的都添加进去
List<PoiUtil.PoiUtilCell> biaotou=new ArrayList<>(); List<PoiUtil.PoiUtilCell> biaotou=new ArrayList<>();
@ -176,68 +145,6 @@ public class ExcelService implements IExcelService {
biao.add(hang); biao.add(hang);
} }
// 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(); Workbook workbook = new XSSFWorkbook();
PoiUtil.exportWB("参赛队伍信息表",biao,workbook); PoiUtil.exportWB("参赛队伍信息表",biao,workbook);
//String name = "跳绳比赛报名人数统计表" + ".xlsx"; //String name = "跳绳比赛报名人数统计表" + ".xlsx";
@ -713,54 +620,12 @@ public class ExcelService implements IExcelService {
public String public String
competeJoinCount(CompeteDto.CompeteTime params) throws IOException { competeJoinCount(CompeteDto.CompeteTime params) throws IOException {
List<TableVo.CompeteOverview> competeOverviewList = competeJoinCountList(params); List<TableVo.CompeteOverview> competeOverviewList = competeJoinCountList(params);
String path = getExcelFilePathForCompeteJoinCount(competeOverviewList); return getExcelFilePathForCompeteJoinCount(competeOverviewList);
return path;
} }
private List<TableVo.CompeteOverview> competeJoinCountList(CompeteDto.CompeteTime params) { private List<TableVo.CompeteOverview> competeJoinCountList(CompeteDto.CompeteTime params) {
List<TableVo.CompeteOverview> competeOverviewList = competeCompanyDao.selectCompeteJoinCountList(params.getCompeteTimeId()); List<TableVo.CompeteOverview> competeOverviewList = competeCompanyDao.selectCompeteJoinCountList(params.getCompeteTimeId());
return competeOverviewList; return competeOverviewList;
// CompeteCompanyExample competeCompanyExample = new CompeteCompanyExample();
// competeCompanyExample.createCriteria().andCompeteTimeIdEqualTo(params.getCompeteTimeId());
// //根据大赛id查公司集合
// List<CompeteCompany> competeCompanyList = competeCompanyMapper.selectByExample(competeCompanyExample);
// List<TableVo.CompeteOverview> competeOverview2List = new ArrayList<>();
// for (CompeteCompany competeCompany : competeCompanyList) {
// //每个公司的教练数量
// int leader = 1;
// int coach = 0;
// CompeteCoachExample competeCoachExample = new CompeteCoachExample();
// competeCoachExample.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) coach);
// competeCoachMapper.selectByExample(competeCoachExample);
// long count = competeCoachMapper.countByExample(competeCoachExample);
// //每个公司的领队数量
// CompeteCoachExample competeCoachExample1 = new CompeteCoachExample();
// competeCoachExample1.createCriteria().andCompanyIdEqualTo(competeCompany.getId()).andIdentityEqualTo((byte) leader);
// long count1 = competeCoachMapper.countByExample(competeCoachExample1);
// //每个公司运动员人数
// CompetePlayerExample competePlayerExample2 = new CompetePlayerExample();
// competePlayerExample2.createCriteria().andCompanyIdEqualTo(competeCompany.getId());
// long count2 = competePlayerDao.countByExample(competePlayerExample2);
// List<CompetePlayer> competePlayerList = competePlayerDao.selectByExample(competePlayerExample2);
// competePlayerList.forEach(mes->{
// CompeteProjectPlayerExample competeProjectPlayerExample = new CompeteProjectPlayerExample();
// competeProjectPlayerMapper.selectByExample(competeProjectPlayerExample);
//
// });
// //总人数
// long sum = count + count1 + count2;
// TableVo.CompeteOverview CompeteOverview2 = new TableVo.CompeteOverview();
// CompeteOverview2.setCompanyName(competeCompany.getName());
// CompeteOverview2.setCoachNum((int) count);
// CompeteOverview2.setGuideNum((int) count1);
// CompeteOverview2.setPlayerNum((int) count2);
// CompeteOverview2.setSum((int) sum);
// competeOverview2List.add(CompeteOverview2);
// }
// return competeOverview2List;
} }
@ -820,10 +685,8 @@ public class ExcelService implements IExcelService {
@Override @Override
public String competeAllCount(CompeteDto.CompeteTime params) throws IOException { public String competeAllCount(CompeteDto.CompeteTime params) throws IOException {
// List<TableVo.CompeteAllCount> competeAllCountList = competeAllCountList(params);
List<TableVo.CompeteAllCount1> competeAllCountList = competeAllCountList1(params.getCompeteTimeId()); List<TableVo.CompeteAllCount1> competeAllCountList = competeAllCountList1(params.getCompeteTimeId());
String path = getExcelFilePathForCompeteAllCount(competeAllCountList); return getExcelFilePathForCompeteAllCount(competeAllCountList);
return path;
} }
/** /**

Loading…
Cancel
Save