Browse Source

优化回避单位

tags/24080901
WendyYang 1 year ago
parent
commit
172cf01531
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java

+ 8
- 7
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -172,8 +172,9 @@ public class ExpertInviteManage {
}

if (CollUtil.isNotEmpty(avoidCompanyExpertIds)) {
for (Long avoidCompanyExpertId : avoidCompanyExpertIds) {
expertIdsIn.remove(avoidCompanyExpertId);
expertIdsIn.removeIf(avoidCompanyExpertIds::contains);
if (expertIdsIn.isEmpty()) {
return null;
}
}
return expertIdsIn;
@@ -249,8 +250,8 @@ public class ExpertInviteManage {
public ExpertChooseDTO expertInviteByRandomRule(AvoidRuleDTO avoidRule,
RandomInviteRuleDTO randomRule,
List<Long> appointExpertIds,
LocalDateTime start,
LocalDateTime end) {
LocalDateTime sTime,
LocalDateTime eTime) {
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0);
List<Long> expertIdsIn = mergeExpertIdsByCondition(randomRule, avoidRule);
if (expertIdsIn == null) {
@@ -287,17 +288,17 @@ public class ExpertInviteManage {
}
}
// 过滤掉已参加会议的专家
List<Long> expertIdsLockByMeeting = expertInviteHelper.listInvitedExpertByTime(start, end);
List<Long> expertIdsLockByMeeting = expertInviteHelper.listInvitedExpertByTime(sTime, eTime);
expertIdsIn.removeIf(expertIdsLockByMeeting::contains);
if (expertIdsIn.isEmpty()) {
return result;
}
query.in(ExpertUserFullInfo::getUserId, expertIdsIn);
} else if (avoidExpert || CollUtil.isNotEmpty(appointExpertIds)) {
Set<Long> tempExperts = expertInviteHelper.getAvoidExpert(appointExpertIds, avoidRule, start, end);
Set<Long> tempExperts = expertInviteHelper.getAvoidExpert(appointExpertIds, avoidRule, sTime, eTime);
query.notIn(ExpertUserFullInfo::getUserId, tempExperts);
} else {
Set<Long> notInUserIds = expertInviteHelper.listExpertLeaveOrInvited(start, end);
Set<Long> notInUserIds = expertInviteHelper.listExpertLeaveOrInvited(sTime, eTime);
if (!notInUserIds.isEmpty()) {
query.notIn(ExpertUserFullInfo::getUserId, notInUserIds);
}


Loading…
Cancel
Save