消息推送

发布于 2026-05-25

参考文档

1、E9二开推送消息

项目同事以及客户第三方系统二开推送消息至ecology9

参考文档链接 https://www.showdoc.com.cn/p/f217b01ce7c26aa9303ab93fe74eccb7

2、E9标准推送消息

各模块同事在ecology9标准产品上推送消息

参考文档链接 https://www.showdoc.com.cn/p/35c24f7496964b49078bbcc5f59f1149

3、E9消息推送给第三方系统

ecology9推送消息至第三方系统,一是采用标准配置,二是采用先推送到ESB,再通过ESB推送到第三系统

参考文档链接 https://www.showdoc.com.cn/p/1a8e0de915a3bbf8dbbaa2edf1e35705

查询消息类型id

数据库查询:

select * from ECOLOGY_MESSAGE_TYPE where id = ?

前端也可以看到消息类型id

Pasted image 20260407095018.png

后端发送消息示例

@Path("/send")
@GET
@Produces({"text/json"})
public String sendMessage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
    JSONObject result = new JSONObject();

    // 接收人id
    Set<String> userIdList = new HashSet<>();
    userIdList.add("89");
    String title = "消息提醒测试";
    String content = "测试";
    String linkUrl = "/spa/workflow/static4form/index.html?_rdm=1691372519303#/main/workflow/req?iscreate=1&workflowid=63";
    String linkMobileUrl = "/spa/workflow/static4form/index.html?_rdm=1691372519303#/main/workflow/req?iscreate=1&workflowid=63";
    // 消息类型
    MessageType type = MessageType.newInstanceById("1209");
    try {
        MessageBean messageBean = Util_Message.createMessage(type, userIdList, title, content, linkUrl, linkMobileUrl);
        // 设置消息创建人
        messageBean.setCreater(1);
        //需要修改消息状态时传入,表示消息最初状态为待处理
        messageBean.setBizState("0");
        //消息来源code +"|"+业务id需要修改消息状态时传入
        //messageBean.setTargetId("120|22"); 
        Util_Message.store(messageBean);
    } catch (IOException e) {
        e.printStackTrace();
        result.put("result", "F");
        return result.toJSONString();
    }
    result.put("result", "S");
    return result.toJSONString();
}