河南机电职业学院-大屏数据统计

dev
zhc077 5 months ago
parent 72d4e222da
commit 8f63b33032
  1. 15
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java
  2. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java
  3. 96
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java

@ -16,13 +16,13 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* @Description: 比赛综合管理系统大屏 * @Description: 河南机电比赛大屏
* @Author: Z.H.C * @Author: Z.H.C
* @CreateTime: 2023-11-28 16:45 * @CreateTime: 2023-11-28 16:45
* @Version: 1.0 * @Version: 1.0
*/ */
@Api(tags = "比赛系统大屏") @Api(tags = "河南机电比赛系统大屏")
@RestController @RestController
@RequestMapping("/comp/bigScreen") @RequestMapping("/comp/bigScreen")
@Slf4j @Slf4j
@ -31,9 +31,16 @@ public class CompSystemBigScreenController /*extends JeecgController*/ {
@Autowired @Autowired
private CompSystemBigScreenService compSystemBigScreenService; private CompSystemBigScreenService compSystemBigScreenService;
@ApiOperation(value = "院系综合大屏", notes = "院系综合大屏") @ApiOperation(value = "河南机电-比赛数据综合展示", notes = "河南机电-比赛数据综合展示")
@GetMapping(value = "/composite")
public Result composite(HttpServletRequest req) {
Map<String, Object> result = compSystemBigScreenService.composite();
return Result.ok(result);
}
@ApiOperation(value = "河南机电-部门比赛数据展示", notes = "河南机电-部门比赛数据展示")
@GetMapping(value = "/depart") @GetMapping(value = "/depart")
public Result bigScreen4Depart(HttpServletRequest req) { public Result bigScreen4Depart(String departId) {
Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart(); Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart();
return Result.ok(result); return Result.ok(result);
} }

@ -8,4 +8,7 @@ public interface CompSystemBigScreenService {
Map<String, Object> bigScreen4Depart(); Map<String, Object> bigScreen4Depart();
Map<String, Object> bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation); Map<String, Object> bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation);
Map<String, Object> composite();
} }

@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* @Description: TODO * @Description: 河南机电-大屏
* @Author: Z.H.C * @Author: Z.H.C
* @CreateTime: 2023-11-28 17:00 * @CreateTime: 2023-11-28 17:00
* @Version: 1.0 * @Version: 1.0
@ -89,11 +89,20 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
@Autowired @Autowired
private IAnnualService iAnnualService; private IAnnualService iAnnualService;
/**
* @description: 部门比赛数据展示
* 使用大数据页面的形式全面展示各部门参加比赛的数据可以用多幅大数据页面分别展示展示内容包括多维度能力评价数据获奖情况得分情况参赛情况需要提供功能截图
* @param: []
* @return: java.util.Map<java.lang.String,java.lang.Object>
* @author: z.h.c
* @date: 24/7/3 17:27
*/
@Override @Override
public Map<String, Object> bigScreen4Depart() { public Map<String, Object> bigScreen4Depart() {
Map<String, Object> resultMap = new LinkedHashMap<>(); Map<String, Object> resultMap = new LinkedHashMap<>();
//比赛列表
resultMap.put("compList", this.getCompList()); resultMap.put("compList", this.getCompList());
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().last("limit 30")); List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().last("limit 30"));
@ -250,6 +259,91 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
return resultMap; return resultMap;
} }
/**
* @description: 比赛数据综合展示
* 使用大数据页面的形式全面展示系统管理的各种综合数据
* 包括比赛列表比赛总数统计参赛人数统计多维度能力评价分析数据近五年比赛数和总人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
* @param: []
* @return: java.util.Map<java.lang.String,java.lang.Object>
* @author: z.h.c
* @date: 24/7/3 16:25
*/
@Override
public Map<String, Object> composite() {
Map<String, Object> resultMap = new LinkedHashMap<>();
//比赛列表
resultMap.put("compList", this.getCompList());
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>().last("limit 30"));
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> {
// 根据报名编号查询参赛者信息,都是个人赛场景
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>()
.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<PersonalCompTotalScore> personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>()
.orderByDesc(PersonalCompTotalScore::getScore)
.last("limit 50"));
//学生积分排行前50名
resultMap.put("studentScore", personalCompScoreList);
Map<String, Object> 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<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0"));
//学生人数
compCounts.put("personCompCount", personCount);
Long teamCount = count - personCount;
//队伍数
compCounts.put("teamCompCount", teamCount);
resultMap.put("compCounts", compCounts);
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list();
resultMap.put("departAbilityEvaluation", departAbilityEvaluations);
List<Integer> years = DateUtils.getLastxYear(5);
List<Annual> annualList = iAnnualService.list(new LambdaQueryWrapper<Annual>().in(Annual::getAnnualName, years).orderByAsc(Annual::getAnnualName));
List<Last5YearDataVo> last5YearDataVos = new LinkedList<>();
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> {
Last5YearDataVo last5YearDataVo = new Last5YearDataVo();
last5YearDataVo.setYear(annual.getAnnualName());
AtomicReference<BigDecimal> personCount4Comp = new AtomicReference<>(BigDecimal.ZERO);
List<AnnualComp> annualCompList = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getAnnualid, annual.getId()));
//比赛数
last5YearDataVo.setCompCount(annualCompList.size());
if (!ObjectUtils.isEmpty(annualCompList)) {
annualCompList.stream().forEach(ac -> {
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper<AnnualCompPoint>().eq(AnnualCompPoint::getAnnualCompId, ac.getId()));
if (!ObjectUtils.isEmpty(annualCompPoint)) {
long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>().
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<CompVo> getCompList() { List<CompVo> getCompList() {
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>() List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>()
.eq(AnnualCompPoint::getRequireApply, "Y")); .eq(AnnualCompPoint::getRequireApply, "Y"));

Loading…
Cancel
Save