diff --git a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs index 07d58f64..422946cd 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr.Entities/Entity/WmsCarryCode.cs @@ -108,5 +108,9 @@ public partial class WmsCarryCode : BaseEntity, IWmsCarryEntity /// 修改时间 /// public DateTime? modify_time { get; set; } + /// + /// 仓库ID + /// + public string? warehouse_id { get; set; } } diff --git a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs index 1c97bda6..336c76f3 100644 --- a/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs +++ b/WarehouseMgr/Tnb.WarehouseMgr/WareHouseService.cs @@ -473,6 +473,13 @@ namespace Tnb.WarehouseMgr for (int i = 0; i < multiList.Count; i++) { await _db.Updateable().SetColumns(it => new WmsCarryH { is_lock = 0, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync(); + //更新条码的库位和仓库信息 + var carryCodes = await _db.Queryable().Where(it => it.id == multiList[i].carry_id).ToListAsync(); + if (carryCodes?.Count>0) { + var loc = await _db.Queryable().SingleAsync(it => it.id == multiList[i].endlocation_id); + await _db.Updateable().SetColumns(it => new WmsCarryCode { warehouse_id = loc.wh_id, location_id = multiList[i].endlocation_id, location_code = multiList[i].endlocation_code }).Where(it => it.id == multiList[i].carry_id).ExecuteCommandAsync(); + } + } } //更新库位信息,使用状态为 使用,锁定状态为未锁定