修改系统通知

This commit is contained in:
2022-05-17 14:07:42 +08:00
parent 12a0812bcd
commit fafe6a76a0
3 changed files with 32 additions and 2 deletions
@@ -93,6 +93,7 @@ namespace IRaCIS.Core.Application.Service
public async Task<IResponseOutput> DeleteSystemNotice(Guid systemNoticeId)
{
var success = await _systemNoticeRepository.BatchDeleteNoTrackingAsync(t => t.Id == systemNoticeId);
return ResponseOutput.Result(success);
}
@@ -131,5 +132,15 @@ namespace IRaCIS.Core.Application.Service
}
public async Task<List<SystemNoticeView>> GetUserNoticeList()
{
var query = _systemNoticeRepository
.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id))
.Where(t=>t.EndDate==null || t.EndDate != null && t.EndDate< DateTime.Now)
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
return await query.ToListAsync();
}
}
}