【8.1.0】【notice】更新系统消息的撤回功能

pull/60/head
fengshuonan 2024-01-14 22:59:53 +08:00
parent 9ad569cdae
commit 54502b63bb
2 changed files with 12 additions and 2 deletions

View File

@ -111,6 +111,12 @@ public class SysMessageServiceImpl extends ServiceImpl<SysMessageMapper, SysMess
LambdaUpdateWrapper<SysMessage> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(SysMessage::getBusinessType, messageRetractDTO.getBusinessType());
wrapper.eq(SysMessage::getBusinessId, messageRetractDTO.getBusinessId());
// 根据选中的人进行撤回
if (ObjectUtil.isNotEmpty(messageRetractDTO.getUserIdList())) {
wrapper.in(SysMessage::getReceiveUserId, messageRetractDTO.getUserIdList());
}
this.remove(wrapper);
}

View File

@ -10,7 +10,9 @@ import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
import cn.stylefeng.roses.kernel.rule.pojo.dict.SimpleDict;
import cn.stylefeng.roses.kernel.sys.api.MessagePublishApi;
import cn.stylefeng.roses.kernel.sys.api.SysUserOrgServiceApi;
import cn.stylefeng.roses.kernel.sys.api.enums.message.MessageBusinessTypeEnum;
import cn.stylefeng.roses.kernel.sys.api.enums.notice.NoticePublishStatusEnum;
import cn.stylefeng.roses.kernel.sys.api.pojo.message.MessageRetractDTO;
import cn.stylefeng.roses.kernel.sys.modular.notice.entity.SysNotice;
import cn.stylefeng.roses.kernel.sys.modular.notice.enums.SysNoticeExceptionEnum;
import cn.stylefeng.roses.kernel.sys.modular.notice.factory.NoticeFactory;
@ -140,8 +142,10 @@ public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper, SysNotice
this.updateById(sysNotice);
// 2. 调用撤回接口,将已发送的消息全都撤回
MessageRetractDTO messageRetractDTO = new MessageRetractDTO();
messageRetractDTO.setBusinessType(MessageBusinessTypeEnum.SYS_NOTICE.getCode());
messageRetractDTO.setBusinessId(String.valueOf(sysNotice.getNoticeId()));
messagePublishApi.batchRetractMessage(messageRetractDTO);
}
@Override