From 4bc2c3107a77becf76b3cd31531ceb66d4e26297 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 16 Aug 2023 13:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E9=99=90=E5=88=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=85=8D=E7=BD=AE=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/SystemDocumentService.cs | 25 ++++++++++++++++--- IRaCIS.Core.Domain/Allocation/VisitTask.cs | 4 +-- 2 files changed, 24 insertions(+), 5 deletions(-) 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 } }