|
|
@@ -513,9 +513,29 @@ public class ExpertInviteManage { |
|
|
|
if (userFullInfos.isEmpty()) { |
|
|
|
return result; |
|
|
|
} |
|
|
|
Map<String, List<ExpertUserFullInfo>> 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<String, List<ExpertUserFullInfo>> unitGroup = CollUtils.group(userFullInfos, ExpertUserFullInfo::getCompanyUniqCode); |
|
|
|
result.setExperts(inviteGroupByUnit(unitGroup, expertsByRecentMeeting(), randomRule.getCount())); |
|
|
|
result.setTotal(unitGroup.size()); |
|
|
|
break; |
|
|
|
case CURR_STRIP: |
|
|
|
List<Long> userIds = CollUtils.fieldList(userFullInfos, ExpertUserFullInfo::getUserId); |
|
|
|
List<ExpertGovBusinessStrip> expertStrips = expertGovBusinessStripService.listByUserIds(userIds); |
|
|
|
if (!expertStrips.isEmpty()) { |
|
|
|
Map<String, List<ExpertGovBusinessStrip>> 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; |
|
|
|
} |
|
|
|
|
|
|
|