From d662c8dec16515741906abc84da6ede6658c1027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B9=85=E5=93=A5?= <787952492@qq.com> Date: Fri, 17 Jun 2022 16:29:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/project/ProjectServiceImpl.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java index 6212bd9a..98af7377 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java @@ -181,20 +181,25 @@ public class ProjectServiceImpl implements ProjectService { //组装 项目成员信息 List memberIDList = new ArrayList<>(); projectListDTOList.forEach(item ->{ - memberIDList.addAll(item.getMembers().toJavaList(Long.class)); + if (ObjectUtil.isNotEmpty(item.getMembers())){ + memberIDList.addAll(item.getMembers().toJavaList(Long.class)); + } }); memberIDList.stream().distinct().collect(Collectors.toList()); - List cpUserList = cpUserMapper.selectList(Wrappers.lambdaQuery().in(CpUserDO::getId, memberIDList)); - projectListDTOList.forEach(item ->{ - List memberList = new ArrayList<>(); - List projectMember = item.getMembers().toJavaList(Long.class); - cpUserList.forEach(user ->{ - if (projectMember.contains(user.getId())){ - memberList.add(user); - } + if (ObjectUtil.isNotEmpty(memberIDList)){ + List cpUserList = cpUserMapper.selectList(Wrappers.lambdaQuery().in(CpUserDO::getId, memberIDList)); + projectListDTOList.forEach(item ->{ + List memberList = new ArrayList<>(); + List projectMember = item.getMembers().toJavaList(Long.class); + cpUserList.forEach(user ->{ + if (projectMember.contains(user.getId())){ + memberList.add(user); + } + }); + item.setMemberList(memberList); }); - item.setMemberList(memberList); - }); + } + //任务完成的