业务系统通知列表
parent
04a608c28b
commit
2d25ebd7ce
|
@ -330,6 +330,12 @@
|
|||
SystemNoticeService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.SystemNoticeService.SetSystemNoticeHaveRead(System.Guid)">
|
||||
<summary>设置已读 </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.SystemNoticeService.GetUserSystemNoticeList(IRaCIS.Core.Application.ViewModel.SystemNoticeQuery)">
|
||||
<summary>获取登陆用户的系统通知列表 只是过滤了用户类型 </summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TrialExternalUserService">
|
||||
<summary>
|
||||
项目外部人员 录入流程相关
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
public string CreateUserName { get; set; }
|
||||
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
|
@ -75,6 +79,19 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
public Guid[] NoticeUserTypeIdList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SystemNoticeReadDTO: SystemNoticeBasicInfo
|
||||
{
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
|
||||
public string CreateUserName { get; set; }
|
||||
|
||||
public string FullFilePath { get; set; }
|
||||
|
||||
public bool IsRead { get; set; }
|
||||
}
|
||||
|
||||
public class SystemNoticeUserTypeView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(querySystemNotice.NoticeTypeEnum != null, t => t.NoticeTypeEnum == querySystemNotice.NoticeTypeEnum)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.FileName), t => t.FileName.Contains(querySystemNotice.FileName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.NoticeContent), t => t.NoticeContent.Contains(querySystemNotice.NoticeContent))
|
||||
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken});
|
||||
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken });
|
||||
|
||||
return await systemNoticeQueryable.ToPagedListAsync(querySystemNotice.PageIndex, querySystemNotice.PageSize, querySystemNotice.SortField, querySystemNotice.Asc);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (addOrEditSystemNotice.Id == null)
|
||||
{
|
||||
var entity = await _systemNoticeRepository.InsertFromDTOAsync(addOrEditSystemNotice,true);
|
||||
var entity = await _systemNoticeRepository.InsertFromDTOAsync(addOrEditSystemNotice, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
|
@ -78,5 +78,38 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
/// <summary>设置已读 </summary>
|
||||
|
||||
public async Task<IResponseOutput> SetSystemNoticeHaveRead(Guid systemNoticeId)
|
||||
{
|
||||
var systemNotice = (await _systemNoticeRepository.FirstOrDefaultAsync(t => t.Id == systemNoticeId)).IfNullThrowException();
|
||||
|
||||
systemNotice.NoticeUserReadList.Add(new SystemNoticeUserRead() { SystemNoticeId = systemNoticeId });
|
||||
|
||||
var success = await _systemNoticeRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
/// <summary>获取登陆用户的系统通知列表 只是过滤了用户类型 </summary>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemNoticeReadDTO>> GetUserSystemNoticeList(SystemNoticeQuery querySystemNotice)
|
||||
{
|
||||
var systemNoticeQueryable = _systemNoticeRepository
|
||||
.Where(t=>t.NoticeUserTypeList.Any(t=>t.UserTypeId==_userInfo.UserTypeId))
|
||||
.WhereIf(querySystemNotice.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == querySystemNotice.ApplicableProjectEnum)
|
||||
.WhereIf(querySystemNotice.NoticeLevelEnum != null, t => t.NoticeLevelEnum == querySystemNotice.NoticeLevelEnum)
|
||||
.WhereIf(querySystemNotice.NoticeModeEnum != null, t => t.NoticeModeEnum == querySystemNotice.NoticeModeEnum)
|
||||
.WhereIf(querySystemNotice.NoticeStateEnum != null, t => t.NoticeStateEnum == querySystemNotice.NoticeStateEnum)
|
||||
.WhereIf(querySystemNotice.NoticeTypeEnum != null, t => t.NoticeTypeEnum == querySystemNotice.NoticeTypeEnum)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.FileName), t => t.FileName.Contains(querySystemNotice.FileName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(querySystemNotice.NoticeContent), t => t.NoticeContent.Contains(querySystemNotice.NoticeContent))
|
||||
.ProjectTo<SystemNoticeReadDTO>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken ,userId=_userInfo.Id});
|
||||
|
||||
return await systemNoticeQueryable.ToPagedListAsync(querySystemNotice.PageIndex, querySystemNotice.PageSize, querySystemNotice.SortField, querySystemNotice.Asc);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,8 +91,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.CanEditUserType, u => u.MapFrom(s => !s.UserTrials.Any()));
|
||||
|
||||
var token = string.Empty;
|
||||
var userId = Guid.Empty;
|
||||
CreateMap<SystemNotice, SystemNoticeView>()
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); ;
|
||||
.ForMember(t=>t.CreateUserName,d=>d.MapFrom(t=>t.CreateUser.FullName))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<SystemNotice, SystemNoticeReadDTO>()
|
||||
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.FullName))
|
||||
.ForMember(t => t.IsRead, d => d.MapFrom(t => t.NoticeUserReadList.Any(t=>t.CreateUserId== userId)))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||
|
||||
CreateMap<SystemNotice, SystemNoticeAddOrEdit>().ReverseMap()
|
||||
.ForMember(t=>t.NoticeUserTypeList,u=>u.MapFrom(t=>t.NoticeUserTypeIdList));
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public List<SystemNoticeUserRead> NoticeUserReadList { get; set; }
|
||||
|
||||
public User CreateUser { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// NoticeContent
|
||||
|
|
Loading…
Reference in New Issue