From fa2126c9315236a9cab297bce21216b12afee351 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sat, 12 Oct 2024 11:36:21 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E5=A2=9E=E5=8A=A0=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=85=81=E8=AE=B8=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E5=AD=97=E6=AE=B5;=202.=20=E4=BC=9A=E8=AE=AE?= =?UTF-8?q?=E8=AF=84=E5=AE=A1=E7=BB=93=E6=9E=9C=E4=B8=8A=E4=BC=A0=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E4=BC=9A=E8=AE=AE=E6=9C=AA=E7=BB=93=E6=9D=9F=E9=99=90?= =?UTF-8?q?=E5=88=B6=EF=BC=9B=203.=20=E7=A1=AE=E8=AE=A4=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5=E6=A0=87?= =?UTF-8?q?=E8=AF=86=EF=BC=9B=204.=20=E4=B8=93=E5=AE=B6=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E6=83=85=E5=86=B5=E5=A2=9E=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=90=8D?= =?UTF-8?q?=E5=8D=95=E7=9F=AD=E4=BF=A1=E5=9B=9E=E5=A4=8D=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hz/pm/api/common/helper/MsgCallHelper.java | 1 + .../api/meeting/entity/domain/MeetingExpert.java | 3 ++ .../meeting/entity/vo/InviteExpertListItemVO.java | 4 +++ .../pm/api/meeting/helper/MeetingNotifyHelper.java | 9 ++++- .../hz/pm/api/meeting/manage/MeetingManage.java | 39 +++++++++++++++++++--- 5 files changed, 51 insertions(+), 5 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/MsgCallHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/MsgCallHelper.java index cb577ae..a982b88 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/MsgCallHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/helper/MsgCallHelper.java @@ -97,6 +97,7 @@ public class MsgCallHelper { if (SendStatus.SUCCESS.equals(mcr.getSendStatus())) { switch (bizType) { case EXPERT_INVITE: + case MEETING_ROSTER_CONFIRM: mcr.setNeedReply(Boolean.TRUE); mcr.setReplyStatus(ReplyStatus.WAITING); break; diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java index de74edb..5e26628 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/domain/MeetingExpert.java @@ -92,4 +92,7 @@ public class MeetingExpert implements Serializable { @ApiModelProperty("专家签到地点") private String signAddress; + @ApiModelProperty("确认名单短信通知标识") + private String confirmedRosterMsgSubmitKey; + } diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java index 3458121..1f7ded1 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/entity/vo/InviteExpertListItemVO.java @@ -62,6 +62,10 @@ public class InviteExpertListItemVO extends ExpertBasicInfoVO { @ApiModelProperty("专家签到地点") private String signAddress; + @ApiModelProperty("是否已确认名单") + private Boolean confirmedRoster; + @ApiModelProperty("确认名单短信回复内容") + private String confirmedRosterReplyContent; } \ No newline at end of file diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java index 86eaa13..af35e06 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java @@ -27,6 +27,7 @@ import com.hz.pm.api.user.model.entity.UserInfo; import com.hz.pm.api.user.service.IUserInfoService; import com.ningdatech.basic.util.CollUtils; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +44,7 @@ import java.util.*; * @author WendyYang * @since 2023/4/20 **/ +@Slf4j @Component @RequiredArgsConstructor public class MeetingNotifyHelper { @@ -135,7 +137,12 @@ public class MeetingNotifyHelper { w.getExpertName(), officialTime(w.getCreateOn()), meetingTime, meeting.getMeetingAddress(), meeting.getConnecter(), meeting.getContact()); // 音信通消息 - msgCallHelper.sendMsg(w.getMobile(), msgContent, BizTypeEnum.MEETING_ROSTER_CONFIRM); + try { + String submitKey = msgCallHelper.sendMsg(w.getMobile(), msgContent, BizTypeEnum.MEETING_ROSTER_CONFIRM); + w.setConfirmedRosterMsgSubmitKey(submitKey); + } catch (Exception e) { + log.error("确认名单失败:{}", w.getMobile(), e); + } UserInfo info = userMap.get(w.getExpertId()); // 发送工作通知 if (info.getAccountId() != null) { diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java index 869e5c0..069f8298 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/manage/MeetingManage.java @@ -49,6 +49,9 @@ import com.hz.pm.api.projectlib.model.entity.Project; import com.hz.pm.api.projectlib.model.enumeration.status.ProjectStatus; import com.hz.pm.api.projectlib.service.IProjectService; import com.hz.pm.api.sys.model.dto.RegionDTO; +import com.hz.pm.api.sys.model.entity.MsgCallRecord; +import com.hz.pm.api.sys.model.enumeration.SubmitTypeEnum; +import com.hz.pm.api.sys.service.IMsgCallRecordService; import com.hz.pm.api.user.helper.MhUnitCache; import com.hz.pm.api.user.model.entity.UserInfo; import com.hz.pm.api.user.model.enumeration.RoleEnum; @@ -112,6 +115,7 @@ public class MeetingManage { private final EnvironmentUtil environmentUtil; private final MhUnitCache mhUnitCache; private final ProjectStateMachineUtil projectStateMachineUtil; + private final IMsgCallRecordService msgCallRecordService; private static final String INVITED_RULE_CREATE = "INVITED_RULE_CREATE:"; @@ -543,12 +547,31 @@ public class MeetingManage { if (experts.isEmpty()) { return result; } - List expertIds = CollUtils.fieldList(experts, MeetingExpert::getExpertId); + List confirmedRosterSubmitKeys = new ArrayList<>(); + List expertIds = CollUtils.fieldList(experts, w -> { + if (StrUtil.isNotBlank(w.getConfirmedRosterMsgSubmitKey())) { + confirmedRosterSubmitKeys.add(w.getConfirmedRosterMsgSubmitKey()); + } + return w.getExpertId(); + }); + Map confirmedRosterReplyMap = new HashMap<>(); + if (!confirmedRosterSubmitKeys.isEmpty()) { + Wrapper query = Wrappers.lambdaQuery(MsgCallRecord.class) + .select(MsgCallRecord::getSubmitKey, MsgCallRecord::getReplyContent) + .eq(MsgCallRecord::getSubmitType, SubmitTypeEnum.SMS) + .in(MsgCallRecord::getSubmitKey, confirmedRosterSubmitKeys); + List msgCallRecords = msgCallRecordService.list(query); + for (MsgCallRecord msgCallRecord : msgCallRecords) { + confirmedRosterReplyMap.put(msgCallRecord.getSubmitKey(), msgCallRecord.getReplyContent()); + } + } Map expertMap = meetingManageHelper.getExpertBasicInfo(expertIds); BiFunction, InviteExpertListItemVO> mapping = (me, ruleMap) -> { ExpertBasicInfoVO expert = expertMap.get(me.getExpertId()); InviteExpertListItemVO item = BeanUtil.copyProperties(expert, InviteExpertListItemVO.class); item.setExpertMeetingId(me.getId()); + item.setConfirmedRoster(me.getConfirmedRoster()); + item.setConfirmedRosterReplyContent(confirmedRosterReplyMap.get(me.getConfirmedRosterMsgSubmitKey())); item.setMeetingId(me.getMeetingId()); item.setStatus(me.getStatus()); item.setStatusName(ExpertAttendStatusEnum.getValByCode(me.getStatus())); @@ -910,13 +933,21 @@ public class MeetingManage { return; } List currConfirmedMeIds = CollUtils.fieldList(expertNoticing, MeetingExpert::getId); - Wrapper meUpdate = Wrappers.lambdaUpdate(MeetingExpert.class) - .in(MeetingExpert::getId, currConfirmedMeIds) + LambdaUpdateWrapper meUpdate = Wrappers.lambdaUpdate(MeetingExpert.class) .set(MeetingExpert::getConfirmedRoster, Boolean.TRUE); - meetingExpertService.update(meUpdate); if (environmentUtil.isProdEnv()) { meetingNotifyHelper.sendConfirmedRosterMsg(expertNoticing, meeting); + for (MeetingExpert expert : expertNoticing) { + if (StrUtil.isBlank(expert.getConfirmedRosterMsgSubmitKey())) { + currConfirmedMeIds.remove(expert.getId()); + } + } + if (currConfirmedMeIds.isEmpty()) { + throw ReturnException.wrap("参会通知短信发送失败,请重试!"); + } } + meUpdate.in(MeetingExpert::getId, currConfirmedMeIds); + meetingExpertService.update(meUpdate); } finally { distributedLock.releaseLock(key); }