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

main
zhc077 5 months ago
parent 0aaac8b79a
commit 0e86c3ffc8
  1. 7
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java
  2. 12
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/controller/CompSystemBigScreenController.java
  3. 4
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenService.java
  4. 99
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java
  5. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java

@ -101,6 +101,13 @@ public class AnnualCompetitionProjectRegistration implements Serializable {
@ApiModelProperty(value = "队伍名称") @ApiModelProperty(value = "队伍名称")
private java.lang.String teamName; private java.lang.String teamName;
/**
* 队伍名称
*/
@Excel(name = "部门id", width = 30)
@ApiModelProperty(value = "部门id")
private java.lang.String departId;
@Excel(name = "年度", width = 15) @Excel(name = "年度", width = 15)
@ApiModelProperty(value = "年度") @ApiModelProperty(value = "年度")

@ -71,4 +71,16 @@ public class CompSystemBigScreenController /*extends JeecgController*/ {
return Result.ok(compSystemBigScreenService.nengLi()); return Result.ok(compSystemBigScreenService.nengLi());
} }
@ApiOperation(value = "河南机电-院系获奖大屏数据", notes = "河南机电-院系获奖大屏数据")
@GetMapping(value = "/huoJiang")
public Result huoJiang() {
return Result.ok(compSystemBigScreenService.huoJiang());
}
@ApiOperation(value = "河南机电-院系各比赛类型得分大屏数据", notes = "河南机电-院系各比赛类型得分大屏数据")
@GetMapping(value = "/deFei")
public Result deFei() {
return Result.ok(compSystemBigScreenService.deFei());
}
} }

@ -17,4 +17,8 @@ public interface CompSystemBigScreenService {
List<Map<String, Object>> canSai(); List<Map<String, Object>> canSai();
Object nengLi(); Object nengLi();
Object huoJiang();
Object deFei();
} }

@ -13,8 +13,10 @@ import org.jeecg.modules.demo.annual.entity.Annual;
import org.jeecg.modules.demo.annual.service.IAnnualService; import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualScore.entity.DepartCompTotalScore;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore; import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompTotalScore; import org.jeecg.modules.demo.annualScore.entity.PersonalCompTotalScore;
import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService; import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
@ -67,6 +69,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
@Autowired @Autowired
private ISysDepartService iSysDepartService; private ISysDepartService iSysDepartService;
@Autowired
private IDepartCompTotalScoreService iDepartCompTotalScoreService;
@Autowired @Autowired
private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService; private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService;
@Autowired @Autowired
@ -115,7 +120,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
//部门名称 //部门名称
vo.setCompOrganName(depart.getDepartName()); vo.setCompOrganName(depart.getDepartName());
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, depart.getOrgCode())); .eq(AnnualCompetitionProjectRegistration::getDepartId, depart.getOrgCode()));
Map<String, List<AnnualCompetitionProjectRegistration>> annualCompIdListMap = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream() Map<String, List<AnnualCompetitionProjectRegistration>> annualCompIdListMap = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(AnnualCompetitionProjectRegistration::getAnnualCompid)); .collect(Collectors.groupingBy(AnnualCompetitionProjectRegistration::getAnnualCompid));
Optional.ofNullable(annualCompIdListMap).orElse(new LinkedHashMap<>()).forEach((key, obj) -> { Optional.ofNullable(annualCompIdListMap).orElse(new LinkedHashMap<>()).forEach((key, obj) -> {
@ -168,6 +173,94 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
return resultList; return resultList;
} }
@Override
public List<Map<String, Object>> huoJiang() {
List<Map<String, Object>> resultList = new LinkedList<>();
//二级部门
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
Map<String, Object> resultMap = new LinkedHashMap<>();
//部门报名人数
List<AnnualCompetitionProjectRegistration> registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getDepartId, depart.getOrgCode()));
//部门得奖人数
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>()
.in(AwardPersion::getSysOrgCode, depart.getOrgCode())
.orderByAsc(AwardPersion::getAwardname));
Map<String, List<AwardPersion>> awardNameListMap = Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(AwardPersion::getAwardname));
//遍历分组后的结果
DecimalFormat decimalFormat = new DecimalFormat();
decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
List<CompVo> vos = new ArrayList<>();
Optional.ofNullable(awardNameListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
double ratio = ComputeUtils.div2(value.size(), registrationList.size());
CompVo vo = new CompVo();
vo.setCompOrganId(depart.getId());
vo.setCompOrganName(depart.getDepartName());
vo.setNumber(registrationList.size());
vo.setAwardName(key);
vo.setAwardNumber(value.size());
vo.setAwardRatio(ratio + "");
vos.add(vo);
});
if (!ObjectUtils.isEmpty(awardNameListMap)) {
CompVo noAwardVo = new CompVo();
noAwardVo.setCompOrganId(depart.getId());
noAwardVo.setCompOrganName(depart.getDepartName());
noAwardVo.setNumber(registrationList.size());
noAwardVo.setAwardName("未获取");
noAwardVo.setAwardNumber(registrationList.size() - awardPersionList.size());
double ratio2 = ComputeUtils.div2(registrationList.size() - awardPersionList.size(), registrationList.size());
noAwardVo.setAwardRatio(ratio2 + "");
vos.add(noAwardVo);
}
resultMap.put(depart.getDepartName(), vos);
resultList.add(resultMap);
});
return resultList;
}
@Override
public List<Map<String, Object>> deFei() {
List<Map<String, Object>> resultList = new LinkedList<>();
//二级部门
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
Map<String, Object> resultMap = new LinkedHashMap<>();
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, depart.getParentId()));
//比赛类型
Map<String, List<Comp>> compTypeListMap = Optional.ofNullable(compList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(Comp::getCompTypeId));
//TODO
//遍历分组后的结果
// DecimalFormat decimalFormat = new DecimalFormat();
// decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
// decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
// List<CompVo> vos = new ArrayList<>();
// Optional.ofNullable(compTypeListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
//
// double ratio = ComputeUtils.div2(value.size(), registrationList.size());
// CompVo vo = new CompVo();
// vo.setCompOrganId(depart.getId());
// vo.setCompOrganName(depart.getDepartName());
// vo.setNumber(registrationList.size());
// vo.setAwardName(key);
// vo.setAwardNumber(value.size());
// vo.setAwardRatio(ratio + "");
// vos.add(vo);
// });
resultMap.put(depart.getDepartName(), null);
resultList.add(resultMap);
});
return resultList;
}
/** /**
* @description: 单项比赛数据展示 * @description: 单项比赛数据展示
* 使用大数据页面的形式全面展示某项比赛的各种综合数据包括年度比赛列表比赛项目数参赛人数统计多维度能力评价分析数据近五年比赛人数对比比赛获奖列表参赛人员积分列表需要提供功能截图 * 使用大数据页面的形式全面展示某项比赛的各种综合数据包括年度比赛列表比赛项目数参赛人数统计多维度能力评价分析数据近五年比赛人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
@ -371,7 +464,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
compCounts.put("count", count); 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())); .eq(AnnualCompetitionProjectRegistration::getDepartId, sysDepart.getOrgCode()));
//学生人数 //学生人数
compCounts.put("personCompCount", personCount); compCounts.put("personCompCount", personCount);
Long teamCount = count - personCount; Long teamCount = count - personCount;
@ -678,7 +771,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
//报名表 //报名表
List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() List<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds)
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) .eq(AnnualCompetitionProjectRegistration::getDepartId, sysDepart.getOrgCode())
); );
compVo.setNumber(list.size()); compVo.setNumber(list.size());
} }

@ -44,6 +44,9 @@ public class CompVo implements Serializable {
@ApiModelProperty(value = "获取人数") @ApiModelProperty(value = "获取人数")
private Integer awardNumber; private Integer awardNumber;
@ApiModelProperty(value = "获取比率")
private String awardRatio;
@ApiModelProperty(value = "年度比赛状态") @ApiModelProperty(value = "年度比赛状态")
private String status; private String status;
} }

Loading…
Cancel
Save