This commit is contained in:
2023-06-20 14:27:52 +08:00
parent e999b4615c
commit 7aec24710d

View File

@@ -88,12 +88,12 @@ namespace Tnb.WarehouseMgr
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString()); ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsPointH.location_id)].ToString());
} }
int i = 0; int i = 0;
//根据每个载具的起始库位做路径运算 //根据每个载具的起始库位做路径运算
for (i = 0; i < setQty.qty; i++) for (i = 0; i < setQty.qty; i++)
{ {
if (carrys?.Count > 0) if (carrys?.Count > 0)
sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id); sPoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == carrys[i].location_id);
var isOk = false; var isOk = false;
@@ -133,12 +133,12 @@ namespace Tnb.WarehouseMgr
}).ToList(); }).ToList();
//更新页面 //更新页面
//赋值签收状态 //赋值签收状态
if (loc.is_sign == 0) if (loc.is_sign == 0)
{ {
preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值 preTasks[^1].is_sign = 0; // 修改最后一个元素的是否签收值
} }
isOk = await _wareHouseService.GenPreTask(preTasks, null); isOk = await _wareHouseService.GenPreTask(preTasks, null);
} }
if (isOk) if (isOk)
{ {
@@ -150,7 +150,7 @@ namespace Tnb.WarehouseMgr
preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList(); preTaskUpInput.LocationIds = points.Select(x => x.location_id).ToList();
//更新明细表 //更新明细表
WmsEmptyOutstockD wmsEmptyOutstockD = new (); WmsEmptyOutstockD wmsEmptyOutstockD = new();
wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId(); wmsEmptyOutstockD.id = SnowflakeIdHelper.NextId();
wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId; wmsEmptyOutstockD.bill_id = preTaskUpInput.RquireId;
wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID; wmsEmptyOutstockD.biz_type = WmsWareHouseConst.BIZTYPE_WMSEPTYOUTSTK_ID;
@@ -166,11 +166,11 @@ namespace Tnb.WarehouseMgr
//根据空载具出库Id回更单据状态 //根据空载具出库Id回更单据状态
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync(); await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput, await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
it => new WmsCarryH { is_lock = 1}, it => new WmsCarryH { is_lock = 1 },
it => new BasLocation { is_lock = 1 }); it => new BasLocation { is_lock = 1 });
} }
} }
} }
await _db.Ado.CommitTranAsync(); await _db.Ado.CommitTranAsync();
@@ -191,9 +191,10 @@ namespace Tnb.WarehouseMgr
var emptyCarrys = await _db.Queryable<WmsEmptyOutstockD>().Where(it => it.bill_id == input.requireId).ToListAsync(); var emptyCarrys = await _db.Queryable<WmsEmptyOutstockD>().Where(it => it.bill_id == input.requireId).ToListAsync();
// 判断所有明细是否都完成 // 判断所有明细是否都完成
if (emptyCarrys.All(x=> x.status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID)) { if (emptyCarrys?.Count > 0 && emptyCarrys.All(x => x.status == WmsWareHouseConst.BILLSTATUS_COMPLETE_ID))
await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it=> new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync(); {
} await _db.Updateable<WmsEmptyOutstockH>().SetColumns(it => new WmsEmptyOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandHasChangeAsync();
}
if (!isOk) throw Oops.Oh(ErrorCode.COM1001); if (!isOk) throw Oops.Oh(ErrorCode.COM1001);
} }
} }