From 7aec24710d4b9581d7d9cd5479bab09835edb396 Mon Sep 17 00:00:00 2001 From: hlb <894797954@qq.com> Date: Tue, 20 Jun 2023 14:27:52 +0800 Subject: [PATCH] 1 --- .../WmsEmptyOutstockService .cs | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs index fc1ee934..428a03a2 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsEmptyOutstockService .cs @@ -88,12 +88,12 @@ namespace Tnb.WarehouseMgr ePoint = await _db.Queryable().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString()); } int i = 0; - - + + //根据每个载具的起始库位做路径运算 for (i = 0; i < setQty.qty; i++) { - + if (carrys?.Count > 0) sPoint = await _db.Queryable().FirstAsync(it => it.location_id == carrys[i].location_id); var isOk = false; @@ -133,12 +133,12 @@ namespace Tnb.WarehouseMgr }).ToList(); //更新页面 //赋值签收状态 - if (loc.is_sign == 0) + if (loc.is_sign == 0) { preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值 } isOk = await _wareHouseService.GenPreTask(preTasks, null); - + } if (isOk) { @@ -150,7 +150,7 @@ namespace Tnb.WarehouseMgr preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); //更新明细表 - WmsEmptyOutstockD wmsEmptyOutstockD = new (); + WmsEmptyOutstockD wmsEmptyOutstockD = new(); wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId(); wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId; wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; @@ -166,11 +166,11 @@ namespace Tnb.WarehouseMgr //根据空载具出库Id,回更单据状态 await _db.Updateable().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, - it => new WmsCarryH { is_lock = 1}, + it => new WmsCarryH { is_lock = 1 }, it => new BasLocation { is_lock = 1 }); } } - + } await _db.Ado.CommitTranAsync(); @@ -191,9 +191,10 @@ namespace Tnb.WarehouseMgr var emptyCarrys = await _db.Queryable().Where(it => it.bill_id == input.requireId).ToListAsync(); // 判断所有明细是否都完成 - if (emptyCarrys.All(x=> x.status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID)) { - await _db.Updateable().SetColumns(it=> new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync(); - } + if (emptyCarrys?.Count > 0 && emptyCarrys.All(x => x.status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID)) + { + await _db.Updateable().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync(); + } if (!isOk) throw Oops.Oh(ErrorCode.COM1001); } }