From 172cf015312c970fbf0468f78f4b3ad29722a26f Mon Sep 17 00:00:00 2001 From: WendyYang Date: Tue, 11 Apr 2023 15:02:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=9E=E9=81=BF=E5=8D=95?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/meeting/manage/ExpertInviteManage.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java index aab476b..0c53657 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java @@ -172,8 +172,9 @@ public class ExpertInviteManage { } if (CollUtil.isNotEmpty(avoidCompanyExpertIds)) { - for (Long avoidCompanyExpertId : avoidCompanyExpertIds) { - expertIdsIn.remove(avoidCompanyExpertId); + expertIdsIn.removeIf(avoidCompanyExpertIds::contains); + if (expertIdsIn.isEmpty()) { + return null; } } return expertIdsIn; @@ -249,8 +250,8 @@ public class ExpertInviteManage { public ExpertChooseDTO expertInviteByRandomRule(AvoidRuleDTO avoidRule, RandomInviteRuleDTO randomRule, List appointExpertIds, - LocalDateTime start, - LocalDateTime end) { + LocalDateTime sTime, + LocalDateTime eTime) { ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); List expertIdsIn = mergeExpertIdsByCondition(randomRule, avoidRule); if (expertIdsIn == null) { @@ -287,17 +288,17 @@ public class ExpertInviteManage { } } // 过滤掉已参加会议的专家 - List expertIdsLockByMeeting = expertInviteHelper.listInvitedExpertByTime(start, end); + List expertIdsLockByMeeting = expertInviteHelper.listInvitedExpertByTime(sTime, eTime); expertIdsIn.removeIf(expertIdsLockByMeeting::contains); if (expertIdsIn.isEmpty()) { return result; } query.in(ExpertUserFullInfo::getUserId, expertIdsIn); } else if (avoidExpert || CollUtil.isNotEmpty(appointExpertIds)) { - Set tempExperts = expertInviteHelper.getAvoidExpert(appointExpertIds, avoidRule, start, end); + Set tempExperts = expertInviteHelper.getAvoidExpert(appointExpertIds, avoidRule, sTime, eTime); query.notIn(ExpertUserFullInfo::getUserId, tempExperts); } else { - Set notInUserIds = expertInviteHelper.listExpertLeaveOrInvited(start, end); + Set notInUserIds = expertInviteHelper.listExpertLeaveOrInvited(sTime, eTime); if (!notInUserIds.isEmpty()) { query.notIn(ExpertUserFullInfo::getUserId, notInUserIds); }