@@ -41,6 +41,7 @@ import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertAttendStatusEnum; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingStatusEnum; | ||||
import com.ningdatech.pmapi.meeting.helper.MeetingCallOrMsgHelper; | |||||
import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | import com.ningdatech.pmapi.meeting.service.IMeetingExpertService; | ||||
import com.ningdatech.pmapi.meeting.service.IMeetingService; | import com.ningdatech.pmapi.meeting.service.IMeetingService; | ||||
import com.ningdatech.pmapi.meeting.task.ExpertRandomInviteTask; | import com.ningdatech.pmapi.meeting.task.ExpertRandomInviteTask; | ||||
@@ -77,6 +78,7 @@ public class LeaveManage { | |||||
private final IExpertMetaApplyService metaApplyService; | private final IExpertMetaApplyService metaApplyService; | ||||
private final FileService fileService; | private final FileService fileService; | ||||
private final IExpertUserFullInfoService userFullInfoService; | private final IExpertUserFullInfoService userFullInfoService; | ||||
private final MeetingCallOrMsgHelper meetingCallOrMsgHelper; | |||||
private static final int HOURS_BEFORE_MEETING = 2; | private static final int HOURS_BEFORE_MEETING = 2; | ||||
@@ -217,6 +219,7 @@ public class LeaveManage { | |||||
.eq(Meeting::getId, meeting.getId()); | .eq(Meeting::getId, meeting.getId()); | ||||
meetingService.update(mUpdate); | meetingService.update(mUpdate); | ||||
} | } | ||||
meetingCallOrMsgHelper.sendExpertLeaveMsg(expert, meeting); | |||||
// 临时请假无需审核 | // 临时请假无需审核 | ||||
leave.setAuditId(0L); | leave.setAuditId(0L); | ||||
leave.setStatus(LeaveStatusEnum.PASSED.getCode()); | leave.setStatus(LeaveStatusEnum.PASSED.getCode()); | ||||
@@ -25,4 +25,8 @@ public interface MeetingMsgTemplateConst { | |||||
*/ | */ | ||||
String MEETING_CANCEL = "尊敬的%s专家,原定于%s的%s会议已取消。给您带来不便,敬请谅解。如有疑问请咨询会议联系人「%s」。"; | String MEETING_CANCEL = "尊敬的%s专家,原定于%s的%s会议已取消。给您带来不便,敬请谅解。如有疑问请咨询会议联系人「%s」。"; | ||||
String EXPERT_LEAVE_RANDOM = "请注意,%s会议有专家请假,将重新抽取以替换该专家。"; | |||||
String EXPERT_LEAVE_APPOINT = "请注意,%s会议的%s专家请假,请及时登录系统替换该专家。"; | |||||
} | } |
@@ -7,6 +7,7 @@ import com.ningdatech.basic.util.CollUtils; | |||||
import com.ningdatech.pmapi.meeting.constant.MeetingMsgTemplateConst; | import com.ningdatech.pmapi.meeting.constant.MeetingMsgTemplateConst; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | import com.ningdatech.pmapi.meeting.entity.domain.Meeting; | ||||
import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; | ||||
import com.ningdatech.pmapi.meeting.entity.enumeration.ExpertInviteTypeEnum; | |||||
import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingReviewTypeEnum; | import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingReviewTypeEnum; | ||||
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; | import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; | ||||
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | import com.ningdatech.pmapi.organization.model.entity.DingOrganization; | ||||
@@ -187,4 +188,29 @@ public class MeetingCallOrMsgHelper { | |||||
experts.forEach(w -> w.setSubmitKey(submitKey)); | experts.forEach(w -> w.setSubmitKey(submitKey)); | ||||
} | } | ||||
public void sendExpertLeaveMsg(MeetingExpert expert, Meeting meeting) { | |||||
Long userId = meeting.getCreateBy(); | |||||
String msgContent; | |||||
if (ExpertInviteTypeEnum.RANDOM.eq(meeting.getInviteType())) { | |||||
msgContent = String.format(MeetingMsgTemplateConst.EXPERT_LEAVE_RANDOM, meeting.getName()); | |||||
} else { | |||||
msgContent = String.format(MeetingMsgTemplateConst.EXPERT_LEAVE_APPOINT, meeting.getName(), expert.getExpertName()); | |||||
} | |||||
UserInfo info = userInfoService.getById(userId); | |||||
SendSmsContext yxtContent = new SendSmsContext(); | |||||
yxtContent.setContent(msgContent); | |||||
yxtContent.setReceiveNumber(info.getMobile()); | |||||
yxtCallOrSmsHelper.sendSms(yxtContent); | |||||
// 发送工作通知 | |||||
if (info.getAccountId() != null) { | |||||
WorkNoticeInfo swn = getSendWorkNoticeInfo(info.getAccountId()); | |||||
swn.setMsg(msgContent); | |||||
workNoticeStagingService.addByWorkNotice(swn, MsgTypeEnum.REVIEW_MEETING); | |||||
Map<String, Object> map = new HashMap<>(2); | |||||
map.put("meetingId", meeting.getId()); | |||||
Notify notify = getNotify(userId, msgContent, MsgTypeEnum.REVIEW_MEETING, map); | |||||
notifyService.save(notify); | |||||
} | |||||
} | |||||
} | } |