Browse Source

修复回避次数概率性无效的问题

master
WendyYang 11 months ago
parent
commit
05b3e5b47f
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java

+ 6
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -290,6 +290,7 @@ public class ExpertInviteManage {
* @param avoidRule 回避信息
* @param randomRule 抽取规则
* @param invitedExpertIds 指定抽取专家ID
* @param meetingCreateOn 会议创建时间
* @return 满足抽取条件的专家
* @author WendyYang
**/
@@ -297,7 +298,8 @@ public class ExpertInviteManage {
RandomInviteRuleDTO randomRule,
List<Long> invitedExpertIds,
LocalDateTime sTime,
LocalDateTime eTime) {
LocalDateTime eTime,
LocalDateTime meetingCreateOn) {
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0);
MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule);
if (merge.getSkip()) {
@@ -328,7 +330,7 @@ public class ExpertInviteManage {
// 处理回避专家次数
if (avoidRule.getWeekInviteCount() != null) {
Integer weekInviteCount = avoidRule.getWeekInviteCount();
List<Long> tmpExpertIdsNotIn = listAgreedUserIdByRecentMeetings(weekInviteCount, recentDays, sTime);
List<Long> tmpExpertIdsNotIn = listAgreedUserIdByRecentMeetings(weekInviteCount, recentDays, meetingCreateOn);
expertIdsNotIn.addAll(tmpExpertIdsNotIn);
}
// 处理专家层级
@@ -557,8 +559,9 @@ public class ExpertInviteManage {
List<Long> chooseExpertIds = new ArrayList<>();
LocalDateTime sTime = meeting.getStartTime();
LocalDateTime eTime = meeting.getEndTime();
LocalDateTime createOn = meeting.getCreateOn();
randomRules.forEach(rule -> {
ExpertChooseDTO tmpExperts = expertInviteByRandomRule(avoidRule, rule, chooseExpertIds, sTime, eTime);
ExpertChooseDTO tmpExperts = expertInviteByRandomRule(avoidRule, rule, chooseExpertIds, sTime, eTime, createOn);
if (tmpExperts.getTotal() < rule.getCount()) {
throw BizException.wrap("可抽取专家数量不足");
}


Loading…
Cancel
Save