|
|
@@ -228,9 +228,9 @@ public class ExpertRandomInviteTask { |
|
|
|
public void invite(Long meetingId, Boolean reInvite, LocalDateTime tsTime) { |
|
|
|
log.info("开始进行专家后台抽取:{}", meetingId); |
|
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
|
if (meeting.getStartTime().isBefore(LocalDateTime.now())) { |
|
|
|
if (meeting.getInviteStatus() || meeting.getStartTime().isBefore(LocalDateTime.now())) { |
|
|
|
log.info("会议已开始停止抽取:{}", meeting); |
|
|
|
cancelByMeetingId(meetingId); |
|
|
|
killTaskAndDelCacheMeetingId(meetingId); |
|
|
|
return; |
|
|
|
} |
|
|
|
// 随机邀请规则 |
|
|
@@ -275,9 +275,13 @@ public class ExpertRandomInviteTask { |
|
|
|
}); |
|
|
|
if (notIgnoreCnt.get() == 0 || notIgnoreCnt.get() == notSupportCnt.get()) { |
|
|
|
log.info("停止会议随机邀请:{} 未完成抽取规则数量 {} 无可抽取专家规则数量 {}", meetingId, notIgnoreCnt, notSupportCnt); |
|
|
|
currProxy().cancelByMeetingId(meetingId); |
|
|
|
meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); |
|
|
|
meetingService.stopRandomInvite(meetingId); |
|
|
|
if (notIgnoreCnt.get() == notSupportCnt.get() && notIgnoreCnt.get() > 0) { |
|
|
|
// 当未完成抽取且无专家可抽取时 |
|
|
|
meetingCallOrMsgHelper.sendInviteStopMsg(meeting.getCreateBy(), meetingId, meeting.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 所有抽取规则抽取人数满足 自动召开会议 |
|
|
|
if (notIgnoreCnt.get() == 0 && notSupportCnt.get() == 0) { |
|
|
|
MeetingManage meetingManage = SpringUtils.getBean(MeetingManage.class); |
|
|
|
ConfirmedRosterReq req = new ConfirmedRosterReq(); |
|
|
@@ -287,10 +291,7 @@ public class ExpertRandomInviteTask { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void cancelByMeetingId(Long meetingId) { |
|
|
|
log.info("终止专家抽取:{}", meetingId); |
|
|
|
meetingService.stopRandomInvite(meetingId); |
|
|
|
private void killTaskAndDelCacheMeetingId(Long meetingId) { |
|
|
|
cachePlusOps.hDel(getCacheKey(meetingId)); |
|
|
|
ScheduledFuture<?> future = INVITE_TASK_MAP.get(meetingId); |
|
|
|
if (future != null) { |
|
|
@@ -301,6 +302,13 @@ public class ExpertRandomInviteTask { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void cancelByMeetingIdAndKillTask(Long meetingId) { |
|
|
|
log.info("终止专家抽取:{}", meetingId); |
|
|
|
meetingService.stopRandomInvite(meetingId); |
|
|
|
killTaskAndDelCacheMeetingId(meetingId); |
|
|
|
} |
|
|
|
|
|
|
|
//================================================================================================================== |
|
|
|
|
|
|
|
private Map<Long, ExpertCntBO> countByAttendStatus(Map<Long, MeetingExpert> expertMap) { |
|
|
|