提交 修改

This commit is contained in:
he
2022-04-13 17:51:30 +08:00
parent 2f3a67ba17
commit 88117a84f7
10 changed files with 52 additions and 24 deletions
@@ -95,7 +95,13 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
/// 访视计划ID
/// </summary>
public Guid? VisitStageId { get; set; }
/// <summary>
/// 通用ID
/// </summary>
public Guid? GeneralId { get; set; }
////需要单独处理
@@ -278,7 +278,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
await SetEnum(addDto);
var add = _mapper.Map<DataInspection>(addDto);
Guid? parentId = null;
parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
parentId = (await _repository.GetQueryable<DataInspection>().Where( x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId&&x.ChildrenType==add.ChildrenType && x.ObjectType==add.ObjectType&&x.VisitStageId==add.VisitStageId&&x.GeneralId==add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.ParentId = parentId;
add.CreateTime = DateTime.Now;
add.CreateUserId = _userInfo.Id;
@@ -319,7 +319,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
foreach (var add in datas)
{
add.ParentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType&&x.VisitStageId==add.VisitStageId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.ParentId = (await _repository.GetQueryable<DataInspection>().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == add.SiteId && x.ChildrenType == add.ChildrenType && x.ObjectType == add.ObjectType&&x.VisitStageId==add.VisitStageId&& x.GeneralId == add.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
add.CreateUserId = _userInfo.Id;
add.IP = _userInfo.IP;
await SetInspectionNameValue(add);