From 8f63b3303221904c3d87014435de49fa558e0390 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Wed, 3 Jul 2024 17:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=B3=E5=8D=97=E6=9C=BA=E7=94=B5=E8=81=8C?= =?UTF-8?q?=E4=B8=9A=E5=AD=A6=E9=99=A2-=E5=A4=A7=E5=B1=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompSystemBigScreenController.java | 15 ++- .../service/CompSystemBigScreenService.java | 3 + .../CompSystemBigScreenServiceImpl.java | 96 ++++++++++++++++++- 3 files changed, 109 insertions(+), 5 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java index 9fd49b13..22fb41ed 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java @@ -16,13 +16,13 @@ import java.util.List; import java.util.Map; /** - * @Description: 比赛综合管理系统大屏 + * @Description: 河南机电比赛大屏 * @Author: Z.H.C * @CreateTime: 2023-11-28 16:45 * @Version: 1.0 */ -@Api(tags = "比赛系统大屏") +@Api(tags = "河南机电比赛系统大屏") @RestController @RequestMapping("/comp/bigScreen") @Slf4j @@ -31,9 +31,16 @@ public class CompSystemBigScreenController /*extends JeecgController*/ { @Autowired private CompSystemBigScreenService compSystemBigScreenService; - @ApiOperation(value = "院系综合大屏", notes = "院系综合大屏") + @ApiOperation(value = "河南机电-比赛数据综合展示", notes = "河南机电-比赛数据综合展示") + @GetMapping(value = "/composite") + public Result composite(HttpServletRequest req) { + Map result = compSystemBigScreenService.composite(); + return Result.ok(result); + } + + @ApiOperation(value = "河南机电-部门比赛数据展示", notes = "河南机电-部门比赛数据展示") @GetMapping(value = "/depart") - public Result bigScreen4Depart(HttpServletRequest req) { + public Result bigScreen4Depart(String departId) { Map result = compSystemBigScreenService.bigScreen4Depart(); return Result.ok(result); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java index e930981b..342edc5b 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java @@ -8,4 +8,7 @@ public interface CompSystemBigScreenService { Map bigScreen4Depart(); Map bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation); + + Map composite(); + } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java index 02c129c3..8536ff6f 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** - * @Description: TODO + * @Description: 河南机电-大屏 * @Author: Z.H.C * @CreateTime: 2023-11-28 17:00 * @Version: 1.0 @@ -89,11 +89,20 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic @Autowired private IAnnualService iAnnualService; + /** + * @description: 部门比赛数据展示 + * 使用大数据页面的形式全面展示各部门参加比赛的数据,可以用多幅大数据页面分别展示,展示内容包括:多维度能力评价数据、获奖情况、得分情况、参赛情况。需要提供功能截图。 + * @param: [] + * @return: java.util.Map + * @author: z.h.c + * @date: 24/7/3 17:27 + */ @Override public Map bigScreen4Depart() { Map resultMap = new LinkedHashMap<>(); + //比赛列表 resultMap.put("compList", this.getCompList()); List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().last("limit 30")); @@ -250,6 +259,91 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic return resultMap; } + /** + * @description: 比赛数据综合展示 + * 使用大数据页面的形式全面展示系统管理的各种综合数据, + * 包括比赛列表、比赛总数统计、参赛人数统计、多维度能力评价分析数据、近五年比赛数和总人数对比,比赛获奖列表,参赛人员积分列表。需要提供功能截图。 + * @param: [] + * @return: java.util.Map + * @author: z.h.c + * @date: 24/7/3 16:25 + */ + @Override + public Map composite() { + + Map resultMap = new LinkedHashMap<>(); + //比赛列表 + resultMap.put("compList", this.getCompList()); + List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper().last("limit 30")); + Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { + // 根据报名编号查询参赛者信息,都是个人赛场景 + TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper() + .eq(TeamManagement::getEnrollCode, award.getEnrollCode()).last("limit 1")); + if (ObjectUtils.isEmpty(management)) return; + SysUser sysUser = iSysUserService.getById(management.getUserId()); + award.setStudentname(sysUser.getRealname()); + AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP()); + award.setAnnualCompPname(annualCompPoint.getObjName()); + }); + //获奖列表 + resultMap.put("awardList", awardPersionList); + + List personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper() + .orderByDesc(PersonalCompTotalScore::getScore) + .last("limit 50")); + //学生积分排行前50名 + resultMap.put("studentScore", personalCompScoreList); + + Map compCounts = new LinkedHashMap<>(); + Long compCount = iCompService.count(); + Long pointCount = iAnnualCompPointService.count(); + //比赛数 + compCounts.put("compCount", compCount); + //年度项目比赛数 + compCounts.put("pointCount", pointCount); + //总报名数数 + Long count = iAnnualCompetitionProjectRegistrationService.count(); + Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")); + //学生人数 + compCounts.put("personCompCount", personCount); + Long teamCount = count - personCount; + //队伍数 + compCounts.put("teamCompCount", teamCount); + resultMap.put("compCounts", compCounts); + + List departAbilityEvaluations = iDepartAbilityEvaluationService.list(); + resultMap.put("departAbilityEvaluation", departAbilityEvaluations); + + List years = DateUtils.getLastxYear(5); + List annualList = iAnnualService.list(new LambdaQueryWrapper().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName)); + List last5YearDataVos = new LinkedList<>(); + Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> { + Last5YearDataVo last5YearDataVo = new Last5YearDataVo(); + last5YearDataVo.setYear(annual.getAnnualName()); + AtomicReference personCount4Comp = new AtomicReference<>(BigDecimal.ZERO); + + List annualCompList = iAnnualCompService.list(new LambdaQueryWrapper().eq(AnnualComp::getAnnualid, annual.getId())); + //比赛数 + last5YearDataVo.setCompCount(annualCompList.size()); + if (!ObjectUtils.isEmpty(annualCompList)) { + annualCompList.stream().forEach(ac -> { + AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); + if (!ObjectUtils.isEmpty(annualCompPoint)) { + long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper(). + eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); + personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp))); + } + }); + } + last5YearDataVo.setPersonCount(personCount4Comp.get().intValue()); + last5YearDataVos.add(last5YearDataVo); + }); + + resultMap.put("last5YearData", last5YearDataVos); + return resultMap; + } + List getCompList() { List annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper() .eq(AnnualCompPoint::getRequireApply, "Y"));