diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java index 5794eba0..6c9ec8bb 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/entity/AnnualCompetitionProjectRegistration.java @@ -101,6 +101,13 @@ public class AnnualCompetitionProjectRegistration implements Serializable { @ApiModelProperty(value = "队伍名称") private java.lang.String teamName; + /** + * 队伍名称 + */ + @Excel(name = "部门id", width = 30) + @ApiModelProperty(value = "部门id") + private java.lang.String departId; + @Excel(name = "年度", width = 15) @ApiModelProperty(value = "年度") 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 89271860..237f7ebd 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 @@ -71,4 +71,16 @@ public class CompSystemBigScreenController /*extends JeecgController*/ { 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()); + } + } 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 dc457fbd..f0870c95 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 @@ -17,4 +17,8 @@ public interface CompSystemBigScreenService { List> canSai(); Object nengLi(); + + Object huoJiang(); + + Object deFei(); } 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 0f38e926..22c968be 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 @@ -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.annualCompPoint.entity.AnnualCompPoint; 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.PersonalCompTotalScore; +import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService; import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService; import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; @@ -67,6 +69,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic @Autowired private ISysDepartService iSysDepartService; + @Autowired + private IDepartCompTotalScoreService iDepartCompTotalScoreService; + @Autowired private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService; @Autowired @@ -115,7 +120,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic //部门名称 vo.setCompOrganName(depart.getDepartName()); List registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() - .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, depart.getOrgCode())); + .eq(AnnualCompetitionProjectRegistration::getDepartId, depart.getOrgCode())); Map> annualCompIdListMap = Optional.ofNullable(registrationList).orElse(new LinkedList<>()).stream() .collect(Collectors.groupingBy(AnnualCompetitionProjectRegistration::getAnnualCompid)); Optional.ofNullable(annualCompIdListMap).orElse(new LinkedHashMap<>()).forEach((key, obj) -> { @@ -168,6 +173,94 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic return resultList; } + @Override + public List> huoJiang() { + List> resultList = new LinkedList<>(); + //二级部门 + List departList = iSysDepartService.list(new LambdaQueryWrapper().eq(SysDepart::getParentId, BASE_PARENT_ID)); + Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { + Map resultMap = new LinkedHashMap<>(); + //部门报名人数 + List registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getDepartId, depart.getOrgCode())); + + //部门得奖人数 + List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper() + .in(AwardPersion::getSysOrgCode, depart.getOrgCode()) + .orderByAsc(AwardPersion::getAwardname)); + Map> 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 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> deFei() { + List> resultList = new LinkedList<>(); + //二级部门 + List departList = iSysDepartService.list(new LambdaQueryWrapper().eq(SysDepart::getParentId, BASE_PARENT_ID)); + Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { + Map resultMap = new LinkedHashMap<>(); + List compList = iCompService.list(new LambdaQueryWrapper().eq(Comp::getCompOrgan, depart.getParentId())); + //比赛类型 + Map> 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 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: 单项比赛数据展示 * 使用大数据页面的形式全面展示某项比赛的各种综合数据,包括年度比赛列表、比赛项目数、参赛人数统计、多维度能力评价分析数据、近五年比赛人数对比,比赛获奖列表,参赛人员积分列表。需要提供功能截图。 @@ -371,7 +464,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic compCounts.put("count", count); Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() .eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0") - .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode())); + .eq(AnnualCompetitionProjectRegistration::getDepartId, sysDepart.getOrgCode())); //学生人数 compCounts.put("personCompCount", personCount); Long teamCount = count - personCount; @@ -678,7 +771,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic //报名表 List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) - .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) + .eq(AnnualCompetitionProjectRegistration::getDepartId, sysDepart.getOrgCode()) ); compVo.setNumber(list.size()); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java index 58ac57ec..c4a0ead0 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/vo/CompVo.java @@ -44,6 +44,9 @@ public class CompVo implements Serializable { @ApiModelProperty(value = "获取人数") private Integer awardNumber; + @ApiModelProperty(value = "获取比率") + private String awardRatio; + @ApiModelProperty(value = "年度比赛状态") private String status; }