| | |
| | | import cn.iocoder.yudao.module.system.dal.mysql.notify.NotifyMessageMapper; |
| | | import cn.iocoder.yudao.module.system.service.notify.NotifySendService; |
| | | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| | | import cn.iocoder.yudao.module.system.api.storage.StorageAttachmentApi; |
| | | import jakarta.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private NotifyMessageMapper notifyMessageMapper; |
| | | |
| | | @Resource |
| | | private StorageAttachmentApi storageAttachmentApi; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long createNotice(Long userId, OaNoticeSaveReqVO createReqVO) { |
| | |
| | | notice.setPublishTime(LocalDateTime.now()); |
| | | } |
| | | oaNoticeMapper.insert(notice); |
| | | storageAttachmentApi.bindAttachments("file", "oa_notice", notice.getId(), createReqVO.getBlobIds()); |
| | | |
| | | // 指定人写入关联表 |
| | | if (OaNoticeSendScopeEnum.SPECIFIED.getScope().equals(createReqVO.getSendScope()) |
| | |
| | | updateObj.setPublishTime(LocalDateTime.now()); |
| | | } |
| | | oaNoticeMapper.updateById(updateObj); |
| | | storageAttachmentApi.updateAttachments("file", "oa_notice", updateReqVO.getId(), updateReqVO.getBlobIds()); |
| | | |
| | | // 更新指定人关联 |
| | | oaNoticeUserMapper.deleteByNoticeId(updateReqVO.getId()); |
| | |
| | | public void deleteNotice(Long id) { |
| | | validateNoticeExists(id); |
| | | oaNoticeMapper.deleteById(id); |
| | | storageAttachmentApi.deleteAttachmentsByRecord("oa_notice", id); |
| | | oaNoticeUserMapper.deleteByNoticeId(id); |
| | | } |
| | | |