From 1e3d54ba5e5eac3f50329b5b04d13c47c62f2995 Mon Sep 17 00:00:00 2001 From: chenwenkai <1084072318@qq.com> Date: Tue, 5 Nov 2024 10:26:07 +0800 Subject: [PATCH] =?UTF-8?q?PDA=E8=B4=A8=E6=A3=80=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D=E6=98=BE=E7=A4=BAbug?= =?UTF-8?q?=EF=BC=9B=E8=BD=BD=E5=85=B7=E8=A7=84=E6=A0=BC=E4=B8=BA=E5=A4=96?= =?UTF-8?q?=E5=8D=8F=E6=96=99=E6=9E=B6-=E9=80=80=E8=87=B3=E4=BA=8C?= =?UTF-8?q?=E6=A5=BC=E6=9A=82=E5=AD=98=E4=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs | 130 +++++++++++++----- .../Consts/WmsWareHouseConst.cs | 9 ++ .../WmsMaterialTransferService.cs | 2 +- 3 files changed, 109 insertions(+), 32 deletions(-) diff --git a/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs b/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs index ba17f358..0ce235d2 100644 --- a/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs +++ b/QcMgr/Tnb.QcMgr/QcCheckTaskResultService.cs @@ -115,37 +115,105 @@ namespace Tnb.QcMgr Expression> expression = list.Where(p => p.FullName == "待执行").First().Id == status ? (a => DateTime.Parse(a.tasktime!)) : (a => DateTime.Parse(a.exectime!)); - SqlSugarPagedList result = await db.Queryable() - .LeftJoin((a, b) => a.materialid == b.id) - .LeftJoin((a, b, c) => a.processid == c.id) - .LeftJoin((a, b, c, d) => a.workid == d.Id) - .LeftJoin((a, b, c, d, e) => a.execuser == e.Id) - .LeftJoin((a,b,c,d,e,f)=>a.mo_task_code==f.mo_task_code) - .LeftJoin((a,b,c,d,e,f,g)=>f.eqp_id==g.id) - .LeftJoin((a,b,c,d,e,f,g,h)=>d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode) - .LeftJoin((a,b,c,d,e,f,g,h,i)=>h.Id==i.OrganizeId) - .WhereIF(_userManager.LoginType=="app" && !_userManager.IsAdministrator,(a,b,c,d,e,f,g,h,i)=>i.EnCode==positionCode) - .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) - .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) - .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) - // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) - .Select((a, b, c, d, e,f,g) => new QcCheckExecHOut - { - id = a.id, - bill_code = a.bill_code, - materialid = b.name, - checktype = a.checktype, - workid = d.FullName, - processid = c.process_name, - wareid = a.wareid, - checknum = a.checknum, - status = a.status, - result = a.result, - tasktime = a.tasktime ?? "", - exectime = a.exectime ?? "", - execuser = e.RealName ?? "", - equip_name = g.name, - }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); + + var result = new SqlSugarPagedList(); + if (_userManager.IsAdministrator) + { + result = await db.Queryable() + .LeftJoin((a, b) => a.materialid == b.id) + .LeftJoin((a, b, c) => a.processid == c.id) + .LeftJoin((a, b, c, d) => a.workid == d.Id) + .LeftJoin((a, b, c, d, e) => a.execuser == e.Id) + .LeftJoin((a, b, c, d, e, f) => a.mo_task_code == f.mo_task_code) + .LeftJoin((a, b, c, d, e, f, g) => f.eqp_id == g.id) + .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) + .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) + .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) + // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) + .Select((a, b, c, d, e, f, g) => new QcCheckExecHOut + { + id = a.id, + bill_code = a.bill_code, + materialid = b.name, + checktype = a.checktype, + workid = d.FullName, + processid = c.process_name, + wareid = a.wareid, + checknum = a.checknum, + status = a.status, + result = a.result, + tasktime = a.tasktime ?? "", + exectime = a.exectime ?? "", + execuser = e.RealName ?? "", + equip_name = g.name, + }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); + } + else + { + result = await db.Queryable() + .LeftJoin((a, b) => a.materialid == b.id) + .LeftJoin((a, b, c) => a.processid == c.id) + .LeftJoin((a, b, c, d) => a.workid == d.Id) + .LeftJoin((a, b, c, d, e) => a.execuser == e.Id) + .LeftJoin((a, b, c, d, e, f) => a.mo_task_code == f.mo_task_code) + .LeftJoin((a, b, c, d, e, f, g) => f.eqp_id == g.id) + .LeftJoin((a, b, c, d, e, f, g, h) => d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode) + .LeftJoin((a, b, c, d, e, f, g, h, i) => h.Id == i.OrganizeId) + .WhereIF(_userManager.LoginType == "app" && !_userManager.IsAdministrator, (a, b, c, d, e, f, g, h, i) => i.EnCode == positionCode) + .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) + .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) + .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) + // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) + .Select((a, b, c, d, e, f, g) => new QcCheckExecHOut + { + id = a.id, + bill_code = a.bill_code, + materialid = b.name, + checktype = a.checktype, + workid = d.FullName, + processid = c.process_name, + wareid = a.wareid, + checknum = a.checknum, + status = a.status, + result = a.result, + tasktime = a.tasktime ?? "", + exectime = a.exectime ?? "", + execuser = e.RealName ?? "", + equip_name = g.name, + }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); + } + + //SqlSugarPagedList result = await db.Queryable() + // .LeftJoin((a, b) => a.materialid == b.id) + // .LeftJoin((a, b, c) => a.processid == c.id) + // .LeftJoin((a, b, c, d) => a.workid == d.Id) + // .LeftJoin((a, b, c, d, e) => a.execuser == e.Id) + // .LeftJoin((a,b,c,d,e,f)=>a.mo_task_code==f.mo_task_code) + // .LeftJoin((a,b,c,d,e,f,g)=>f.eqp_id==g.id) + // .LeftJoin((a,b,c,d,e,f,g,h)=>d.OrganizeIdTree.Contains(h.Id) && h.Category == DictConst.RegionCategoryWorkshopCode) + // .LeftJoin((a,b,c,d,e,f,g,h,i)=>h.Id==i.OrganizeId) + // .WhereIF(_userManager.LoginType=="app" && !_userManager.IsAdministrator,(a,b,c,d,e,f,g,h,i)=>i.EnCode==positionCode) + // .WhereIF(!string.IsNullOrEmpty(materialid), (a, b, c, d, e) => a.materialid == materialid) + // .WhereIF(!string.IsNullOrEmpty(checktype), (a, b, c, d, e) => a.checktype == checktype) + // .WhereIF(!string.IsNullOrEmpty(status), (a, b, c, d, e) => a.status == status) + // // .Where((a, b, c, d, e) => a.status == list.Where(p => p.FullName == "已完成").First().Id) + // .Select((a, b, c, d, e,f,g) => new QcCheckExecHOut + // { + // id = a.id, + // bill_code = a.bill_code, + // materialid = b.name, + // checktype = a.checktype, + // workid = d.FullName, + // processid = c.process_name, + // wareid = a.wareid, + // checknum = a.checknum, + // status = a.status, + // result = a.result, + // tasktime = a.tasktime ?? "", + // exectime = a.exectime ?? "", + // execuser = e.RealName ?? "", + // equip_name = g.name, + // }).OrderByDescending(expression).ToPagedListAsync(input.currentPage, input.pageSize); foreach (QcCheckExecHOut? item in result.list) { diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs index 38b18f76..4d83555c 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Consts/WmsWareHouseConst.cs @@ -421,6 +421,10 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// 预任务生成业务类型-盘点出库 /// public const string BIZTYPE_WMSCHECKOUTSTOCK_ID = "27718132310037"; + /// + /// 预任务生成业务类型-暂控料出库 + /// + public const string BIZTYPE_TEMPCONTROLOUTSTOCK_ID = "38027183728661"; /// /// 成品调拨入库 @@ -470,6 +474,11 @@ namespace Tnb.WarehouseMgr.Entities.Consts /// 载具规格-载运料架 /// public const string CARRY_ZYLJSTD_ID = "34995839046677"; + /// + /// 载具规格-外协料架 + /// + public const string CARRY_WXLJSTD_ID = "37896162328597"; + /// /// 打印状态-未打印 /// diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs index ca07ef6d..0542435f 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs @@ -2386,7 +2386,7 @@ namespace Tnb.WarehouseMgr } // 料架到暂存仓 - if (wmsCarryH.carrystd_id == "26037267399717") + if (wmsCarryH.carrystd_id == "26037267399717" || wmsCarryH.carrystd_id==WmsWareHouseConst.CARRY_WXLJSTD_ID) { return await RackInstock_到暂存仓(input, wmsCarryH); }