diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index d5826b0d3..f87dc1dac 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -140,8 +140,8 @@ namespace IRaCIS.Core.Application.Service.Inspection }; query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId) - //.WhereIf(dto.RelationDeadlineTime != null, x => x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)) - .WhereIf(dto.TrialId != null, t => (t.TrialId == dto.TrialId) || (t.CreateTime >= trialData.CreateTime && t.CreateTime <= trialData.TrialFinishTime)) + //.WhereIf(dto.RelationDeadlineTime != null, x => x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)) + .Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime)) .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId) .WhereIf(dto.BatchId != null && dto.GeneralId != null && dto.ObjectRelationParentId == null, x => x.BatchId == dto.BatchId || ((x.GeneralId == dto.GeneralId || x.ObjectRelationParentId == dto.GeneralId) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1))) diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 48b4a6c0b..0f3cad0ef 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -570,19 +570,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common subjectVisit = subjectVisit ?? new SubjectVisit(); if (type == "Add") { - //await AddInspectionRecordAsync( new - //{ - // QcQuestionAnswerCommands = await Getdata(entitylist), - //},new InspectionConvertDTO() - //{ - // SiteId = subjectVisit.SiteId, - // Identification = $"{_userInfo.RequestUrl}/{firstEntity.GetType().Name}/{type}", - // SubjectId = subjectVisit.SubjectId, - // SubjectVisitName = subjectVisit.VisitName, - // TrialId = subjectVisit.TrialId, - // SubjectVisitId = subjectVisit.Id, - // GeneralId = subjectVisit.Id, - //}); + await InsertInspection(firstEntity, type, answer => new InspectionConvertDTO() { @@ -618,19 +606,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common QcQuestionAnswerCommands = await Getdata(entitylist), }); - //await AddInspectionRecordAsync( new - //{ - // QcQuestionAnswerCommands = await Getdata(entitylist), - //},new InspectionConvertDTO() - //{ - // Identification = $"{_userInfo.RequestUrl}/{firstEntity.GetType().Name}/{type}", - // SiteId = subjectVisit.SiteId, - // SubjectId = subjectVisit.SubjectId, - // TrialId = subjectVisit.TrialId, - // SubjectVisitId = subjectVisit.Id, - // SubjectVisitName = subjectVisit.VisitName, - // GeneralId = subjectVisit.Id, - //}); + } async Task> Getdata(List questionAnswers)