Browse Source

修改专家抽取模版

dev
WendyYang 3 weeks ago
parent
commit
f7ee73b305
4 changed files with 14 additions and 10 deletions
  1. +1
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java
  2. +6
    -4
      hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java
  3. +3
    -1
      hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java
  4. +4
    -4
      hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java

+ 1
- 1
hz-pm-api/src/main/java/com/hz/pm/api/meeting/controller/ExpertDashboardController.java View File

@@ -42,7 +42,7 @@ public class ExpertDashboardController {
@ApiOperation("短信发送")
@GetMapping("/sendSms")
public SmsDTO<SmsSendDTO> 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("短信回复")


+ 6
- 4
hz-pm-api/src/main/java/com/hz/pm/api/meeting/helper/MeetingNotifyHelper.java View File

@@ -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<String, Object> extraPara) {
@@ -160,7 +162,7 @@ public class MeetingNotifyHelper {
* @author WendyYang
**/
private void callExperts(Meeting meeting, List<MeetingExpert> 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<String> phones = CollUtils.fieldSet(experts, MeetingExpert::getMobile);
@@ -175,7 +177,7 @@ public class MeetingNotifyHelper {
* @param meeting 会议
*/
private void smsExperts(Meeting meeting, List<MeetingExpert> 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<String> phones = CollUtils.fieldSet(experts, MeetingExpert::getMobile);


+ 3
- 1
hz-pm-api/src/main/java/com/hz/pm/api/sms/constant/VoiceSmsTemplateConst.java View File

@@ -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。请您选择";

}

+ 4
- 4
hz-pm-api/src/test/java/com/hz/pm/api/external/MobileCallClientTest.java View File

@@ -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"));
}
}

Loading…
Cancel
Save