Lihong@123456 5 years ago
parent
commit
3be8ac75fc
  1. 2
      mt/src/main/java/com/ccsens/mt/api/DebugController.java
  2. 5
      mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java
  3. 34
      mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java
  4. 10
      mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java
  5. 7
      mt/src/main/java/com/ccsens/mt/persist/dao/CompetePlayerDao.java
  6. 3
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java
  7. 69
      mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java
  8. 476
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  9. 2
      mt/src/main/java/com/ccsens/mt/service/IExcelService.java
  10. 4
      mt/src/main/resources/mapper_dao/CompeteJudgmentDao.xml
  11. 88
      mt/src/main/resources/mapper_dao/CompetePlayerDao.xml
  12. 137
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml
  13. 5
      mt/src/main/resources/mapper_dao/CompeteVideoDao.xml
  14. 4
      tall/src/main/resources/application.yml
  15. 43
      tall/src/main/resources/banner.txt
  16. 7
      util/src/test/java/com/ccsens/util/OtherTest.java

2
mt/src/main/java/com/ccsens/mt/api/DebugController.java

@ -44,7 +44,7 @@ public class DebugController {
}) })
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"}) @RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception { public JsonResponse debug(HttpServletRequest request) throws Exception {
List<TableVo.CompeteAllCount1> competeAllCount1s = excelService.competeAllCountList1(0); List<TableVo.CompeteAllCount1> competeAllCount1s = excelService.competeAllCountList1(1L);
return JsonResponse.newInstance().ok(competeAllCount1s); return JsonResponse.newInstance().ok(competeAllCount1s);
} }

5
mt/src/main/java/com/ccsens/mt/bean/dto/ScoreDto.java

@ -105,12 +105,10 @@ public class ScoreDto {
@NotNull @NotNull
@ApiModelProperty("裁判id") @ApiModelProperty("裁判id")
private Long judgmentId; private Long judgmentId;
@NotNull
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remark; private String remark;
@NotNull
@ApiModelProperty("裁判是否选择了弃权还是啥的") @ApiModelProperty("裁判是否选择了弃权还是啥的")
private Byte waiver; private Byte waiver = 0;
@NotNull @NotNull
@ApiModelProperty("计分项目") @ApiModelProperty("计分项目")
private List<Fraction> fractionsList; private List<Fraction> fractionsList;
@ -131,7 +129,6 @@ public class ScoreDto {
@NotNull @NotNull
@ApiModelProperty("项目id") @ApiModelProperty("项目id")
private Long projectId; private Long projectId;
@ApiModelProperty("当前页") @ApiModelProperty("当前页")
private int page=1; private int page=1;
@ApiModelProperty("每页数量") @ApiModelProperty("每页数量")

34
mt/src/main/java/com/ccsens/mt/bean/vo/CompeteVo.java

@ -595,4 +595,38 @@ public class CompeteVo {
@ApiModelProperty("公司") @ApiModelProperty("公司")
private Long companyId; private Long companyId;
} }
@Data
@ApiModel("代表对名单查询用")
public static class DaiBiaoDUi {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("公司名称")
private String companyName;
@ApiModelProperty("运动员名称")
private String names;
@ApiModelProperty("领队or教练")
private Byte identity;
@ApiModelProperty("领队教练身份")
private String name;
}
@Data
@ApiModel("参赛队伍信息表")
public static class MesBiao {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("公司名称")
private String companyName;
@ApiModelProperty("运动员名称")
private String names;
@ApiModelProperty("领队or教练")
private String identity;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("性别")
private String gender;
@ApiModelProperty("身份证号")
private String idCard;
@ApiModelProperty("电话号")
private String phone;
}
} }

10
mt/src/main/java/com/ccsens/mt/bean/vo/TableVo.java

@ -118,13 +118,17 @@ public class TableVo {
@ApiModel("XXX比赛报名汇总表") @ApiModel("XXX比赛报名汇总表")
public static class CompeteAllCount1{ public static class CompeteAllCount1{
@ApiModelProperty("参赛id") @ApiModelProperty("参赛id")
private String projectId; private long projectId;
@ApiModelProperty()
private int id = (int) projectId;
@ApiModelProperty("参赛项目") @ApiModelProperty("参赛项目")
private String projectName; private String projectName;
@ApiModelProperty("通级 0限制 1不限制") @ApiModelProperty("通级 0限制 1不限制")
private int certificate; private int certificate;
@ApiModelProperty("是否限制组别 0否 1是") @ApiModelProperty("是否限制组别 0否 1是")
private int joinRile; private int joinRule;
@ApiModelProperty("是否是团队 0否 1是")
private int team;
@ApiModelProperty("参赛人数 顺序:小学(男女混)→中学(男女混)→高职院校(男女混)→本科院校(男女混)→俱乐部(男女混)") @ApiModelProperty("参赛人数 顺序:小学(男女混)→中学(男女混)→高职院校(男女混)→本科院校(男女混)→俱乐部(男女混)")
private List<String> nums; private List<String> nums;
@ApiModelProperty("每个组别内的人数") @ApiModelProperty("每个组别内的人数")
@ -205,7 +209,7 @@ public class TableVo {
public int getGames(){ public int getGames(){
if(joinNum != 0 && siteNum != 0) { if(joinNum != 0 && siteNum != 0) {
return (int) Math.ceil(joinNum / siteNum); return (int) Math.ceil((float)joinNum / (float)siteNum);
} }
return 0; return 0;
} }

7
mt/src/main/java/com/ccsens/mt/persist/dao/CompetePlayerDao.java

@ -99,4 +99,11 @@ public interface CompetePlayerDao extends CompetePlayerMapper {
* @return * @return
*/ */
List<TableVo.CompeteAllCount1> getJoinTeamNumByType(@Param("type")byte type); List<TableVo.CompeteAllCount1> getJoinTeamNumByType(@Param("type")byte type);
/**
* 查询团队限制组别的项目的数量汇总交互绳 一带一
* @param type
* @return
*/
List<TableVo.CompeteAllCount1> getJoinRuleTeamNumByType(@Param("type")byte type);
} }

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

@ -96,4 +96,7 @@ public interface CompeteScoreDao {
* @return 成绩 * @return 成绩
*/ */
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.MesBiao> selCanSaiDuiWuMes();
} }

69
mt/src/main/java/com/ccsens/mt/service/CompeteTaskService.java

@ -25,9 +25,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
/** /**
@ -137,12 +135,12 @@ public class CompeteTaskService implements ICompeteTaskService {
log.info("本项目参加的人数:{}", playerIdOrTeamIdList); log.info("本项目参加的人数:{}", playerIdOrTeamIdList);
if (CollectionUtil.isNotEmpty(playerIdOrTeamIdList)) { if (CollectionUtil.isNotEmpty(playerIdOrTeamIdList)) {
//计算场次 //计算场次
int order = (int) Math.ceil(playerIdOrTeamIdList.size() / projectConfig.getSiteNum()); int order = (int) Math.ceil((float)playerIdOrTeamIdList.size() / (float)projectConfig.getSiteNum());
//计算每个场次时间 //计算每个场次时间
long projectStartTime = projectConfig.getStartTime(); long projectStartTime = projectConfig.getStartTime();
long orderTime = 0; long orderTime = 0;
if (order != 0) { if (order != 0) {
orderTime = (long) Math.floor((projectConfig.getEndTime() - projectStartTime) / order); orderTime = (long) Math.floor(((float)projectConfig.getEndTime() - (float)projectStartTime) / (float)order);
} else { } else {
log.info("场次为0的比赛:{}------{}", project, projectConfig); log.info("场次为0的比赛:{}------{}", project, projectConfig);
} }
@ -431,29 +429,61 @@ public class CompeteTaskService implements ICompeteTaskService {
@Override @Override
public List<ProvinceCompeteVo.QueryJudgment> queryJudgment(ProvinceCompeteDto.QueryJudgment param) { public List<ProvinceCompeteVo.QueryJudgment> queryJudgment(ProvinceCompeteDto.QueryJudgment param) {
List<ProvinceCompeteVo.QueryJudgment> queryJudgmentList = competeJudgmentDao.queryJudgment(param.getCompeteTimeId(), param.getProjectId()); List<ProvinceCompeteVo.QueryJudgment> queryJudgmentList = competeJudgmentDao.queryJudgment(param.getCompeteTimeId(), param.getProjectId());
// if (CollectionUtil.isNotEmpty(queryJudgmentList)) { if (CollectionUtil.isNotEmpty(queryJudgmentList)) {
// queryJudgmentList.forEach(projectJudgment -> { queryJudgmentList.forEach(projectJudgment -> {
//// for(ProvinceCompeteVo.QueryJudgment projectJudgment : queryJudgmentList){ //裁判数量
// //裁判数量 int count = projectJudgment.getProjectType() == 0 ? 3 : 7;
// int count = projectJudgment.getProjectType() == 0 ? 3 : 7; Map<Integer,Integer> siteMap = new HashMap<>();
Map<Integer,Integer> judgmentMap = new HashMap<>();
projectJudgment.getSiteList().forEach(site-> {
siteMap.put(site.getSiteNum(),site.getSiteNum());
if (CollectionUtil.isEmpty(site.getJudgmentList())) {
site.setJudgmentList(new ArrayList<>());
}else {
site.getJudgmentList().forEach(judgment -> judgmentMap.put(judgment.getJudgmentNum(),judgment.getJudgmentNum()));
}
for (int j = 0; j < count; j++) {
if(judgmentMap.get(j) == null) {
ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
siteJudgment1.setJudgmentNum(j);
site.getJudgmentList().add(siteJudgment1);
}
}
CollectionUtil.sort(site.getJudgmentList(), Comparator.comparingInt(ProvinceCompeteVo.SiteJudgment::getJudgmentNum));
});
for (int j = 0; j < projectJudgment.getSiteNums(); j++) {
if(siteMap.get(j+1) == null) {
ProvinceCompeteVo.ProjectSite siteJudgment = new ProvinceCompeteVo.ProjectSite();
siteJudgment.setSiteNum(j + 1);
projectJudgment.getSiteList().add(siteJudgment);
for (int x = 0; x < count; x++) {
ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
siteJudgment1.setJudgmentNum(x);
siteJudgment.getJudgmentList().add(siteJudgment1);
}
}
}
//
// projectJudgment.getSiteList().forEach(site-> judgmentMap.put(site.getSiteNum(),site.getSiteNum()));
// for (int i = 0; i < projectJudgment.getSiteNums(); i++) { // for (int i = 0; i < projectJudgment.getSiteNums(); i++) {
// if (i < projectJudgment.getSiteList().size()) { // if (i < projectJudgment.getSiteList().size()) {
// ProvinceCompeteVo.ProjectSite siteJudgment = projectJudgment.getSiteList().get(i); // ProvinceCompeteVo.ProjectSite siteJudgment = projectJudgment.getSiteList().get(i);
// if (CollectionUtil.isEmpty(siteJudgment.getJudgmentList())) { // if (CollectionUtil.isEmpty(siteJudgment.getJudgmentList())) {
// siteJudgment.setJudgmentList(new ArrayList<>()); // siteJudgment.setJudgmentList(new ArrayList<>());
// }else {
// siteJudgment.getJudgmentList().forEach(judgment -> siteMap.put(judgment.getJudgmentNum(),judgment.getJudgmentNum()));
// } // }
// int a = siteJudgment.getJudgmentList().size(); // for (int j = 0; j < count; j++) {
// for (int j = 0; j < count - a; j++) { // if(siteMap.get(j) == null) {
// ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment(); // ProvinceCompeteVo.SiteJudgment siteJudgment1 = new ProvinceCompeteVo.SiteJudgment();
// siteJudgment1.setJudgmentNum(a + j); // siteJudgment1.setJudgmentNum(j);
// siteJudgment.getJudgmentList().add(siteJudgment1); // siteJudgment.getJudgmentList().add(siteJudgment1);
// } // }
// }
// CollectionUtil.sort(siteJudgment.getJudgmentList(), Comparator.comparingInt(ProvinceCompeteVo.SiteJudgment::getJudgmentNum));
// } else { // } else {
// int a = projectJudgment.getSiteList().size(); // int a = projectJudgment.getSiteList().size();
//// System.out.println("==========="+ a); // for (int j = 0; j < projectJudgment.getSiteNums(); j++) {
//// System.out.println("==========="+ projectJudgment.getSiteNums());
//// System.out.println("==========="+ (projectJudgment.getSiteNums()-a));
// for (int j = 0; j < projectJudgment.getSiteNums() - a; j++) {
// ProvinceCompeteVo.ProjectSite siteJudgment = new ProvinceCompeteVo.ProjectSite(); // ProvinceCompeteVo.ProjectSite siteJudgment = new ProvinceCompeteVo.ProjectSite();
// siteJudgment.setSiteNum(a + j + 1); // siteJudgment.setSiteNum(a + j + 1);
// projectJudgment.getSiteList().add(siteJudgment); // projectJudgment.getSiteList().add(siteJudgment);
@ -466,9 +496,8 @@ public class CompeteTaskService implements ICompeteTaskService {
// } // }
// } // }
// } // }
//// } });
// }); }
// }
return queryJudgmentList; return queryJudgmentList;
} }

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

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

2
mt/src/main/java/com/ccsens/mt/service/IExcelService.java

@ -94,7 +94,7 @@ public interface IExcelService {
// String patternExpTable(ScoreDto.ShowResult param); // String patternExpTable(ScoreDto.ShowResult param);
List<TableVo.CompeteAllCount1> competeAllCountList1(int type); List<TableVo.CompeteAllCount1> competeAllCountList1(Long competeTimeid);
/** /**
* 生成比赛前八名的表格 * 生成比赛前八名的表格
* @param params 第几届比赛 * @param params 第几届比赛

4
mt/src/main/resources/mapper_dao/CompeteJudgmentDao.xml

@ -36,9 +36,9 @@
FROM FROM
t_compete_project p LEFT JOIN t_compete_time ct on p.type = ct.type t_compete_project p LEFT JOIN t_compete_time ct on p.type = ct.type
LEFT JOIN t_compete_project_config pc on p.id = pc.project_id LEFT JOIN t_compete_project_config pc on p.id = pc.project_id
LEFT JOIN (SELECT 1 as nums union All SELECT 2 as nums union All SELECT 3 as nums) n on 1=1
LEFT JOIN t_compete_judgment j on j.project_id = p.id and (j.rec_status = 0 or j.rec_status IS NULL) LEFT JOIN t_compete_judgment j on j.project_id = p.id and (j.rec_status = 0 or j.rec_status IS NULL)
and j.chief_judgment = n.nums
WHERE WHERE
ct.id = #{competeTimeId} ct.id = #{competeTimeId}
<if test="projectId != null"> <if test="projectId != null">

88
mt/src/main/resources/mapper_dao/CompetePlayerDao.xml

@ -44,6 +44,8 @@
<id column="projectId" property="projectId"/> <id column="projectId" property="projectId"/>
<result column="projectName" property="projectName"/> <result column="projectName" property="projectName"/>
<result column="certificate" property="certificate"/> <result column="certificate" property="certificate"/>
<result column="team" property="team"/>
<result column="joinRule" property="joinRule"/>
<collection property="joinNum" ofType="com.ccsens.mt.bean.vo.TableVo$JoinGroupNum"> <collection property="joinNum" ofType="com.ccsens.mt.bean.vo.TableVo$JoinGroupNum">
<id column="groupId" property="groupId"/> <id column="groupId" property="groupId"/>
<result column="aNum" property="num"/> <result column="aNum" property="num"/>
@ -332,7 +334,9 @@
p.`name` as projectName, p.`name` as projectName,
p.certificate as certificate, p.certificate as certificate,
a.groupId as groupId, a.groupId as groupId,
a.aNum as aNum a.aNum as aNum,
p.team as team,
p.join_rule as joinRule
FROM FROM
t_compete_project p t_compete_project p
LEFT JOIN( LEFT JOIN(
@ -379,6 +383,86 @@
ORDER BY p.id,a.sequence ORDER BY p.id,a.sequence
</select> </select>
<select id="getJoinTeamNumByType" resultMap="teamNum1"> <select id="getJoinTeamNumByType" resultMap="teamNum1">
SELECT
p.id as projectId,
p.`name` as projectName,
count(t.id) as aNum,
p.team as team,
p.join_rule as joinRule
FROM
t_compete_project p
LEFT JOIN t_compete_team t on p.id = t.project_id
LEFT JOIN t_compete_company c on t.company_id = c.id
WHERE
p.type = #{type}
and p.`level` = 2
and p.team = 1
and p.join_rule = 1
and p.rec_status = 0
and t.rec_status = 0
and c.rec_status = 0
GROUP BY p.id
</select>
<select id="getJoinRuleTeamNumByType" resultMap="teamNum1">
SELECT
p.id as projectId,
p.`name` as projectName,
p.certificate as certificate,
a.groupId as groupId,
a.aNum as aNum,
p.team as team,
p.join_rule as joinRule
FROM
t_compete_project p
LEFT JOIN(
SELECT
g.id as groupId,
g.group_name as groupName,
g.sequence as sequence,
t.projectId,
if(t.num is null,'/',t.num) as aNum
FROM
t_compete_group g
LEFT JOIN
(
SELECT
g.id as gid,
g.group_name,
count(t.teamId) as num,
t.projectId as projectId
FROM
t_compete_group g
LEFT JOIN
(
SELECT
t.id as teamId,
t.project_id as projectId,
t.gender_group,
t.group_remark
FROM
t_compete_team t
LEFT JOIN t_compete_company c on t.company_id = c.id
WHERE
(t.rec_status = 0 or t.rec_status is null)
and (c.rec_status = 0 or c.rec_status is null)
)t on ((t.gender_group = g.sex and t.group_remark = g.group_remark) or t.teamId is null)
WHERE
g.type = 0
and g.rec_status = 0
GROUP BY g.id,t.projectId
ORDER BY g.sequence
)t
on (t.gid = g.id or t.gid is null)
WHERE
g.type = 0
and g.rec_status = 0
)a on (p.id = a.projectId or a.projectId is null)
WHERE
p.type = #{type}
and p.team = 1
and p.`level` = 2
and p.join_rule = 0
and p.rec_status = 0
ORDER BY p.id,a.sequence
</select> </select>
</mapper> </mapper>

137
mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

@ -725,6 +725,143 @@
group by s.site_order_id group by s.site_order_id
order by result desc order by result desc
</select> </select>
<select id="selAllDaiBiaoDui" resultType="com.ccsens.mt.bean.vo.CompeteVo$DaiBiaoDUi">
select q.*,identity,GROUP_CONCAT(tcch.name) as name From
(
SELECT
id,
companyName,
GROUP_CONCAT( `name` ) AS `names`
FROM
(
SELECT
tcc.id,
tcc.`name` AS companyName,
concat( tcp.NAME, IF ( tcp.gender = 0, '(女)', '(男)' ) ) AS `name`,
(
IF
(
(
( tcp.id IN ( SELECT t_compete_project_player.player_id FROM t_compete_project_player ) )
OR ( tcp.id IN ( SELECT t_compete_team_member.player_id FROM t_compete_team_member ) )
),
1,
0
)
) AS `after`
FROM
t_compete_company tcc
LEFT JOIN t_compete_player tcp ON tcp.company_id = tcc.id
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
) t
WHERE
`after` != 0
GROUP BY
t.id) q left join t_compete_coach tcch on q.id=tcch.company_id and tcch.rec_status=0 and tcch.identity=#{identity}
group by q.id
</select>
<select id="selCanSaiDuiWuMes" resultType="com.ccsens.mt.bean.vo.CompeteVo$MesBiao">
SELECT
*
FROM
(
SELECT
q.*,
IF
( identity = 0, '领队', '教练' ) AS identity,
tcch.NAME,
IF
( tcch.gender = 0, '女', '男' ) AS gender,
tcch.id_card AS idCard,
tcch.phone
FROM
(
SELECT
id,
companyName,
GROUP_CONCAT( `name` ) AS `names`
FROM
(
SELECT
tcc.id,
tcc.`name` AS companyName,
concat( tcp.NAME, IF ( tcp.gender = 0, '(女)', '(男)' ) ) AS `name`,
(
IF
(
(
( tcp.id IN ( SELECT t_compete_project_player.player_id FROM t_compete_project_player ) )
OR ( tcp.id IN ( SELECT t_compete_team_member.player_id FROM t_compete_team_member ) )
),
1,
0
)
) AS `after`
FROM
t_compete_company tcc
LEFT JOIN t_compete_player tcp ON tcp.company_id = tcc.id
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
) t
WHERE
`after` != 0
GROUP BY
t.id
) q
LEFT JOIN t_compete_coach tcch ON q.id = tcch.company_id
AND tcch.rec_status = 0 UNION
(
SELECT
id,
companyName,
GROUP_CONCAT( `name` ) AS `names`,
'联系人' AS identity,
contacts_name AS NAME,
'/' AS gender,
'/' AS idCard,
contacts_phone AS phone
FROM
(
SELECT
tcc.id,
tcc.`name` AS companyName,
tcc.contacts_name,
tcc.contacts_phone,
concat( tcp.NAME, IF ( tcp.gender = 0, '(女)', '(男)' ) ) AS `name`,
(
IF
(
(
( tcp.id IN ( SELECT t_compete_project_player.player_id FROM t_compete_project_player ) )
OR ( tcp.id IN ( SELECT t_compete_team_member.player_id FROM t_compete_team_member ) )
),
1,
0
)
) AS `after`
FROM
t_compete_company tcc
LEFT JOIN t_compete_player tcp ON tcp.company_id = tcc.id
WHERE
tcc.rec_status = 0
AND tcp.rec_status = 0
AND tcc.compete_time_id = 1
) t
WHERE
`after` != 0
GROUP BY
t.id
)
) tt
ORDER BY
tt.id
</select>
<!--<select id="queryEightGroupLimit" resultType="com.ccsens.mt.bean.vo.CompeteExcelVo$BeforeEight"> <!--<select id="queryEightGroupLimit" resultType="com.ccsens.mt.bean.vo.CompeteExcelVo$BeforeEight">
select t1.group_name as groupName, GROUP_CONCAT(t1.name) as eightNames from select t1.group_name as groupName, GROUP_CONCAT(t1.name) as eightNames from

5
mt/src/main/resources/mapper_dao/CompeteVideoDao.xml

@ -52,17 +52,20 @@
tt.`cr` as `time` tt.`cr` as `time`
FROM FROM
t_compete_judgment tcj t_compete_judgment tcj
left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id
left join ( left join (
select select
max(created_at) as cr, max(created_at) as cr,
user_id user_id
From tall.t_sys_log From tall.t_sys_log
where `url`='/users/signin' and `rec_status`=0 where `url`='/users/signin' and `rec_status`=0
<if test="param.signEndTime!=null"> <if test="param.signEndTime!=null">
and tall.t_sys_log.created_at &lt;= #{param.signEndTime,jdbcType=TIMESTAMP} and tall.t_sys_log.created_at &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if> </if>
GROUP BY tall.t_sys_log.user_id GROUP BY tall.t_sys_log.user_id
) tt on tt.`user_id`=tcj.`user_id` ) tt on tt.`user_id`=ttpm.`user_id`
LEFT JOIN t_compete_time tct on tct.id =tcj.`compete_time_id` LEFT JOIN t_compete_time tct on tct.id =tcj.`compete_time_id`
WHERE WHERE
tct.id=#{param.id} tct.id=#{param.id}

4
tall/src/main/resources/application.yml

@ -1,5 +1,5 @@
spring: spring:
profiles: profiles:
active: test active: dev
include: util-test,common include: util-dev,common

43
tall/src/main/resources/banner.txt

@ -1,22 +1,21 @@
/** // _ooOoo_
* _ooOoo_ // o8888888o
* o8888888o // 88" . "88
* 88" . "88 // (| -_- |)
* (| -_- |) // O\ = /O
* O\ = /O // ____/`---'\____
* ___/`---'\____ // . ' \\| |// `.
* . ' \\| |// `. // / \\||| : |||// \
* / \\||| : |||// \ // / _||||| -:- |||||- \
* / _||||| -:- |||||- \ // | | \\\ - /// | |
* | | \\\ - /// | | // | \_| ''\---/'' | |
* | \_| ''\---/'' | | // \ .-\__ `-` ___/-. /
* \ .-\__ `-` ___/-. / // ___`. .' /--.--\ `. . __
* ___`. .' /--.--\ `. . __ // ."" '< `.___\_<|>_/___.' >'"".
* ."" '< `.___\_<|>_/___.' >'"". // | | : `- \`.;`\ _ /`;.`/ - ` : | |
* | | : `- \`.;`\ _ /`;.`/ - ` : | | // \ \ `-. \_ __\ /__ _/ .-` / /
* \ \ `-. \_ __\ /__ _/ .-` / / // ======`-.____`-.___\_____/___.-`____.-'======
* ======`-.____`-.___\_____/___.-`____.-'====== // `=---='
* `=---=' //
* ............................................. // .............................................
* 佛曰:bug泛滥,我已瘫痪! // 佛祖保佑 永无BUG
*/

7
util/src/test/java/com/ccsens/util/OtherTest.java

@ -45,4 +45,11 @@ public class OtherTest {
System.out.println(sd2); System.out.println(sd2);
} }
@Test
public void test4() {
int a = 119;
int b = 6;
System.out.println(Math.ceil((float)a/(float)b));
}
} }

Loading…
Cancel
Save