diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index d74012a95..0405a9b56 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -121,7 +121,7 @@ namespace IRaCIS.Core.Application.Contracts { throw new BusinessValidationFailedException("当前任务存在子问题,删除失败"); } - var success = await _qcQuestionRepository.BatchDeleteNoTrackingAsync(t => t.Id == qCQuestionConfigureId); + var success = await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId,true); return ResponseOutput.Result(success); } diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 9cf11fd2b..6d7eb5dc6 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -174,27 +174,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common }); } - // 项目问题 - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestion))) - { - var entity = item.Entity as TrialQCQuestion; - var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync(); - await InsertInspection(entity, type, x => new InspectionConvertDTO() - { - ObjectRelationParentId = x.TrialId - }, new - { - QuestionName = entity.QuestionName, - Type = entity.Type, - TypeValue = entity.TypeValue, - ShowOrder = entity.ShowOrder, - IsRequired = entity.IsRequired, - ParentName = paretName, - ParentTriggerValue = entity.ParentTriggerValue, - IsEnable = entity.IsEnable, - IsQCQuestionConfirmed = entity.IsConfirm, - }); - } @@ -461,6 +440,37 @@ namespace IRaCIS.Core.Infra.EFCore.Common #region 已修改 + //系统 Qc 问题 + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion))) + { + var entity = item.Entity as QCQuestion; + + var parentName = await _dbContext.QCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync(); + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + IsDistinctionInterface = false + + }, new { ParentName = parentName }) ; + } + + // 项目QC问题 + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestion))) + { + var entity = item.Entity as TrialQCQuestion; + + var parentName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync(); + + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { + ObjectRelationParentId = x.TrialId, + IsDistinctionInterface = false + }, new + { + ParentName = parentName + }); + } + //系统文件 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocument))) @@ -512,11 +522,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common } - //Qc 问题 - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion))) - { - await InsertInspection(item.Entity as QCQuestion, type); - } // 项目文档 foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))