修改稽查
parent
175b0459df
commit
2104677e46
|
@ -238,6 +238,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
Dictionary<string, object> jsonDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(item.JsonStr);
|
||||
|
||||
if (!jsonDict.ContainsKey(nameof(InspectionJsonDetail.CommonData)))
|
||||
{
|
||||
jsonDict.Add(nameof(InspectionJsonDetail.CommonData), new { });
|
||||
}
|
||||
|
||||
//查询关联父层级数据
|
||||
if (item.Id == currentInspectionId)
|
||||
{
|
||||
|
@ -247,6 +252,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var commonDataObjList = await GetRelationParentData( item.Id,item.ObjectRelationParentId, item.ObjectRelationParentId2, item.CreateTime, item.BatchId, objectLsit);
|
||||
|
||||
|
||||
|
||||
var currentDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonDict[nameof(InspectionJsonDetail.CommonData)].ToJsonStr());
|
||||
|
||||
foreach (var commonDataObj in commonDataObjList)
|
||||
|
@ -359,10 +366,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
Dictionary<string, object> jsonDic = JsonConvert.DeserializeObject<Dictionary<string, object>>(relationParentInspection.JsonDetail);
|
||||
|
||||
|
||||
if (jsonDic.ContainsKey(nameof(InspectionJsonDetail.CommonData)))
|
||||
{
|
||||
var commonDataDicObj = jsonDic[nameof(InspectionJsonDetail.CommonData)];
|
||||
|
||||
objectLsit.Add(commonDataDicObj);
|
||||
}
|
||||
|
||||
|
||||
//避免对象信息记录 把 Data里面的信息也取过去 但是加上稽查对象的前缀
|
||||
var dataDicObj = jsonDic[nameof(InspectionJsonDetail.Data)];
|
||||
|
|
|
@ -263,40 +263,45 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudy)))
|
||||
{
|
||||
var entity = item.Entity as NoneDicomStudy;
|
||||
var fileCount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == entity.Id).CountAsync();
|
||||
|
||||
|
||||
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, null, new
|
||||
{
|
||||
FileCount = fileCount,
|
||||
});
|
||||
|
||||
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, null);
|
||||
|
||||
//var fileCount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == entity.Id).CountAsync();
|
||||
|
||||
|
||||
//await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, null, new
|
||||
//{
|
||||
// FileCount = fileCount,
|
||||
//});
|
||||
}
|
||||
|
||||
// 非Dicom文件
|
||||
if (entitys.Any(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
|
||||
{
|
||||
var noneDicomStudyfile = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).Select(x => x.Entity).FirstOrDefault() as NoneDicomStudyFile;
|
||||
var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == noneDicomStudyfile.NoneDicomStudyId).FirstOrDefaultAsync();
|
||||
if (noneDicomStudy != null)
|
||||
{
|
||||
var filecount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == noneDicomStudyfile.NoneDicomStudyId).CountAsync();
|
||||
var count = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).ToList().Count;
|
||||
if (type == "Deleted")
|
||||
{
|
||||
filecount = filecount - count;
|
||||
}
|
||||
else
|
||||
{
|
||||
filecount = filecount + count;
|
||||
}
|
||||
//// 非Dicom文件
|
||||
//if (entitys.Any(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
|
||||
//{
|
||||
// var noneDicomStudyfile = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).Select(x => x.Entity).FirstOrDefault() as NoneDicomStudyFile;
|
||||
// var noneDicomStudy = await _dbContext.NoneDicomStudy.Where(x => x.Id == noneDicomStudyfile.NoneDicomStudyId).FirstOrDefaultAsync();
|
||||
// if (noneDicomStudy != null)
|
||||
// {
|
||||
// var filecount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == noneDicomStudyfile.NoneDicomStudyId).CountAsync();
|
||||
// var count = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).ToList().Count;
|
||||
// if (type == "Deleted")
|
||||
// {
|
||||
// filecount = filecount - count;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// filecount = filecount + count;
|
||||
// }
|
||||
|
||||
await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, null, new
|
||||
{
|
||||
FileCount = filecount,
|
||||
});
|
||||
// await InsertInspection<NoneDicomStudy>(noneDicomStudy, type, null, new
|
||||
// {
|
||||
// FileCount = filecount,
|
||||
// });
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue