Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -354,7 +354,8 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
taskCode = it.bill_code,
|
||||
sourceName = it.startpoint_code,
|
||||
targetName = it.endpoint_code
|
||||
targetName = it.endpoint_code,
|
||||
carryCode = it.carry_code,
|
||||
}));
|
||||
Log.Information($"请求地址:{url}");
|
||||
foreach (var (k, v) in taskChainCodeDic)
|
||||
@@ -498,32 +499,43 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Updateable(eles).ReSetValue(it => it.task_nums--).ExecuteCommandAsync();
|
||||
|
||||
//更新载具,锁定状态为未锁定,更新载具的库位当前任务的目标库位
|
||||
var multiList = disTasks.Select(it => (it.carry_id, it.endlocation_id, it.endlocation_code)).ToList();
|
||||
for (int i = 0; i < multiList.Count; i++)
|
||||
var multiList = disTasks.Select(it => (it.carry_id, it.carry_status, it.endlocation_id, it.endlocation_code)).ToList();
|
||||
var locWhIdMap = await _db.Queryable<BasLocation>().Where(it => multiList.Select(x => x.endlocation_id).Contains(it.id)).ToDictionaryAsync(it => it.id, it => it.wh_id);
|
||||
List<WmsCarryH> carryIts = new();
|
||||
List<WmsCarryCode> carryCodeIts = new();
|
||||
List<BasLocation> locIts = new();
|
||||
for (int i = 0, cnt = multiList.Count; i < cnt; 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)
|
||||
WmsCarryH carry = new()
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
id = multiList[i].carry_id,
|
||||
is_lock = 0,
|
||||
location_id = multiList[i].endlocation_id,
|
||||
location_code = multiList[i].endlocation_code
|
||||
};
|
||||
WmsCarryCode carryCode = new()
|
||||
{
|
||||
warehouse_id = locWhIdMap[multiList[i].endlocation_id].ToString(),
|
||||
location_id = multiList[i].endlocation_id,
|
||||
location_code = multiList[i].endlocation_code
|
||||
};
|
||||
carryIts.Add(carry);
|
||||
carryCodeIts.Add(carryCode);
|
||||
|
||||
BasLocation loc = new();
|
||||
loc.is_lock = 0;
|
||||
if (multiList[i].carry_status.ToEnum<EnumCarryStatus>() == EnumCarryStatus.空闲)
|
||||
{
|
||||
loc.is_use = ((int)EnumCarryStatus.占用).ToString();
|
||||
}
|
||||
locIts.Add(loc);
|
||||
|
||||
}
|
||||
await _db.Updateable(carryIts).UpdateColumns(it => new { it.is_lock, it.location_id, it.location_code }).ExecuteCommandAsync();
|
||||
//更新条码的库位和仓库信息
|
||||
await _db.Updateable(carryCodeIts).UpdateColumns(it => new { it.warehouse_id, it.location_id, it.location_code }).Where(it => multiList.Select(x => x.carry_id).Contains(it.carry_id)).ExecuteCommandAsync();
|
||||
//更新库位信息,使用状态为 使用,锁定状态为未锁定
|
||||
var multis = disTasks.Select(it => (it.endlocation_id, it.carry_status)).ToList();
|
||||
for (int i = 0; i < multis.Count; i++)
|
||||
{
|
||||
var carryStatus = multis[i].carry_status;
|
||||
if (multis[i].carry_status == ((int)EnumCarryStatus.空闲).ToString())
|
||||
{
|
||||
carryStatus = ((int)EnumCarryStatus.占用).ToString();
|
||||
}
|
||||
var cStatus = carryStatus.ParseToInt();
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_use = cStatus.ToString(), is_lock = 0 }).Where(it => it.id == multis[i].endlocation_id).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
await _db.Updateable(locIts).UpdateColumns(it => new { it.is_use, it.is_lock }).Where(it => multiList.Select(x => x.endlocation_id).Contains(it.id)).ExecuteCommandAsync();
|
||||
//更新业务主表的单据状态
|
||||
foreach (var dt in disTasks)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user