|
|
@@ -39,6 +39,7 @@ import com.ningdatech.pmapi.leave.service.IExpertLeaveService; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.domain.Meeting; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; |
|
|
|
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; |
|
|
|
import com.ningdatech.pmapi.meeting.helper.YxtCallOrSmsHelper; |
|
|
|
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; |
|
|
@@ -70,6 +71,7 @@ import java.util.stream.Collectors; |
|
|
|
@AllArgsConstructor |
|
|
|
public class LeaveManage { |
|
|
|
|
|
|
|
private final ExpertInviteTask inviteTask; |
|
|
|
private final IMeetingService meetingService; |
|
|
|
private final IMeetingExpertService meetingExpertService; |
|
|
|
private final IExpertLeaveService leaveService; |
|
|
@@ -77,6 +79,10 @@ public class LeaveManage { |
|
|
|
private final IExpertMetaApplyService metaApplyService; |
|
|
|
private final FileService fileService; |
|
|
|
private final IExpertUserFullInfoService userFullInfoService; |
|
|
|
private final YxtCallOrSmsHelper yxtCallOrSmsHelper; |
|
|
|
private final IUserInfoService userInfoService; |
|
|
|
|
|
|
|
private static final int HOURS_BEFORE_MEETING = 2; |
|
|
|
|
|
|
|
public void cancelMeetingExpertByLeave(Long meetingExpertId, ExpertAttendStatusEnum status) { |
|
|
|
MeetingExpert update = buildMeetingExpertUpdate(meetingExpertId, status); |
|
|
@@ -190,8 +196,11 @@ public class LeaveManage { |
|
|
|
} |
|
|
|
po.setStartTime(meeting.getStartTime()); |
|
|
|
po.setEndTime(meeting.getEndTime()); |
|
|
|
if (now.plusHours(HOURS_BEFORE_MEETING).isAfter(po.getStartTime())) { |
|
|
|
throw BizException.wrap("会议开始前" + HOURS_BEFORE_MEETING + "小时,不能在线请假,请电话该会议的联系人。"); |
|
|
|
} |
|
|
|
MeetingExpert expert = meetingExpertService.getByMeetingIdAndExpertId(po.getMeetingId(), leaveUserId); |
|
|
|
if (!expert.getStatus().equals(ExpertAttendStatusEnum.AGREED.getCode())) { |
|
|
|
if (!ExpertAttendStatusEnum.AGREED.eq(expert.getStatus())) { |
|
|
|
// 非确认参加状态无法临时请假 |
|
|
|
throw BizException.wrap("未同意参加该会议,无法临时请假"); |
|
|
|
} |
|
|
@@ -203,10 +212,12 @@ public class LeaveManage { |
|
|
|
} |
|
|
|
LeaveManage proxy = (LeaveManage) AopContext.currentProxy(); |
|
|
|
proxy.cancelMeetingExpertByLeave(expert.getId(), ExpertAttendStatusEnum.ON_LEAVE); |
|
|
|
if (ExpertInviteTypeEnum.RANDOM.eq(meeting.getInviteType())) { |
|
|
|
inviteTask.notifyInviteTask(meeting.getId(), Boolean.FALSE); |
|
|
|
} |
|
|
|
// 临时请假无需审核 |
|
|
|
leave.setAuditId(0L); |
|
|
|
leave.setStatus(LeaveStatusEnum.PASSED.getCode()); |
|
|
|
// 临时请假需通知专家管理进行专家补抽 |
|
|
|
} |
|
|
|
if (type != LeaveTypeEnum.TEMPORARY) { |
|
|
|
ExpertMetaApply apply = getExpertMetaApply(po, leaveUserId, applyUserId, now); |
|
|
|