|
@@ -1,6 +1,7 @@
|
|
|
package com.xy.service;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -47,13 +48,24 @@ public class MsgUserMessageServiceImpl extends ServiceImpl<MsgUserMessageMapper,
|
|
|
public R<MsgUserMessageDto.Vo> obj(MsgUserMessageDto.Vo vo) {
|
|
|
MsgUserMessageDto.SelectList selectList = copy(MsgUserMessageDto.SelectList.class, vo);
|
|
|
List<MsgUserMessageDto.Vo> list = list(selectList).getData();
|
|
|
+ MsgUserMessageDto.Vo myMsg = new MsgUserMessageDto.Vo();
|
|
|
if (Emptys.check(list)) {
|
|
|
- MsgUserMessageDto.Vo myMsg = list.get(0);
|
|
|
+ myMsg = list.get(0);
|
|
|
//更新已读
|
|
|
- this.updateById(new MsgUserMessage().setId(myMsg.getId()).setReadState(MsgReadStatus.READ.getCode().toString()));
|
|
|
+ MsgUserMessage msgUserMessage = new MsgUserMessage();
|
|
|
+ msgUserMessage.setId(myMsg.getId()).setReadState(MsgReadStatus.READ.getCode().toString());
|
|
|
+ if (ObjectUtil.isNotEmpty(myMsg)) {
|
|
|
+ Long msgId = myMsg.getMsgId();
|
|
|
+ MsgSysMonitorNotice msgSysMonitorNotice = msgSysMonitorNoticeService.getById(msgId);
|
|
|
+ if (ObjectUtil.isNotEmpty(msgSysMonitorNotice)) {
|
|
|
+ myMsg.setContent(msgSysMonitorNotice.getContent());
|
|
|
+ myMsg.setTitle(msgSysMonitorNotice.getTitle());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.updateById(msgUserMessage);
|
|
|
return R.ok(myMsg);
|
|
|
}
|
|
|
- return R.ok();
|
|
|
+ return R.ok(myMsg);
|
|
|
}
|
|
|
|
|
|
public R<List<MsgUserMessageDto.Vo>> list(MsgUserMessageDto.SelectList selectList) {
|