|
|
|
@ -96,6 +96,78 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
@Autowired |
|
|
|
|
private IAnnualService iAnnualService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//二级部门id
|
|
|
|
|
private final String BASE_PARENT_ID = "1693446350597038081"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<Map<String, Object>> canSai() { |
|
|
|
|
List<Map<String, Object>> resultList = new LinkedList<>(); |
|
|
|
|
//二级部门
|
|
|
|
|
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID)); |
|
|
|
|
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { |
|
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(); |
|
|
|
|
List<CompVo> vos = new LinkedList<>(); |
|
|
|
|
CompVo vo = new CompVo(); |
|
|
|
|
//部门id
|
|
|
|
|
vo.setCompOrganId(depart.getId()); |
|
|
|
|
//部门名称
|
|
|
|
|
vo.setCompOrganName(depart.getDepartName()); |
|
|
|
|
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, depart.getOrgCode())); |
|
|
|
|
Map<String, List<AnnualCompetitionProjectRegistration>> annualCompIdListMap = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(AnnualCompetitionProjectRegistration::getAnnualCompid)); |
|
|
|
|
Optional.ofNullable(annualCompIdListMap).orElse(new LinkedHashMap<>()).forEach((key, obj) -> { |
|
|
|
|
vo.setNumber(obj.size()); |
|
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(key); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompPoint)) { |
|
|
|
|
vo.setCompName(annualCompPoint.getObjName()); |
|
|
|
|
} |
|
|
|
|
Long awardCount = iAwardPersionService.count(new LambdaQueryWrapper<AwardPersion>() |
|
|
|
|
.in(AwardPersion::getAnnalComp, key)); |
|
|
|
|
vo.setAwardNumber(awardCount.intValue()); |
|
|
|
|
vos.add(vo); |
|
|
|
|
}); |
|
|
|
|
resultMap.put(depart.getDepartName(), vos); |
|
|
|
|
resultList.add(resultMap); |
|
|
|
|
}); |
|
|
|
|
return resultList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<Map<String, Object>> nengLi() { |
|
|
|
|
List<Map<String, Object>> resultList = new LinkedList<>(); |
|
|
|
|
//二级部门
|
|
|
|
|
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID)); |
|
|
|
|
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { |
|
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(); |
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>() |
|
|
|
|
.eq(DepartAbilityEvaluation::getDepetId, depart.getId())); |
|
|
|
|
List<DepartAbilityEvaluation> vos = new LinkedList<>(); |
|
|
|
|
Map<String, List<DepartAbilityEvaluation>> capacityIdListMap = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId)); |
|
|
|
|
//遍历分组后的结果
|
|
|
|
|
Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluationList = value; |
|
|
|
|
double sum = departAbilityEvaluationList.stream().mapToDouble(obj -> obj.getValue()).sum(); |
|
|
|
|
DecimalFormat decimalFormat = new DecimalFormat(); |
|
|
|
|
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
|
|
|
|
|
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
|
|
|
|
|
double val = ComputeUtils.div2(sum, departAbilityEvaluationList.size()); |
|
|
|
|
DepartAbilityEvaluation vo = new DepartAbilityEvaluation(); |
|
|
|
|
vo.setDepetId(depart.getId()); |
|
|
|
|
vo.setValue(val); |
|
|
|
|
vo.setCapacityId(key); |
|
|
|
|
vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); |
|
|
|
|
vos.add(vo); |
|
|
|
|
}); |
|
|
|
|
resultMap.put(depart.getDepartName(), vos); |
|
|
|
|
resultList.add(resultMap); |
|
|
|
|
}); |
|
|
|
|
return resultList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @description: 单项比赛数据展示 |
|
|
|
|
* 使用大数据页面的形式全面展示某项比赛的各种综合数据,包括年度比赛列表、比赛项目数、参赛人数统计、多维度能力评价分析数据、近五年比赛人数对比,比赛获奖列表,参赛人员积分列表。需要提供功能截图。 |
|
|
|
@ -144,10 +216,13 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
List<PersonalCompScore> personalCompScoreList = iPersonalCompScoreService.list(new LambdaQueryWrapper<PersonalCompScore>().in(PersonalCompScore::getAnnualCompId, annualCompIds)); |
|
|
|
|
//参加该比赛的所有学生学号
|
|
|
|
|
Set<String> workNos = Optional.ofNullable(personalCompScoreList).orElse(new ArrayList<>()).stream().map(personalCompScore -> personalCompScore.getWorkOn()).collect(Collectors.toSet()); |
|
|
|
|
List<PersonalCompTotalScore> personalCompTotalScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>() |
|
|
|
|
.in(PersonalCompTotalScore::getWorkOn, workNos) |
|
|
|
|
.orderByDesc(PersonalCompTotalScore::getScore) |
|
|
|
|
.last("limit 50")); |
|
|
|
|
List<PersonalCompTotalScore> personalCompTotalScoreList = null; |
|
|
|
|
if (!ObjectUtils.isEmpty(workNos)) { |
|
|
|
|
personalCompTotalScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>() |
|
|
|
|
.in(PersonalCompTotalScore::getWorkOn, workNos) |
|
|
|
|
.orderByDesc(PersonalCompTotalScore::getScore) |
|
|
|
|
.last("limit 50")); |
|
|
|
|
} |
|
|
|
|
//学生积分排名
|
|
|
|
|
resultMap.put("studentScore", personalCompTotalScoreList); |
|
|
|
|
|
|
|
|
|