出入库后端调整

This commit is contained in:
2026-01-09 15:54:21 +08:00
parent 8b206b257c
commit 0087d05657
5 changed files with 39 additions and 18 deletions

View File

@@ -113,6 +113,7 @@ namespace DOAN.Service.BZFM
.Where(it => it.Status == "启用")
.Select(it => new MmMaterialOption
{
Id = it.Id,
MaterialCode = it.MaterialCode,
MaterialName = it.MaterialName,
CategoryCode = it.CategoryCode,
@@ -121,6 +122,7 @@ namespace DOAN.Service.BZFM
SupplierName = it.SupplierName,
Type = it.Type,
})
.OrderBy(it => it.Type)
.ToList();
}
catch (Exception)
@@ -138,6 +140,7 @@ namespace DOAN.Service.BZFM
.Where(it => it.Status == "启用")
.Select(it => new MmLocationOption
{
Id = it.Id,
WarehouseCode = it.WarehouseCode,
WarehouseName = it.WarehouseName,
LocationCode = it.LocationCode,
@@ -239,9 +242,10 @@ namespace DOAN.Service.BZFM
}
else
{
mmInventory.CurrentQty += delta;
Context
.Updateable(mmInventory)
.SetColumns(it => it.CurrentQty == it.CurrentQty + delta)
.UpdateColumns(it => it.CurrentQty)
.ExecuteCommand();
}
@@ -341,10 +345,10 @@ namespace DOAN.Service.BZFM
Context.Ado.RollbackTran();
return "库存不足,无法出库";
}
mmInventory.CurrentQty -= delta;
Context
.Updateable(mmInventory)
.SetColumns(it => it.CurrentQty == it.CurrentQty - delta)
.UpdateColumns(it => it.CurrentQty)
.ExecuteCommand();
}