稽查修改

This commit is contained in:
2022-08-25 17:05:57 +08:00
parent cc60c4f9f0
commit fbabbfc807
5 changed files with 68 additions and 68 deletions
@@ -142,19 +142,26 @@ namespace IRaCIS.Core.Application.Service.Inspection
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
//.WhereIf(dto.RelationDeadlineTime != null, x => x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1))
.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime))
.WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId)
.WhereIf(dto.BatchId != null && dto.GeneralId != null && dto.ObjectRelationParentId == null, x => x.BatchId == dto.BatchId ||
((x.GeneralId == dto.GeneralId || x.ObjectRelationParentId == dto.GeneralId) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
.WhereIf(dto.ObjectRelationParentId != null && dto.BatchId != null && dto.GeneralId != null,
x =>
x.BatchId == dto.BatchId || //同一事务批次
//x.ObjectRelationParentId == dto.ObjectRelationParentId || //不同对象 但是同一层级 适用于子对象
#region
// .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId)
// .WhereIf(dto.BatchId != null && dto.GeneralId != null && dto.ObjectRelationParentId == null, x => x.BatchId == dto.BatchId ||
// ((x.GeneralId == dto.GeneralId || x.ObjectRelationParentId == dto.GeneralId) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
// .WhereIf(dto.ObjectRelationParentId != null && dto.BatchId != null && dto.GeneralId != null,
// x =>
// x.BatchId == dto.BatchId || //同一事务批次
// //x.ObjectRelationParentId == dto.ObjectRelationParentId || //不同对象 但是同一层级 适用于子对象
//((x.GeneralId == dto.ObjectRelationParentId || //子稽查 查询父记录
// x.GeneralId == dto.GeneralId || //同一对象
// x.ObjectRelationParentId == dto.GeneralId //父稽查 查询子记录
// ) && x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
#endregion
.WhereIf(dto.BatchId != null, x => x.BatchId == dto.BatchId)
.WhereIf(dto.BatchId == null && dto.GeneralId != null, x => x.GeneralId == dto.GeneralId)
( ( x.GeneralId == dto.ObjectRelationParentId || //子稽查 查询父记录
x.GeneralId == dto.GeneralId || //同一对象
x.ObjectRelationParentId == dto.GeneralId //父稽查 查询子记录
)&& x.CreateTime <= dto.RelationDeadlineTime.Value.AddSeconds(1)))
.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
//.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo)
//.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false)