|
@@ -51,14 +51,15 @@ public class ExpertRandomInviteAlgorithm { |
|
|
for (int i = 0; i < count; i++) { |
|
|
for (int i = 0; i < count; i++) { |
|
|
String company = keySet.get(RandomUtils.nextInt(0, keySet.size())); |
|
|
String company = keySet.get(RandomUtils.nextInt(0, keySet.size())); |
|
|
List<ExpertUserFullInfo> expertsByCompany = expertGroupByUnit.get(company); |
|
|
List<ExpertUserFullInfo> expertsByCompany = expertGroupByUnit.get(company); |
|
|
for (List<MeetingExpert> experts : expertsByRecentMeeting) { |
|
|
|
|
|
|
|
|
for (int j = 0; j < expertsByRecentMeeting.size(); j++) { |
|
|
|
|
|
List<MeetingExpert> experts = expertsByRecentMeeting.get(j); |
|
|
List<ExpertUserFullInfo> notInvitedUsers = expertsByCompany.stream() |
|
|
List<ExpertUserFullInfo> notInvitedUsers = expertsByCompany.stream() |
|
|
.filter(w -> expertMatchNone(experts, w)) |
|
|
.filter(w -> expertMatchNone(experts, w)) |
|
|
.collect(Collectors.toList()); |
|
|
.collect(Collectors.toList()); |
|
|
if (!notInvitedUsers.isEmpty()) { |
|
|
if (!notInvitedUsers.isEmpty()) { |
|
|
result.add(RandomUtil.randomEle(notInvitedUsers)); |
|
|
result.add(RandomUtil.randomEle(notInvitedUsers)); |
|
|
break; |
|
|
break; |
|
|
} else if (expertsByRecentMeeting.indexOf(experts) == (expertsByRecentMeeting.size() - 1)) { |
|
|
|
|
|
|
|
|
} else if (j == (expertsByRecentMeeting.size() - 1)) { |
|
|
result.add(RandomUtil.randomEle(expertsByCompany)); |
|
|
result.add(RandomUtil.randomEle(expertsByCompany)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|