private void sendTodo(ISysNotifyModel notifyModel, List<SysOrgElement> notifyTarget, String subject,
String notifyType, int flag, String key, String link, HashMap<String, String> map) throws Exception {
NotifyContext notifyContext = getSysNotifyMainCoreService().getContext("sc.produce:sc.rws.job.notify");
notifyContext.setNotifyTarget(notifyTarget);//通知对象
notifyContext.setSubject(subject);//标题
notifyContext.setNotifyType(notifyType); //"todo"
notifyContext.setFlag(flag);//通知类型
notifyContext.setKey(key);//自定义key全局唯一
notifyContext.setLink(link);//点击通知后跳转的链接
getSysNotifyMainCoreService().send(notifyModel, notifyContext, map);
}
notifyTarget:通知的对象,是一个集合
subject:通知的标题
notifyType:写死,"todo"
flag:通知类型,具体可以参考代码
key:在ApplicationResources.properties中自定义,必须是全局唯一
link:点击通知后跳转的链接
notifyModel:实体类
map:map.put("docSubject", subject);写法固定,具体可以参考代码