|
|
|
@ -26,7 +26,6 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnu |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService; |
|
|
|
|
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; |
|
|
|
|
import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; |
|
|
|
|
import org.jeecg.modules.demo.bigScreen.vo.CompVo; |
|
|
|
|
import org.jeecg.modules.demo.comp.entity.Comp; |
|
|
|
|
import org.jeecg.modules.demo.comp.service.ICompService; |
|
|
|
|
import org.jeecg.modules.demo.comptype.entity.CompType; |
|
|
|
@ -524,24 +523,26 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
Map<String, Object> departMap = new LinkedHashMap<>(); |
|
|
|
|
departMap.put("部门名称", depart.getDepartName()); |
|
|
|
|
//报名列表
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.in(!ObjectUtils.isEmpty(pointIds4Depart), AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); |
|
|
|
|
if (!ObjectUtils.isEmpty(registrationList)) { |
|
|
|
|
//报名编号
|
|
|
|
|
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes)); |
|
|
|
|
departMap.put("比赛总人数", count); |
|
|
|
|
//个人赛报名数
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList()); |
|
|
|
|
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu)); |
|
|
|
|
//学生人数
|
|
|
|
|
departMap.put("个人赛人数", count4Stu); |
|
|
|
|
departMap.put("团队赛人数", count - count4Stu); |
|
|
|
|
if (!ObjectUtils.isEmpty(pointIds4Depart)) { |
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); |
|
|
|
|
if (!ObjectUtils.isEmpty(registrationList)) { |
|
|
|
|
//报名编号
|
|
|
|
|
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes)); |
|
|
|
|
departMap.put("比赛总人数", count); |
|
|
|
|
//个人赛报名数
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList()); |
|
|
|
|
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu)); |
|
|
|
|
//学生人数
|
|
|
|
|
departMap.put("个人赛人数", count4Stu); |
|
|
|
|
departMap.put("团队赛人数", count - count4Stu); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
canSaiList.add(departMap); |
|
|
|
|
|
|
|
|
|
List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); |
|
|
|
|
/*List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); |
|
|
|
|
Map<String, Object> departHuoJiangMap = new LinkedHashMap<>(); |
|
|
|
|
departHuoJiangMap.put("部门名称", depart.getDepartName()); |
|
|
|
|
departHuoJiangMap.put("获取人数", awardPersionList4Depart.size()); |
|
|
|
@ -551,10 +552,10 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
Optional.ofNullable(awardNameMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
departHuoJiangMap.put(depart.getDepartName() + "-" + key, value.size()); |
|
|
|
|
}); |
|
|
|
|
huoJiangList.add(departHuoJiangMap); |
|
|
|
|
huoJiangList.add(departHuoJiangMap);*/ |
|
|
|
|
}); |
|
|
|
|
resultMap.put("部门参赛情况列表", canSaiList); |
|
|
|
|
resultMap.put("部门获奖情况列表", huoJiangList); |
|
|
|
|
// resultMap.put("部门获奖情况列表", huoJiangList);
|
|
|
|
|
|
|
|
|
|
List<HomePageCompVo> scoreList4Point = new LinkedList<>(); |
|
|
|
|
List<PersonalCompScore> personalCompScores = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>().eq(PersonalCompScore::getAnnualCompP, annualCompPointIds)); |
|
|
|
@ -585,9 +586,15 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
private List<AnnualCompPoint> convertPoint4Depart(SysDepart depart) { |
|
|
|
|
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, depart.getId())); |
|
|
|
|
Set<String> compIds = Optional.ofNullable(compList).orElse(new ArrayList<>()).stream().map(comp -> comp.getId()).collect(Collectors.toSet()); |
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().in(!ObjectUtils.isEmpty(compIds), AnnualComp::getCompid, compIds)); |
|
|
|
|
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet()); |
|
|
|
|
return iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(!ObjectUtils.isEmpty(annualCompIds), AnnualCompPoint::getAnnualCompId, annualCompIds)); |
|
|
|
|
List<AnnualCompPoint> pointList = new LinkedList<>(); |
|
|
|
|
if (!ObjectUtils.isEmpty(compIds)) { |
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().in(AnnualComp::getCompid, compIds)); |
|
|
|
|
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompIds)) { |
|
|
|
|
pointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return pointList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -609,7 +616,7 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
|
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>() |
|
|
|
|
.eq(AnnualComp::getAnnualid, annual.getId()) |
|
|
|
|
.in(AnnualComp::getCompid, compIds)); |
|
|
|
|
.in(!ObjectUtils.isEmpty(compIds),AnnualComp::getCompid, compIds)); |
|
|
|
|
|
|
|
|
|
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); |
|
|
|
|
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds)); |
|
|
|
@ -763,26 +770,28 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
Set<String> pointIds4Depart = Optional.ofNullable(pointList4Depart).orElse(new ArrayList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); |
|
|
|
|
Map<String, Object> departMap = new LinkedHashMap<>(); |
|
|
|
|
departMap.put("部门名称", sysDepart.getDepartName()); |
|
|
|
|
//报名列表
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); |
|
|
|
|
if (!ObjectUtils.isEmpty(registrationList)) { |
|
|
|
|
//报名编号
|
|
|
|
|
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes)); |
|
|
|
|
departMap.put("比赛总人数", count); |
|
|
|
|
//个人赛报名数
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList()); |
|
|
|
|
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu)); |
|
|
|
|
//学生人数
|
|
|
|
|
departMap.put("个人赛人数", count4Stu); |
|
|
|
|
departMap.put("团队赛人数", count - count4Stu); |
|
|
|
|
if (!ObjectUtils.isEmpty(pointIds4Depart)) { |
|
|
|
|
//报名列表
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, pointIds4Depart)); |
|
|
|
|
if (!ObjectUtils.isEmpty(registrationList)) { |
|
|
|
|
//报名编号
|
|
|
|
|
Set<String> enrollCodes = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes)); |
|
|
|
|
departMap.put("比赛总人数", count); |
|
|
|
|
//个人赛报名数
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList4Stu = registrationList.stream().filter(b -> b.getEntryFormat().equals("0")).collect(Collectors.toList()); |
|
|
|
|
Set<String> enrollCodes4Stu = Optional.ofNullable(registrationList4Stu).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(!ObjectUtils.isEmpty(enrollCodes4Stu), TeamManagement::getEnrollCode, enrollCodes4Stu)); |
|
|
|
|
//学生人数
|
|
|
|
|
departMap.put("个人赛人数", count4Stu); |
|
|
|
|
departMap.put("团队赛人数", count - count4Stu); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
canSaiList.add(departMap); |
|
|
|
|
resultMap.put("部门参赛情况列表", canSaiList); |
|
|
|
|
|
|
|
|
|
List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); |
|
|
|
|
/* List<AwardPersion> awardPersionList4Depart = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getAnnualCompP, pointIds4Depart)); |
|
|
|
|
Map<String, Object> departHuoJiangMap = new LinkedHashMap<>(); |
|
|
|
|
departHuoJiangMap.put("部门名称", sysDepart.getDepartName()); |
|
|
|
|
departHuoJiangMap.put("获取人数", awardPersionList4Depart.size()); |
|
|
|
@ -797,30 +806,8 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
}); |
|
|
|
|
// awardTypeMap2.put("获奖人数", huoJiangCount.get());
|
|
|
|
|
// huoJiangList.add(awardTypeMap2);
|
|
|
|
|
resultMap.put("部门获奖情况列表", departHuoJiangMap); |
|
|
|
|
resultMap.put("部门获奖情况列表", departHuoJiangMap);*/ |
|
|
|
|
|
|
|
|
|
/*List<HomePageCompVo> scoreList4Point = new LinkedList<>(); |
|
|
|
|
List<PersonalCompScore> personalCompScores = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>().eq(PersonalCompScore::getAnnualCompP, annualCompPointIds)); |
|
|
|
|
Map<String, List<PersonalCompScore>> AnnualCompPointIdsMap = Optional.ofNullable(personalCompScores).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(PersonalCompScore::getAnnualCompP)); |
|
|
|
|
Optional.ofNullable(AnnualCompPointIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
double sum = value.stream().mapToDouble(obj -> obj.getScore()).sum(); |
|
|
|
|
HomePageCompVo vo = new HomePageCompVo(); |
|
|
|
|
AnnualCompPoint point = iAnnualCompPointService.getById(key); |
|
|
|
|
vo.setAnnualCompPointName(point.getObjName()); |
|
|
|
|
vo.setAnnualCompPointId(key); |
|
|
|
|
AnnualComp annualComp = iAnnualCompService.getById(point.getAnnualCompId()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualComp)) { |
|
|
|
|
Comp comp = iCompService.getById(annualComp.getCompid()); |
|
|
|
|
if (!ObjectUtils.isEmpty(comp)) { |
|
|
|
|
vo.setCompName(comp.getCompName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
vo.setTotalScore(sum); |
|
|
|
|
scoreList4Point.add(vo); |
|
|
|
|
}); |
|
|
|
|
scoreList4Point.stream().sorted(Comparator.comparing(HomePageCompVo::getTotalScore)).collect(Collectors.toList()); |
|
|
|
|
resultMap.put("比赛学生积分况分析", scoreList4Point);*/ |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|