This commit is contained in:
FanLian
2023-07-20 17:59:52 +08:00
parent 70b78d9756
commit f4134375f6
3 changed files with 6 additions and 2 deletions

View File

@@ -78,7 +78,7 @@ namespace Tnb.WarehouseMgr
//判断目标库位是否自动签收
var loc = await _db.Queryable<BasLocation>().SingleAsync(it => it.id == input.data[nameof(WmsPointH.location_id)].ToString());
//出库取起点,获取所有符合输入的载具规格的载具
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
var carrys = await _db.Queryable<WmsCarryH>().LeftJoin<BasLocation>((a, b) => a.location_id == b.id)
.Where((a, b) => a.carrystd_id == input.data[nameof(WmsEmptyOutstockH.carrystd_id)].ToString()
&& a.carry_status == ((int)EnumCarryStatus.).ToString() && a.is_lock == 0 && b.is_lock == 0 && b.is_type == ((int)EnumLocationType.).ToString())
@@ -95,6 +95,7 @@ namespace Tnb.WarehouseMgr
VisualDevEntity? templateEntity = await _visualDevService.GetInfoById(ModuleConsts.MODULE_WMSEMPTYOUTSTK_ID, true);
await _runService.Create(templateEntity, input);
var setQty = await _db.Queryable<WmsEmptyOutstockH>().FirstAsync(it => it.bill_code == input.data[nameof(WmsEmptyOutstockH.bill_code)].ToString());
WmsPointH? sPoint = null;
WmsPointH? ePoint = null;
if (input.data.ContainsKey(nameof(WmsPointH.location_id)))

View File

@@ -134,7 +134,8 @@ namespace Tnb.WarehouseMgr
pretaskCodes.AddRange(curPreTaskCodes);
}
await _warehouseService.GenPreTask(preTasks, pretaskCodes);
await _db.Updateable(kittingout).UpdateColumns(it => it.status == WmsWareHouseConst.BILLSTATUS_ON_ID).ExecuteCommandAsync();
kittingout.status = WmsWareHouseConst.BILLSTATUS_ON_ID;
await _db.Updateable(kittingout).UpdateColumns(it => it.status).ExecuteCommandAsync();
GenPreTaskUpInput genPreTaskAfterUpInput = new();
genPreTaskAfterUpInput.CarryIds = preTasks.Select(x => x.carry_id).ToList();
genPreTaskAfterUpInput.LocationIds = new List<string> { carry.location_id! };

View File

@@ -304,12 +304,14 @@ namespace Tnb.WarehouseMgr
carrys.Add(carry);
if (carrys?.Count > 0)
{
await _db.Ado.BeginTranAsync();
var tasks = new List<Task<int>>();
foreach (var carryIt in carrys)
{
tasks.Add(_carryService.UpdateNullCarry(carryIt));
}
var all = await Task.WhenAll(tasks);
await _db.Ado.CommitTranAsync();
if (all.All(x => x > 0))
isOk = all?.Length > 0;
}