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); - }); + } + //任务完成的