From 0820c60529729d7339cdb79c4373180efa926e91 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854@qq.com> Date: Sat, 13 Jul 2024 16:54:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=B3=E5=8D=97=E6=9C=BA=E7=94=B5=E8=81=8C?= =?UTF-8?q?=E4=B8=9A=E5=AD=A6=E9=99=A2-=E5=A4=A7=E5=B1=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompSystemBigScreenServiceImpl.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) 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 2bec6008..c8a49d42 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 @@ -1,5 +1,6 @@ package org.jeecg.modules.demo.bigScreen.service; +import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -131,16 +132,17 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> { Map resultMap = new LinkedHashMap<>(); List vos = new LinkedList<>(); - CompVo vo = new CompVo(); - //部门id - vo.setCompOrganId(depart.getId()); - //部门名称 - vo.setCompOrganName(depart.getDepartName()); List registrationList = iAnnualCompetitionProjectRegistrationService.list(new LambdaQueryWrapper() .eq(AnnualCompetitionProjectRegistration::getSysOrgCode, 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) -> { + CompVo vo = new CompVo(); + //部门id + vo.setCompOrganId(depart.getId()); + //部门名称 + vo.setCompOrganName(depart.getDepartName()); vo.setNumber(obj.size()); AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(key); if (!ObjectUtils.isEmpty(annualCompPoint)) { @@ -388,7 +390,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic //年度比赛ids Set annualCompIds = Optional.ofNullable(annualCompList).orElse(new ArrayList<>()).stream().map(annualComp -> annualComp.getCompId()).collect(Collectors.toSet()); List awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper() - .in(AwardPersion::getAnnalComp, annualCompIds) + .in(ObjectUtil.isNotNull(annualCompIds),AwardPersion::getAnnalComp, annualCompIds) .orderByAsc(AwardPersion::getAwardname) .last("limit 30")); Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(award -> { @@ -444,8 +446,8 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic List personalAbilityEvaluationList = iPersonalAbilityEvaluationService.list(new LambdaQueryWrapper() - .in(PersonalAbilityEvaluation::getAnnualCompId, annualCompIds) - .in(PersonalAbilityEvaluation::getWorkOn, workNos) + .in(!ObjectUtils.isEmpty(annualCompIds),PersonalAbilityEvaluation::getAnnualCompId, annualCompIds) + .in(!ObjectUtils.isEmpty(workNos),PersonalAbilityEvaluation::getWorkOn, workNos) ); List vos = new LinkedList<>(); Map> capacityIdListMap = Optional.ofNullable(personalAbilityEvaluationList).orElse(new LinkedList<>()).stream() @@ -683,9 +685,9 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic studentInfoMap.put("last4YearData", last4YearData); studentInfoMap.put("workNo", workNo); studentInfoMap.put("name", sysUser.getRealname()); - studentInfoMap.put("major", "软件工程"); - studentInfoMap.put("grade", "202*级"); - studentInfoMap.put("class", "软工*班"); + studentInfoMap.put("major", "—"); + studentInfoMap.put("grade", "—"); + studentInfoMap.put("class", "—"); resultMap.put("studentInfo", studentInfoMap); List studentEnrollCodeList = iTeamManagementService.list(new LambdaQueryWrapper()