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; }