From f7ee73b30540fd63661b6e9a472b607db73c4eca Mon Sep 17 00:00:00 2001 From: WendyYang Date: Sun, 28 Apr 2024 11:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=93=E5=AE=B6=E6=8A=BD?= =?UTF-8?q?=E5=8F=96=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pm/api/meeting/controller/ExpertDashboardController.java | 2 +- .../java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java | 10 ++++++---- .../java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java | 4 +++- .../test/java/com/hz/pm/api/external/MobileCallClientTest.java | 8 ++++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java index 8e761c7..b4225e0 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java @@ -42,7 +42,7 @@ public class ExpertDashboardController { @ApiOperation("短信发送") @GetMapping("/sendSms") public SmsDTO test(String phone) { - return MhSmsClient.getClient().smsSend(VoiceSmsTemplateConst.EXPERT_INVITE, Collections.singletonList(phone)); + return MhSmsClient.getClient().smsSend(VoiceSmsTemplateConst.EXPERT_INVITE_SMS, Collections.singletonList(phone)); } @ApiOperation("短信回复") 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 221fad8..5745200 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 @@ -15,7 +15,6 @@ import com.hz.pm.api.organization.model.entity.DingOrganization; import com.hz.pm.api.organization.service.IDingEmployeeInfoService; import com.hz.pm.api.organization.service.IDingOrganizationService; import com.hz.pm.api.sms.constant.VoiceSmsTemplateConst; -import com.hz.pm.api.sms.utils.DateUtil; import com.hz.pm.api.staging.enums.MsgTypeEnum; import com.hz.pm.api.staging.service.INdWorkNoticeStagingService; import com.hz.pm.api.sys.model.entity.Notify; @@ -30,6 +29,7 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; /** @@ -51,8 +51,10 @@ public class MeetingNotifyHelper { private final IDingOrganizationService dingOrganizationService; private final INotifyService notifyService; + private static final DateTimeFormatter MEETING_TIME_DTF = DateTimeFormatter.ofPattern("yyyy年M月d日 HH:mm"); + private static String officialTime(LocalDateTime time) { - return time.format(DateUtil.DTF_YMD_HM); + return time.format(MEETING_TIME_DTF); } private Notify getNotify(Long userId, String msg, MsgTypeEnum type, Map extraPara) { @@ -160,7 +162,7 @@ public class MeetingNotifyHelper { * @author WendyYang **/ private void callExperts(Meeting meeting, List experts) { - String content = String.format(VoiceSmsTemplateConst.EXPERT_INVITE, + String content = String.format(VoiceSmsTemplateConst.EXPERT_INVITE_CALL, meeting.getHoldOrg(), meeting.getName(), officialTime(meeting.getStartTime()), meeting.getMeetingAddress()); Set phones = CollUtils.fieldSet(experts, MeetingExpert::getMobile); @@ -175,7 +177,7 @@ public class MeetingNotifyHelper { * @param meeting 会议 */ private void smsExperts(Meeting meeting, List experts) { - String content = String.format(VoiceSmsTemplateConst.EXPERT_INVITE, + String content = String.format(VoiceSmsTemplateConst.EXPERT_INVITE_SMS, meeting.getHoldOrg(), meeting.getName(), officialTime(meeting.getStartTime()), meeting.getMeetingAddress()); Set phones = CollUtils.fieldSet(experts, MeetingExpert::getMobile); diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java b/hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java index 69eadb2..5c53060 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java @@ -26,6 +26,8 @@ public class VoiceSmsTemplateConst { /** * 专家电话通知语音模版 */ - public static final String EXPERT_INVITE = "【杭州数字信创】尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2。请您选择"; + public static final String EXPERT_INVITE_CALL = "尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2,重听请按星号键。请您选择"; + + public static final String EXPERT_INVITE_SMS = "【杭州数字信创】尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请回复 1,拒绝参加请回复 2。请您选择"; } diff --git a/hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java b/hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java index 3cad7bf..670dc22 100644 --- a/hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java +++ b/hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java @@ -29,14 +29,14 @@ class MobileCallClientTest extends AppTests { @Test void sendCall() { - String format = String.format("【杭州数字信创】尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2。请您选择", - "信创办", "测试语音", "2024年1月1日 12:30 至 2024年1月1日 12:30", "杭州市"); - String ret = msgCallHelper.sendCall("19530651430", format, BizTypeEnum.EXPERT_INVITE); + String format = String.format("尊敬的专家您好,%s现邀请您作为专家参加%s会议,会议时间:%s,会议地点:%s。 确认参加请按 1,拒绝参加请按 2。请您选择,重听请按星号键。", + "信创办", "测试语音", "2024年1月1日 12:30", "杭州市"); + String ret = msgCallHelper.sendCall("17364572214", format, BizTypeEnum.EXPERT_INVITE); System.out.println(ret); } @Test void replyCall() { - System.out.println(msgCallHelper.callReply("3086259928697016320")); + System.out.println(msgCallHelper.callReply("3086839870409281536")); } } \ No newline at end of file