修复bug
This commit is contained in:
Binary file not shown.
@@ -522,14 +522,17 @@ namespace WMS.Web.Domain.Services
|
||||
});
|
||||
|
||||
var all_boxIds = dto.Boxs.Select(s => s.BoxId).ToList();
|
||||
//2.1判断箱是否上架过了
|
||||
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
|
||||
foreach (var b in dto.Boxs)
|
||||
//2.1判断箱是否上架过了 按箱出货才判断
|
||||
if (dto.ShelfMethod == 1)
|
||||
{
|
||||
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
|
||||
if (boxInventory != null)
|
||||
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
|
||||
foreach (var b in dto.Boxs)
|
||||
{
|
||||
return Result<InStock>.ReFailure($"{b.BoxBillNo} 箱号已上架入库", 80000);
|
||||
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
|
||||
if (boxInventory != null)
|
||||
{
|
||||
return Result<InStock>.ReFailure($"{b.BoxBillNo} 箱号已上架入库", 80000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -579,12 +579,12 @@ namespace WMS.Web.Domain.Services
|
||||
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
|
||||
{
|
||||
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
||||
OutStockId= outStock.Id,
|
||||
OutStockBoxDetailsId=b.Id,
|
||||
BoxLength =b.BoxLength,
|
||||
BoxWide=b.BoxWide,
|
||||
BoxHigh=b.BoxHigh,
|
||||
BoxWeight=b.BoxWeight,
|
||||
OutStockId = outStock.Id,
|
||||
OutStockBoxDetailsId = b.Id,
|
||||
BoxLength = b.BoxLength,
|
||||
BoxWide = b.BoxWide,
|
||||
BoxHigh = b.BoxHigh,
|
||||
BoxWeight = b.BoxWeight,
|
||||
Qty = b.Qty,
|
||||
SerialNumbers = string.Join(",", b.SerialNumbers),
|
||||
SerialNumberList = b.SerialNumbers,
|
||||
@@ -601,9 +601,25 @@ namespace WMS.Web.Domain.Services
|
||||
response.Details.Add(infoDetail);
|
||||
}
|
||||
//排序和加序号值
|
||||
response.Details = response.Details.OrderByDescending(s => s.Specifications)
|
||||
.ThenByDescending(s => s.Method).ThenByDescending(s => s.Qty).ToList();
|
||||
response.Details.ForEach(f => f.IndexNumber = response.Details.IndexOf(f) + 1);
|
||||
//response.Details = response.Details.OrderByDescending(s => s.Specifications)
|
||||
// .ThenByDescending(s => s.Method).ThenByDescending(s => s.Qty).ToList();
|
||||
// response.Details.ForEach(f => f.IndexNumber = response.Details.IndexOf(f) + 1);
|
||||
response.Details = response.Details.OrderByDescending(s => s.Method)
|
||||
.ThenByDescending(s => s.BoxBillNo).ThenByDescending(s => s.BoxLength).ToList();
|
||||
|
||||
for (int i = 0; i < response.Details.Count(); i++)
|
||||
{
|
||||
if (i == 0)
|
||||
response.Details[0].IndexNumber = 1;
|
||||
else
|
||||
{
|
||||
//和上一个箱子比 如果是相同的箱子序号一样
|
||||
if (response.Details[i].BoxBillNo == response.Details[i - 1].BoxBillNo)
|
||||
response.Details[i].IndexNumber = response.Details[i - 1].IndexNumber;
|
||||
else
|
||||
response.Details[i].IndexNumber = response.Details[i - 1].IndexNumber + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return Result<OutStockTaskInfoResponse>.ReSuccess(response);
|
||||
}
|
||||
@@ -640,11 +656,11 @@ namespace WMS.Web.Domain.Services
|
||||
MaterialName = d.MaterialName,
|
||||
MaterialNumber = d.MaterialNumber,
|
||||
BarCode = d.BarCode,
|
||||
IndexNumber=d.IndexNumber,
|
||||
BoxLength=d.BoxLength,
|
||||
BoxWide=d.BoxWide,
|
||||
BoxHigh=d.BoxHigh,
|
||||
BoxWeight=d.BoxWeight,
|
||||
IndexNumber = d.IndexNumber,
|
||||
BoxLength = d.BoxLength,
|
||||
BoxWide = d.BoxWide,
|
||||
BoxHigh = d.BoxHigh,
|
||||
BoxWeight = d.BoxWeight,
|
||||
SerialNumbers = ""
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user