库位载具数,灭菌入库单号

This commit is contained in:
2024-09-03 16:23:52 +08:00
parent 9f1806e852
commit df654b1523
5 changed files with 24 additions and 14 deletions

View File

@@ -2637,7 +2637,7 @@ namespace Tnb.WarehouseMgr
if (carryAndLocIds?.Count > 0)
{
List<string> startLocationIds = carryAndLocIds.Select(x => x.startlocation_id).ToList();
_ = await db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = ((int)EnumCarryStatus.).ToString(), is_lock = 0 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
_ = await db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = ((int)EnumCarryStatus.).ToString(), is_lock = 0, carry_count = it.carry_count - 1 }).Where(it => startLocationIds.Contains(it.id)).ExecuteCommandAsync();
}
List<WmsDistaskH> disTasks = db.Queryable<WmsDistaskH>().Where(r => input.disTaskIds.Contains(r.id)).ToList();
@@ -2755,6 +2755,7 @@ namespace Tnb.WarehouseMgr
List<(string carry_id, string carry_status, string endlocation_id, string endlocation_code)> multiList = disTasks.Select(it => (it.carry_id, it.carry_status, it.endlocation_id, it.endlocation_code)).ToList();
Dictionary<string, object> locWhIdMap = await db.Queryable<BasLocation>().Where(it => multiList.Select(x => x.endlocation_id).Contains(it.id)).ToDictionaryAsync(it => it.id, it => it.wh_id);
Dictionary<string, object> locTypeMap = await db.Queryable<BasLocation>().Where(it => multiList.Select(x => x.endlocation_id).Contains(it.id)).ToDictionaryAsync(it => it.id, it => it.is_type);
Dictionary<string, object> locCarrycountMap = await db.Queryable<BasLocation>().Where(it => multiList.Select(x => x.endlocation_id).Contains(it.id)).ToDictionaryAsync(it => it.id, it => it.carry_count);
List<WmsCarryH> carryIts = new();
List<WmsCarryCode> carryCodeIts = new();
List<BasLocation> locIts = new();
@@ -2801,6 +2802,7 @@ namespace Tnb.WarehouseMgr
{
id = multiList[i].endlocation_id,
is_lock = 0,
carry_count = locCarrycountMap[endLocId] == null ? 1: int.Parse(locCarrycountMap[endLocId].ToString()) + 1,
is_use = string.IsNullOrEmpty(multiList[i].carry_status) ? ((int)EnumCarryStatus.).ToString() : multiList[i].carry_status
};
if (!string.IsNullOrEmpty(multiList[i].carry_status))
@@ -2823,7 +2825,7 @@ namespace Tnb.WarehouseMgr
//更新条码的库位和仓库信息
_ = await db.Updateable(carryCodeIts).UpdateColumns(it => new { it.warehouse_id, it.location_id, it.location_code }).ExecuteCommandAsync();
//更新库位信息,使用状态为 使用,锁定状态为未锁定
_ = await db.Updateable(locIts).UpdateColumns(it => new { it.is_use, it.is_lock }).ExecuteCommandAsync();
_ = await db.Updateable(locIts).UpdateColumns(it => new { it.is_use, it.is_lock, it.carry_count }).ExecuteCommandAsync();
Logger.Information($"【TaskComplate】 更新库位 {JsonConvert.SerializeObject(locIts)}");
/* var loginType= _userManager?.LoginType ?? "web";
Log.Information($"_userManager.LoginType={loginType}");