|
|
|
@ -6,7 +6,9 @@ import org.jeecg.common.exception.JeecgBootException; |
|
|
|
|
import org.jeecg.common.util.ComputeUtils; |
|
|
|
|
import org.jeecg.common.util.DateUtils; |
|
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; |
|
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluationCollect; |
|
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.service.IDepartAbilityEvaluationService; |
|
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.service.IPersonalAbilityEvaluationCollectService; |
|
|
|
|
import org.jeecg.modules.demo.annual.entity.Annual; |
|
|
|
|
import org.jeecg.modules.demo.annual.service.IAnnualService; |
|
|
|
|
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; |
|
|
|
@ -19,14 +21,23 @@ import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService |
|
|
|
|
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; |
|
|
|
|
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration; |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement; |
|
|
|
|
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; |
|
|
|
|
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; |
|
|
|
|
import org.jeecg.modules.demo.comptype.service.ICompTypeService; |
|
|
|
|
import org.jeecg.modules.demo.homepage.vo.HomePageCompVo; |
|
|
|
|
import org.jeecg.modules.demo.homepage.vo.ReportCompVo; |
|
|
|
|
import org.jeecg.modules.demo.projectlevel.entity.Projectlevel; |
|
|
|
|
import org.jeecg.modules.demo.projectlevel.service.IProjectlevelService; |
|
|
|
|
import org.jeecg.modules.system.entity.SysDepart; |
|
|
|
|
import org.jeecg.modules.system.service.ISysDepartService; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
@ -55,9 +66,8 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
@Autowired |
|
|
|
|
private ICompService iCompService; |
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private ICompTypeService iCompTypeService;
|
|
|
|
|
//
|
|
|
|
|
@Autowired |
|
|
|
|
private ICompTypeService iCompTypeService; |
|
|
|
|
@Autowired |
|
|
|
|
private ISysDepartService iSysDepartService; |
|
|
|
|
|
|
|
|
@ -67,11 +77,11 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
@Autowired |
|
|
|
|
private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService; |
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private ITeamManagementService iTeamManagementService;
|
|
|
|
|
@Autowired |
|
|
|
|
private ITeamManagementService iTeamManagementService; |
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private IAwardPersionService iAwardPersionService;
|
|
|
|
|
@Autowired |
|
|
|
|
private IAwardPersionService iAwardPersionService; |
|
|
|
|
//
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private ISysUserService iSysUserService;
|
|
|
|
@ -85,11 +95,11 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
@Autowired |
|
|
|
|
private IDepartAbilityEvaluationService iDepartAbilityEvaluationService; |
|
|
|
|
|
|
|
|
|
// @Autowired
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private IPersonalAbilityEvaluationService iPersonalAbilityEvaluationService;
|
|
|
|
|
//
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private IPersonalAbilityEvaluationCollectService iPersonalAbilityEvaluationCollectService;
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IPersonalAbilityEvaluationCollectService iPersonalAbilityEvaluationCollectService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IAnnualService iAnnualService; |
|
|
|
@ -346,6 +356,247 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
return resultMap; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> report4School() { |
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(); |
|
|
|
|
int currentYear = DateUtils.getCurrentYear(); |
|
|
|
|
//当前年度
|
|
|
|
|
Annual annual = iAnnualService.getOne(new LambdaQueryWrapper<Annual>().eq(Annual::getAnnualName, currentYear + "")); |
|
|
|
|
|
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>() |
|
|
|
|
.eq(AnnualComp::getAnnualid, annual.getId())); |
|
|
|
|
|
|
|
|
|
Set<String> compIds = Optional.ofNullable(annualCompList).orElse(new LinkedList<>()).stream().map(obj -> obj.getId()).collect(Collectors.toSet()); |
|
|
|
|
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(!ObjectUtils.isEmpty(compIds), AnnualCompPoint::getAnnualCompId, compIds)); |
|
|
|
|
//当前年,所有项目id
|
|
|
|
|
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
|
|
//未评奖的项目为进行中
|
|
|
|
|
List<AnnualCompPoint> pj0PointList = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().filter(bo -> "0".equals(bo.getIsPj())).collect(Collectors.toList()); |
|
|
|
|
Map<String, Object> countMap = this.convertProjectLevel(annualCompPointList); |
|
|
|
|
countMap.put("本年度已开展比赛项目数", annualCompPointList.size()); |
|
|
|
|
countMap.put("本年度参加比赛队伍数", 0); |
|
|
|
|
countMap.put("正在进行的比赛数", pj0PointList.size()); |
|
|
|
|
int donePointCount = annualCompPointList.size() - pj0PointList.size(); |
|
|
|
|
countMap.put("已完成的比赛", donePointCount); |
|
|
|
|
countMap.put("未完成的比赛", pj0PointList.size()); |
|
|
|
|
if (donePointCount > 0) { |
|
|
|
|
DecimalFormat decimalFormat = new DecimalFormat(); |
|
|
|
|
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
|
|
|
|
|
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
|
|
|
|
|
double val = ComputeUtils.div2(donePointCount, annualCompPointList.size()); |
|
|
|
|
countMap.put("已完成比赛比率", val); |
|
|
|
|
} else { |
|
|
|
|
countMap.put("已完成比赛比率", 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<PersonalAbilityEvaluationCollect> evaluationCollects = iPersonalAbilityEvaluationCollectService |
|
|
|
|
.list(new LambdaQueryWrapper<PersonalAbilityEvaluationCollect>() |
|
|
|
|
.orderByDesc(PersonalAbilityEvaluationCollect::getCreateTime) |
|
|
|
|
.last(" limit 60")); |
|
|
|
|
resultMap.put("前60名学生能力值", evaluationCollects); |
|
|
|
|
|
|
|
|
|
List<PersonalAbilityEvaluationCollect> vos = new LinkedList<>(); |
|
|
|
|
Map<String, List<PersonalAbilityEvaluationCollect>> capacityIdListMap = Optional.ofNullable(evaluationCollects).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(PersonalAbilityEvaluationCollect::getCapacityId)); |
|
|
|
|
//遍历分组后的结果
|
|
|
|
|
Optional.ofNullable(capacityIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
List<PersonalAbilityEvaluationCollect> 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()); |
|
|
|
|
PersonalAbilityEvaluationCollect vo = new PersonalAbilityEvaluationCollect(); |
|
|
|
|
vo.setValue(val); |
|
|
|
|
vo.setCapacityId(key); |
|
|
|
|
vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); |
|
|
|
|
vos.add(vo); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("前60名学生能力平均值", vos); |
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> abilityList = new LinkedList<>(); |
|
|
|
|
List<Integer> years = DateUtils.getLastxYear(2); |
|
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); |
|
|
|
|
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(bo -> { |
|
|
|
|
Map<String, Object> abilityResultMap = new LinkedHashMap<>(); |
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>() |
|
|
|
|
.eq(DepartAbilityEvaluation::getAnnualId, bo.getId())); |
|
|
|
|
List<DepartAbilityEvaluation> voList = new LinkedList<>(); |
|
|
|
|
Map<String, List<DepartAbilityEvaluation>> capacityIdListMap2 = Optional.ofNullable(departAbilityEvaluations).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(DepartAbilityEvaluation::getCapacityId)); |
|
|
|
|
//遍历分组后的结果
|
|
|
|
|
Optional.ofNullable(capacityIdListMap2).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.setAnnualId(bo.getId()); |
|
|
|
|
vo.setValue(val); |
|
|
|
|
vo.setCapacityId(key); |
|
|
|
|
vo.setCapacityName(departAbilityEvaluationList.get(0).getCapacityName()); |
|
|
|
|
voList.add(vo); |
|
|
|
|
}); |
|
|
|
|
abilityResultMap.put(bo.getAnnualName(), voList); |
|
|
|
|
abilityList.add(abilityResultMap); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("近2年能力分析", abilityList); |
|
|
|
|
|
|
|
|
|
resultMap.put("比赛类型占比", convertCompType(iCompService.list())); |
|
|
|
|
|
|
|
|
|
List<AnnualCompPoint> pointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() |
|
|
|
|
.eq(AnnualCompPoint::getRequireApply, "Y")); |
|
|
|
|
List<ReportCompVo> compVoList = new LinkedList<>(); |
|
|
|
|
Optional.ofNullable(pointList).orElse(new LinkedList<>()).stream().forEach(p -> { |
|
|
|
|
ReportCompVo compVo = new ReportCompVo(); |
|
|
|
|
BeanUtils.copyProperties(p, compVo); |
|
|
|
|
compVo.setPointName(p.getObjName()); |
|
|
|
|
|
|
|
|
|
AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualComp)) { |
|
|
|
|
Comp comp = iCompService.getById(annualComp.getCompid()); |
|
|
|
|
compVo.setCompName(comp.getCompName()); |
|
|
|
|
CompType compType = iCompTypeService.getById(comp.getCompTypeId()); |
|
|
|
|
compVo.setTypeName(compType.getTypeName()); |
|
|
|
|
Projectlevel projectlevel = iProjectlevelService.getById(p.getObjLevel()); |
|
|
|
|
compVo.setProjectLevel(projectlevel.getName()); |
|
|
|
|
} |
|
|
|
|
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); |
|
|
|
|
if (!ObjectUtils.isEmpty(list)) { |
|
|
|
|
Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats)); |
|
|
|
|
compVo.setNumber(count.intValue()); |
|
|
|
|
} |
|
|
|
|
compVoList.add(compVo); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("学生参赛情况", compVoList); |
|
|
|
|
|
|
|
|
|
List<AwardPersion> awardPersionList = iAwardPersionService.list(); |
|
|
|
|
Map<String, List<AwardPersion>> awardIdListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(AwardPersion::getAwardname)); |
|
|
|
|
Map<String, Object> awardTypeMap = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
|
|
//遍历分组后的结果
|
|
|
|
|
Optional.ofNullable(awardIdListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
Map<String, Object> awardIdMap = new LinkedHashMap<>(); |
|
|
|
|
awardIdMap.put(key, value.size()); |
|
|
|
|
awardTypeMap.putAll(awardIdMap); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("比赛获奖占比", awardTypeMap); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<ReportCompVo> awareVos = new ArrayList<>(); |
|
|
|
|
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream().forEach(p -> { |
|
|
|
|
ReportCompVo compVo = new ReportCompVo(); |
|
|
|
|
compVo.setStuName(p.getStudentname()); |
|
|
|
|
// BeanUtils.copyProperties(p, compVo);
|
|
|
|
|
AnnualCompPoint point = iAnnualCompPointService.getById(p.getAnnualCompP()); |
|
|
|
|
if (!ObjectUtils.isEmpty(point)) { |
|
|
|
|
compVo.setPointName(point.getObjName()); |
|
|
|
|
Projectlevel projectlevel = iProjectlevelService.getById(point.getObjLevel()); |
|
|
|
|
compVo.setProjectLevel(projectlevel.getName()); |
|
|
|
|
} |
|
|
|
|
AnnualComp annualComp = iAnnualCompService.getById(p.getAnnalComp()); |
|
|
|
|
if (!ObjectUtils.isEmpty(annualComp)) { |
|
|
|
|
Comp comp = iCompService.getById(annualComp.getCompid()); |
|
|
|
|
compVo.setCompName(comp.getCompName()); |
|
|
|
|
CompType compType = iCompTypeService.getById(comp.getCompTypeId()); |
|
|
|
|
compVo.setTypeName(compType.getTypeName()); |
|
|
|
|
} |
|
|
|
|
awareVos.add(compVo); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("比赛获奖情况列表", awareVos); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> canSaiList = new LinkedList<>(); |
|
|
|
|
List<Map<String, Object>> huoJiangList = new LinkedList<>(); |
|
|
|
|
//二级部门
|
|
|
|
|
final String BASE_PARENT_ID = "1693446350597038081"; |
|
|
|
|
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID)); |
|
|
|
|
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { |
|
|
|
|
List<AnnualCompPoint> pointList4Depart = convertPoint4Depart(depart); |
|
|
|
|
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("部门名称", depart.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(registrationList).orElse(new LinkedList<>()).stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count4Stu = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, enrollCodes4Stu)); |
|
|
|
|
//学生人数
|
|
|
|
|
departMap.put("参加学生数", count4Stu); |
|
|
|
|
departMap.put("队伍数", registrationList.size() - registrationList4Stu.size()); |
|
|
|
|
} |
|
|
|
|
canSaiList.add(departMap); |
|
|
|
|
|
|
|
|
|
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()); |
|
|
|
|
Map<String, List<AwardPersion>> awardNameMap = Optional.ofNullable(awardPersionList4Depart).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(AwardPersion::getAwardname)); |
|
|
|
|
//遍历分组后的结果
|
|
|
|
|
Optional.ofNullable(awardNameMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
Map<String, Object> awardTypeMap2 = new HashMap<>(); |
|
|
|
|
awardTypeMap2.put(key, value.size()); |
|
|
|
|
departHuoJiangMap.putAll(awardTypeMap2); |
|
|
|
|
}); |
|
|
|
|
huoJiangList.add(departHuoJiangMap); |
|
|
|
|
}); |
|
|
|
|
resultMap.put("部门参赛情况列表", canSaiList); |
|
|
|
|
resultMap.put("部门获奖情况列表", huoJiangList); |
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> report4Depart() { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, Object> convertProjectLevel(List<AnnualCompPoint> annualCompPointList) { |
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>(); |
|
|
|
|
Map<String, List<AnnualCompPoint>> objLevelIdsMap = Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream() |
|
|
|
@ -359,4 +610,35 @@ public class UserHomePageServiceImpl implements UserHomePageService { |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Map<String, Object> convertCompType(List<Comp> compList) { |
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>(); |
|
|
|
|
Map<String, List<Comp>> typeIdsMap = Optional.ofNullable(compList).orElse(new LinkedList<>()).stream() |
|
|
|
|
.collect(Collectors.groupingBy(Comp::getCompTypeId)); |
|
|
|
|
Optional.ofNullable(typeIdsMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> { |
|
|
|
|
Map<String, Object> levelMap = new LinkedHashMap<>(); |
|
|
|
|
CompType compType = iCompTypeService.getById(key); |
|
|
|
|
levelMap.put(compType.getTypeName(), value.size()); |
|
|
|
|
map.putAll(levelMap); |
|
|
|
|
}); |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<CompVo> getCompList() { |
|
|
|
|
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() |
|
|
|
|
.eq(AnnualCompPoint::getRequireApply, "Y")); |
|
|
|
|
List<CompVo> compVoList = new LinkedList<>(); |
|
|
|
|
Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().forEach(p -> { |
|
|
|
|
CompVo compVo = new CompVo(); |
|
|
|
|
BeanUtils.copyProperties(p, compVo); |
|
|
|
|
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); |
|
|
|
|
if (!ObjectUtils.isEmpty(list)) { |
|
|
|
|
Set<String> entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); |
|
|
|
|
Long count = iTeamManagementService.count(new LambdaQueryWrapper<TeamManagement>().in(TeamManagement::getEnrollCode, entryFormats)); |
|
|
|
|
compVo.setNumber(count.intValue()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return compVoList; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|