|
|
|
@ -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<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() |
|
|
|
|
.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<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: 单项比赛数据展示 |
|
|
|
|
* 使用大数据页面的形式全面展示某项比赛的各种综合数据,包括年度比赛列表、比赛项目数、参赛人数统计、多维度能力评价分析数据、近五年比赛人数对比,比赛获奖列表,参赛人员积分列表。需要提供功能截图。 |
|
|
|
@ -371,7 +464,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic |
|
|
|
|
compCounts.put("count", count); |
|
|
|
|
Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.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<AnnualCompetitionProjectRegistration> list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>() |
|
|
|
|
.in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) |
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) |
|
|
|
|
.eq(AnnualCompetitionProjectRegistration::getDepartId, sysDepart.getOrgCode()) |
|
|
|
|
); |
|
|
|
|
compVo.setNumber(list.size()); |
|
|
|
|
} |
|
|
|
|