From 04814c3c03df60572a4da099eb03c8209e7d4be7 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 6 Jun 2024 19:34:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BA=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A1=A5=E6=8A=BD=E4=B8=93=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pm/api/meeting/manage/ExpertInviteManage.java | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java index d5514ff..46f3568 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/ExpertInviteManage.java @@ -513,9 +513,29 @@ public class ExpertInviteManage { if (userFullInfos.isEmpty()) { return result; } - Map> userGroupByUnit = CollUtils.group(userFullInfos, ExpertUserFullInfo::getCompanyUniqCode); - result.setTotal(userGroupByUnit.size()); - result.setExperts(inviteGroupByUnit(userGroupByUnit, expertsByRecentMeeting(), count)); + AvoidTypeEnum avoidType = avoidRule.getAvoidType() == null ? AvoidTypeEnum.CURR_UNIT : AvoidTypeEnum.getByCode(avoidRule.getAvoidType()); + switch (avoidType) { + case NONE: + result.setExperts(inviteWithoutCompany(userFullInfos, expertsByRecentMeeting(), randomRule.getCount())); + result.setTotal(userFullInfos.size()); + break; + case CURR_UNIT: + Map> unitGroup = CollUtils.group(userFullInfos, ExpertUserFullInfo::getCompanyUniqCode); + result.setExperts(inviteGroupByUnit(unitGroup, expertsByRecentMeeting(), randomRule.getCount())); + result.setTotal(unitGroup.size()); + break; + case CURR_STRIP: + List userIds = CollUtils.fieldList(userFullInfos, ExpertUserFullInfo::getUserId); + List expertStrips = expertGovBusinessStripService.listByUserIds(userIds); + if (!expertStrips.isEmpty()) { + Map> stripGroup = CollUtils.group(expertStrips, ExpertGovBusinessStrip::getBusinessStripCode); + result.setExperts(inviteGroupByStrip(stripGroup, userFullInfos, expertsByRecentMeeting(), randomRule.getCount())); + result.setTotal(stripGroup.size()); + } else { + result.setTotal(0); + } + break; + } return result; }