diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 59aee3afa..b583430a9 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -16992,11 +16992,32 @@ SystemDocumentService - + SystemDocumentService + + + 获取系统文档附件 + + + + + + + 新增或编辑系统文档附件 + + + + + + + 删除系统文档附件 + + + + 管理端列表 diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs index 776891288..61d9c46e7 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs @@ -8,6 +8,49 @@ using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts { + public class SystemDocumentAttachmentView : SystemDocumentAttachmentAddOrEdit + { + + public DateTime CreateTime { get; set; } + + public DateTime UpdateTime { get; set; } + + } + + + public class SystemDocumentAttachmentAddOrEdit + { + public Guid? Id { get; set; } + + public string FileFormat { get; set; } + + public string FileName { get; set; } + + public string FilePath { get; set; } + + public decimal? FileSize { get; set; } + + public bool OffLine { get; set; } + + public Guid SystemDocumentId { get; set; } + } + + public class SystemDocumentAttachmentQuery : PageInput + { + public string? FileFormat { get; set; } + + public string? FileName { get; set; } + + public string? FilePath { get; set; } + + public decimal? FileSize { get; set; } + + public bool? OffLine { get; set; } + + public Guid? SystemDocumentId { get; set; } + } + + /// SystemDocumentView 列表视图模型 public class SystemDocumentView : SystemDocumentAddOrEdit { diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs index 4b4c530e4..ecab216e5 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs @@ -27,6 +27,13 @@ namespace IRaCIS.Core.Application.Contracts Task> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument); + Task> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery); + + Task AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment); + + Task DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId); + + } diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 27342add0..d3490fa7b 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -16,12 +16,59 @@ namespace IRaCIS.Core.Application.Services [ApiExplorerSettings(GroupName = "Trial")] public class SystemDocumentService(IRepository _systemDocumentRepository, IRepository _userRoleRepository, + IRepository _systemDocumentAttachmentRepository, IRepository _identityUserRepository, IRepository _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService { + /// + /// 获取系统文档附件 + /// + /// + /// + [HttpPost] + public async Task> GetSystemDocumentAttachmentList(SystemDocumentAttachmentQuery inQuery) + { + + var systemDocumentAttachmentQueryable = _systemDocumentAttachmentRepository + .WhereIf(inQuery.SystemDocumentId != null, t => t.SystemDocumentId == inQuery.SystemDocumentId) + .WhereIf(inQuery.FileName != null, t => t.FileName == inQuery.FileName) + .WhereIf(inQuery.FileFormat != null, t => t.FileFormat == inQuery.FileFormat) + .ProjectTo(_mapper.ConfigurationProvider); + + var pageList = await systemDocumentAttachmentQueryable.ToPagedListAsync(inQuery); + + return pageList; + } + /// + /// 新增或编辑系统文档附件 + /// + /// + /// + public async Task AddOrUpdateSystemDocumentAttachment(SystemDocumentAttachmentAddOrEdit addOrEditSystemDocumentAttachment) + { + + + + var entity = await _systemDocumentAttachmentRepository.InsertOrUpdateAsync(addOrEditSystemDocumentAttachment, true); + + return ResponseOutput.Ok(entity.Id.ToString()); + + } + + /// + /// 删除系统文档附件 + /// + /// + /// + [HttpDelete("{systemDocumentAttachmentId:guid}")] + public async Task DeleteSystemDocumentAttachment(Guid systemDocumentAttachmentId) + { + var success = await _systemDocumentAttachmentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentAttachmentId, true); + return ResponseOutput.Ok(); + } /// diff --git a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs index 88a39c772..0cd170208 100644 --- a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs @@ -14,6 +14,12 @@ namespace IRaCIS.Core.Application.Service var userId = Guid.Empty; var isEn_Us = false; + + // 在此处拷贝automapper 映射 + + CreateMap(); + CreateMap().ReverseMap(); + CreateMap(); //CreateMap, List>(); CreateMap();