|
|
@ -1,6 +1,7 @@ |
|
|
|
package org.jeecg.modules.demo.bigScreen.service; |
|
|
|
package org.jeecg.modules.demo.bigScreen.service; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import org.jeecg.common.exception.JeecgBootException; |
|
|
|
import org.jeecg.common.util.DateUtils; |
|
|
|
import org.jeecg.common.util.DateUtils; |
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; |
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation; |
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation; |
|
|
|
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation; |
|
|
@ -98,14 +99,21 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
* @date: 24/7/3 17:27 |
|
|
|
* @date: 24/7/3 17:27 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> bigScreen4Depart() { |
|
|
|
public Map<String, Object> bigScreen4Depart(String departId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(departId, "部门id不能为空"); |
|
|
|
|
|
|
|
SysDepart sysDepart = iSysDepartService.getById(departId); |
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(sysDepart)) { |
|
|
|
|
|
|
|
throw new JeecgBootException("部门不存在"); |
|
|
|
|
|
|
|
} |
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(); |
|
|
|
Map<String, Object> resultMap = new LinkedHashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
//比赛列表
|
|
|
|
//比赛列表
|
|
|
|
resultMap.put("compList", this.getCompList()); |
|
|
|
List<CompVo> compVoList = this.getCompList4Depart(sysDepart); |
|
|
|
|
|
|
|
resultMap.put("compList", compVoList); |
|
|
|
|
|
|
|
|
|
|
|
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().last("limit 30")); |
|
|
|
|
|
|
|
|
|
|
|
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().eq(AwardPersion::getSysOrgCode, sysDepart.getOrgCode()).last("limit 30")); |
|
|
|
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { |
|
|
|
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { |
|
|
|
// 根据报名编号查询参赛者信息,都是个人赛场景
|
|
|
|
// 根据报名编号查询参赛者信息,都是个人赛场景
|
|
|
|
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>() |
|
|
|
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>() |
|
|
@ -116,36 +124,52 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP()); |
|
|
|
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP()); |
|
|
|
award.setAnnualCompPname(annualCompPoint.getObjName()); |
|
|
|
award.setAnnualCompPname(annualCompPoint.getObjName()); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
//获奖列表
|
|
|
|
resultMap.put("awardList", awardPersionList); |
|
|
|
resultMap.put("awardList", awardPersionList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PersonalCompTotalScore> personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>() |
|
|
|
List<PersonalCompTotalScore> personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>() |
|
|
|
|
|
|
|
.eq(PersonalCompTotalScore::getDepet, departId) |
|
|
|
.orderByDesc(PersonalCompTotalScore::getScore) |
|
|
|
.orderByDesc(PersonalCompTotalScore::getScore) |
|
|
|
.last("limit 50")); |
|
|
|
.last("limit 50")); |
|
|
|
|
|
|
|
//学生积分排名
|
|
|
|
resultMap.put("studentScore", personalCompScoreList); |
|
|
|
resultMap.put("studentScore", personalCompScoreList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> compCounts = new LinkedHashMap<>(); |
|
|
|
Map<String, Object> compCounts = new LinkedHashMap<>(); |
|
|
|
Long compCount = iCompService.count(); |
|
|
|
// Long pointCount = iAnnualCompPointService.count();
|
|
|
|
Long pointCount = iAnnualCompPointService.count(); |
|
|
|
Long compCount = iCompService.count(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, departId)); |
|
|
|
//比赛数
|
|
|
|
//比赛数
|
|
|
|
compCounts.put("compCount", compCount); |
|
|
|
compCounts.put("compCount", compCount); |
|
|
|
//年度项目比赛数
|
|
|
|
//年度项目比赛数
|
|
|
|
compCounts.put("pointCount", pointCount); |
|
|
|
// long pointCount = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getAnnualCompPointNumber()).sum();
|
|
|
|
//总报名数数
|
|
|
|
// compCounts.put("pointCount", pointCount);
|
|
|
|
Long count = iAnnualCompetitionProjectRegistrationService.count(); |
|
|
|
//总报名数
|
|
|
|
|
|
|
|
long count = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getNumber()).sum(); |
|
|
|
|
|
|
|
//总报名数
|
|
|
|
|
|
|
|
compCounts.put("count", count); |
|
|
|
Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")); |
|
|
|
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0") |
|
|
|
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode())); |
|
|
|
//学生人数
|
|
|
|
//学生人数
|
|
|
|
compCounts.put("personCompCount", personCount); |
|
|
|
compCounts.put("personCompCount", personCount); |
|
|
|
Long teamCount = count - personCount; |
|
|
|
Long teamCount = count - personCount; |
|
|
|
//队伍数
|
|
|
|
//队伍数
|
|
|
|
compCounts.put("teamCompCount", teamCount); |
|
|
|
compCounts.put("teamCompCount", teamCount); |
|
|
|
|
|
|
|
//比赛统计
|
|
|
|
resultMap.put("compCounts", compCounts); |
|
|
|
resultMap.put("compCounts", compCounts); |
|
|
|
|
|
|
|
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(); |
|
|
|
|
|
|
|
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(new LambdaQueryWrapper<DepartAbilityEvaluation>() |
|
|
|
|
|
|
|
.eq(DepartAbilityEvaluation::getDepetId, departId)); |
|
|
|
|
|
|
|
//能力评估
|
|
|
|
resultMap.put("departAbilityEvaluation", departAbilityEvaluations); |
|
|
|
resultMap.put("departAbilityEvaluation", departAbilityEvaluations); |
|
|
|
|
|
|
|
|
|
|
|
List<Integer> years = DateUtils.getLastxYear(5); |
|
|
|
List<Integer> years = DateUtils.getLastxYear(5); |
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); |
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>() |
|
|
|
|
|
|
|
.in(Annual::getAnnualName, years) |
|
|
|
|
|
|
|
.eq(Annual::getSysOrgCode, sysDepart.getOrgCode()) |
|
|
|
|
|
|
|
.orderByAsc(Annual::getAnnualName)); |
|
|
|
List<Last5YearDataVo> last5YearDataVos = new LinkedList<>(); |
|
|
|
List<Last5YearDataVo> last5YearDataVos = new LinkedList<>(); |
|
|
|
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { |
|
|
|
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { |
|
|
|
Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); |
|
|
|
Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); |
|
|
@ -313,7 +337,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
resultMap.put("compCounts", compCounts); |
|
|
|
resultMap.put("compCounts", compCounts); |
|
|
|
|
|
|
|
|
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(); |
|
|
|
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list(); |
|
|
|
resultMap.put("departAbilityEvaluation", departAbilityEvaluations); |
|
|
|
resultMap.put("abilityEvaluation", departAbilityEvaluations); |
|
|
|
|
|
|
|
|
|
|
|
List<Integer> years = DateUtils.getLastxYear(5); |
|
|
|
List<Integer> years = DateUtils.getLastxYear(5); |
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); |
|
|
|
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); |
|
|
@ -358,7 +382,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
if (!ObjectUtils.isEmpty(annualComp)) { |
|
|
|
if (!ObjectUtils.isEmpty(annualComp)) { |
|
|
|
Comp comp = iCompService.getById(annualComp.getCompid()); |
|
|
|
Comp comp = iCompService.getById(annualComp.getCompid()); |
|
|
|
if (!ObjectUtils.isEmpty(comp)) { |
|
|
|
if (!ObjectUtils.isEmpty(comp)) { |
|
|
|
|
|
|
|
compVo.setCompId(comp.getId()); |
|
|
|
compVo.setCompName(comp.getCompName()); |
|
|
|
compVo.setCompName(comp.getCompName()); |
|
|
|
|
|
|
|
compVo.setCompOrganId(comp.getCompOrgan()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getById(comp.getCompOrgan()); |
|
|
|
SysDepart sysDepart = iSysDepartService.getById(comp.getCompOrgan()); |
|
|
|
compVo.setCompOrganName(sysDepart.getDepartName()); |
|
|
|
compVo.setCompOrganName(sysDepart.getDepartName()); |
|
|
|
} |
|
|
|
} |
|
|
@ -367,4 +393,40 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
}); |
|
|
|
}); |
|
|
|
return compVoList; |
|
|
|
return compVoList; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CompVo> getCompList4Depart(SysDepart sysDepart) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//比赛表
|
|
|
|
|
|
|
|
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, sysDepart.getId())); |
|
|
|
|
|
|
|
List<CompVo> compVoList = new LinkedList<>(); |
|
|
|
|
|
|
|
Optional.ofNullable(compList).orElse(new LinkedList<>()).stream().forEach(c -> { |
|
|
|
|
|
|
|
CompVo compVo = new CompVo(); |
|
|
|
|
|
|
|
compVo.setCompId(c.getId()); |
|
|
|
|
|
|
|
compVo.setCompName(c.getCompName()); |
|
|
|
|
|
|
|
compVo.setCompOrganId(sysDepart.getId()); |
|
|
|
|
|
|
|
compVo.setCompOrganName(sysDepart.getDepartName()); |
|
|
|
|
|
|
|
compVo.setNumber(0); |
|
|
|
|
|
|
|
compVo.setAnnualCompPointNumber(0); |
|
|
|
|
|
|
|
//年度比赛表
|
|
|
|
|
|
|
|
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().in(AnnualComp::getCompid, c.getId())); |
|
|
|
|
|
|
|
Set<String> annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getId()).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
//年度比赛项目表
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompIds)) { |
|
|
|
|
|
|
|
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() |
|
|
|
|
|
|
|
.in(AnnualCompPoint::getAnnualCompId, annualCompIds)); |
|
|
|
|
|
|
|
compVo.setAnnualCompPointNumber(annualCompPointList.size()); |
|
|
|
|
|
|
|
Set<String> annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); |
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(annualCompPointIds)) { |
|
|
|
|
|
|
|
//报名表
|
|
|
|
|
|
|
|
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
|
|
|
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) |
|
|
|
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
compVo.setNumber(list.size()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
compVoList.add(compVo); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return compVoList; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|