消息修改
This commit is contained in:
+4
@@ -144,4 +144,8 @@ public class SysAnnouncement implements Serializable {
|
||||
* 摘要
|
||||
*/
|
||||
private java.lang.String msgAbstract;
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private String templateCode;
|
||||
}
|
||||
|
||||
+2
-1
@@ -37,7 +37,8 @@
|
||||
sa.bus_id as bus_id,
|
||||
sa.open_type as open_type,
|
||||
sa.open_page as open_page,
|
||||
sa.msg_abstract
|
||||
sa.msg_abstract,
|
||||
sa.template_code
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.send_status = '1'
|
||||
|
||||
+5
@@ -77,4 +77,9 @@ public class AnnouncementSendModel implements Serializable {
|
||||
*/
|
||||
private java.lang.String msgAbstract;
|
||||
|
||||
/**
|
||||
* 模板编码
|
||||
*/
|
||||
private java.lang.String templateCode;
|
||||
|
||||
}
|
||||
|
||||
+30
@@ -13,6 +13,7 @@ import com.jero.common.util.HuaWeiSmsUtil;
|
||||
import com.jero.modules.oss.mapper.OSSFileMapper;
|
||||
import com.jero.modules.pay.company.entity.PayContactsManagement;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.api.dto.OnlineAuthDTO;
|
||||
@@ -430,6 +431,7 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
announcement.setBusType(busType);
|
||||
announcement.setOpenType(SysAnnmentTypeEnum.getByType(busType).getOpenType());
|
||||
announcement.setOpenPage(SysAnnmentTypeEnum.getByType(busType).getOpenPage());
|
||||
announcement.setTemplateCode(templateCode);
|
||||
sysAnnouncementMapper.insert(announcement);
|
||||
// 2.插入用户通告阅读标记表记录
|
||||
String userId = toUser;
|
||||
@@ -1012,6 +1014,34 @@ public class SysBaseApiImpl implements ISysBaseAPI {
|
||||
emailHandle.SendMsg(email, title, content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEmailTemplateMsg(String email,String title,String templateCode,HashMap<String,String> map) {
|
||||
if(StringUtils.isBlank(email)){
|
||||
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);
|
||||
//模板标题
|
||||
title = Objects.isNull(title) ? sysSmsTemplate.getTemplateName() : title;
|
||||
//模板内容
|
||||
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());
|
||||
}
|
||||
}
|
||||
EmailSendMsgHandle emailHandle = new EmailSendMsgHandle();
|
||||
emailHandle.SendMsg(email, title, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件+ 附件消息
|
||||
* @param email
|
||||
|
||||
Reference in New Issue
Block a user