From a43d53509928769b403c140b3c0c617475ff7a7f Mon Sep 17 00:00:00 2001 From: liukewei Date: Thu, 18 Jan 2024 14:38:07 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E8=B7=9F=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ehs/EhsMyMessageController.java | 11 ++++++--- ruoyi-ui/src/layout/components/Navbar.vue | 23 +++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java index 48658f1..73023b9 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java @@ -121,10 +121,15 @@ public class EhsMyMessageController extends BaseController ehsMyMessage.setMyMessageType("0"); ehsMyMessage.setMyUserId(SecurityUtils.getUserId()); EhsMyMessage msg = ehsMyMessageService.selectEhsMyMessageByMyMessageMax(ehsMyMessage); - if(msg.getMyMessageState().equals("N")) - ajr.put("msgHD","1"); - else + if(msg == null){ ajr.put("msgHD","0"); + }else{ + if(msg.getMyMessageState().equals("N")) + ajr.put("msgHD","1"); + else + ajr.put("msgHD","0"); + } + //分析是否有本人的未读消息通知 //消息通知的每一记录,我的消息都应该有一条记录,如果没有,说明未读,并向我的消息插入一条记录,并设置为未读 //消息通知模块点击阅读按钮后,需要同时修改我的消息的已读标志 diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 721c9a9..a31bd07 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -32,13 +32,14 @@ - - + + 隐患消息 + - + 消息通知 @@ -121,6 +122,20 @@ } }, methods: { + goHD(msgC){ + if(msgC!=0){ + this.$router.push({ + path: '/ehsHiddenDangerMenu/ehsHiddenDanger', query: {overTime: "10" } + }); + } + }, + goMsg(msgC){ + if(msgC!=0){ + this.$router.push({ + path: '/ehsNoticeMessage/ehsNoticeMessageDept', query: {noticeType: "0" } + }); + } + }, getUnread() { console.log("定时任务"); getUnread().then(response => {