From 2577ebc090d25c57ac67c8a976f69079aa270b71 Mon Sep 17 00:00:00 2001 From: majian <780924089@qq.com> Date: Sat, 29 Jun 2024 15:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E6=96=99=E5=88=A4=E6=96=AD=E7=89=A9?= =?UTF-8?q?=E6=96=99=E7=A7=8D=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsMaterialTransferService.cs | 2 +- .../Tnb.WarehouseMgr/WmsPrdReturnService.cs | 29 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs index 8008fbd9..acbf33c1 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsMaterialTransferService.cs @@ -101,7 +101,7 @@ namespace Tnb.WarehouseMgr .InnerJoin((a, b, c) => c.Id == a.create_id) .InnerJoin((a, b, c, d) => d.id == a.warehouse_outstock) .InnerJoin((a, b, c, d, e) => e.id == a.warehouse_instock) - .InnerJoin((a, b, c, d, e, f) => a.type == f.EnCode) + .LeftJoin((a, b, c, d, e, f) => a.type == f.EnCode) // 只显示未完成的单据 .Where(a => a.status != "25065149810453") .WhereIF(queryJson != null, a => a.type == queryJson["type"].ToString()) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdReturnService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdReturnService.cs index b4f9b33f..515fb99a 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdReturnService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPrdReturnService.cs @@ -136,15 +136,14 @@ namespace Tnb.WarehouseMgr BasLocation endlocation = rackEndLocations.First(); - var memberCarryCodes = _db.Queryable() - .InnerJoin((a, b) => a.membercarry_id == b.id) - .InnerJoin((a, b, c) => b.id == c.carry_id) - .Where((a, b, c) => a.carry_id == wmsCarryH.id).Select((a, b, c) => new + var memberCarryCodes = _db.Queryable() + .InnerJoin((a, b) => a.id == b.carry_id) + .Where((a, b) => input.details.Select(r => r.carry_code).Contains(a.carry_code)).Select((a, b) => new { - carry_code = b.carry_code, - barcode = c.barcode, - material_id = c.material_id, - material_code = c.material_code, + carry_code = a.carry_code, + barcode = b.barcode, + material_id = b.material_id, + material_code = b.material_code, }).ToList(); List matIds = memberCarryCodes.Select(r => r.material_id).Distinct().ToList(); @@ -243,8 +242,8 @@ namespace Tnb.WarehouseMgr } if (string.IsNullOrEmpty(input.carry_code)) { - Logger.LogWarning($"【PrdReturn】料架不能为空!{input.carry_code}"); - throw new AppFriendlyException($"【PrdReturn】料架不能为空!{input.carry_code}!", 500); + Logger.LogWarning($"【PrdReturn】料架/载运小车不能为空!{input.carry_code}"); + throw new AppFriendlyException($"【PrdReturn】料架/载运小车不能为空!{input.carry_code}!", 500); } // 找到未占用且未锁定的库位 @@ -287,17 +286,17 @@ namespace Tnb.WarehouseMgr string msg = ""; foreach (var row in existsMat) { - msg += $",料箱{row.carry_code} 条码{row.barcode}"; + msg += $",料架/载运小车{row.carry_code} 条码{row.barcode}"; } - Logger.LogWarning($"【PrdReturn】存在装有与生产退料单明细不匹配物料的料箱,请检查! {msg.Trim(',')}"); - throw new AppFriendlyException($"【PrdReturn】存在装有与生产退料单明细不匹配物料的料箱,请检查!{msg.Trim(',')}", 500); + Logger.LogWarning($"【PrdReturn】存在装有与生产退料单明细不匹配物料的料架/载运小车,请检查! {msg.Trim(',')}"); + throw new AppFriendlyException($"【PrdReturn】存在装有与生产退料单明细不匹配物料的料架/载运小车,请检查!{msg.Trim(',')}", 500); } WmsPretaskH wmsPretaskH = _db.Queryable().Where(r => r.carry_code == wmsCarryH.carry_code && r.status != WmsWareHouseConst.PRETASK_BILL_STATUS_COMPLE_ID).First(); if (wmsPretaskH != null) { - Logger.LogWarning($"【CallRackToProductionLine】此料架{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}!"); - throw new AppFriendlyException($"此料架{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}!", 500); + Logger.LogWarning($"【CallRackToProductionLine】此料架/载运小车{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}!"); + throw new AppFriendlyException($"此料架/载运小车{wmsCarryH.carry_code}存在未完成的预任务{wmsPretaskH.bill_code}!", 500); } await _db.Ado.BeginTranAsync();