diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index 2ee426311..71b149ed0 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -8,6 +8,7 @@ using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Image.QA; +using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Domain.Models; @@ -31,6 +32,7 @@ namespace IRaCIS.Core.API.Controllers private readonly IQCListService _qCListService; private readonly ITrialConfigService _trialConfigService; private readonly ISubjectService _subjectService; + private readonly ISubjectVisitService _subjectVisitService; private readonly IInspectionService _inspectionService; private readonly IRepository _dataInspectionRepository; private delegate Task executionFun(dynamic data); @@ -42,8 +44,10 @@ namespace IRaCIS.Core.API.Controllers IRepository dataInspectionRepository, IQCListService _qCListService, IInspectionService sinspectionService, - ITrialConfigService _trialConfigService, - ISubjectService _subjectService) + ITrialConfigService _trialConfigService, + ISubjectService _subjectService, + ISubjectVisitService subjectVisitService + ) { _repository = repository; _mapper = mapper; @@ -53,6 +57,7 @@ namespace IRaCIS.Core.API.Controllers this._qCListService = _qCListService; this._trialConfigService = _trialConfigService; this._subjectService = _subjectService; + _subjectVisitService = subjectVisitService; this._dataInspectionRepository = dataInspectionRepository; } @@ -66,19 +71,27 @@ namespace IRaCIS.Core.API.Controllers return await _inspectionService.GetInspectionData(dto); } - ///// - ///// 用户 签名某个文档 签署文件 - ///// - ///// - ///// - //[HttpPost, Route("Inspection/trialDocument/userConfirm")] - //[UnitOfWork] - //public async Task UserConfirm(TrialDocumentConfirmDTO opt) - //{ - // var fun = _trialDocumentService.UserConfirm; - // return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); - //} + #region 访视 + + [HttpPost, Route("Inspection/subjectVisit/addOrUpdateSV")] + [UnitOfWork] + public async Task AddOrUpdateSV(DataInspectionDto opt) + { + //opt.AuditInfo.SubjectCode = opt.OptCommand.Code; + var fun = await _subjectVisitService.AddOrUpdateSV(opt.OptCommand); + opt.AuditInfo.SubjectId = Guid.Parse(fun.Data); + var statusdata = new + { + Status = 1, + //OutEnrollmentTime = DateTime.Now.ToString("yyyy-MM-dd"), + //VisitOverTime = DateTime.Now.ToString("yyyy-MM-dd"), + Reason = string.Empty, + }; + + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, null, fun, statusdata); + } + #endregion #region setting ///// @@ -138,11 +151,8 @@ namespace IRaCIS.Core.API.Controllers { opt.AuditInfo.SubjectCode = opt.OptCommand.Code; - var fun = await _subjectService.AddOrUpdateSubject(opt.OptCommand); - opt.AuditInfo.SubjectId = Guid.Parse(fun.Data); - var statusdata = new { Status = 1, //OutEnrollmentTime = DateTime.Now.ToString("yyyy-MM-dd"), diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 2f1d6c296..400cdf4f6 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -123,6 +123,11 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO #endregion + public class DataInspectionDto : InspectionBase, IInspectionDTO, ISignDTO + { + public T OptCommand { get; set; } + } + #region 受试者 public class InsSubjectCommand : InspectionBase, IInspectionDTO, ISignDTO { diff --git a/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectVisitService.cs index 81bee8106..667edf92d 100644 --- a/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectVisitService.cs @@ -4,7 +4,7 @@ namespace IRaCIS.Core.Application.Interfaces { public interface ISubjectVisitService { - Task AddOrUpdateSV(SubjectVisitCommand svCommand); + Task> AddOrUpdateSV(SubjectVisitCommand svCommand); Task DeleteSV(Guid id); Task> GetVisitStudyList(Guid trialId, Guid sujectVisitId, int isReading); Task SetSVExecuted(Guid subjectVisitId); diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 52c65013d..f96793546 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -24,7 +24,7 @@ namespace IRaCIS.Core.Application.Services [HttpPost] [TypeFilter(typeof(TrialResourceFilter))] [UnitOfWork] - public async Task AddOrUpdateSV(SubjectVisitCommand svCommand) + public async Task> AddOrUpdateSV(SubjectVisitCommand svCommand) { var verifyExp1 = new EntityVerifyExp() @@ -178,7 +178,7 @@ namespace IRaCIS.Core.Application.Services - return ResponseOutput.Ok(); + return ResponseOutput.Ok(needDealEntity.Id.ToString()); }