From dcda2d5af623586f9597f53ce4a337a833eb5772 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 26 Aug 2022 16:21:10 +0800 Subject: [PATCH] =?UTF-8?q?QC=20=E9=97=AE=E9=A2=98=20=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=A8=BD=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/QC/QCQuestionService.cs | 2 +- .../Common/AuditingData.cs | 57 ++++++++++--------- 2 files changed, 32 insertions(+), 27 deletions(-) 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)))