From 39f6e1eb8fd8192d3b1ed2f23fc3cc8c2c13c324 Mon Sep 17 00:00:00 2001 From: "zhouj1203@hotmail.com" Date: Tue, 20 Aug 2024 15:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8F=82=E8=80=83=E4=BA=BA?= =?UTF-8?q?=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/service/impl/ArtServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/teammodel/controller/admin/service/impl/ArtServiceImpl.java b/src/main/java/cn/teammodel/controller/admin/service/impl/ArtServiceImpl.java index 7abe6e6..25e0d90 100644 --- a/src/main/java/cn/teammodel/controller/admin/service/impl/ArtServiceImpl.java +++ b/src/main/java/cn/teammodel/controller/admin/service/impl/ArtServiceImpl.java @@ -60,8 +60,9 @@ public class ArtServiceImpl implements ArtService { try { for (ArtElementsVo artElementsVo : artElementsVos) { List classes1 = artElementsVo.getClasses(); - //int stuInClassCount = 0; + int stuInClassCount = 0; for(String classId : classes1) { + stuInClassCount += (int) rMembers.stream().filter(rMember -> rMember.getClassId().equals(classId)).count(); //stuInClassCount += studentRepository.countByClassIdAndCode(classId, String.format(PK.STUDENT, artFindDto.getCode())); ArtElementsVo.ClassInfos classInfos = new ArtElementsVo.ClassInfos(); rGroupList.stream().filter(rGroupList1 -> rGroupList1.getId().equals(classId)).findFirst().ifPresent(rGroupList1 -> { @@ -70,7 +71,7 @@ public class ArtServiceImpl implements ArtService { }); artElementsVo.addClassesInfos(classInfos); } - artElementsVo.setCount(rMembers.size()); + artElementsVo.setCount(stuInClassCount); } } catch (Exception e) {