diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 74409fb44..1445783b7 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -177,6 +177,7 @@ namespace IRaCIS.Api.Controllers [HttpGet, Route("imageShare/ShareImage")] + [AllowAnonymous] public IResponseOutput ShareImage([FromServices] ITokenService _tokenService) { var token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo() @@ -191,7 +192,7 @@ namespace IRaCIS.Api.Controllers UserTypeEnum = UserTypeEnum.ShareImage, Code = "ShareCode001", })); - return ResponseOutput.Ok("/#/preview?studyId=d8e7ed1c-4b59-a483-563d-4f05bd4f8921&token=" + token); + return ResponseOutput.Ok("/#//showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share" + token); } diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 448f4e0ce..f92f0dec6 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -389,7 +389,7 @@ 设置已读 - 获取登陆用户的系统通知列表 只是过滤了用户类型 + 获取登陆用户的系统通知列表 只是过滤了用户类型 和已经发布的 @@ -1890,6 +1890,12 @@ + + + 获取所有下拉框 枚举 bool 数据 + + + 获取是和否 @@ -1906,12 +1912,6 @@ - - - 获取所有下拉框 枚举 bool 数据 - - - 打包医生官方简历 diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index db073ace2..8f0c1856d 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -135,6 +135,21 @@ namespace IRaCIS.Application.Services return searchList; } + /// + /// 获取所有下拉框 枚举 bool 数据 + /// + /// + [AllowAnonymous] + public async Task>> GetBasicDataAllSelect() + { + var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + + return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); + } + + + #region 稽查相关 + /// /// 获取是和否 /// @@ -155,11 +170,11 @@ namespace IRaCIS.Application.Services /// public async Task GetAuditState(Guid trial, T childCode) { - var QCProcessEnum = _trialRepository.Where(x=>x.Id==trial).Select(x => x.QCProcessEnum).FirstOrDefault(); + var QCProcessEnum = _trialRepository.Where(x => x.Id == trial).Select(x => x.QCProcessEnum).FirstOrDefault(); switch (QCProcessEnum) { - - + + case TrialQCProcess.SingleAudit: return await _dicRepository.Where(t => t.Parent.Code == "AuditStatePE" && t.Code == Convert.ToInt32(childCode).ToString()).Select(x => x.ValueCN).FirstOrDefaultAsync() ?? string.Empty; @@ -173,20 +188,14 @@ namespace IRaCIS.Application.Services public async Task GetBasicDataTranslateItem(string parentCode, T childCode) { - return await _dicRepository.Where(t => t.Parent.Code == parentCode && t.Code == Convert.ToInt32(childCode).ToString() ).Select(x => x.ValueCN).FirstOrDefaultAsync()??string.Empty; + return await _dicRepository.Where(t => t.Parent.Code == parentCode && t.Code == Convert.ToInt32(childCode).ToString()).Select(x => x.ValueCN).FirstOrDefaultAsync() ?? string.Empty; } - /// - /// 获取所有下拉框 枚举 bool 数据 - /// - /// - [AllowAnonymous] - public async Task>> GetBasicDataAllSelect() - { - var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); - } + #endregion + + + } diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportHelper.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportHelper.cs index 33230b3b4..f7363fab2 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportHelper.cs @@ -13,7 +13,7 @@ public static class ExcelExportHelper if (doc == null) { - throw new Exception("当前code 没要找到对应的导出模板文件"); + throw new Exception("当前code 没找到对应的导出模板文件"); } var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\'))?.FullName; diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 2ee9e9143..808befd20 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -4,13 +4,8 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; using User = IRaCIS.Core.Domain.Models.User; namespace IRaCIS.Core.Application.Services @@ -70,9 +65,8 @@ namespace IRaCIS.Core.Application.Services } else { - var document = await _systemDocumentRepository.Where(t => t.Id == addOrEditSystemDocument.Id, true, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync(); + var document = (await _systemDocumentRepository.Where(t => t.Id == addOrEditSystemDocument.Id, true, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync()).IfNullThrowException(); - if (document == null) return Null404NotFound(document); if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id, true)) { @@ -82,25 +76,29 @@ namespace IRaCIS.Core.Application.Services _mapper.Map(addOrEditSystemDocument, document); - document.UpdateTime = DateTime.Now; + #region 之前区分路径文件夹 现在不区分废弃 - if (document.FileTypeId != addOrEditSystemDocument.FileTypeId) - { - var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName; - var beforeFilePath = Path.Combine(rootPath, document.Path); + //if (document.FileTypeId != addOrEditSystemDocument.FileTypeId) + //{ + // var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName; + // var beforeFilePath = Path.Combine(rootPath, document.Path); - document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditSystemDocument.FileTypeId.ToString()); + // document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditSystemDocument.FileTypeId.ToString()); - var nowPath = Path.Combine(rootPath, document.Path); + // var nowPath = Path.Combine(rootPath, document.Path); - if (File.Exists(beforeFilePath)) - { - File.Move(beforeFilePath, nowPath, true); - File.Delete(beforeFilePath); - } + // if (File.Exists(beforeFilePath)) + // { + // File.Move(beforeFilePath, nowPath, true); + // File.Delete(beforeFilePath); + // } - } - var success = await _repository.SaveChangesAsync(); + //} + + #endregion + + + var success = await _systemDocumentRepository.SaveChangesAsync(); return ResponseOutput.Ok(document.Id.ToString()); } diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 131338172..b632695f1 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -418,34 +418,37 @@ namespace IRaCIS.Core.Application.Services return ResponseOutput.NotOk("同类型已存在该文件名"); } - var document = _trialDocumentRepository.Where(t => t.Id == addOrEditTrialDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefault(); + var document = (await _trialDocumentRepository.Where(t => t.Id == addOrEditTrialDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync()).IfNullThrowException(); - if (document == null) return Null404NotFound(document); - //var dbDocumentType = document.Type; _mapper.Map(addOrEditTrialDocument, document); - if (document.FileTypeId != addOrEditTrialDocument.FileTypeId) - { + #region 不区分路径了 + + //if (document.FileTypeId != addOrEditTrialDocument.FileTypeId) + //{ - var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName; - var beforeFilePath = Path.Combine(rootPath, document.Path); + // var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName; + // var beforeFilePath = Path.Combine(rootPath, document.Path); - document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditTrialDocument.FileTypeId.ToString()); + // document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditTrialDocument.FileTypeId.ToString()); - var nowPath = Path.Combine(rootPath, document.Path); + // var nowPath = Path.Combine(rootPath, document.Path); - if (File.Exists(beforeFilePath)) - { - File.Move(beforeFilePath, nowPath, true); - File.Delete(beforeFilePath); - } + // if (File.Exists(beforeFilePath)) + // { + // File.Move(beforeFilePath, nowPath, true); + // File.Delete(beforeFilePath); + // } - } + //} - var success = await _repository.SaveChangesAsync(); + #endregion + + + var success = await _trialDocumentRepository.SaveChangesAsync(); return ResponseOutput.Ok(document.Id.ToString()); } @@ -525,10 +528,7 @@ namespace IRaCIS.Core.Application.Services /// public async Task UserConfirm(UserConfirmCommand userConfirmCommand) { - - - - + if (userConfirmCommand.isSystemDoc) { if (await _repository.AnyAsync(t => t.SystemDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.Id)) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyListService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyListService.cs index 886f424e1..4a916a58d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyListService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyListService.cs @@ -463,6 +463,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc /// 指定资源Id,获取Dicom检查信息 /// Dicom检查的Id [HttpGet, Route("{studyId:guid}")] + [AllowAnonymous] public IResponseOutput Item(Guid studyId) { return ResponseOutput.Ok(_mapper.Map(_repository.Where().FirstOrDefault(s => s.Id == studyId))); diff --git a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs index 9a64a0549..48be64dc5 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs @@ -112,6 +112,30 @@ namespace IRaCIS.Core.Application.ViewModel public string FullFilePath { get; set; } public bool IsRead { get; set; } + + + public Guid? PublishedUserId { get; set; } + + public DateTime? PublishedTime { get; set; } + + public string PublishUserName { get; set; } + + public SystemNotice_NoticeStateEnum ActualNoticeStateEnum + + { + get + { + if (NoticeStateEnum == SystemNotice_NoticeStateEnum.HavePublished && EndDate != null && EndDate < DateTime.Now) + { + return SystemNotice_NoticeStateEnum.HaveExpired; + } + else + { + return NoticeStateEnum; + } + } + } + } public class SystemNoticeUserTypeView diff --git a/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs index 798b8c691..e2e626e43 100644 --- a/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs +++ b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs @@ -111,7 +111,7 @@ namespace IRaCIS.Core.Application.Service return ResponseOutput.Result(success); } - /// 获取登陆用户的系统通知列表 只是过滤了用户类型 + /// 获取登陆用户的系统通知列表 只是过滤了用户类型 和已经发布的 [HttpPost] public async Task> GetUserSystemNoticeList(SystemNoticeQuery querySystemNotice) { diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index d59605e4c..fa77bf4c8 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -78,14 +78,14 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName)); CreateMap() - .ForMember(d => d.RealName, u => u.MapFrom(s => s.LastName + " / " + s.FirstName)) + .ForMember(d => d.RealName, u => u.MapFrom(s => s.FullName)) .ForMember(d => d.UserTypeId, u => u.MapFrom(s => s.UserTypeRole.Id)) .ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeName)) .ForMember(d => d.UserTypeShortName, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName)) .ForMember(d => d.CanEditUserType, u => u.MapFrom(s => !s.UserTrials.Any())); CreateMap() - .ForMember(d => d.RealName, u => u.MapFrom(s => s.LastName + " / " + s.FirstName)) + .ForMember(d => d.RealName, u => u.MapFrom(s => s.FullName)) .ForMember(d => d.UserTypeId, u => u.MapFrom(s => s.UserTypeRole.Id)) .ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName)) .ForMember(d => d.CanEditUserType, u => u.MapFrom(s => !s.UserTrials.Any())); @@ -93,15 +93,16 @@ namespace IRaCIS.Core.Application.Service var token = string.Empty; var userId = Guid.Empty; CreateMap() - .ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.FullName)) - .ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.FullName)) + .ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName)) + .ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.UserName)) .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); CreateMap() - .ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.FullName)) + .ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName)) + .ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUser.UserName)) .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));