瀏覽代碼

修复会议详情专家层级查询报错

master
WendyYang 1 年之前
父節點
當前提交
eb97271e1c
共有 2 個文件被更改,包括 22 次插入12 次删除
  1. +6
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java
  2. +16
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java

+ 6
- 4
pmapi/src/main/java/com/ningdatech/pmapi/meeting/service/impl/MeetingServiceImpl.java 查看文件

@@ -1,5 +1,7 @@
package com.ningdatech.pmapi.meeting.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.common.model.entity.CountGroupByDTO;
@@ -25,10 +27,10 @@ public class MeetingServiceImpl extends ServiceImpl<MeetingMapper, Meeting> impl

@Override
public void stopRandomInvite(Long meetingId) {
Meeting meeting = new Meeting();
meeting.setId(meetingId);
meeting.setInviteStatus(Boolean.TRUE);
baseMapper.updateById(meeting);
LambdaUpdateWrapper<Meeting> update = Wrappers.lambdaUpdate(Meeting.class)
.eq(Meeting::getId, meetingId)
.set(Meeting::getInviteStatus, Boolean.TRUE);
update(update);
}

@Override


+ 16
- 8
pmapi/src/main/java/com/ningdatech/pmapi/meeting/task/ExpertRandomInviteTask.java 查看文件

@@ -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) {


Loading…
取消
儲存