diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java index cbae96e..f2dd37a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/quote/QuoteController.java @@ -23,7 +23,7 @@ import static com.ruoyi.common.utils.PageUtils.startPage; /** * @ClassName QuoteController - * @Description TODO + * @Description 报价单Controller * @Author JIAL * @Date 2024/3/5 12:57 * @Version 1.0 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SsoLoginController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SsoLoginController.java index 8ff75bc..f662992 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SsoLoginController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SsoLoginController.java @@ -5,7 +5,7 @@ package com.ruoyi.web.controller.system; * @package: com.ruoyi.web.controller.system * @className: ThirdPartLoginController * @author: sean - * @description: TODO + * @description: 免密登录Controller * @date: 2023/2/20 14:47 * @version: 1.0 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java index 6516b34..6650e07 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysNoticeController.java @@ -8,6 +8,7 @@ import java.util.stream.Collectors; import com.alibaba.fastjson2.JSONObject; import com.ruoyi.common.constant.WebsocketConst; import com.ruoyi.framework.websocket.WebSocket; +import com.ruoyi.system.domain.NoticeUserSelect; import com.ruoyi.system.domain.SysNoticeUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; @@ -79,7 +80,7 @@ public class SysNoticeController extends BaseController Long userId = getLoginUser().getUserId();//当前登陆者 insertNoticeUser(userId,notice,noticeService,null); }catch (Exception e){ - e.printStackTrace(); + return error("系统异常"); } return success(); } @@ -131,6 +132,14 @@ public class SysNoticeController extends BaseController @GetMapping(value = "navbarNotice/{noticeId}") public AjaxResult getNavbarNoticeInfo(@PathVariable Long noticeId) { + try{ + //更新消息表 isRead字段 设置 为 1-已读 + SysNotice sysNotice = noticeService.selectNoticeById(noticeId); + sysNotice.setIsRead("1"); + noticeService.updateNotice(sysNotice); + }catch(Exception e){ + return error("系统异常"); + } return success(noticeService.selectNoticeById(noticeId)); } @@ -187,4 +196,16 @@ public class SysNoticeController extends BaseController } } } + + /** + * 获取对应消息对象的 人员 + * @param noticeUserSelect + * @return + */ + @GetMapping("/listNoticeEventUser") + public List listNoticeEventUser(NoticeUserSelect noticeUserSelect) + { + List list = noticeService.listNoticeEventUser(noticeUserSelect); + return list; + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java b/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java index 8309f97..3133f19 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/mapper/QuoteMapper.java @@ -11,7 +11,7 @@ import java.util.Map; /** * @ClassName QuoteMapper - * @Description TODO + * @Description 报价单Mapper * @Author JIAL * @Date 2024/3/5 16:07 * @Version 1.0 diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java b/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java index a322bfa..ee6cd45 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/service/QuoteService.java @@ -8,7 +8,7 @@ import java.util.Map; /** * @ClassName QuoteService - * @Description TODO + * @Description 报价单Service * @Author JIAL * @Date 2024/3/5 16:06 * @Version 1.0 diff --git a/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java index 0276af6..8739f74 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/quote/service/impl/QuoteServiceImpl.java @@ -12,7 +12,7 @@ import java.util.Map; /** * @ClassName QuoteServiceImpl - * @Description TODO + * @Description 报价单ServiceImpl * @Author JIAL * @Date 2024/3/5 16:07 * @Version 1.0 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/NoticeUserSelect.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/NoticeUserSelect.java new file mode 100644 index 0000000..616506b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/NoticeUserSelect.java @@ -0,0 +1,31 @@ +package com.ruoyi.system.domain; + +public class NoticeUserSelect { + private String noticeEventType; + private String userName; + private String nickName; + + public String getNoticeEventType() { + return noticeEventType; + } + + public void setNoticeEventType(String noticeEventType) { + this.noticeEventType = noticeEventType; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName; + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java index 5f80885..9709274 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -1,6 +1,8 @@ package com.ruoyi.system.mapper; import java.util.List; + +import com.ruoyi.system.domain.NoticeUserSelect; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.domain.SysNoticeUser; @@ -70,4 +72,11 @@ public interface SysNoticeMapper * @param sysNoticeUsers */ void insertNoticeUserBatch(List sysNoticeUsers); + + /** + * 获取对应消息对象的 人员 + * @param noticeUserSelect + * @return + */ + List listNoticeEventUser(NoticeUserSelect noticeUserSelect); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java index 891f1e9..3928699 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java @@ -1,6 +1,8 @@ package com.ruoyi.system.service; import java.util.List; + +import com.ruoyi.system.domain.NoticeUserSelect; import com.ruoyi.system.domain.SysNotice; import com.ruoyi.system.domain.SysNoticeUser; @@ -70,4 +72,11 @@ public interface ISysNoticeService * @param sysNoticeUsers */ void insertNoticeUserBatch(List sysNoticeUsers); + + /** + * 获取对应消息对象的 人员 + * @param noticeUserSelect + * @return + */ + List listNoticeEventUser(NoticeUserSelect noticeUserSelect); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java index 7b552af..7f239fc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -4,6 +4,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.system.domain.NoticeUserSelect; import com.ruoyi.system.domain.SysNoticeUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -131,4 +132,14 @@ public class SysNoticeServiceImpl implements ISysNoticeService public void insertNoticeUserBatch(List sysNoticeUsers) { noticeMapper.insertNoticeUserBatch(sysNoticeUsers); } + + /** + * 获取对应消息对象的 人员 + * @param noticeUserSelect + * @return + */ + @Override + public List listNoticeEventUser(NoticeUserSelect noticeUserSelect) { + return noticeMapper.listNoticeEventUser(noticeUserSelect); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml index b6a5140..cce51e8 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysNoticeMapper.xml @@ -15,10 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark + select notice_id, notice_title, notice_type, notice_content, status, create_by, create_time, update_by, update_time, remark, isRead from sys_notice @@ -70,7 +71,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" notice_content = #{noticeContentBit}, status = #{status}, update_by = #{updateBy}, - update_time = getdate() + update_time = getdate(), + isRead = #{isRead} where notice_id = #{noticeId} @@ -109,4 +111,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + diff --git a/ruoyi-ui/src/api/system/notice.js b/ruoyi-ui/src/api/system/notice.js index 4bea853..9566138 100644 --- a/ruoyi-ui/src/api/system/notice.js +++ b/ruoyi-ui/src/api/system/notice.js @@ -60,3 +60,12 @@ export function getNavbarNotice(noticeId) { }) } +// 获取对应消息对象的 人员 +export function listNoticeEventUser(query) { + return request({ + url: '/system/notice/listNoticeEventUser', + method: 'get', + params: query + }) +} + diff --git a/ruoyi-ui/src/layout/components/NavbarNotice.vue b/ruoyi-ui/src/layout/components/NavbarNotice.vue index 55b1e2c..d4c0ddf 100644 --- a/ruoyi-ui/src/layout/components/NavbarNotice.vue +++ b/ruoyi-ui/src/layout/components/NavbarNotice.vue @@ -102,6 +102,7 @@ this.websocketOnclose(); }, methods: { + /**获取消息数据*/ getList() { this.noticeData = []; this.sysLog = []; @@ -120,11 +121,13 @@ }, handleClick(tab, event) { }, + /**获取消息详情*/ clickNote(data) { getNavbarNotice(data.noticeId).then(response => { this.form = response.data; this.noteTitle = "消息详情" this.noteVisible = true + this.getList() }); }, initWebSocket() { diff --git a/ruoyi-ui/src/views/components/Tools/PeopleSelect/index.vue b/ruoyi-ui/src/views/components/Tools/PeopleSelect/index.vue index 0775d6a..f6102da 100644 --- a/ruoyi-ui/src/views/components/Tools/PeopleSelect/index.vue +++ b/ruoyi-ui/src/views/components/Tools/PeopleSelect/index.vue @@ -254,10 +254,12 @@ uns.forEach(item => { if(this.allUserMap.has(item)) { - result.push(this.allUserMap.get(item).nickName || ''); + var json = {}; + json.userName = this.allUserMap.get(item).userName || ''; + json.nickName = this.allUserMap.get(item).nickName || ''; + result.push(json); } }) - return result; }, @@ -407,7 +409,7 @@ .leftBox_title { width:100%; height:40px; - font-size: 16px; + /*font-size: 16px;*/ line-height: 40px; padding-left: 10px; background-color: #f5f5f5; @@ -531,7 +533,7 @@ height: 40px; border-radius: 50%; color: #fff; - font-size: 16px; + /*font-size: 16px;*/ text-align: center; line-height: 40px; user-select: none; @@ -551,7 +553,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - font-size: 16px; + /*font-size: 16px;*/ line-height: 20px; } diff --git a/ruoyi-ui/src/views/noticeUserSelect/noticeUserSelect/index.vue b/ruoyi-ui/src/views/noticeUserSelect/noticeUserSelect/index.vue index a07f416..cc22dbd 100644 --- a/ruoyi-ui/src/views/noticeUserSelect/noticeUserSelect/index.vue +++ b/ruoyi-ui/src/views/noticeUserSelect/noticeUserSelect/index.vue @@ -1,32 +1,81 @@ +