From 261ae65addfcb0551ec2e21cde61431794dd3a62 Mon Sep 17 00:00:00 2001 From: "747575620@qq.com" <747575620@qq.com> Date: Thu, 18 Apr 2024 16:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BPA.MES.Base.Application.xml | 15 +++++++++++++++ .../WorkInfoService/Dtos/WorkBatchDto.cs | 16 +++++++++++++++- .../WorkInfoService/Services/WorkBatchService.cs | 3 +++ frontend/src/pages/workInfo/index.tsx | 6 +++--- frontend/src/types/WorkInfo.d.ts | 2 ++ 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml index fffd724..2555923 100644 --- a/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml +++ b/backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml @@ -7415,6 +7415,21 @@ 分页 + + + 创建时间 + + + + + 起始时间 + + + + + 结束时间 + + 输出 diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs index 6d35b08..cefe65a 100644 --- a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkBatchDto.cs @@ -62,7 +62,21 @@ /// public class WorkBatchQueryPageInput : RequestPage { - + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } + + public string Id { get; set; } + + /// + /// 起始时间 + /// + public DateTime? StartTime { get; set; } + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } } /// /// 输出 diff --git a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs index ed4927e..17065e4 100644 --- a/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs +++ b/backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkBatchService.cs @@ -51,6 +51,9 @@ public async Task> PagedList(WorkBatchQueryPageInput input) { var entity = await _dbContext.Queryable() + .WhereIF(!string.IsNullOrEmpty(input.Id),x=>x.Id.Contains(input.Id)) + .WhereIF(input.StartTime != null, x => input.StartTime <= Convert.ToDateTime(x.CreateTime)) + .WhereIF(input.EndTime != null, x => input.EndTime.Value.AddHours(23).AddMinutes(59).AddSeconds(59) >= Convert.ToDateTime(x.CreateTime)) .OrderByDescending(x => x.CreateTime) .Select((x)=>new WorkBatchOutput { diff --git a/frontend/src/pages/workInfo/index.tsx b/frontend/src/pages/workInfo/index.tsx index 1da311b..6454861 100644 --- a/frontend/src/pages/workInfo/index.tsx +++ b/frontend/src/pages/workInfo/index.tsx @@ -700,9 +700,9 @@ const OnBatchSubmit= async (values:any)=>{ const jsonData: WorkInfoTypes.Page = { pageIndex: params.current || 1, pageSize: params.pageSize || 10, - name: params.name || '', - code: params.code, - batchId: '' + id: params.id, + endTime: params.createTime ? dayjs(params.createTime[1]) : null, + startTime: params.createTime ? dayjs(params.createTime[0]) : null }; const response = await WorkInfoAPI.WorkBatchPagedList(jsonData); if (response.statusCode === 200) { diff --git a/frontend/src/types/WorkInfo.d.ts b/frontend/src/types/WorkInfo.d.ts index f818ef1..1f1ce4b 100644 --- a/frontend/src/types/WorkInfo.d.ts +++ b/frontend/src/types/WorkInfo.d.ts @@ -25,6 +25,8 @@ name:string, code:string, batchId:string, + endTime:any, + startTime:any } type BatchAdd = Info interface WorkMaterialsRecordQueryPageInput {