Bladeren bron

优化回避单位

master
WendyYang 1 jaar geleden
bovenliggende
commit
172cf01531
1 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  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 Bestand weergeven

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


Laden…
Annuleren
Opslaan