修复bug

This commit is contained in:
18942506660
2024-11-21 17:34:18 +08:00
parent 46f296fcda
commit 657e3e01f7
2 changed files with 12 additions and 1 deletions

View File

@@ -8,7 +8,8 @@ namespace WMS.Web.Core.Dto.OutStock
/// <summary>
/// 出库单保存
/// </summary>
public class SaveOutStockRequest
[Serializable]
public class SaveOutStockRequest
{
/// <summary>
/// 出库任务单Id
@@ -23,6 +24,7 @@ namespace WMS.Web.Core.Dto.OutStock
public List<SaveOutStockDetailsRequest> Details { get; set; } = new List<SaveOutStockDetailsRequest>();
}
[Serializable]
public class SaveOutStockDetailsRequest
{
/// <summary>

View File

@@ -125,7 +125,9 @@ namespace WMS.Web.Domain.Services
//如果是按箱出库从库存拿取数据
if (dto.Method == 1)
{
var oldDetails = dto.Details.Clone();
dto.Details.Clear();
//获取箱子对应的所有库存
//过滤掉不同仓库和不同组织的
boxInventoryList = boxInventoryList.Where(w => w.StockCode == outStockTask.StockCode && w.OrgCode == outStockTask.OrgCode).ToList();
@@ -146,6 +148,13 @@ namespace WMS.Web.Domain.Services
var dtod = _mapper.Map<SaveOutStockDetailsRequest>(b);
dtod.BoxId = box.BoxId;
dtod.SubStockCode = box.SubStockCode;
var oldd = oldDetails.FirstOrDefault(f=>f.BoxId==box.BoxId&&f.MaterialNumber.Equals(dtod.MaterialNumber));
if(oldd==null)
return Result.ReFailure(ResultCodes.BoxMateriaNoData);
dtod.BoxLength = oldd.BoxLength;
dtod.BoxWide = oldd.BoxWide;
dtod.BoxHigh = oldd.BoxHigh;
dtod.BoxWeight = oldd.BoxWeight;
dto.Details.Add(dtod);
}
}