Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

tiaosheng
zy_Java 5 years ago
parent
commit
837925f466
  1. 15
      mt/src/main/java/com/ccsens/mt/api/CompeteController.java
  2. 44
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  3. 10
      mt/src/main/java/com/ccsens/mt/service/ICompeteService.java

15
mt/src/main/java/com/ccsens/mt/api/CompeteController.java

@ -171,13 +171,20 @@ public class CompeteController {
}
@ApiOperation(value = "报名表人数表下载", notes = "")
@RequestMapping(value = "/enrollCount", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayCount() throws IOException {
// log.info("查询各个项目报名人员信息:{}",);
String path = competeService.enrollPlayCount();
@RequestMapping(value = "/enrollCountDownload", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayCountDownLoad() throws IOException {
log.info("查询各个项目报名人员信息:{}");
String path = competeService.enrollPlayCountDownLoad();
return JsonResponse.newInstance().ok(path);
}
@ApiOperation(value = "报名表人数统计", notes = "")
@RequestMapping(value = "/enrollCount", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse enrollPlayCount() throws IOException {
log.info("查询各个项目报名人员信息:{}");
List<CompeteVo.GroupNum> list = competeService.enrollPlayCount();
return JsonResponse.newInstance().ok(list);
}
// @MustLogin
// @ApiOperation(value = "查询比赛项目上的参赛选手列表", notes = "")

44
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -447,6 +447,7 @@ public class CompeteService implements ICompeteService{
/**
* 判断是否已加入其他团队
*
* @param project 项目信息
* @param competeTimeId 比赛ID
* @param player 选手信息
@ -728,7 +729,7 @@ public class CompeteService implements ICompeteService{
}
@Override
public String enrollPlayCount() throws IOException {
public String enrollPlayCountDownLoad() throws IOException {
//查询该类型下所有项目的id,name,team信息,排除level为1的的集合
int typeId = 2;
//放总数据集合
@ -740,7 +741,6 @@ public class CompeteService implements ICompeteService{
for (CompeteVo.ProjectInfo projectInfo : projectInfoList) {
CompeteVo.GroupNum groupNum = new CompeteVo.GroupNum();
groupNum.setName(projectInfo.getName());
//查询所有组别
List<CompeteVo.Count> countList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(groupIdAndNameList)) {
for (CompeteVo.Count groupIdAndName : groupIdAndNameList) {
@ -812,4 +812,44 @@ public class CompeteService implements ICompeteService{
}
return PropUtil.imgDomain + filepath;
}
@Override
public List<CompeteVo.GroupNum> enrollPlayCount() {
//查询该类型下所有项目的id,name,team信息,排除level为1的的集合
int typeId = 2;
//放总数据集合
List<CompeteVo.GroupNum> list1 = new ArrayList<>();
//根据type 查项目
List<CompeteVo.ProjectInfo> projectInfoList = competeEnrollDao.getProject(typeId);
//根据type 查组别id,组别名
List<CompeteVo.Count> groupIdAndNameList = competeEnrollDao.getGroupIdNameFromGroup(typeId);
for (CompeteVo.ProjectInfo projectInfo : projectInfoList) {
CompeteVo.GroupNum groupNum = new CompeteVo.GroupNum();
groupNum.setName(projectInfo.getName());
List<CompeteVo.Count> countList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(groupIdAndNameList)) {
for (CompeteVo.Count groupIdAndName : groupIdAndNameList) {
CompeteVo.Count count1 = new CompeteVo.Count();
count1.setGroup_name(groupIdAndName.getGroup_name());
// groupIdAndNameList.forEach(groupIdAndName -> {
if (projectInfo.getTeam() == 0) {
CompeteProjectPlayerExample projectPlayerExample = new CompeteProjectPlayerExample();
projectPlayerExample.createCriteria().andProjectIdEqualTo(projectInfo.getId()).andCompeteGroupIdEqualTo(groupIdAndName.getCompete_group_id());
long count = competeProjectPlayerMapper.countByExample(projectPlayerExample);
count1.setCount((int) count);
} else {
CompeteTeamExample teamExample = new CompeteTeamExample();
teamExample.createCriteria().andProjectIdEqualTo(projectInfo.getId()).andCompeteGroupIdEqualTo(groupIdAndName.getCompete_group_id());
long count = competeTeamDao.countByExample(teamExample);
count1.setCount((int) count);
}
// });
countList.add(count1);
}
}
groupNum.setCountList(countList);
list1.add(groupNum);
}
return list1;
}
}

10
mt/src/main/java/com/ccsens/mt/service/ICompeteService.java

@ -124,9 +124,15 @@ public interface ICompeteService {
/**
* 根据项目类型查询参赛者信息
* @return 返回参赛者数量
* @return 返回参赛者数量下载表
*/
String enrollPlayCount() throws IOException;
String enrollPlayCountDownLoad() throws IOException;
/**
* 根据项目类型查询参赛者信息
* @return 返回参赛者数量统计
*/
List<CompeteVo.GroupNum> enrollPlayCount() throws IOException;
}

Loading…
Cancel
Save