修改通知

Uat_Study
hang 2022-04-28 16:23:12 +08:00
parent bacc6bb24a
commit fd380ce430
2 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ namespace IRaCIS.Core.Application.Service
entity.PublishedUserId = _userInfo.Id; entity.PublishedUserId = _userInfo.Id;
entity.PublishedTime = DateTime.Now; entity.PublishedTime = DateTime.Now;
} }
_systemNoticeRepository.SaveChangesAsync(); await _systemNoticeRepository.SaveChangesAsync();
return ResponseOutput.Ok(entity.Id.ToString()); return ResponseOutput.Ok(entity.Id.ToString());
} }
@ -64,8 +64,6 @@ namespace IRaCIS.Core.Application.Service
var systemNotice = await _systemNoticeRepository.Where(t => t.Id == addOrEditSystemNotice.Id, true, true).Include(t => t.NoticeUserTypeList).FirstOrDefaultAsync(); var systemNotice = await _systemNoticeRepository.Where(t => t.Id == addOrEditSystemNotice.Id, true, true).Include(t => t.NoticeUserTypeList).FirstOrDefaultAsync();
_mapper.Map(addOrEditSystemNotice, systemNotice);
if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && systemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.NotPublish) if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && systemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.NotPublish)
{ {
systemNotice.PublishedUserId = _userInfo.Id; systemNotice.PublishedUserId = _userInfo.Id;
@ -77,6 +75,8 @@ namespace IRaCIS.Core.Application.Service
systemNotice.PublishedTime = null; systemNotice.PublishedTime = null;
} }
_mapper.Map(addOrEditSystemNotice, systemNotice);
await _systemNoticeRepository.SaveChangesAsync(); await _systemNoticeRepository.SaveChangesAsync();