|
|
@@ -70,6 +70,9 @@ public class ExpertInviteManage { |
|
|
|
@Value("#{randomInviteProperties.recentMeetingCount}") |
|
|
|
private Integer recentMeetingCount; |
|
|
|
|
|
|
|
@Value("#{randomInviteProperties.recentDays}") |
|
|
|
private Integer recentDays; |
|
|
|
|
|
|
|
private static final Predicate<Collection<?>> COLL_EMPTY = (coll) -> coll != null && coll.isEmpty(); |
|
|
|
|
|
|
|
private LambdaQueryWrapper<ExpertUserFullInfo> buildBaseExpertQuery() { |
|
|
@@ -97,6 +100,23 @@ public class ExpertInviteManage { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取一周内被抽中并同意参会的专家ID |
|
|
|
* |
|
|
|
* @param agreeCnt 一周内被抽中并同意参会次数 |
|
|
|
* @param sTime 会议开始时间 |
|
|
|
* @param days 天数 |
|
|
|
* @return java.util.List<java.lang.Long> |
|
|
|
* @author WendyYang |
|
|
|
**/ |
|
|
|
private List<Long> listAgreedUserIdByRecentMeetings(int agreeCnt, int days, LocalDateTime sTime) { |
|
|
|
if (agreeCnt == 0 || days == 0) { |
|
|
|
return Collections.emptyList(); |
|
|
|
} |
|
|
|
LocalDateTime beginLimit = sTime.minusDays(days); |
|
|
|
return meetingExpertService.listAgreeExpertIdByRecentDaysAndAgreeCount(agreeCnt, beginLimit, sTime); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 增加专家层级限制 |
|
|
|
* |
|
|
|
* @param query 查询 |
|
|
@@ -294,6 +314,12 @@ public class ExpertInviteManage { |
|
|
|
} else if (CollUtil.isNotEmpty(merge.getExpertIdsNotIn())) { |
|
|
|
expertIdsNotIn.addAll(merge.getExpertIdsNotIn()); |
|
|
|
} |
|
|
|
// 处理回避专家次数 |
|
|
|
if (avoidRule.getWeekInviteCount() != null) { |
|
|
|
Integer weekInviteCount = avoidRule.getWeekInviteCount(); |
|
|
|
List<Long> tmpExpertIdsNotIn = listAgreedUserIdByRecentMeetings(weekInviteCount, recentDays, sTime); |
|
|
|
expertIdsNotIn.addAll(tmpExpertIdsNotIn); |
|
|
|
} |
|
|
|
// 处理专家层级 |
|
|
|
addRegionLimit(query, randomRule); |
|
|
|
if (!expertIdsIn.isEmpty()) { |
|
|
@@ -378,6 +404,12 @@ public class ExpertInviteManage { |
|
|
|
Set<String> notInCompanyUniqCodeList = new HashSet<>(avoidRule.getAvoidUnitIdList()); |
|
|
|
// 处理回避单位与回避条线 |
|
|
|
buildAvoidCompanyAndBusinessStrip(query, avoidRule.getAvoidUnitIdList(), avoidRule.getAvoidOrgIdList()); |
|
|
|
// 处理回避专家次数 |
|
|
|
if (avoidRule.getWeekInviteCount() != null) { |
|
|
|
Integer weekInviteCount = avoidRule.getWeekInviteCount(); |
|
|
|
List<Long> tmpExpertIdsNotIn = listAgreedUserIdByRecentMeetings(weekInviteCount, recentDays, msTime); |
|
|
|
expertIdsNotIn.addAll(tmpExpertIdsNotIn); |
|
|
|
} |
|
|
|
// 处理专家层级 |
|
|
|
addRegionLimit(query, randomRule); |
|
|
|
|
|
|
|