修复bug

This commit is contained in:
18942506660
2024-03-01 10:19:31 +08:00
parent 0f25118b8b
commit 710e66c86f

View File

@@ -54,7 +54,7 @@ namespace WMS.Web.Domain.Entitys
/// 创建时间对应老OPS的创建时间
/// </summary>
public DateTime CreateTime { get; set; } = DateTime.Now;
/// <summary>
/// 明细
/// </summary>
@@ -63,7 +63,7 @@ namespace WMS.Web.Domain.Entitys
//移出
public Result Out(List<(int MaterialId, decimal Qty, List<string> SerialNumbers)> list)
{
foreach(var l in list)
foreach (var l in list)
{
var d = this.Details.FirstOrDefault(f => f.MaterialId == l.MaterialId);
if (d == null) return Result.ReFailure(ResultCodes.BoxMateriaNoData);
@@ -85,7 +85,7 @@ namespace WMS.Web.Domain.Entitys
this.Details.Add(new BoxDetails()
{
MaterialId = l.MaterialId,
Qty=l.Qty,
Qty = l.Qty,
//SerialNumbers=l.SerialNumbers
});
continue;
@@ -100,12 +100,12 @@ namespace WMS.Web.Domain.Entitys
public Result TakeStock(int materialId, decimal qty)
{
var d = this.Details.FirstOrDefault(f => f.MaterialId == materialId);
if(d==null)
if (d == null)
{
this.Details.Add(new BoxDetails()
{
MaterialId = materialId,
Qty= qty
Qty = qty
});
}
return Result.ReSuccess();
@@ -119,16 +119,17 @@ namespace WMS.Web.Domain.Entitys
public Result BackRecordUp(int materialId, decimal qty)
{
var d = this.Details.FirstOrDefault(f => f.MaterialId == materialId);
if(d==null)
if (d == null)
{
this.Details.Add(new BoxDetails()
{
MaterialId = materialId,
Qty = qty
});
}else
}
else
{
d.Qty = d.Qty + qty;
d.Qty = qty;
}
return Result.ReSuccess();
}
@@ -141,18 +142,9 @@ namespace WMS.Web.Domain.Entitys
public Result BackRecordDown(int materialId, decimal qty)
{
var d = this.Details.FirstOrDefault(f => f.MaterialId == materialId);
if (d == null)
{
this.Details.Add(new BoxDetails()
{
MaterialId = materialId,
Qty = qty
});
}
else
{
d.Qty = d.Qty + qty;
}
if (d != null)
d.Qty = (d.Qty - qty) > 0 ? (d.Qty - qty) : 0;
return Result.ReSuccess();
}
}