修改一版

Uat_Study
he 2022-06-06 16:20:13 +08:00
parent 93d363f76c
commit 198a8601be
4 changed files with 137 additions and 108 deletions

View File

@ -269,7 +269,7 @@
</summary>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.AccessToDialogue(IRaCIS.Core.Infra.EFCore.Common.Dto.AccessToDialogueInDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetDialogList(IRaCIS.Core.Infra.EFCore.Common.Dto.AccessToDialogueInDto)">
<summary>
获取查询对象
</summary>
@ -303,7 +303,7 @@
<param name="dto"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValueData(IRaCIS.Core.Infra.EFCore.Common.Dto.SetInspectionEnumValueDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.SetInspectionEnumValueDataList(IRaCIS.Core.Infra.EFCore.Common.Dto.SetInspectionEnumValueDto)">
<summary>
翻译稽查数据
</summary>
@ -350,11 +350,11 @@
<param name="value"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetChildrenItem(IRaCIS.Core.Application.ViewModel.GetChildrenItem)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetAuditConfigChildList(System.Guid)">
<summary>
获取子数据
</summary>
<param name="item"></param>
<param name="frontAuditConfigId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.FullyReplicated(IRaCIS.Core.Application.ViewModel.FullyReplicated)">
@ -371,11 +371,11 @@
<param name="item"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetDescriptionByModuleType(IRaCIS.Core.Application.ViewModel.GetDescriptionByModuleTypeDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetModuleTypeDescriptionList(System.Guid)">
<summary>
获取Description
</summary>
<param name="dto"></param>
<param name="moduleTypeId"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.GetFrontAuditConfigList(IRaCIS.Core.Application.ViewModel.FrontAuditConfigQuery)">
@ -385,11 +385,11 @@
<param name="iq"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.ChangeFrontAuditSort(IRaCIS.Core.Application.ViewModel.ChangeFrontAuditSortDto)">
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.ChangeFrontAuditSort(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.FrontAuditSort})">
<summary>
修改排序
</summary>
<param name="sortDto"></param>
<param name="sortDataList"></param>
<returns></returns>
</member>
<member name="M:IRaCIS.Core.Application.Service.FrontAuditConfigService.AddOrUpdateFrontAuditConfig(IRaCIS.Core.Application.ViewModel.FrontAuditConfigAddOrEdit)">
@ -1015,12 +1015,12 @@
完全复制对象
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.FullyReplicated.DataFromItemGuid">
<member name="P:IRaCIS.Core.Application.ViewModel.FullyReplicated.FromItemId">
<summary>
数据来源对象
</summary>
</member>
<member name="P:IRaCIS.Core.Application.ViewModel.FullyReplicated.ThisItemGuid">
<member name="P:IRaCIS.Core.Application.ViewModel.FullyReplicated.ToItemId">
<summary>
要赋值到的对象
</summary>

View File

@ -56,12 +56,12 @@ namespace IRaCIS.Core.Application.ViewModel
/// <summary>
/// 数据来源对象
/// </summary>
public Guid DataFromItemGuid { get; set; }
public Guid FromItemId { get; set; }
/// <summary>
/// 要赋值到的对象
/// </summary>
public Guid ThisItemGuid { get; set; }
public Guid ToItemId { get; set; }
}
@ -84,7 +84,7 @@ namespace IRaCIS.Core.Application.ViewModel
public class GetDescriptionByModuleTypeDto
{
public Guid? ModuleType { get; set; }
public Guid ModuleTypeId { get; set; }
}
///<summary>FrontAuditConfigQuery 列表查询参数模型</summary>
@ -118,7 +118,7 @@ namespace IRaCIS.Core.Application.ViewModel
public class ChangeFrontAuditSortDto
{
public List<FrontAuditSort> SortData { get; set; }
public List<FrontAuditSort> SortDataList { get; set; }
}
public class FrontAuditSort

View File

@ -64,7 +64,7 @@ namespace IRaCIS.Core.Application.Service
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<AccessToDialogueOutDto>> AccessToDialogue(AccessToDialogueInDto inDto)
public async Task<List<AccessToDialogueOutDto>> GetDialogList(AccessToDialogueInDto inDto)
{
List<AccessToDialogueOutDto> data = new List<AccessToDialogueOutDto>();
@ -153,15 +153,15 @@ namespace IRaCIS.Core.Application.Service
/// <returns></returns>
public async Task BatchAddFrontAudit(BatchAddFrontAudit data)
{
var maxsort = await _frontAuditConfigRepository.Where(x => x.ParentId == data.ParentId).MaxAsync(x => x.Sort);
var maxSort = await _frontAuditConfigRepository.Where(x => x.ParentId == data.ParentId).MaxAsync(x => x.Sort);
List<FrontAuditConfig> fronts=new List<FrontAuditConfig>();
foreach (var item in data.Columns)
{
maxsort++;
maxSort++;
fronts.Add(new FrontAuditConfig()
{
Sort = maxsort,
Sort = maxSort,
Code = item.Name,
ValueCN = item.Remake,
IsEnable = true,
@ -180,7 +180,7 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<List<string>> SetInspectionEnumValue(SetInspectionEnumValueDto dto)
{
return await SetInspectionEnumValueData(dto);
return await SetInspectionEnumValueDataList(dto);
}
@ -190,7 +190,7 @@ namespace IRaCIS.Core.Application.Service
/// </summary>
/// <param name="dto">传入Dto</param>
/// <returns></returns>
private async Task<List<string>> SetInspectionEnumValueData(SetInspectionEnumValueDto dto)
private async Task<List<string>> SetInspectionEnumValueDataList(SetInspectionEnumValueDto dto)
{
var listIdentification = dto.Items.Select(x => x.Identification).ToList();
foreach (var item in dto.Items)
@ -215,9 +215,9 @@ namespace IRaCIS.Core.Application.Service
/// </summary>
/// <param name="Data">稽查数据</param>
/// <returns></returns>
private async Task<string> SetDataInspectionDateType(List<string> identification, string json)
private async Task<string> SetDataInspectionDateType(List<string> identificationList, string jsonStr)
{
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identification.Contains(x.Identification))
var list = await (from parent in _frontAuditConfigRepository.AsQueryable().Where(x => identificationList.Contains(x.Identification))
join child in _frontAuditConfigRepository.AsQueryable().Where(x => x.EnumType == "Date" && x.IsEnable ) on parent.Id equals child.ParentId
select new DateDto()
{
@ -231,28 +231,28 @@ namespace IRaCIS.Core.Application.Service
DateType = lst.Max(x => x.DateType),
}).ToList();
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(json);
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
if (JsonData == null)
if (jsonDataDic == null)
{
return json;
return jsonStr;
}
foreach (var item in JsonData.Keys)
foreach (var item in jsonDataDic.Keys)
{
var datefirst = list.FirstOrDefault(x => x.Code.ToLower() == item.ToLower());
if (datefirst != null && !IsNullOrEmpty(JsonData[item]))
if (datefirst != null && !IsNullOrEmpty(jsonDataDic[item]))
{
try
{
if (datefirst.DateType == "Date")
{
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd");
jsonDataDic[item] = DateTime.Parse(jsonDataDic[item].ToString()).ToString("yyyy-MM-dd");
}
if (datefirst.DateType == "DateTime")
{
JsonData[item] = DateTime.Parse(JsonData[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
jsonDataDic[item] = DateTime.Parse(jsonDataDic[item].ToString()).ToString("yyyy-MM-dd HH:mm:ss");
}
}
catch (Exception)
@ -263,7 +263,7 @@ namespace IRaCIS.Core.Application.Service
}
return JsonConvert.SerializeObject(JsonData);
return JsonConvert.SerializeObject(jsonDataDic);
}
@ -276,9 +276,9 @@ namespace IRaCIS.Core.Application.Service
/// <param name="ForeignKeyText">要查询的外键值</param>
/// <param name="value">传入的纸</param>
/// <returns></returns>
private async Task<string> GetInspectionEnumValue(List<string> identification, string json)
private async Task<string> GetInspectionEnumValue(List<string> identificationList, string jsonStr)
{
var list = await (from u in _frontAuditConfigRepository.Where(x => identification.Contains(x.Identification))
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
join p in _frontAuditConfigRepository.Where(x => x.EnumType == "Foreign" && x.IsEnable) on u.Id equals p.ParentId
select new
{
@ -296,19 +296,19 @@ namespace IRaCIS.Core.Application.Service
}).ToList();
var JsonDataValue = JsonConvert.DeserializeObject<IDictionary<string, object>>(json);
var jsonDataValueDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
foreach (var item in list)
{
if (!JsonDataValue.ContainsKey(item.Key))
if (!jsonDataValueDic.ContainsKey(item.Key))
{
continue;
}
string Table = item.ForeignKeyTable;
string ForeignKeyValue = item.ForeignKeyValue;
string ForeignKeyText = item.ForeignKeyText;
if (JsonDataValue[item.Key] != null)
if (jsonDataValueDic[item.Key] != null)
{
string value = JsonDataValue[item.Key].ToString();
string value = jsonDataValueDic[item.Key].ToString();
string para = string.Empty;
string sql = string.Empty;
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(JsonConvert.SerializeObject(new { item = value }));
@ -328,10 +328,10 @@ namespace IRaCIS.Core.Application.Service
SqlParameter[] paravalue = new SqlParameter[] {
new SqlParameter("@para",para)
};
JsonDataValue[item.Key] = string.Join(",", _frontAuditConfigRepository._dbContext.Database.SqlQuery<ForeignKey>(sql, paravalue).Select(x => x.Text).ToList());
jsonDataValueDic[item.Key] = string.Join(",", _frontAuditConfigRepository._dbContext.Database.SqlQuery<ForeignKey>(sql, paravalue).Select(x => x.Text).ToList());
}
}
return JsonConvert.SerializeObject(JsonDataValue);
return JsonConvert.SerializeObject(jsonDataValueDic);
}
@ -342,13 +342,13 @@ namespace IRaCIS.Core.Application.Service
/// <param name="identifications">标识</param>
/// <param name="jsonStr">Json对象</param>
/// <returns></returns>
private async Task<string> SetEnum(Guid trialId, List<string> identifications, string jsonStr)
private async Task<string> SetEnum(Guid trialId, List<string> identificationList, string jsonStr)
{
if (jsonStr == null || jsonStr == "null")
{
return null;
}
var list = await (from u in _frontAuditConfigRepository.Where(x => identifications.Contains(x.Identification))
var list = await (from u in _frontAuditConfigRepository.Where(x => identificationList.Contains(x.Identification))
join p in _frontAuditConfigRepository.Where(x => x.Code != "AuditState" && x.EnumType == "Dictionary" && x.IsEnable) on u.Id equals p.ParentId
select new
{
@ -376,17 +376,17 @@ namespace IRaCIS.Core.Application.Service
Type = lst.Max(x => x.Type),
}).ToList();
var JsonData = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
var jsonDataDic = JsonConvert.DeserializeObject<IDictionary<string, object>>(jsonStr);
foreach (var item in list)
{
try
{
if (!JsonData.ContainsKey(item.Key) || JsonData[item.Key] == null)
if (!jsonDataDic.ContainsKey(item.Key) || jsonDataDic[item.Key] == null)
{
continue;
}
var value = JsonData[item.Key];
var value = jsonDataDic[item.Key];
if (value.GetType() == typeof(JArray))
{
JArray arrays = (JArray)value;
@ -397,7 +397,7 @@ namespace IRaCIS.Core.Application.Service
{
guids.Add(Guid.Parse(x.ToString()));
});
JsonData[item.Key] = string.Join(',', await _dictionaryRepository.Where(x => guids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync());
jsonDataDic[item.Key] = string.Join(',', await _dictionaryRepository.Where(x => guids.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync());
}
else if (item.Type.ToLower() == "ChildGroup".ToLower())
{
@ -406,7 +406,7 @@ namespace IRaCIS.Core.Application.Service
{
guids.Add(x.ToString());
});
JsonData[item.Key] = string.Join(',', await
jsonDataDic[item.Key] = string.Join(',', await
_dictionaryRepository.Where(x => x.Code == item.Code).GroupJoin(
_dictionaryRepository.Where(x => guids.Contains(x.ChildGroup)), a => a.Id, b => b.ParentId, (a, b) => new
{
@ -424,7 +424,7 @@ namespace IRaCIS.Core.Application.Service
{
guids.Add(x.ToString());
});
JsonData[item.Key] = string.Join(',', await
jsonDataDic[item.Key] = string.Join(',', await
_dictionaryRepository.Where(x => x.Code == item.Code).GroupJoin(
_dictionaryRepository.Where(x => guids.Contains(x.Code)), a => a.Id, b => b.ParentId, (a, b) => new
{
@ -441,18 +441,18 @@ namespace IRaCIS.Core.Application.Service
if (item.Type.ToLower() == "id".ToLower())
{
Guid guid = Guid.Parse(value.ToString());
JsonData[item.Key] = await _dictionaryRepository.Where(x => guid == x.Id).Select(x => x.ValueCN).FirstOrDefaultAsync();
jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => guid == x.Id).Select(x => x.ValueCN).FirstOrDefaultAsync();
}
else if (item.Type.ToLower() == "ChildGroup".ToLower())
{
JsonData[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.ChildGroup == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.ChildGroup == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
{
value = b.ValueCN
}).Select(x => x.value).FirstOrDefaultAsync();
}
else
{
JsonData[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.Code == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
jsonDataDic[item.Key] = await _dictionaryRepository.Where(x => x.Code == item.Code).Join(_dictionaryRepository.Where(x => x.Code == value.ToString()), a => a.Id, b => b.ParentId, (a, b) => new
{
value = b.ValueCN
}).Select(x => x.value).FirstOrDefaultAsync();
@ -463,7 +463,7 @@ namespace IRaCIS.Core.Application.Service
{
}
}
return JsonConvert.SerializeObject(JsonData);
return JsonConvert.SerializeObject(jsonDataDic);
}
@ -537,12 +537,12 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取子数据
/// </summary>
/// <param name="item"></param>
/// <param name="frontAuditConfigId"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<FrontAuditConfig>> GetChildrenItem(GetChildrenItem item)
[HttpGet]
public async Task<List<FrontAuditConfig>> GetAuditConfigChildList(Guid frontAuditConfigId)
{
var list =await (from data in _repository.GetQueryable<FrontAuditConfig>().Where(x => x.Id == item.Id)
var list =await (from data in _repository.GetQueryable<FrontAuditConfig>().Where(x => x.Id == frontAuditConfigId)
join childrenType in _repository.GetQueryable<FrontAuditConfig>() on data.Id equals childrenType.ParentId
select childrenType).OrderBy(x=>x.Sort).ToListAsync();
return list;
@ -556,12 +556,12 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<IResponseOutput> FullyReplicated(FullyReplicated fully)
{
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ThisItemGuid);
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.DataFromItemGuid).ToListAsync();
await _frontAuditConfigRepository.DeleteFromQueryAsync(x => x.ParentId == fully.ToItemId);
var list = await _frontAuditConfigRepository.Where(x => x.ParentId == fully.FromItemId).ToListAsync();
list.ForEach(x =>
{
x.Id = NewId.NextGuid();
x.ParentId = fully.ThisItemGuid;
x.ParentId = fully.ToItemId;
});
await _frontAuditConfigRepository.AddRangeAsync(list);
await _frontAuditConfigRepository.SaveChangesAsync();
@ -662,12 +662,12 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 获取Description
/// </summary>
/// <param name="dto"></param>
/// <param name="moduleTypeId"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<string>> GetDescriptionByModuleType(GetDescriptionByModuleTypeDto dto)
[HttpGet]
public async Task<List<string>> GetModuleTypeDescriptionList(Guid moduleTypeId)
{
var result= await _frontAuditConfigRepository.Where(x=>x.ModuleTypeId== dto.ModuleType&&x.Description!=null &&x.Description!=string.Empty).Select(x=>x.Description).Distinct().ToListAsync();
var result= await _frontAuditConfigRepository.Where(x=>x.ModuleTypeId== moduleTypeId && x.Description!=string.Empty).Select(x=>x.Description).Distinct().ToListAsync();
return result;
}
@ -756,11 +756,11 @@ namespace IRaCIS.Core.Application.Service
/// <summary>
/// 修改排序
/// </summary>
/// <param name="sortDto"></param>
/// <param name="sortDataList"></param>
/// <returns></returns>
public async Task<IResponseOutput> ChangeFrontAuditSort(ChangeFrontAuditSortDto sortDto)
public async Task<IResponseOutput> ChangeFrontAuditSort(List<FrontAuditSort> sortDataList)
{
foreach (var item in sortDto.SortData)
foreach (var item in sortDataList)
{
await _frontAuditConfigRepository.BatchUpdateNoTrackingAsync(x => x.Id == item.Id, x => new FrontAuditConfig
{
@ -778,29 +778,18 @@ namespace IRaCIS.Core.Application.Service
/// <returns></returns>
public async Task<IResponseOutput> AddOrUpdateFrontAuditConfig(FrontAuditConfigAddOrEdit addOrEditFrontAuditConfig)
{
// 在此处拷贝automapper 映射
//CreateMap<FrontAuditConfig, FrontAuditConfigView>();
// CreateMap< FrontAuditConfig,FrontAuditConfigAddOrEdit>().ReverseMap();
if (await _frontAuditConfigRepository.AnyAsync(x =>x.Identification!=string.Empty&& x.Identification == addOrEditFrontAuditConfig.Identification && x.Id != addOrEditFrontAuditConfig.Id&&x.ConfigType=="M"&& addOrEditFrontAuditConfig.ConfigType== "M"))
{
return ResponseOutput.NotOk("标识重复");
}
if (await _frontAuditConfigRepository.AnyAsync(x => x.Description == addOrEditFrontAuditConfig.Description && x.Id != addOrEditFrontAuditConfig.Id && x.ConfigType == "M" && addOrEditFrontAuditConfig.ConfigType == "M"))
{
return ResponseOutput.NotOk("名称重复");
}
addOrEditFrontAuditConfig.CreateTime= DateTime.Now;
addOrEditFrontAuditConfig.UpdateTime= DateTime.Now;
addOrEditFrontAuditConfig.CreateUserId = _userInfo.Id;
addOrEditFrontAuditConfig.UpdateUserId= _userInfo.Id;
var entity = await _repository.InsertOrUpdateAsync<FrontAuditConfig, FrontAuditConfigAddOrEdit>(addOrEditFrontAuditConfig, true);
var entity = await _frontAuditConfigRepository.InsertOrUpdateAsync(addOrEditFrontAuditConfig, true);
return ResponseOutput.Ok(entity.Id.ToString());

View File

@ -85,6 +85,46 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
}
/// <summary>
/// 需要赋值的GeneralId
/// </summary>
private List<Type> NeedSetGeneralIdList
{
get
{
return new List<Type>()
{
typeof(SystemDocument),
typeof(SystemBasicData),
typeof(Trial),
typeof(VisitStage),
typeof(TrialDocument),
typeof(SystemDocConfirmedUser),
typeof(TrialDocUserTypeConfirmedUser),
typeof(Enroll),
typeof(EnrollDetail),
typeof(TrialSite),
typeof(TrialUser),
typeof(TrialSiteUser),
typeof(TrialSiteSurvey),
typeof(TrialQCQuestion),
typeof(DicomStudy),
typeof(DicomSeries),
typeof(NoneDicomStudy),
typeof(CheckChallengeDialog),
typeof(PreviousSurgery),
typeof(PreviousHistory),
typeof(PreviousOther),
typeof(QCChallenge),
typeof(QCChallengeDialog),
typeof(QCQuestion),
typeof(ConsistencyCheckFile),
typeof(DataInspection),
};
}
}
/// <summary>
/// 插入Add的实体
/// </summary>
@ -105,21 +145,21 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
var userTypeIds = userTypes.Select(x => x.NeedConfirmUserTypeId).ToList();
var usertypeNames = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
var usertypeName = string.Join(",", usertypeNames);
await InsertInspection<SystemDocument>(item.Entity, type, x => new DataInspection()
var userTypeNameList = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
var userTypeName = string.Join(",", userTypeNameList);
await InsertInspection<SystemDocument>(entity, type, x => new DataInspection()
{
GeneralId = x.Id
}, new
{
NeedConfirmedUserType = usertypeName,
NeedConfirmedUserType = userTypeName,
});
}
// 签名模板
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemBasicData)))
{
await InsertInspection<SystemBasicData>(item.Entity, type, x => new DataInspection()
await InsertInspection<SystemBasicData>(item.Entity as SystemBasicData, type, x => new DataInspection()
{
GeneralId = x.Id,
});
@ -145,7 +185,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
trials = await this._dbContext.Dictionary.Where(x => dictionaryIds.Contains(x.Id)).Select(x => x.ValueCN).ToListAsync();
await InsertInspection<Trial>(item.Entity, type, x => new DataInspection()
await InsertInspection<Trial>(item.Entity as Trial, type, x => new DataInspection()
{
TrialId = x.Id,
@ -169,7 +209,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
VisitPlanStatus = false;
}
await InsertInspection<VisitStage>(item.Entity, type, x => new DataInspection()
await InsertInspection<VisitStage>(item.Entity as VisitStage, type, x => new DataInspection()
{
VisitStageId = x.Id,
GeneralId = x.Id,
@ -193,7 +233,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var userTypeIds = userTypes.Select(x => x.NeedConfirmUserTypeId).ToList();
var usertypeNames = await _dbContext.UserType.Where(x => userTypeIds.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
var usertypeName = string.Join(",", usertypeNames);
await InsertInspection<TrialDocument>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialDocument>(entity, type, x => new DataInspection()
{
GeneralId = x.Id
}, new
@ -209,7 +249,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
var entity = item.Entity as SystemDocConfirmedUser;
var systemDocument = await _dbContext.SystemDocument.Where(x => x.Id == entity.SystemDocumentId).FirstOrDefaultAsync();
await InsertInspection<SystemDocConfirmedUser>(item.Entity, type, x => new DataInspection()
await InsertInspection<SystemDocConfirmedUser>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
}, new
@ -229,7 +269,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var trialDocument = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
var trialid = trialDocument.TrialId;
await InsertInspection<TrialDocUserTypeConfirmedUser>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialDocUserTypeConfirmedUser>(entity as TrialDocUserTypeConfirmedUser, type, x => new DataInspection()
{
TrialId = trialid,
GeneralId = x.Id,
@ -245,7 +285,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 医生
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(Enroll)))
{
await InsertInspection<Enroll>(item.Entity, type, x => new DataInspection()
await InsertInspection<Enroll>(item.Entity as Enroll, type, x => new DataInspection()
{
GeneralId = x.Id,
});
@ -254,7 +294,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 医生详情
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(EnrollDetail)))
{
await InsertInspection<EnrollDetail>(item.Entity, type, x => new DataInspection()
await InsertInspection<EnrollDetail>(item.Entity as EnrollDetail, type, x => new DataInspection()
{
GeneralId = x.Id,
});
@ -268,7 +308,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync();
}
await InsertInspection<TrialSite>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialSite>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
@ -289,7 +329,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as TrialUser;
var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
await InsertInspection<TrialUser>(item.Entity, type, x => new DataInspection
await InsertInspection<TrialUser>(entity, type, x => new DataInspection
{
TrialId = x.TrialId,
}, new
@ -336,7 +376,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
UserType userType = new UserType();
userType = await _dbContext.UserType.Where(x => x.Id == user.UserTypeId).FirstOrDefaultAsync();
await InsertInspection<TrialSiteUser>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialSiteUser>(item.Entity as TrialSiteUser, type, x => new DataInspection()
{
GeneralId = x.Id,
}, new
@ -376,7 +416,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entity.ReviewerUser = await _dbContext.User.Where(x => x.Id == entity.ReviewerUserId).FirstOrDefaultAsync();
}
await InsertInspection<TrialSiteSurvey>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialSiteSurvey>(item.Entity as TrialSiteSurvey, type, x => new DataInspection()
{
GeneralId = x.Id,
@ -398,7 +438,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
var entity = item.Entity as TrialQCQuestion;
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
await InsertInspection<TrialQCQuestion>(item.Entity, type, x => new DataInspection()
await InsertInspection<TrialQCQuestion>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
}, new
@ -421,7 +461,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as Subject;
var FinalSubjectVisitName = await _dbContext.SubjectVisit.AsNoTracking().Where(x => x.Id == entity.FinalSubjectVisitId && entity.FinalSubjectVisitId != null).Select(x => x.VisitName).FirstOrDefaultAsync();
await InsertInspection<Subject>(item.Entity, type, x => new DataInspection()
await InsertInspection<Subject>(entity, type, x => new DataInspection()
{
SubjectId = x.Id,
SubjectCode = x.Code,
@ -434,7 +474,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 检查
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
{
await InsertInspection<DicomStudy>(item.Entity, type, x => new DataInspection()
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new DataInspection()
{
GeneralId = x.Id,
});
@ -449,7 +489,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
dicomStudy = await _dbContext.DicomStudys.AsNoTracking().FirstOrDefaultAsync(x => x.Id == entity.StudyId);
}
await InsertInspection<DicomSeries>(item.Entity, type, x => new DataInspection()
await InsertInspection<DicomSeries>(item.Entity as DicomSeries, type, x => new DataInspection()
{
GeneralId = x.Id,
}, new
@ -467,7 +507,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var filecount = await _dbContext.NoneDicomStudyFile.Where(x => x.NoneDicomStudyId == entity.Id).CountAsync();
await InsertInspection<NoneDicomStudy>(item.Entity, type, x => new DataInspection()
await InsertInspection<NoneDicomStudy>(item.Entity as NoneDicomStudy, type, x => new DataInspection()
{
GeneralId = x.Id,
}, new
@ -521,7 +561,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
reason = entity.TalkContent.Substring(entity.TalkContent.LastIndexOf(':') + 1);
break;
}
await InsertInspection<CheckChallengeDialog>(item.Entity, type, x => new DataInspection()
await InsertInspection<CheckChallengeDialog>(entity, type, x => new DataInspection()
{
GeneralId = entity.SubjectVisitId,
TrialId = subjectvisit.TrialId,
@ -553,7 +593,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var subjectCode = entity.Subject?.Code;
await InsertInspection<SubjectVisit>(item.Entity, type, x => new DataInspection()
await InsertInspection<SubjectVisit>(item.Entity as SubjectVisit, type, x => new DataInspection()
{
SubjectCode = subjectCode,
SubjectId = x.SubjectId,
@ -570,7 +610,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousSurgery;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousSurgery>(item.Entity, type, x => new DataInspection()
await InsertInspection<PreviousSurgery>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -590,7 +630,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousHistory;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousHistory>(item.Entity, type, x => new DataInspection()
await InsertInspection<PreviousHistory>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -609,7 +649,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var entity = item.Entity as PreviousOther;
var subjectvisit = await _dbContext.SubjectVisit.Where(x => x.Id == entity.SubjectVisitId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
await InsertInspection<PreviousOther>(item.Entity, type, x => new DataInspection()
await InsertInspection<PreviousOther>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
SiteId = subjectvisit.SiteId,
@ -634,7 +674,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
{
content = entity.Content;
}
await InsertInspection<QCChallenge>(item.Entity, type, x => new DataInspection()
await InsertInspection<QCChallenge>(entity, type, x => new DataInspection()
{
GeneralId = x.Id,
TrialId = x.TrialId,
@ -668,7 +708,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
var qCChallenge = await _dbContext.QCChallenge.Where(x => x.Id == entity.QCChallengeId).FirstOrDefaultAsync();
subjectvisit = subjectvisit ?? new SubjectVisit();
qCChallenge = qCChallenge ?? new QCChallenge();
await InsertInspection<QCChallengeDialog>(item.Entity, type, x => new DataInspection()
await InsertInspection<QCChallengeDialog>(entity, type, x => new DataInspection()
{
GeneralId = qCChallenge.Id,
TrialId = subjectvisit.TrialId,
@ -694,7 +734,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
//Qc 问题
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(QCQuestion)))
{
await InsertInspection<QCQuestion>(item.Entity, type, x => new DataInspection()
await InsertInspection<QCQuestion>(item.Entity as QCQuestion, type, x => new DataInspection()
{
GeneralId = x.Id,
});
@ -705,7 +745,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 一致性核查文件
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(ConsistencyCheckFile)))
{
await InsertInspection<ConsistencyCheckFile>(item.Entity, type, x => new DataInspection()
await InsertInspection<ConsistencyCheckFile>(item.Entity as ConsistencyCheckFile, type, x => new DataInspection()
{
GeneralId = x.Id,
CreateTime=x.CreateTime,
@ -805,7 +845,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <param name="expression">表达式</param>
/// <param name="otherItem">其他对象</param>
/// <returns></returns>
public async Task InsertInspection<T>(object data, string type, Expression<Func<T, DataInspection>> expression = null, object otherItem = null,object originaldata=null) where T : class
public async Task InsertInspection<T>(T data, string type, Expression<Func<T, DataInspection>> expression = null, object otherItem = null,object originaldata=null) where T : class
{
object entityobj = data;
DataInspection inspection = new DataInspection();