修改一版

This commit is contained in:
he
2022-06-06 17:32:40 +08:00
parent 198a8601be
commit 46b5846d0c
5 changed files with 67 additions and 97 deletions
@@ -25,17 +25,17 @@ namespace IRaCIS.Core.Application.Service.Inspection
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto)
public async Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto dto)
{
//_repository.GetQueryable.GetQueryable < DataInspection >
var trialfirst= await _repository.GetQueryable< Trial >().Where(x=>x.Id== dto.TrialId).AsNoTracking().FirstOrDefaultAsync();
var trialData= await _repository.GetQueryable<Trial>().Where(x=>x.Id== dto.TrialId).AsNoTracking().FirstOrDefaultAsync();
trialfirst.TrialFinishTime = trialfirst.TrialFinishTime == null ? DateTime.Now : trialfirst.TrialFinishTime;
trialData.TrialFinishTime = trialData.TrialFinishTime == null ? DateTime.Now : trialData.TrialFinishTime;
#region
var query = from data in _repository.GetQueryable<DataInspection>().Where(x => (x.TrialId == dto.TrialId)||(x.TrialId==null&&x.CreateTime> trialfirst.CreateTime&&x.CreateTime < trialfirst.TrialFinishTime))
var query = from data in _repository.GetQueryable<DataInspection>().Where(x => (x.TrialId == dto.TrialId)||(x.TrialId==null&&x.CreateTime> trialData.CreateTime&&x.CreateTime < trialData.TrialFinishTime))
join trial in _repository.GetQueryable<Trial>().IgnoreQueryFilters() on data.TrialId equals trial.Id into trialtemp
from leftrial in trialtemp.DefaultIfEmpty()
@@ -127,7 +127,6 @@ namespace IRaCIS.Core.Application.Service.Inspection
IsFrontAdd=data.IsFrontAdd,
BatchId=data.BatchId,
OptTypeName = leftOptType.Value,
};
query = query.WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId)
@@ -141,14 +140,12 @@ namespace IRaCIS.Core.Application.Service.Inspection
.WhereIf(!dto.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(dto.OpByUserName))
//.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo))
.WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign);
#endregion
dto.Asc = false;
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc);
return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize,"CreateTime", dto.Asc);
}
@@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface
public interface IInspectionService
{
Task<PageOutput<GetDataInspectionOutDto>> GetInspectionData(GetDataInspectionDto dto);
Task<PageOutput<GetDataInspectionOutDto>> GetInspectionList(GetDataInspectionDto dto);