Browse Source

处理重复抽取bug

tags/24080901
WendyYang 1 year ago
parent
commit
bef6666139
2 changed files with 15 additions and 10 deletions
  1. +14
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java

+ 14
- 9
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -337,6 +337,7 @@ public class ExpertInviteManage {
* @param count 抽取数量 * @param count 抽取数量
* @param msTime 会议开始时间 * @param msTime 会议开始时间
* @param meTime 会议结束时间 * @param meTime 会议结束时间
* @param reInvite 邀请已拒绝
* @return {@link ExpertChooseDTO} * @return {@link ExpertChooseDTO}
* @author WendyYang * @author WendyYang
**/ **/
@@ -347,7 +348,7 @@ public class ExpertInviteManage {
LocalDateTime msTime, LocalDateTime msTime,
LocalDateTime meTime, LocalDateTime meTime,
LocalDateTime tsTime, LocalDateTime tsTime,
boolean invitedRefused) {
boolean reInvite) {
ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0); ExpertChooseDTO result = new ExpertChooseDTO(new ArrayList<>(), 0);
// 合并标签、字典 // 合并标签、字典
MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule); MergeExpertIdDTO merge = mergeExpertIdsByCondition(randomRule, avoidRule);
@@ -402,17 +403,21 @@ public class ExpertInviteManage {
List<String> tmpUniqCompanyCodes = CollUtils.fieldList(agreeOrNoticingUserInfos, ExpertUserFullInfo::getCompanyUniqCode); List<String> tmpUniqCompanyCodes = CollUtils.fieldList(agreeOrNoticingUserInfos, ExpertUserFullInfo::getCompanyUniqCode);
notInCompanyUniqCodeList.addAll(tmpUniqCompanyCodes); notInCompanyUniqCodeList.addAll(tmpUniqCompanyCodes);
} }
if (!invitedRefused) {
// 拒绝参加的不可以被再次抽中
List<MeetingExpert> refusedExperts = expertGroupByStatus.get(REFUSED);
if (refusedExperts.size() > 0) {
List<Long> refusedExpertIds = refusedExperts.stream()
.filter(w -> w.getCreateOn().isBefore(tsTime))

// 处理已拒绝专家与重复抽取
BizUtils.notEmpty(expertGroupByStatus.get(REFUSED), refuseExperts -> {
List<Long> tmpExpertIdsNotIn;
if (reInvite) {
tmpExpertIdsNotIn = refuseExperts.stream()
.filter(w -> w.getCreateOn().isAfter(tsTime))
.map(MeetingExpert::getExpertId) .map(MeetingExpert::getExpertId)
.collect(Collectors.toList()); .collect(Collectors.toList());
expertIdsNotIn.addAll(refusedExpertIds);
} else {
tmpExpertIdsNotIn = CollUtils.fieldList(refuseExperts, MeetingExpert::getExpertId);
} }
}
expertIdsNotIn.addAll(tmpExpertIdsNotIn);
});

boolean hasExpertIdIn = !expertIdsIn.isEmpty(); boolean hasExpertIdIn = !expertIdsIn.isEmpty();
boolean hasExpertIdNotIn = !expertIdsNotIn.isEmpty(); boolean hasExpertIdNotIn = !expertIdsNotIn.isEmpty();
if (hasExpertIdIn && hasExpertIdNotIn) { if (hasExpertIdIn && hasExpertIdNotIn) {


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertInviteTask.java View File

@@ -157,7 +157,7 @@ public class ExpertInviteTask {
* @author WendyYang * @author WendyYang
**/ **/
public void notifyInviteTask(Long meetingId, boolean... reInvite) { public void notifyInviteTask(Long meetingId, boolean... reInvite) {
boolean tmpReInvite = !ArrayUtil.isNotEmpty(reInvite) || reInvite[0];
boolean tmpReInvite = ArrayUtil.isEmpty(reInvite) || reInvite[0];
if (!INVITE_TASK_MAP.containsKey(meetingId)) { if (!INVITE_TASK_MAP.containsKey(meetingId)) {
if (addInviteTask(meetingId, false, properties.getInviteDelay(), tmpReInvite, LocalDateTime.now())) { if (addInviteTask(meetingId, false, properties.getInviteDelay(), tmpReInvite, LocalDateTime.now())) {
log.info("重置会议的随机抽取状态:{}", meetingId); log.info("重置会议的随机抽取状态:{}", meetingId);


Loading…
Cancel
Save