任务完成时,更新条码的库位和仓库信息

This commit is contained in:
2023-06-30 17:11:05 +08:00
parent a90c18f89c
commit f2829ecfd1
2 changed files with 11 additions and 0 deletions

View File

@@ -108,5 +108,9 @@ public partial class WmsCarryCode : BaseEntity<string>, IWmsCarryEntity
/// 修改时间
/// </summary>
public DateTime? modify_time { get; set; }
/// <summary>
/// 仓库ID
/// </summary>
public string? warehouse_id { get; set; }
}

View File

@@ -473,6 +473,13 @@ namespace Tnb.WarehouseMgr
for (int i = 0; i < multiList.Count; i++)
{
await _db.Updateable<WmsCarryH>().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<WmsCarryCode>().Where(it => it.id == multiList[i].carry_id).ToListAsync();
if (carryCodes?.Count>0) {
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == multiList[i].endlocation_id);
await _db.Updateable<WmsCarryCode>().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();
}
}
}
//更新库位信息,使用状态为 使用,锁定状态为未锁定