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); }