稽查修改
parent
5b1d676bb9
commit
8c03058f5b
|
@ -148,7 +148,7 @@ namespace IRaCIS.Core.Application.Service.Inspection
|
||||||
.WhereIf(dto.ObjectRelationParentId != null && dto.BatchId != null && dto.GeneralId != null,
|
.WhereIf(dto.ObjectRelationParentId != null && dto.BatchId != null && dto.GeneralId != null,
|
||||||
x =>
|
x =>
|
||||||
x.BatchId == dto.BatchId || //同一事务批次
|
x.BatchId == dto.BatchId || //同一事务批次
|
||||||
x.ObjectRelationParentId == dto.ObjectRelationParentId || //不同对象 但是同一层级 适用于子对象
|
//x.ObjectRelationParentId == dto.ObjectRelationParentId || //不同对象 但是同一层级 适用于子对象
|
||||||
|
|
||||||
|
|
||||||
( ( x.GeneralId == dto.ObjectRelationParentId || //子稽查 查询父记录
|
( ( x.GeneralId == dto.ObjectRelationParentId || //子稽查 查询父记录
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
//public Guid? VisitStageId { get; set; }
|
//public Guid? VisitStageId { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通用Id
|
/// 稽查的对象Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Guid? GeneralId { get; set; }
|
public Guid? GeneralId { get; set; }
|
||||||
|
|
||||||
|
@ -139,6 +139,9 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
public Guid BatchId { get; set; }
|
public Guid BatchId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 稽查对象,关联的父对象Id
|
||||||
|
/// </summary>
|
||||||
public Guid? ObjectRelationParentId { get; set; }
|
public Guid? ObjectRelationParentId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -580,6 +580,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
TrialId = subjectVisit.TrialId,
|
TrialId = subjectVisit.TrialId,
|
||||||
SubjectVisitId = subjectVisit.Id,
|
SubjectVisitId = subjectVisit.Id,
|
||||||
GeneralId = subjectVisit.Id,
|
GeneralId = subjectVisit.Id,
|
||||||
|
//byzhouhang
|
||||||
|
ObjectRelationParentId=subjectVisit.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
QcQuestionAnswerCommands = await Getdata(entitylist),
|
QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||||
|
@ -601,6 +603,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
TrialId = subjectVisit.TrialId,
|
TrialId = subjectVisit.TrialId,
|
||||||
SubjectVisitId = subjectVisit.Id,
|
SubjectVisitId = subjectVisit.Id,
|
||||||
GeneralId = subjectVisit.Id,
|
GeneralId = subjectVisit.Id,
|
||||||
|
//byzhouhang
|
||||||
|
ObjectRelationParentId = subjectVisit.Id,
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
QcQuestionAnswerCommands = await Getdata(entitylist),
|
QcQuestionAnswerCommands = await Getdata(entitylist),
|
||||||
|
@ -644,6 +648,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
await InsertInspection<CheckChallengeDialog>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<CheckChallengeDialog>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
GeneralId = entity.SubjectVisitId,
|
GeneralId = entity.SubjectVisitId,
|
||||||
|
//byzhouhang
|
||||||
|
ObjectRelationParentId = entity.SubjectVisitId,
|
||||||
TrialId = subjectvisit.TrialId,
|
TrialId = subjectvisit.TrialId,
|
||||||
SubjectVisitId = x.SubjectVisitId,
|
SubjectVisitId = x.SubjectVisitId,
|
||||||
SiteId = subjectvisit.SiteId,
|
SiteId = subjectvisit.SiteId,
|
||||||
|
@ -679,6 +685,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
await InsertInspection<QCChallengeDialog>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<QCChallengeDialog>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
GeneralId = qCChallenge.Id,
|
GeneralId = qCChallenge.Id,
|
||||||
|
//byzhouhang
|
||||||
|
ObjectRelationParentId = qCChallenge.Id,
|
||||||
|
|
||||||
TrialId = subjectvisit.TrialId,
|
TrialId = subjectvisit.TrialId,
|
||||||
SubjectVisitId = x.SubjectVisitId,
|
SubjectVisitId = x.SubjectVisitId,
|
||||||
SiteId = subjectvisit.SiteId,
|
SiteId = subjectvisit.SiteId,
|
||||||
|
@ -920,7 +929,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
#endregion
|
#endregion
|
||||||
if (inspection.ParentId == null)
|
if (inspection.ParentId == null)
|
||||||
{
|
{
|
||||||
inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == inspection.TrialId && x.SubjectVisitId == inspection.SubjectVisitId && x.SubjectId == inspection.SubjectId && x.SiteId == inspection.SiteId && x.GeneralId == inspection.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
//inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.TrialId == inspection.TrialId && x.SubjectVisitId == inspection.SubjectVisitId && x.SubjectId == inspection.SubjectId && x.SiteId == inspection.SiteId && x.GeneralId == inspection.GeneralId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||||
|
|
||||||
|
|
||||||
|
inspection.ParentId = (await _dbContext.DataInspection.AsQueryable().Where(x => x.GeneralId == inspection.GeneralId && x.ObjectRelationParentId==x.ObjectRelationParentId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id;
|
||||||
}
|
}
|
||||||
inspection.CreateUserId = _userInfo.Id;
|
inspection.CreateUserId = _userInfo.Id;
|
||||||
inspection.IP = _userInfo.IP;
|
inspection.IP = _userInfo.IP;
|
||||||
|
|
Loading…
Reference in New Issue