diff --git a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs index 256ce972..23db5be9 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/BaseWareHouseService.cs @@ -36,12 +36,14 @@ namespace Tnb.WarehouseMgr } } + + protected async Task DoUpdate(WareHouseUpInput input) { if (_serviceMap.ContainsKey(input.bizTypeId)) { await _serviceMap[input.bizTypeId].ModifyAsync(input); - } + } } public virtual Task ModifyAsync(WareHouseUpInput input) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 2d93878e..06fa790d 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -228,26 +228,30 @@ namespace Tnb.WarehouseMgr //任务链属性处理内部函数 async Task _taskChainAttrHandle(List items, List areaPreTasks, int moveNum) { - if (moveNum == 1 || (moveNum > areaPreTasks.Count && areaPreTasks.Count == 1)) - { - items.ForEach(x => - { - x.is_chain = 0; + await Task.Run(() => + { + if (moveNum == 1 || (moveNum > areaPreTasks.Count && areaPreTasks.Count == 1)) + { + items.ForEach(x => + { + x.is_chain = 0; + + x.chain_type = "0"; + }); + } + else if ((moveNum > areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum < areaPreTasks.Count) + { + items.ForEach(x => x.is_chain = 1); + items[0].chain_type = "1"; + for (int i = 0; i < items.Count; i++) + { + if (i == 0 || i == items.Count - 1) continue; + items[i].chain_type = "2"; + } + items[items.Count - 1].chain_type = "3"; + } + }); - x.chain_type = "0"; - }); - } - else if ((moveNum > areaPreTasks.Count && areaPreTasks.Count > 1) || moveNum < areaPreTasks.Count) - { - items.ForEach(x => x.is_chain = 1); - items[0].chain_type = "1"; - for (int i = 0; i < items.Count; i++) - { - if (i == 0 || i == items.Count - 1) continue; - items[i].chain_type = "2"; - } - items[items.Count - 1].chain_type = "3"; - } } //获取所有未下发的预任务申请 @@ -485,16 +489,16 @@ namespace Tnb.WarehouseMgr await _db.Insertable(input.PreTaskHandleCodes).ExecuteCommandAsync(); } //根据载具ID,更新是否锁定和赋值起始库位 - if (!input.IsCheck.HasValue) - { - await _db.Updateable().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); - } - else - { - await _db.Updateable().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); - } - //根据所有库位更新库位的锁定状态为“锁定” - await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync(); + //if (!input.IsCheck.HasValue) + //{ + // await _db.Updateable().SetColumns(it => new WmsCarryH { is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); + //} + //else + //{ + // await _db.Updateable().SetColumns(it => new WmsCarryH { is_check = input.IsCheck.Value, is_lock = 1, location_id = input.CarryStartLocationId, location_code = input.CarryStartLocationCode }).Where(it => it.id == input.CarryId).ExecuteCommandAsync(); + //} + ////根据所有库位更新库位的锁定状态为“锁定” + //await _db.Updateable().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => input.LocationIds.Contains(it.id)).ExecuteCommandAsync(); await _db.Ado.CommitTranAsync(); } catch (Exception) diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs index 7e801433..8d94d272 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WmsPDAInStockService.cs @@ -151,7 +151,7 @@ namespace Tnb.WarehouseMgr var materialId = jo.Value(nameof(WmsHandleCode.material_id)); WmsHandleCode handleCode = new(); handleCode.bill_id = operBillId; - handleCode.material_id = jo.Value(nameof(WmsHandleCode.material_id)); + handleCode.material_id = materialId; handleCode.material_code = jo.Value(nameof(WmsHandleCode.material_code)); handleCode.barcode = jo.Value(nameof(WmsHandleCode.barcode)); handleCode.code_batch = jo.Value(nameof(WmsHandleCode.code_batch));