当前位置: 首页 > news >正文

西安市市政建设网站船员专用网站开发建议

西安市市政建设网站,船员专用网站开发建议,网页版游戏排行榜j,潜山网站建设更多ruoyi-nbcio功能请看演示系统 gitee源代码地址 前后端代码#xff1a; https://gitee.com/nbacheng/ruoyi-nbcio 演示地址#xff1a;RuoYi-Nbcio后台管理系统 1、上一节说到RedisReceiver #xff0c;这里有调用了NbcioRedisListener自定义业务监听#xff0c;如下…更多ruoyi-nbcio功能请看演示系统 gitee源代码地址 前后端代码 https://gitee.com/nbacheng/ruoyi-nbcio 演示地址RuoYi-Nbcio后台管理系统 1、上一节说到RedisReceiver 这里有调用了NbcioRedisListener自定义业务监听如下 package com.ruoyi.common.redis.listener;import com.ruoyi.common.base.BaseMap;/*** 自定义消息监听* author nbacheng* date 2023-09-20*/public interface NbcioRedisListener {void onMessage(BaseMap message); }2、实现这个代码如下 package com.ruoyi.common.websocket;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;import com.ruoyi.common.base.BaseMap; import com.ruoyi.common.constant.CommonSendStatus; import com.ruoyi.common.redis.listener.NbcioRedisListener;import cn.hutool.core.util.ObjectUtil; import lombok.extern.slf4j.Slf4j;/*** 监听消息(采用redis发布订阅方式发送消息)*/ Slf4j Component public class SocketHandler implements NbcioRedisListener {Autowiredprivate WebSocketServer webSocket;Overridepublic void onMessage(BaseMap map) {log.info(【SocketHandler消息】Redis Listerer: map.toString());String userId map.get(userId);String message map.get(message);if (ObjectUtil.isNotEmpty(userId)) {webSocket.pushMessage(userId, message);//app端消息推送webSocket.pushMessage(userIdCommonSendStatus.APP_SESSION_SUFFIX, message);} else {webSocket.pushMessage(message);}} 这里进行了websocket的服务器给用户推送同时之前第一个节里公共类方法也同时往两个表增加数据以便失败后后续可以进行发送以确保能真正通知到用户。 3、接下来就是需要在用户提起流程发给审批人进行消息发送了 package com.ruoyi.flowable.listener;import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j;import org.apache.commons.lang3.StringUtils; import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType; import org.flowable.common.engine.api.delegate.event.FlowableEvent; import org.flowable.common.engine.api.delegate.event.FlowableEventListener; import org.flowable.common.engine.api.delegate.event.FlowableEventType; import org.flowable.engine.HistoryService; import org.flowable.engine.RepositoryService; import org.flowable.engine.TaskService; import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.task.service.impl.persistence.entity.TaskEntity; import org.springframework.stereotype.Component;import com.ruoyi.common.core.service.CommonService; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.domain.model.LoginUser;import javax.annotation.Resource;/*** 全局监听-工作流待办消息提醒** author nbacheng*/ Slf4j Component RequiredArgsConstructor public class TaskCreateListener implements FlowableEventListener {private final TaskService taskService;Resourceprivate CommonService commonService;Resourceprotected RepositoryService repositoryService;Resourceprotected HistoryService historyService;Overridepublic void onEvent(FlowableEvent flowableEvent) {FlowableEventType type flowableEvent.getType();if (type FlowableEngineEventType.TASK_ASSIGNED) { if(flowableEvent instanceof org.flowable.engine.delegate.event.impl.FlowableEntityEventImpl ) {TaskEntity taskEntity (TaskEntity) ((org.flowable.engine.delegate.event.impl.FlowableEntityEventImpl) flowableEvent).getEntity();String taskId taskEntity.getId();String procInsId taskEntity.getProcessInstanceId();HistoricProcessInstance historicProcessInstance historyService.createHistoricProcessInstanceQuery().processInstanceId(procInsId).singleResult();String businessKey historicProcessInstance.getBusinessKey();String deployId historicProcessInstance.getDeploymentId();String startUserId historicProcessInstance.getStartUserId();//获取任务接收人String receiver taskEntity.getAssignee();if (StringUtils.isNotEmpty(receiver)) {//发送提醒消息String category ;if(taskService.getVariables(taskId).get(category) ! null) {category taskService.getVariables(taskId).get(category).toString();}LoginUser loginUser commonService.getLoginUser();String taskMessageUrl;if(StringUtils.isNotBlank(businessKey)) {taskMessageUrl a href commonService.getBaseUrl() ?procInsId procInsId deployId deployId taskId taskId businessKey businessKey category category finishedtrue 点击这个进行处理/a ;}else {taskMessageUrl a href commonService.getBaseUrl() ?procInsId procInsId deployId deployId taskId taskId businessKey category category finishedtrue 点击这个进行处理/a ;}String msgContent 流程待办通知 taskMessageUrl;if(!StringUtils.equals(startUserId, receiver) || !StringUtils.equals((loginUser.getUserId()).toString(),receiver)) {//发起人或登录人自己不发送log.info(流程待办通知给: receiver);commonService.sendSysNotice(loginUser.getUserId().toString(), receiver, 流程待办通知, msgContent, Constants.MSG_CATEGORY_3);//setMsgCategory3是待办}}}} }Overridepublic boolean isFailOnException() {return false;}Overridepublic boolean isFireOnTransactionLifecycleEvent() {return false;}Overridepublic String getOnTransaction() {return null;} }
http://www.hkea.cn/news/14368898/

相关文章:

  • 西安新能源网站建设网站建设需要找工信部吗
  • 青州市网站建设济南行知网站制作
  • 中国光大国际建设工程公司网站网站文章推广
  • 网站设计网站优化公司用ps做的网站样图怎么切
  • 烟台企业建站系统模板微信网站开发公司电话
  • 做网页网站建站公司有哪些服务
  • 七彩建设集团官方网站网站加速打开
  • 高端html5网站建设织梦模板电商模板网站
  • 网站建设饱和了吗宜宾商城网站建设
  • 上海建设工程安全质量监督站网站一个网站服务器一年大概多少钱
  • 网站建设类论文导出wordpress数据库
  • 做游戏攻略网站赚钱吗扫图片识别图片原图
  • 山东省城乡与建设厅网站首页百度做公司网站有用吗
  • 微信公众号 做不了微网站吗在线平面设计工具
  • 秦皇岛市网站建设手机网站引导页js插件
  • 在线制作插画网站互联网+创业项目
  • php 如何在网站根目录创建文件夹邵阳房产网
  • 网站建设安全架构个体营业执照可以做网站嘛
  • 为什么要立刻做网站虚拟电脑主机平台
  • 集团网站建设工作方案网站做彩票
  • 广东上海专业网站建设公司哪家好怎么做公司网站竞价
  • 潍坊企业网站制作虚拟网站规划与设计
  • 网站制作实验报告贵州省文化旅游网站建设的必要性
  • linux网站服务器搭建网站的流量有什么用
  • 18芯城网站开发案例wordpress怎么上传自己的网站吗
  • 河北中凯建设有限公司网站app下载安装安卓版
  • 网上给别人做设计的网站手机版wordpress怎样用
  • 做网站设计最好的公司怎样做旅游网站设计
  • 我的家乡网站建设模板下载免费做外贸网站
  • 哪个网站做初中英语试题赚钱怎么使用电脑是做网站