From ebe9b1216ff3517c7eb2cbcc8a03276742ee6dd6 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Fri, 27 May 2022 15:10:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/InspectionController.cs | 35 ++++++++++++------- .../IRaCIS.Core.Application.xml | 10 +++++- .../Service/Inspection/InspectionService.cs | 24 +++++++++++-- .../Interface/IInspectionService.cs | 9 +++-- IRaCIS.Core.Domain/SQLFile/Sql脚本.sql | 2 +- .../Common/AuditingData.cs | 6 ++-- 6 files changed, 64 insertions(+), 22 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index 9610d3cf7..824b8836d 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -111,8 +111,9 @@ namespace IRaCIS.Core.API.Controllers { opt.Data.IsTrialBasicLogicConfirmed = true; + var singid= await _inspectionService.RecordSing(opt.SignInfo); var result = await _trialConfigService.ConfigTrialBasicInfo(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; @@ -127,8 +128,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task TrialConfigSignatureConfirm(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _trialConfigService.TrialConfigSignatureConfirm(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -146,8 +148,10 @@ namespace IRaCIS.Core.API.Controllers public async Task ConfigTrialProcessInfoConfirm(DataInspectionDto opt) { opt.Data.IsTrialProcessConfirmed = true; + + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _trialConfigService.ConfigTrialProcessInfo(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo,result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -165,8 +169,9 @@ namespace IRaCIS.Core.API.Controllers public async Task ConfigTrialUrgentInfoConfirm(DataInspectionDto opt) { opt.Data.IsTrialUrgentConfirmed = true; + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result= await _trialConfigService.ConfigTrialUrgentInfo(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -180,8 +185,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task CRCRequestToQC(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _qCOperationService.CRCRequestToQC(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -193,8 +199,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task QCPassedOrFailed(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result= await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -205,8 +212,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task CheckBack(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _qCOperationService.CheckBack(opt.Data.Id); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -221,9 +229,10 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task SetReuploadFinished(DataInspectionDto opt) { - var result = await _qCOperationService.SetReuploadFinished(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); - return result; + var singid = await _inspectionService.RecordSing(opt.SignInfo); + var result = await _qCOperationService.SetReuploadFinished(opt.Data); + await _inspectionService.CompletedSign(singid, result); + return result; } /// @@ -235,8 +244,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task UpdateTrialState(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _trialConfigService.UpdateTrialState(opt.Data.trialId, opt.Data.trialStatusStr, opt.Data.reason); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } @@ -249,8 +259,9 @@ namespace IRaCIS.Core.API.Controllers [UnitOfWork] public async Task UserConfirm(DataInspectionDto opt) { + var singid = await _inspectionService.RecordSing(opt.SignInfo); var result = await _trialDocumentService.UserConfirm(opt.Data); - await _inspectionService.RecordSing(opt.SignInfo, result); + await _inspectionService.CompletedSign(singid, result); return result; } } diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 1df0c3722..5375f2026 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -331,7 +331,7 @@ 批次Id - + 传入参数记录ID @@ -339,6 +339,14 @@ + + + 完成签名 + + + + + 验证用户签名信息 /// diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 4137c8c28..5da81713e 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -167,18 +167,36 @@ namespace IRaCIS.Core.Application.Service.Inspection /// /// /// - public async Task RecordSing(SignDTO SignInfo, IResponseOutput response) + public async Task RecordSing(SignDTO SignInfo) { - if (SignInfo != null&&response.IsSuccess) + if (SignInfo != null) { var verifyResult = await VerifySignatureAsync(SignInfo); var signId = await AddSignRecordAsync(SignInfo); _userInfo.SignId = signId; - await _repository.BatchUpdateAsync(t => t.Id == signId, u => new TrialSign() { IsCompleted = true }); + return signId; + } + else + { + return default(Guid); } } + /// + /// 完成签名 + /// + /// + /// + /// + public async Task CompletedSign(Guid signId, IResponseOutput response) + { + if (response.IsSuccess) + { + await _repository.BatchUpdateAsync(t => t.Id == signId, u => new TrialSign() { IsCompleted = true }); + } + } + /// 验证用户签名信息 /// diff --git a/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs index e57290129..141506bc5 100644 --- a/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs @@ -17,9 +17,12 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface Task AddSignRecordAsync(SignDTO signDTO); - Task RecordSing(SignDTO SignInfo, IResponseOutput response); - + Task RecordSing(SignDTO SignInfo); + + + Task CompletedSign(Guid signId, IResponseOutput response); + + - } } diff --git a/IRaCIS.Core.Domain/SQLFile/Sql脚本.sql b/IRaCIS.Core.Domain/SQLFile/Sql脚本.sql index 645a65178..42cdb8ab5 100644 --- a/IRaCIS.Core.Domain/SQLFile/Sql脚本.sql +++ b/IRaCIS.Core.Domain/SQLFile/Sql脚本.sql @@ -4,4 +4,4 @@ update DataInspection set BatchId=Id where BatchId is null update QCChallenge set Code=ChallengeCode -update QCChallenge set ChallengeCode='D'+ RIGHT('00000'+CAST( Code AS nvarchar(50)),5); \ No newline at end of file +update QCChallenge set ChallengeCode='Q'+ RIGHT('00000'+CAST( Code AS nvarchar(50)),5); \ No newline at end of file diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 6c2cefdf9..21c85920d 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -164,7 +164,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { TrialDicList = string.Join(",", trials) - }); + }, item.OriginalValues); } // 访视计划 @@ -899,7 +899,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common type = type + (entity.ParentId == null ? "/parent" : string.Empty); break; case nameof(Trial): - var oldentity = originaldata as Trial; + entity = entityobj as Trial; + Guid id = entity.Id; + Trial oldentity =await _dbContext.Trial.Where(x=>x.Id==id).FirstOrDefaultAsync(); switch (_userInfo.RequestUrl.ToLower()) { case "configtrialbasicinfo/configtrialbasicinfoconfirm":