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

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. 86
      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 = "河南机电-部门比赛数据展示") @ApiOperation(value = "河南机电-部门比赛数据展示", notes = "河南机电-部门比赛数据展示")
@GetMapping(value = "/depart") @GetMapping(value = "/depart")
public Result bigScreen4Depart(String departId) { public Result bigScreen4Depart(String departId) {
Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart(); Map<String, Object> result = compSystemBigScreenService.bigScreen4Depart(departId);
return Result.ok(result); return Result.ok(result);
} }

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

@ -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;
}
} }

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

Loading…
Cancel
Save