diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/constant/MeetingMsgTemplateConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/constant/MeetingMsgTemplateConst.java index 1bdbfcd..90cf49a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/constant/MeetingMsgTemplateConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/constant/MeetingMsgTemplateConst.java @@ -16,9 +16,13 @@ public interface MeetingMsgTemplateConst { String INVITE_END = "注意,%s会议自动抽取已结束,请及时确认是否召开会议"; /** - * 尊敬的【姓名】专家您好,您于【确认时间】接受了信息化项目评审会议邀请,会议时间:【会议时间】,会议地点:【会议地点】。请准时参加评审会议。如有疑问请联系【联系人】(【联系方式】)。 + * 确认名单:尊敬的【姓名】专家您好,您于【确认时间】接受了信息化项目评审会议邀请,会议时间:【会议时间】,会议地点:【会议地点】。请准时参加评审会议。如有疑问请联系【联系人】(【联系方式】)。 */ String CONFIRMED_ROSTER = "尊敬的%s专家您好,您于%s接受了信息化项目评审会议邀请,会议时间:%s,会议地点:%s。请准时参加评审会议。如有疑问请联系%s(%s)。"; + /** + * 会议取消:尊敬的{name}专家,因会议取消说明,原定于开会时间的会议类型会议已取消。给您带来不便,敬请谅解。如有疑问请咨询会议联系人「会议联系人联系方式」。 + */ + String MEETING_CANCEL = "尊敬的%s专家,原定于%s的%s会议已取消。给您带来不便,敬请谅解。如有疑问请咨询会议联系人「%s」。"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java index 43e8188..27ffb72 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/helper/MeetingMsgHelper.java @@ -8,6 +8,7 @@ import com.ningdatech.basic.util.CollUtils; import com.ningdatech.pmapi.meeting.constant.MeetingMsgTemplateConst; import com.ningdatech.pmapi.meeting.entity.domain.Meeting; import com.ningdatech.pmapi.meeting.entity.domain.MeetingExpert; +import com.ningdatech.pmapi.meeting.entity.enumeration.MeetingReviewTypeEnum; import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; import com.ningdatech.pmapi.organization.model.entity.DingOrganization; import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; @@ -29,6 +30,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** *

@@ -103,7 +105,7 @@ public class MeetingMsgHelper { WorkNoticeInfo swn = getSendWorkNoticeInfo(info.getAccountId()); swn.setMsg(msgContent); workNoticeStagingService.addByWorkNotice(swn, MsgTypeEnum.REVIEW_MEETING); - Map map = new HashMap<>(); + Map map = new HashMap<>(2); map.put("meetingId", meetingId); Notify notify = getNotify(userId, msgContent, MsgTypeEnum.REVIEW_MEETING, map); notifyService.save(notify); @@ -136,7 +138,7 @@ public class MeetingMsgHelper { WorkNoticeInfo swn = getSendWorkNoticeInfo(info.getAccountId()); swn.setMsg(msgContent); workingNotices.add(swn); - Map map = new HashMap<>(); + Map map = new HashMap<>(2); map.put("meetingId", meeting.getId()); Notify notify = getNotify(info.getId(), msgContent, MsgTypeEnum.EXPERT_REVIEW, map); notifies.add(notify); @@ -148,4 +150,18 @@ public class MeetingMsgHelper { } + public void sendCancelMeetingMsg(List experts, Meeting meeting) { + String startTime = officialTime(meeting.getStartTime()); + String meetingType = MeetingReviewTypeEnum.getValue(meeting.getType()); + List contexts = experts.stream().map(w -> { + String content = String.format(MeetingMsgTemplateConst.MEETING_CANCEL, + w.getExpertName(), startTime, meetingType, meeting.getContact()); + SendSmsContext context = new SendSmsContext(); + context.setReceiveNumber(w.getMobile()); + context.setContent(content); + return context; + }).collect(Collectors.toList()); + yxtCallOrSmsHelper.sendSms(contexts); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java index a710160..aa8f9be 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java @@ -664,11 +664,7 @@ public class MeetingManage { // 发送通知给专家 List experts = meetingExpertService.listAgreedExperts(meetingId); if (!experts.isEmpty()) { - // TODO 取消会议后发送短信通知 - // meeting.setCancelRemark(po.getCancelRemark()); - // String meetingType = dictionaryCache.getByCode(meeting.getType()).getName(); - // List contexts = YxtSmsContextBuilder.smsToExpertByCancelMeeting(meeting, experts, meetingType); - // yxtCallOrSmsHelper.sendSms(contexts); + meetingMsgHelper.sendCancelMeetingMsg(experts, meeting); } } finally { distributedLock.releaseLock(key);