修改稽查数据

Uat_Study
hang 2022-09-07 14:38:13 +08:00
parent 18ef02886f
commit 6295820804
3 changed files with 108 additions and 12 deletions

View File

@ -985,7 +985,7 @@ namespace IRaCIS.Core.Application.Service
x.DataType = !item.DataType.IsNullOrEmpty() ? item.DataType : x.DataType;
x.DateType = !item.DateType.IsNullOrEmpty() ? item.DateType : x.DateType;
x.DictionaryKey = !item.DictionaryKey.IsNullOrEmpty() ? item.DictionaryKey : x.DictionaryKey;
x.IsShowParent = !item.IsShowParent == null ? item.IsShowParent : x.IsShowParent;
x.IsShowParent = /*!item.IsShowParent == null ?*/ item.IsShowParent /*: x.IsShowParent*/;
x.ForeignKeyTableName = !item.ForeignKeyTableName.IsNullOrEmpty() ? item.ForeignKeyTableName : x.ForeignKeyTableName;
x.ForeignKeyText = !item.ForeignKeyText.IsNullOrEmpty() ? item.ForeignKeyText : x.ForeignKeyText;
x.ForeignKeyValue = !item.ForeignKeyValue.IsNullOrEmpty() ? item.ForeignKeyValue : x.ForeignKeyValue;

View File

@ -95,7 +95,7 @@ namespace IRaCIS.Core.Domain.Models
/// </summary>
public Guid? ChildrenTypeId { get; set; }
public bool IsShowParent { get; set; }
public int IsShowParent { get; set; }
public string ConfigType { get; set; } = String.Empty;

View File

@ -169,9 +169,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
await InsertInspection<ReadingQuestionCriterionTrial>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false,
IsDistinctionInterface = type == AuditOpt.Update ? true : false,
ObjectRelationParentId=x.TrialId
ObjectRelationParentId = x.TrialId
});
}
@ -183,12 +183,26 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as ReadingQuestionSystem;
int? parentQuestionShowOrder = null;
int? relavantQuestionShowOrder = null;
if (entity.ParentId != null)
{
parentQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.ParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.RelevanceId != null)
{
relavantQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.RelevanceId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
await InsertInspection<ReadingQuestionSystem>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false
});
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder });
}
//项目标准问题
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingQuestionTrial)))
@ -198,13 +212,30 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as ReadingQuestionTrial;
int? parentQuestionShowOrder = null;
int? relavantQuestionShowOrder = null;
if (entity.ParentId != null)
{
parentQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.ParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.RelevanceId != null)
{
relavantQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.RelevanceId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
await InsertInspection<ReadingQuestionTrial>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false,
ObjectRelationParentId = x.TrialId
});
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder });
}
//系统标准表格问题
@ -215,12 +246,32 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as ReadingTableQuestionSystem;
int? dependQuestionShowOrder = null;
int? parentQuestionShowOrder = null;
int? relavantQuestionShowOrder = null;
if (entity.ParentId != null)
{
parentQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.ParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.RelevanceId != null)
{
relavantQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.RelevanceId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.DependParentId != null)
{
dependQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.DependParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
await InsertInspection<ReadingTableQuestionSystem>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false
});
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder, DependQuestionShowOrder = dependQuestionShowOrder });
}
//项目标准表格问题
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionTrial)))
@ -229,6 +280,24 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as ReadingTableQuestionTrial;
int? dependQuestionShowOrder = null;
int? parentQuestionShowOrder = null;
int? relavantQuestionShowOrder = null;
if (entity.ParentId != null)
{
parentQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.ParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.RelevanceId != null)
{
relavantQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.RelevanceId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
if (entity.DependParentId != null)
{
dependQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.DependParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync();
}
await InsertInspection<ReadingTableQuestionTrial>(entity, type, x => new InspectionConvertDTO()
{
@ -236,7 +305,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
ObjectRelationParentId = x.TrialId
});
}, new { ParentQuestionShowOrder = parentQuestionShowOrder, RelavantQuestionShowOrder = relavantQuestionShowOrder, DependQuestionShowOrder = dependQuestionShowOrder });
}
@ -979,13 +1048,28 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as QCQuestion;
var parentQuestionName = await _dbContext.QCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
int? parentQuestionOrder = null;
string parentQuestionName = string.Empty;
if (entity.ParentId != null)
{
var question = await _dbContext.QCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync();
parentQuestionOrder = question.ShowOrder;
parentQuestionName = question.QuestionName;
}
await InsertInspection<QCQuestion>(entity, type, x => new InspectionConvertDTO()
{
IsDistinctionInterface = false
}, new { ParentQuestionName = parentQuestionName });
}, new
{
ParentQuestionName = parentQuestionName,
ParentQuestionOrder = parentQuestionOrder
});
}
// 项目QC问题
@ -996,7 +1080,18 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as TrialQCQuestion;
var parentQuestionName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
int? parentQuestionOrder = null;
string parentQuestionName = string.Empty;
if (entity.ParentId != null)
{
var question = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => new { x.ShowOrder, x.QuestionName }).FirstOrDefaultAsync();
parentQuestionOrder = question.ShowOrder;
parentQuestionName = question.QuestionName;
}
await InsertInspection<TrialQCQuestion>(entity, type, x => new InspectionConvertDTO()
{
@ -1004,7 +1099,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
IsDistinctionInterface = false
}, new
{
ParentQuestionName = parentQuestionName
ParentQuestionName = parentQuestionName,
ParentQuestionOrder= parentQuestionOrder
});
}