出库申请,回更载具条码数量代码调整

This commit is contained in:
alex
2023-06-29 09:22:07 +08:00
parent 7325880f11
commit fd7b2deaad

View File

@@ -338,7 +338,8 @@ namespace Tnb.WarehouseMgr
await _db.Updateable<WmsOutstockH>().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_COMPLETE_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
//如果是自动单据,需要回更上层系统
}
else {
else
{
//如果没有完成,修改为工作中
await _db.Updateable<WmsOutstockH>().SetColumns(it => new WmsOutstockH { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.requireId).ExecuteCommandAsync();
}
@@ -411,11 +412,15 @@ namespace Tnb.WarehouseMgr
}
if (dicUpdate.Count > 0)
{
//var dicCarryCodes = carryCodes.FindAll(x => dicUpdate.Keys.Contains(x.barcode)).GroupBy(g => g.barcode).ToDictionary(x => x.Key, x => x.FirstOrDefault());
foreach (var pair in dicUpdate)
{
WmsCarryCode carryCode = new();
carryCode.codeqty = pair.Value;
await _db.Updateable(carryCode).UpdateColumns(it => it.codeqty).Where(it => it.barcode == pair.Key).ExecuteCommandAsync();
WmsCarryCode carryCode = carryCodes.Find(x => x.barcode == pair.Key);
if (carryCode != null)
{
carryCode.codeqty = pair.Value;
await _db.Updateable(carryCode).UpdateColumns(it => it.codeqty).ExecuteCommandAsync();
}
}
await _db.Updateable<WmsCarryH>().SetColumns(it => new WmsCarryH { out_status = ((int)EnumOutStatus.).ToString() }).Where(it => input.carryIds.Contains(it.id)).ExecuteCommandAsync();
await _db.Deleteable<WmsCarryMat>().Where(it => input.carryIds.Contains(it.carry_id)).ExecuteCommandAsync();