消息修改

This commit is contained in:
梁琦涛
2021-09-27 17:11:06 +08:00
parent 1ecd1f78a8
commit 943ce2bdb4
8 changed files with 247 additions and 95 deletions
@@ -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;
}
@@ -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);
}
/**