系统通知
parent
13b4c25b58
commit
21a261a806
|
@ -14,6 +14,12 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
/// <summary> SystemNoticeView 列表视图模型 </summary>
|
||||
public class SystemNoticeView : SystemNoticeBasicInfo
|
||||
{
|
||||
public Guid? PublishedUserId { get; set; }
|
||||
|
||||
public DateTime? PublishedTime { get; set; }
|
||||
|
||||
public string PublishUserName { get; set; }
|
||||
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
|
|
@ -48,8 +48,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (addOrEditSystemNotice.Id == null)
|
||||
{
|
||||
var entity = await _systemNoticeRepository.InsertFromDTOAsync(addOrEditSystemNotice, true);
|
||||
var entity = await _systemNoticeRepository.InsertFromDTOAsync(addOrEditSystemNotice);
|
||||
|
||||
if (entity.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished)
|
||||
{
|
||||
entity.PublishedUserId = _userInfo.Id;
|
||||
entity.PublishedTime = DateTime.Now;
|
||||
}
|
||||
_systemNoticeRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
@ -60,6 +66,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
_mapper.Map(addOrEditSystemNotice, systemNotice);
|
||||
|
||||
if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && systemNotice.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.NotPublish)
|
||||
{
|
||||
systemNotice.PublishedUserId = _userInfo.Id;
|
||||
systemNotice.PublishedTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
systemNotice.PublishedUserId = null;
|
||||
systemNotice.PublishedTime = null;
|
||||
}
|
||||
|
||||
|
||||
await _systemNoticeRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
|
|
@ -93,6 +93,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var token = string.Empty;
|
||||
var userId = Guid.Empty;
|
||||
CreateMap<SystemNotice, SystemNoticeView>()
|
||||
.ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishUser.FullName))
|
||||
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.FullName))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||
|
||||
|
|
|
@ -73,18 +73,18 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public DateTime? EndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FileName
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Path
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string Path { get; set; }
|
||||
|
||||
public Guid? PublishedUserId { get; set; }
|
||||
|
||||
public User PublishUser { get; set; }
|
||||
|
||||
public DateTime? PublishedTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue