From e29d74844ce420d7e785a623a9b435d02b1b625c Mon Sep 17 00:00:00 2001 From: zhoukeda <1315948824@qq.com> Date: Thu, 16 Nov 2023 09:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=8D=95=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tnb.ProductionMgr/PrdInstockService.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs index 1a21e971..9d5faede 100644 --- a/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs +++ b/ProductionMgr/Tnb.ProductionMgr/PrdInstockService.cs @@ -59,7 +59,7 @@ namespace Tnb.ProductionMgr { Dictionary? queryJson = !string.IsNullOrEmpty(input.queryJson) ? Newtonsoft.Json.JsonConvert.DeserializeObject>(input.queryJson) : new Dictionary(); string moCode = queryJson.ContainsKey("mo_task_code") ? queryJson["mo_task_code"].ToString() : ""; - List list = await _repository.AsSugarClient().Queryable() + var list = await _repository.AsSugarClient().Queryable() .LeftJoin((a, b) => a.material_id == b.id) .LeftJoin((a, b, c) => a.mold_id == c.id) .LeftJoin((a, b, c, d) => a.eqp_id == d.id) @@ -78,20 +78,20 @@ namespace Tnb.ProductionMgr estimated_start_date = a.estimated_start_date!.ToString(), estimated_end_date = a.estimated_end_date.ToString(), create_time = a.create_time.ToString() - }).ToListAsync(); - List treeList = list.ToTree(); - treeList = treeList.Skip((input.currentPage - 1) * input.pageSize).Take(input.pageSize).ToList(); - SqlSugarPagedList pagedList = new() - { - list = treeList, - pagination = new Pagination - { - CurrentPage = input.currentPage, - PageSize = input.pageSize, - Total = treeList.Count - } - }; - return PageResult.SqlSugarPageResult(pagedList); + }).ToPagedListAsync(input.currentPage, input.pageSize); + // List treeList = list.ToTree(); + // treeList = treeList.Skip((input.currentPage - 1) * input.pageSize).Take(input.pageSize).ToList(); + // SqlSugarPagedList pagedList = new() + // { + // list = treeList, + // pagination = new Pagination + // { + // CurrentPage = input.currentPage, + // PageSize = input.pageSize, + // Total = treeList.Count + // } + // }; + return PageResult.SqlSugarPageResult(list); } [HttpPost]