修改一版
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user