diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index fc4b1efa1..4d3003ad9 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Contracts; using User = IRaCIS.Core.Domain.Models.User; +using DocumentFormat.OpenXml.Office2010.Word; namespace IRaCIS.Core.Application.Services { @@ -19,14 +20,16 @@ namespace IRaCIS.Core.Application.Services private readonly IRepository _systemDocumentRepository; private readonly IRepository _systemDocNeedConfirmedUserTypeRepository; + private readonly IRepository _systemDocConfirmedUserRepository; public SystemDocumentService( IRepository systemDocumentRepository, - IRepository systemDocNeedConfirmedUserTypeRepository - ) + IRepository systemDocNeedConfirmedUserTypeRepository, + IRepository systemDocConfirmedUserRepository) { _systemDocumentRepository = systemDocumentRepository; this._systemDocNeedConfirmedUserTypeRepository = systemDocNeedConfirmedUserTypeRepository; - } + _systemDocConfirmedUserRepository = systemDocConfirmedUserRepository; + } @@ -109,6 +112,22 @@ namespace IRaCIS.Core.Application.Services } + [HttpDelete("{systemDocumentId:guid}")] + public async Task AbandonSystemDocumentAsync(Guid systemDocumentId) + { + + await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true }); + + await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedUser() + { + IsDeleted = true + }); + + await _systemDocConfirmedUserRepository.SaveChangesAsync(); + return ResponseOutput.Result(true); + } + + [HttpDelete("{systemDocumentId:guid}")] public async Task DeleteSystemDocumentAsync(Guid systemDocumentId) diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index 1135e0088..263ac8f46 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -489,11 +489,11 @@ namespace IRaCIS.Core.Domain.Models /// /// PI不认同 /// - PIAgree = 1, + PINotAgree = 1, /// /// PI认同 /// - PINotAgree = 2 + PIAgree = 2 } }