Merge branch 'master' of http://192.168.1.2:8033/IRaCIS_Core_Api
commit
d495d03619
|
@ -0,0 +1,80 @@
|
|||
--- 1、变更的表名
|
||||
|
||||
--EXEC sp_rename 'old_table_name', 'new_table_name';
|
||||
EXEC sp_rename 'CriterionNidus', 'CriterionNidusSystem';
|
||||
EXEC sp_rename 'ReadingCriterionDictionary', 'ReadingSystemCriterionDictionary';
|
||||
|
||||
|
||||
---- 2、处理发布环境的表数据拆分
|
||||
|
||||
--会直接创建表 CriterionNidusSystem_copy
|
||||
--SELECT *
|
||||
--INTO CriterionNidusSystem_copy
|
||||
--FROM CriterionNidusSystem
|
||||
--WHERE IsSystemCriterion = 0;
|
||||
|
||||
--创建CriterionNidusTrial 将数据迁移过来
|
||||
SELECT *
|
||||
INTO CriterionNidusTrial
|
||||
FROM CriterionNidusSystem
|
||||
WHERE IsSystemCriterion = 0;
|
||||
|
||||
|
||||
SELECT *
|
||||
INTO ReadingTrialCriterionDictionary
|
||||
FROM ReadingSystemCriterionDictionary
|
||||
WHERE IsSystemCriterion = 0;
|
||||
|
||||
|
||||
----- 三、维护稽查数据
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
|
||||
select Count(*) from DataInspection where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
|
||||
|
||||
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
|
||||
select Count(*) from DataInspection where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'
|
||||
|
||||
|
||||
--系统 CriterionNidusSystem
|
||||
update DataInspection SET Identification='CriterionNidusSystem/Add', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add'
|
||||
update DataInspection SET Identification='CriterionNidusSystem/Update' , EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update'
|
||||
update DataInspection SET Identification='CriterionNidusSystem/Deleted', EntityName='CriterionNidusSystem' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted'
|
||||
|
||||
--项目 CriterionNidusTrial
|
||||
update DataInspection SET Identification='CriterionNidusTrial/Add' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial'
|
||||
update DataInspection SET Identification='CriterionNidusTrial/Add/Auto' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Add/IsTrial/Auto'
|
||||
update DataInspection SET Identification='CriterionNidusTrial/Update' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Update/IsTrial'
|
||||
update DataInspection SET Identification='CriterionNidusTrial/Deleted' , EntityName='CriterionNidusTrial' where EntityName='CriterionNidus' and Identification='CriterionNidus/Deleted/IsTrial'
|
||||
|
||||
--系统ReadingSystemCriterionDictionary
|
||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/QuestionType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType'
|
||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/LesionType' , EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType'
|
||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType'
|
||||
update DataInspection SET Identification='ReadingSystemCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingSystemCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType'
|
||||
|
||||
--项目ReadingTrialCriterionDictionary
|
||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/QuestionType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/QuestionType/IsTrial'
|
||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/LesionType' , EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/LesionType/IsTrial'
|
||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/OncologyAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/OncologyAssessType/IsTrial'
|
||||
update DataInspection SET Identification='ReadingTrialCriterionDictionary/Add/GlobalAssessType', EntityName='ReadingTrialCriterionDictionary' where EntityName='ReadingCriterionDictionary' and Identification='ReadingCriterionDictionary/Add/GlobalAssessType/IsTrial'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -570,26 +570,38 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var entity = item.Entity as CriterionNidusSystem;
|
||||
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
if (entity.IsSystemCriterion == false)
|
||||
{
|
||||
extraIdentification = "/IsTrial";
|
||||
|
||||
if (_userInfo.RequestUrl != "OrganInfo/addOrUpdateCriterionNidus" && type == AuditOpt.Add)
|
||||
{
|
||||
extraIdentification = "/IsTrial/Auto";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
await InsertInspection<CriterionNidusSystem>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
|
||||
ObjectRelationParentId = entity.CriterionId,
|
||||
|
||||
TrialReadingCriterionId = entity.IsSystemCriterion == false ? entity.CriterionId : null,
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(CriterionNidusTrial)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as CriterionNidusTrial;
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
if (_userInfo.RequestUrl != "OrganInfo/addOrUpdateCriterionNidus" && type == AuditOpt.Add)
|
||||
{
|
||||
extraIdentification = "/Auto";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
await InsertInspection<CriterionNidusTrial>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
|
||||
ObjectRelationParentId = entity.CriterionId,
|
||||
|
||||
TrialReadingCriterionId = entity.CriterionId,
|
||||
|
||||
ExtraIndentification = extraIdentification
|
||||
|
||||
|
@ -597,6 +609,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
//疗效评估
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TumorAssessment_RECIST1Point1)))
|
||||
|
@ -621,8 +634,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary)))
|
||||
{
|
||||
|
||||
|
||||
|
||||
var type = AuditOpt.Add;
|
||||
|
||||
var allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingSystemCriterionDictionary)).Select(t => t.Entity as ReadingSystemCriterionDictionary).ToList();
|
||||
|
@ -646,15 +657,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
//系统标准
|
||||
if (cloneEntity.IsSystemCriterion)
|
||||
{
|
||||
|
||||
extraIdentification = $"/{cloneEntity.ParentCode}";
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = $"/{cloneEntity.ParentCode}/IsTrial";
|
||||
}
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingSystemCriterionDictionary>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
|
@ -687,9 +692,70 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)))
|
||||
{
|
||||
|
||||
var type = AuditOpt.Add;
|
||||
|
||||
var allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)).Select(t => t.Entity as ReadingTrialCriterionDictionary).ToList();
|
||||
|
||||
//查询出字典的Value ValueCN Des 保存
|
||||
var dicIdList = allList.Select(t => t.DictionaryId).ToList();
|
||||
|
||||
var selectList = await _dbContext.Dictionary.Where(x => dicIdList.Contains(x.Id)).Select(t => new { t.Id, t.Value, t.ValueCN, t.Description, t.ShowOrder }).ToListAsync();
|
||||
|
||||
|
||||
foreach (var list in allList.GroupBy(t => t.ParentCode))
|
||||
{
|
||||
|
||||
var firstEntity = list.First();
|
||||
var cloneEntity = list.First().Clone();
|
||||
|
||||
|
||||
//保证Id 唯一
|
||||
cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.CriterionId.ToString(), firstEntity.ParentCode.ToString());
|
||||
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
|
||||
extraIdentification = $"/{cloneEntity.ParentCode}/IsTrial";
|
||||
|
||||
|
||||
|
||||
await InsertInspection<ReadingTrialCriterionDictionary>(cloneEntity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
|
||||
ObjectRelationParentId = x.CriterionId,
|
||||
|
||||
TrialReadingCriterionId = x.CriterionId,
|
||||
|
||||
//不显示区分接口 通过是否是系统字典 以及字典Code 区分
|
||||
IsDistinctionInterface = false,
|
||||
ExtraIndentification = extraIdentification
|
||||
|
||||
},
|
||||
new
|
||||
{
|
||||
SelectList = selectList.Join(list, t => t.Id, u => u.DictionaryId, (t, u) =>
|
||||
new
|
||||
{
|
||||
t.Value,
|
||||
t.ValueCN,
|
||||
t.Description,
|
||||
t.ShowOrder,
|
||||
u.IsBaseLineUse,
|
||||
u.IsFollowVisitUse
|
||||
}
|
||||
).OrderBy(t => t.ShowOrder).ToList()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1980,7 +2046,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
}, new { QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) =>
|
||||
}, new
|
||||
{
|
||||
QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, t => t.ReadingQuestionTrialId, u => u.QuestionId, (t, u) =>
|
||||
new { Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, u.DictionaryCode, u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList()
|
||||
,
|
||||
TableQuestionAndAnswerList = tableQuesionAndAnswerList
|
||||
|
|
Loading…
Reference in New Issue