|
|
@@ -16,6 +16,7 @@ import com.hz.pm.api.common.exception.ReturnException; |
|
|
|
import com.hz.pm.api.common.helper.RegionCacheHelper; |
|
|
|
import com.hz.pm.api.common.model.constant.BizConst; |
|
|
|
import com.hz.pm.api.common.util.BizUtils; |
|
|
|
import com.hz.pm.api.common.util.EnvironmentUtil; |
|
|
|
import com.hz.pm.api.expert.entity.ExpertUserFullInfo; |
|
|
|
import com.hz.pm.api.expert.service.IExpertUserFullInfoService; |
|
|
|
import com.hz.pm.api.external.MhApiClient; |
|
|
@@ -103,6 +104,7 @@ public class MeetingManage { |
|
|
|
private final IMeetingExpertJudgeService meetingExpertJudgeService; |
|
|
|
private final MhApiClient mhApiClient; |
|
|
|
private final IUserInfoService userInfoService; |
|
|
|
private final EnvironmentUtil environmentUtil; |
|
|
|
|
|
|
|
private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; |
|
|
|
|
|
|
@@ -682,15 +684,15 @@ public class MeetingManage { |
|
|
|
Long meetingId = req.getMeetingId(); |
|
|
|
String key = "CANCEL_MEETING:" + meetingId; |
|
|
|
if (!distributedLock.lock(key, RETRY_TIMES)) { |
|
|
|
throw BizException.wrap("正在取消会议,请刷新后重试"); |
|
|
|
throw ReturnException.wrap("正在取消会议"); |
|
|
|
} |
|
|
|
try { |
|
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
|
if (MeetingStatusEnum.CANCELED.eq(meeting.getStatus())) { |
|
|
|
throw BizException.wrap("会议已取消"); |
|
|
|
throw ReturnException.wrap("会议已取消"); |
|
|
|
} |
|
|
|
if (meeting.getStartTime().isBefore(LocalDateTime.now())) { |
|
|
|
throw BizException.wrap("会议已开始,暂时无法取消"); |
|
|
|
throw ReturnException.wrap("会议已开始,暂时无法取消"); |
|
|
|
} |
|
|
|
Wrapper<Meeting> meetingUpdate = Wrappers.lambdaUpdate(Meeting.class) |
|
|
|
.set(Meeting::getStatus, MeetingStatusEnum.CANCELED.getCode()) |
|
|
@@ -714,10 +716,10 @@ public class MeetingManage { |
|
|
|
Long userId = expertId == null ? LoginUserUtil.getUserId() : expertId; |
|
|
|
MeetingExpert me = meetingExpertService.getByMeetingIdAndExpertId(meetingId, userId); |
|
|
|
if (me == null) { |
|
|
|
throw BizException.wrap("未被邀请参加此会议"); |
|
|
|
throw ReturnException.wrap("未被邀请参加此会议"); |
|
|
|
} |
|
|
|
if (AGREED.eq(me.getStatus())) { |
|
|
|
throw BizException.wrap("未确认参加此会议"); |
|
|
|
throw ReturnException.wrap("未确认参加此会议"); |
|
|
|
} |
|
|
|
ExpertUserFullInfo userInfo = expertUserFullInfoService.getByUserId(userId); |
|
|
|
Meeting meeting = meetingService.getById(meetingId); |
|
|
@@ -736,12 +738,12 @@ public class MeetingManage { |
|
|
|
public void confirmAttendByManager(ExpertConfirmReq req) { |
|
|
|
String key = "CONFIRM_ATTEND:" + req.getExpertMeetingId(); |
|
|
|
if (!distributedLock.lock(key, RETRY_TIMES)) { |
|
|
|
throw BizException.wrap("操作失败,请重试!"); |
|
|
|
throw ReturnException.wrap("操作失败,请重试!"); |
|
|
|
} |
|
|
|
try { |
|
|
|
MeetingExpert me = meetingExpertService.getById(req.getExpertMeetingId()); |
|
|
|
if (!NOTICING.eq(me.getStatus())) { |
|
|
|
throw BizException.wrap("操作失败,请重试!"); |
|
|
|
throw ReturnException.wrap("操作失败,请重试!"); |
|
|
|
} |
|
|
|
Integer status = (Boolean.TRUE.equals(req.getAgreed()) ? AGREED : REFUSED).getCode(); |
|
|
|
Wrapper<MeetingExpert> update = Wrappers.lambdaUpdate(MeetingExpert.class) |
|
|
@@ -867,7 +869,9 @@ public class MeetingManage { |
|
|
|
.in(MeetingExpert::getId, currConfirmedMeIds) |
|
|
|
.set(MeetingExpert::getConfirmedRoster, Boolean.TRUE); |
|
|
|
meetingExpertService.update(meUpdate); |
|
|
|
meetingNotifyHelper.sendConfirmedRosterMsg(expertNoticing, meeting); |
|
|
|
if (environmentUtil.isProdEnv()) { |
|
|
|
meetingNotifyHelper.sendConfirmedRosterMsg(expertNoticing, meeting); |
|
|
|
} |
|
|
|
} finally { |
|
|
|
distributedLock.releaseLock(key); |
|
|
|
} |
|
|
|