消息修改
This commit is contained in:
+3
@@ -38,4 +38,7 @@ public class SysMessageTemplate extends JeroEntity {
|
||||
@Excel(name = "模板类型", width = 15)
|
||||
@Dict(dicCode = "msgType")
|
||||
private java.lang.String templateType;
|
||||
/**接收人*/
|
||||
@Dict(dicCode = "receive_message_user_type")
|
||||
private String recipient;
|
||||
}
|
||||
|
||||
+2
-24
@@ -1060,30 +1060,8 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSMS(String phone, String codeType, String codeTime,String templateCode,HashMap<String,String> map) {
|
||||
if(StringUtils.isBlank(phone)){
|
||||
throw new JeroBootException("手机号不能为空");
|
||||
}
|
||||
if(StringUtils.isBlank(templateCode)){
|
||||
throw new JeroBootException("模板编码不能为空");
|
||||
}
|
||||
List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.selectByCode(templateCode);
|
||||
if(CollectionUtils.isEmpty(sysSmsTemplates)){
|
||||
throw new JeroBootException("消息模板不存在,模板编码:"+templateCode);
|
||||
}
|
||||
SysMessageTemplate sysSmsTemplate = sysSmsTemplates.get(0);
|
||||
//模板标题
|
||||
String title = sysSmsTemplate.getTemplateName();
|
||||
//模板内容
|
||||
String content = sysSmsTemplate.getTemplateContent();
|
||||
if(!Objects.isNull(map)) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
String str = "${" + entry.getKey() + "}";
|
||||
title = title.replace(str, entry.getValue());
|
||||
content = content.replace(str, entry.getValue());
|
||||
}
|
||||
}
|
||||
huaWeiSmsUtil.sendVerificationCode(phone, codeType, codeTime, content);
|
||||
public void sendMessage(String phone, String sender,String templateId,String signature,String templateParas) {
|
||||
huaWeiSmsUtil.sendMessageNotice( phone, sender, templateId, signature, templateParas);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user