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

基于若依ruoyi-nbcio增加flowable流程待办消息的提醒,并提供右上角的红字数字提醒(五)

1、下面提供给前端待办提醒消息的接口SysNoticeController,增加如下:

 /*** 补充用户数据,并返回系统消息* @return*/@Log(title = "系统消息")@GetMapping("/listByUser")public R<Map<String, Object>> listByUser(@RequestParam(required = false, defaultValue = "5") Integer pageSize) {LoginUser loginUser = commonService.getLoginUser();Long userId = loginUser.getUserId();// 1.将系统消息补充到用户通告阅读标记表中LambdaQueryWrapper<SysNotice> querySaWrapper = new LambdaQueryWrapper<SysNotice>();querySaWrapper.eq(SysNotice::getMsgType,Constants.MSG_TYPE_ALL); // 全部人员querySaWrapper.eq(SysNotice::getStatus,Constants.CLOSE_FLAG_0.toString());  // 未关闭querySaWrapper.eq(SysNotice::getSendStatus, Constants.HAS_SEND); //已发布//querySaWrapper.ge(SysNotice::getEndTime, loginUser.getCreateTime()); //新注册用户不看结束通知querySaWrapper.notInSql(SysNotice::getNoticeId,"select notice_id from sys_notice_send where user_id='"+userId+"'");List<SysNotice> notices = noticeService.list(querySaWrapper);if(notices.size()>0) {for(int i=0;i<notices.size();i++) {	//因为websocket没有判断是否存在这个用户,要是判断会出现问题,故在此判断逻辑LambdaQueryWrapper<SysNoticeSend> query = new LambdaQueryWrapper<>();query.eq(SysNoticeSend::getNoticeId,notices.get(i).getNoticeId());query.eq(SysNoticeSend::getUserId,userId);SysNoticeSend one = noticeSendService.getOne(query);if(null==one){SysNoticeSend noticeSend = new SysNoticeSend();noticeSend.setNoticeId(notices.get(i).getNoticeId());noticeSend.setUserId(userId);noticeSend.setReadFlag(Constants.NO_READ_FLAG);noticeSendService.save(noticeSend);}}}// 2.查询用户未读的系统消息Page<SysNotice> anntMsgList = new Page<SysNotice>(0, pageSize);anntMsgList = noticeService.querySysNoticePageByUserId(anntMsgList,userId,"1");//通知公告消息Page<SysNotice> sysMsgList = new Page<SysNotice>(0, pageSize);sysMsgList = noticeService.querySysNoticePageByUserId(sysMsgList,userId,"2");//系统消息Page<SysNotice> todealMsgList = new Page<SysNotice>(0, pageSize);todealMsgList = noticeService.querySysNoticePageByUserId(todealMsgList,userId,"3");//待办消息Map<String,Object> sysMsgMap = new HashMap<String, Object>();sysMsgMap.put("sysMsgList", sysMsgList.getRecords());sysMsgMap.put("sysMsgTotal", sysMsgList.getTotal());sysMsgMap.put("anntMsgList", anntMsgList.getRecords());sysMsgMap.put("anntMsgTotal", anntMsgList.getTotal());sysMsgMap.put("todealMsgList", todealMsgList.getRecords());sysMsgMap.put("todealMsgTotal", todealMsgList.getTotal());return R.ok(sysMsgMap);}

2、其中这里用到了querySysNoticePageByUserId方法

@Overridepublic Page<SysNotice> querySysNoticePageByUserId(Page<SysNotice> page, Long userId, String msgCategory) {if (page.getSize() == -1) {return page.setRecords(baseMapper.querySysNoticeListByUserId(null, userId.toString(), msgCategory));} else {return page.setRecords(baseMapper.querySysNoticeListByUserId(page, userId.toString(), msgCategory));}}

3、上面又用到了sql 在SysNoticeMapper.xml里

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysNoticeMapper"><resultMap type="com.ruoyi.system.domain.SysNotice" id="SysNoticeResult"><result property="noticeId" column="notice_id"/><result property="noticeTitle" column="notice_title"/><result property="noticeType" column="notice_type"/><result property="noticeContent" column="notice_content"/><result property="status" column="status"/><result property="sender" column="sender"/><result property="priority" column="priority"/><result property="msgType" column="msg_type"/><result property="sendStatus" column="send_status"/><result property="sendTime" column="send_time"/><result property="cancelTime" column="cancel_time"/><result property="createBy" column="create_by"/><result property="createTime" column="create_time"/><result property="updateBy" column="update_by"/><result property="updateTime" column="update_time"/><result property="remark" column="remark"/></resultMap><select id="querySysNoticeListByUserId" parameterType="String"  resultMap="SysNoticeResult">select * from sys_noticewhere send_status = '1' and status = '0' and notice_type = #{msgCategory} and notice_id IN ( select notice_id from sys_notice_send where user_id = CAST(#{userId} AS SIGNED INTEGER) and read_flag = '0')order by create_time DESC</select></mapper>

至此,后端的代码基本上就这些了,下一节开始讲一下前端。

相关文章:

基于若依ruoyi-nbcio增加flowable流程待办消息的提醒,并提供右上角的红字数字提醒(五)

1、下面提供给前端待办提醒消息的接口SysNoticeController&#xff0c;增加如下&#xff1a; /*** 补充用户数据&#xff0c;并返回系统消息* return*/Log(title "系统消息")GetMapping("/listByUser")public R<Map<String, Object>> listByU…...

hive数据初始化

mysql版本&#xff1a;3.1.3 hive版本&#xff1a; 8.0.31 hive连接配置 <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://node88:3306/hive?createDatabaseIfNotExisttrue</value> </pr…...

React+Node——next.js 构建前后端项目

一、安装全局依赖 npm i -g create-next-app二、创建next项目 create-next-app react-next-demo //或 create-next-app react-next-demo --typescript三、加载mysql依赖 npm i -S mysql2四、运行项目 npm run dev五、创建db文件目录&#xff0c;目录下创建index.ts import…...

CRM系统主要包括哪些功能?

CRM系统应该要包括的功能总结为3大方向—— 核心必须要具备的功能常见尽量要有的功能可选有了自然更好的功能 以我们公司用的简道云CRM系统模板为例&#xff1a;https://www.jiandaoyun.com 01 核心必须要具备的功能 核心功能决定了系统是否能够被纳入CRM类别&#xff0c;这些…...

Nginx location 精准匹配URL = /

Location是什么&#xff1f; Location是Nginx中的块级指令(block directive)&#xff0c;通过配置Location指令块&#xff0c;可以决定客户端发过来的请求URI如何处理&#xff08;是映射到本地文件还是转发出去&#xff09;及被哪个location处理。 匹配模式 分为两种模式&…...

使用JAXB将Java对象转xml

文章目录 使用JAXB将Java对象转xml1. 要求生成的xml2. Java对象3. 封装的工具类4. 测试 使用JAXB将Java对象转xml 1. 要求生成的xml <?xml version"1.0" encoding"UTF-8" ?> <root><result status"success" msg"成功&qu…...

Atlas 200 DK开发板问题总结

1.fatal error: acl/acl.h: No such file or directory 该问题是因为在设置的DDK环境变量下找不到头文件。 解决方法&#xff1a; 1&#xff09;输入echo $DDK&#xff0c;查看当前DDK地址 2&#xff09;在src文件夹下找到CMakeLists.txt文件&#xff0c;发现该文件有一个变量名…...

uniapp——实现二维码生成+保存二维码图片——基础积累

最近在做二维码推广功能&#xff0c;自从2020年下半年到今天&#xff0c;大概有三年没有用过uniapp了&#xff0c;而且我之前用uniapp开发的程序还比较少&#xff0c;因此很多功能都浪费了很多时间去查资料&#xff0c;现在把功能记录一下。 这里写目录标题 效果图1.根据接口返…...

零基础学前端(六)重点讲解 JavaScript

1. 该篇适用于从零基础学习前端的小白&#xff0c;完全从零基础角度出发 2. 我们学习时&#xff0c;应该主动向自己提问&#xff1f;只有你能提出问题&#xff0c;你才算是在编程中学习进步了。 3. 初学者不懂得问题很多&#xff0c;在自己在不懂时&#xff0c;一定要求助有经验…...

数据库问题记录(粗略版)oracle、mysql等主流数据库通用

1. ORA-00918&#xff1a;未明确定义列 该问题情况大致为&#xff1a;select 所取列名错误、重复等问题。 2. “select * from temp where 10; ”的含义 布尔值为FALSE&#xff0c;只返回表结构&#xff0c;不返回数据。 举一反三&#xff1a; select * from temp where 1&…...

ORACLE多列中取出数据最大的一条

1.需求说明&#xff1a; 当查询出来的数据存在多条数据时&#xff0c;想按照一定条件排序取出其中一条数据。 2.使用函数&#xff1a; row_number() over( partition by 分组字段 order by 排序字段 desc&#xff09; 3.示例&#xff1a; --根据table_a中的pk_house&#x…...

Xamarin.Android实现App内版本更新

目录 1、具体的效果2、代码实现2.1 基本原理2.2 开发环境2.3 具体代码2.3.1 基本设置2.3.2 系统的权限授予2.3.3 进度条的layout文件2.3.4 核心的升级文件 3、代码下载4、知识点5、参考文献 1、具体的效果 有事需要在程序内集成自动更新的功能&#xff0c;网上找了下&#xff…...

运维工程师面经

文章目录 前言RedisMongoDBPython中的GIL&#xff08;全局解释器锁&#xff09;Python算法总结 前言 本博客仅做学习笔记&#xff0c;如有侵权&#xff0c;联系后即刻更改 科普&#xff1a; Redis 参考网址 NoSQL技术 基于内存的数据库&#xff0c;并且提供一定的持久化功能…...

stm32之智能垃圾桶实战

之前用过51做过一个垃圾桶的小项目&#xff0c;这里用32重新搞了一下。视频的效果和之前一样&#xff0c;可参考这个垃圾桶效果 。 一、项目描述&#xff08;同51&#xff09; 项目主要是模拟不用手动打开垃圾桶盖&#xff0c;而进行自动操作。自动打开的条件如下&#xff1a…...

【C++面向对象侯捷下】2.转换函数 | 3.non-explicit-one-argument ctor

文章目录 operator double() const {} 歧义了 标准库的转换函数...

UOS Deepin Ubuntu Linux 开启 ssh 远程登录

UOS Deepin Ubuntu Linux 开启 ssh 远程登录 打开控制台 安装 openssh-server sudo apt -y install openssh-server修改 /etc/ssh/ssh_config 文件 sudo vim /etc/ssh/ssh_config找到 # Port 22 去掉 # 注释后 保存 重启 ssh 服务 sudo systemctl restart ssh设置 ssh 服务 开机…...

Postman应用——接口请求和响应(Get和Post请求)

文章目录 新增Request请求Get请求Post请求 Request请求响应Postman响应界面说明请求响应另存为示例&#xff08;模板&#xff09;Postman显示的响应数据清空请求响应数据保存到本地文件 这里只讲用的比较多的Get和Post请求方式&#xff0c;也可以遵循restful api接口规范&#…...

Linux查看哪些进程占用的系统 buffer/cache 较高 (hcache,lsof)命令

1、什么是buffer/cache &#xff1f; buffer/cache 其实是作为服务器系统的文件数据缓存使用的&#xff0c;尤其是针对进程对文件存在 read/write 操作的时候&#xff0c;所以当你的服务进程在对文件进行读写的时候&#xff0c;Linux内核为了提高服务的读写速度&#xff0c;则将…...

(Vue2)自定义创建项目、ESLint、Vuex

自定义创建项目&#xff1a;基于VueCli自定义创建项目架子 安装脚手架->创建项目->选择自定义->Babel/Router/CSS/Linter 路由配置项很多&#xff0c;希望创建项目时就把架子搭好 hash模式和history模式 页面跳转和加载模式 Vue为单页面&#xff0c;只有一个HTML…...

LLaMa

文章目录 Problems403 代码文件LLaMA: Open and Efficient Foundation Language Models方法预训练数据结构优化器一些加速的方法 结果Common Sense ReasoningClosed-book Question AnsweringReading ComprehensionMassive Multitask Language Understanding Instruction Finetu…...

Qt/C++开发监控GB28181系统/取流协议/同时支持udp/tcp被动/tcp主动

一、前言说明 在2011版本的gb28181协议中&#xff0c;拉取视频流只要求udp方式&#xff0c;从2016开始要求新增支持tcp被动和tcp主动两种方式&#xff0c;udp理论上会丢包的&#xff0c;所以实际使用过程可能会出现画面花屏的情况&#xff0c;而tcp肯定不丢包&#xff0c;起码…...

【SpringBoot】100、SpringBoot中使用自定义注解+AOP实现参数自动解密

在实际项目中,用户注册、登录、修改密码等操作,都涉及到参数传输安全问题。所以我们需要在前端对账户、密码等敏感信息加密传输,在后端接收到数据后能自动解密。 1、引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId...

Qt Widget类解析与代码注释

#include "widget.h" #include "ui_widget.h"Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget) {ui->setupUi(this); }Widget::~Widget() {delete ui; }//解释这串代码&#xff0c;写上注释 当然可以&#xff01;这段代码是 Qt …...

postgresql|数据库|只读用户的创建和删除(备忘)

CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...

现代密码学 | 椭圆曲线密码学—附py代码

Elliptic Curve Cryptography 椭圆曲线密码学&#xff08;ECC&#xff09;是一种基于有限域上椭圆曲线数学特性的公钥加密技术。其核心原理涉及椭圆曲线的代数性质、离散对数问题以及有限域上的运算。 椭圆曲线密码学是多种数字签名算法的基础&#xff0c;例如椭圆曲线数字签…...

Java入门学习详细版(一)

大家好&#xff0c;Java 学习是一个系统学习的过程&#xff0c;核心原则就是“理论 实践 坚持”&#xff0c;并且需循序渐进&#xff0c;不可过于着急&#xff0c;本篇文章推出的这份详细入门学习资料将带大家从零基础开始&#xff0c;逐步掌握 Java 的核心概念和编程技能。 …...

【碎碎念】宝可梦 Mesh GO : 基于MESH网络的口袋妖怪 宝可梦GO游戏自组网系统

目录 游戏说明《宝可梦 Mesh GO》 —— 局域宝可梦探索Pokmon GO 类游戏核心理念应用场景Mesh 特性 宝可梦玩法融合设计游戏构想要素1. 地图探索&#xff08;基于物理空间 广播范围&#xff09;2. 野生宝可梦生成与广播3. 对战系统4. 道具与通信5. 延伸玩法 安全性设计 技术选…...

基于PHP的连锁酒店管理系统

有需要请加文章底部Q哦 可远程调试 基于PHP的连锁酒店管理系统 一 介绍 连锁酒店管理系统基于原生PHP开发&#xff0c;数据库mysql&#xff0c;前端bootstrap。系统角色分为用户和管理员。 技术栈 phpmysqlbootstrapphpstudyvscode 二 功能 用户 1 注册/登录/注销 2 个人中…...

PostgreSQL——环境搭建

一、Linux # 安装 PostgreSQL 15 仓库 sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-$(rpm -E %{rhel})-x86_64/pgdg-redhat-repo-latest.noarch.rpm# 安装之前先确认是否已经存在PostgreSQL rpm -qa | grep postgres# 如果存在&#xff0…...

[USACO23FEB] Bakery S

题目描述 Bessie 开了一家面包店! 在她的面包店里&#xff0c;Bessie 有一个烤箱&#xff0c;可以在 t C t_C tC​ 的时间内生产一块饼干或在 t M t_M tM​ 单位时间内生产一块松糕。 ( 1 ≤ t C , t M ≤ 10 9 ) (1 \le t_C,t_M \le 10^9) (1≤tC​,tM​≤109)。由于空间…...