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 5d9c203d..15ef2f2b 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,7 +13,6 @@ 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; @@ -704,9 +703,13 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic annualCompList.stream().forEach(ac -> { AnnualCompPoint annualCompPoint = iAnnualCompPointService.getOne(new LambdaQueryWrapper().eq(AnnualCompPoint::getAnnualCompId, ac.getId())); if (!ObjectUtils.isEmpty(annualCompPoint)) { - long personCount4CompTemp = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper(). - eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); - personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp))); + List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() + .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPoint.getId())); + if (!ObjectUtils.isEmpty(list)) { + Set entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + long personCount4CompTemp = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + personCount4Comp.getAndUpdate(val -> val.add(new BigDecimal(personCount4CompTemp))); + } } }); } @@ -726,9 +729,13 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic Optional.ofNullable(annualCompPointList).orElse(new LinkedList<>()).stream().forEach(p -> { CompVo compVo = new CompVo(); BeanUtils.copyProperties(p, compVo); - Long numberCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper() + List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() .eq(AnnualCompetitionProjectRegistration::getAnnualCompid, p.getId())); - compVo.setNumber(numberCount.intValue()); + if (!ObjectUtils.isEmpty(list)) { + Set entryFormats = list.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + compVo.setNumber(count.intValue()); + } AnnualComp annualComp = iAnnualCompService.getById(p.getAnnualCompId()); if (!ObjectUtils.isEmpty(annualComp)) { Comp comp = iCompService.getById(annualComp.getCompid()); @@ -768,12 +775,15 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic compVo.setAnnualCompPointNumber(annualCompPointList.size()); Set annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); if (!ObjectUtils.isEmpty(annualCompPointIds)) { - //报名表 - List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() - .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds) - .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, sysDepart.getOrgCode()) - ); - compVo.setNumber(list.size()); + //报名表,只存本次的报名编号和项目id + List annualCompetitionProjectRegistrationList = iAnnualCompetitionProjectRegistrationService + .list(new LambdaQueryWrapper() + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds)); + if (!ObjectUtils.isEmpty(annualCompetitionProjectRegistrationList)) { + Set entryFormats = annualCompetitionProjectRegistrationList.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + compVo.setNumber(count.intValue()); + } } } compVoList.add(compVo); @@ -806,9 +816,15 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic Set annualCompPointIds = Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().map(annualCompPoint -> annualCompPoint.getId()).collect(Collectors.toSet()); if (!ObjectUtils.isEmpty(annualCompPointIds)) { //报名表 - List list = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() - .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds)); - compVo.setNumber(list.size()); + //报名表,只存本次的报名编号和项目id + List annualCompetitionProjectRegistrationList = iAnnualCompetitionProjectRegistrationService + .list(new LambdaQueryWrapper() + .in(AnnualCompetitionProjectRegistration::getAnnualCompid, annualCompPointIds)); + if (!ObjectUtils.isEmpty(annualCompetitionProjectRegistrationList)) { + Set entryFormats = annualCompetitionProjectRegistrationList.stream().map(bo -> bo.getEnrollCode()).collect(Collectors.toSet()); + Long count = iTeamManagementService.count(new LambdaQueryWrapper().in(TeamManagement::getEnrollCode, entryFormats)); + compVo.setNumber(count.intValue()); + } } compVoList.add(compVo); });