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

dev
zhc077 5 months ago
parent 8f63b33032
commit 6f9e348266
  1. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java
  2. 2
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java
  3. 90
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java
  4. 16
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java

@ -41,7 +41,7 @@ public class CompSystemBigScreenController /*extends JeecgController*/ {
@ApiOperation(value = "河南机电-部门比赛数据展示", notes = "河南机电-部门比赛数据展示")
@GetMapping(value = "/depart")
public Result bigScreen4Depart(String departId) {
Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart();
Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart(departId);
return Result.ok(result);
}

@ -5,7 +5,7 @@ import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation
import java.util.Map;
public interface CompSystemBigScreenService {
Map<String, Object> bigScreen4Depart();
Map<String, Object> bigScreen4Depart(String departId);
Map<String, Object> bigScreen4Student(PersonalAbilityEvaluation personalAbilityEvaluation);

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.bigScreen.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation;
import org.jeecg.modules.demo.abilityEvaluation.entity.PersonalAbilityEvaluation;
@ -93,19 +94,26 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
* @description: 部门比赛数据展示
* 使用大数据页面的形式全面展示各部门参加比赛的数据可以用多幅大数据页面分别展示展示内容包括多维度能力评价数据获奖情况得分情况参赛情况需要提供功能截图
* @param: []
* @return: java.util.Map<java.lang.String,java.lang.Object>
* @return: java.util.Map<java.lang.String, java.lang.Object>
* @author: z.h.c
* @date: 24/7/3 17:27
*/
@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<>();
//比赛列表
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 -> {
// 根据报名编号查询参赛者信息,都是个人赛场景
TeamManagement management = iTeamManagementService.getOne(new LambdaQueryWrapper<TeamManagement>()
@ -116,36 +124,52 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(award.getAnnualCompP());
award.setAnnualCompPname(annualCompPoint.getObjName());
});
//获奖列表
resultMap.put("awardList", awardPersionList);
List<PersonalCompTotalScore> personalCompScoreList = iPersonalCompTotalScoreService.list(new LambdaQueryWrapper<PersonalCompTotalScore>()
.eq(PersonalCompTotalScore::getDepet, departId)
.orderByDesc(PersonalCompTotalScore::getScore)
.last("limit 50"));
//学生积分排名
resultMap.put("studentScore", personalCompScoreList);
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("pointCount", pointCount);
//总报名数数
Long count = iAnnualCompetitionProjectRegistrationService.count();
// long pointCount = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getAnnualCompPointNumber()).sum();
// compCounts.put("pointCount", pointCount);
//总报名数
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>()
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0"));
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()));
//学生人数
compCounts.put("personCompCount", personCount);
Long teamCount = count - personCount;
//队伍数
compCounts.put("teamCompCount", teamCount);
//比赛统计
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);
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<>();
Optional.ofNullable(annualList).orElse(new LinkedList<>()).stream().forEach(annual -> {
Last5YearDataVo last5YearDataVo = new Last5YearDataVo();
@ -264,7 +288,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
* 使用大数据页面的形式全面展示系统管理的各种综合数据
* 包括比赛列表比赛总数统计参赛人数统计多维度能力评价分析数据近五年比赛数和总人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
* @param: []
* @return: java.util.Map<java.lang.String,java.lang.Object>
* @return: java.util.Map<java.lang.String, java.lang.Object>
* @author: z.h.c
* @date: 24/7/3 16:25
*/
@ -313,7 +337,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
resultMap.put("compCounts", compCounts);
List<DepartAbilityEvaluation> departAbilityEvaluations = iDepartAbilityEvaluationService.list();
resultMap.put("departAbilityEvaluation", departAbilityEvaluations);
resultMap.put("abilityEvaluation", departAbilityEvaluations);
List<Integer> years = DateUtils.getLastxYear(5);
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)) {
Comp comp = iCompService.getById(annualComp.getCompid());
if (!ObjectUtils.isEmpty(comp)) {
compVo.setCompId(comp.getId());
compVo.setCompName(comp.getCompName());
compVo.setCompOrganId(comp.getCompOrgan());
SysDepart sysDepart = iSysDepartService.getById(comp.getCompOrgan());
compVo.setCompOrganName(sysDepart.getDepartName());
}
@ -367,4 +393,40 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
});
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;
}
}

@ -14,8 +14,11 @@ import java.io.Serializable;
@Data
public class CompVo implements Serializable {
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "比赛id")
private String compId;
// @ApiModelProperty(value = "年度比赛项目id")
// private String annualCompPointId;
/**
* 比赛名称
@ -23,11 +26,18 @@ public class CompVo implements Serializable {
@ApiModelProperty(value = "比赛名称")
private String compName;
@ApiModelProperty(value = "负责部门")
@ApiModelProperty(value = "部门id")
private String compOrganId;
@ApiModelProperty(value = "部门名称")
private String compOrganName;
@ApiModelProperty(value = "奖项名称")
private java.lang.String awardName;
@ApiModelProperty(value = "参数人数")
private Integer number;
@ApiModelProperty(value = "年度比赛项目数")
private Integer annualCompPointNumber;
}

Loading…
Cancel
Save