修复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();
|
var all_boxIds = dto.Boxs.Select(s => s.BoxId).ToList();
|
||||||
//2.1判断箱是否上架过了
|
//2.1判断箱是否上架过了 按箱出货才判断
|
||||||
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
|
if (dto.ShelfMethod == 1)
|
||||||
foreach (var b in dto.Boxs)
|
|
||||||
{
|
{
|
||||||
var boxInventory = boxInventoryList.FirstOrDefault(f => f.BoxId == b.BoxId);
|
var boxInventoryList = await _boxInventoryRepositories.GetList(all_boxIds);
|
||||||
if (boxInventory != null)
|
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()
|
OutStockTaskInfoDetailsResponse infoDetail = new OutStockTaskInfoDetailsResponse()
|
||||||
{
|
{
|
||||||
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
BoxBillNo = boxList.FirstOrDefault(f => f.Id == b.BoxId)?.BoxBillNo ?? "",
|
||||||
OutStockId= outStock.Id,
|
OutStockId = outStock.Id,
|
||||||
OutStockBoxDetailsId=b.Id,
|
OutStockBoxDetailsId = b.Id,
|
||||||
BoxLength =b.BoxLength,
|
BoxLength = b.BoxLength,
|
||||||
BoxWide=b.BoxWide,
|
BoxWide = b.BoxWide,
|
||||||
BoxHigh=b.BoxHigh,
|
BoxHigh = b.BoxHigh,
|
||||||
BoxWeight=b.BoxWeight,
|
BoxWeight = b.BoxWeight,
|
||||||
Qty = b.Qty,
|
Qty = b.Qty,
|
||||||
SerialNumbers = string.Join(",", b.SerialNumbers),
|
SerialNumbers = string.Join(",", b.SerialNumbers),
|
||||||
SerialNumberList = b.SerialNumbers,
|
SerialNumberList = b.SerialNumbers,
|
||||||
@@ -601,9 +601,25 @@ namespace WMS.Web.Domain.Services
|
|||||||
response.Details.Add(infoDetail);
|
response.Details.Add(infoDetail);
|
||||||
}
|
}
|
||||||
//排序和加序号值
|
//排序和加序号值
|
||||||
response.Details = response.Details.OrderByDescending(s => s.Specifications)
|
//response.Details = response.Details.OrderByDescending(s => s.Specifications)
|
||||||
.ThenByDescending(s => s.Method).ThenByDescending(s => s.Qty).ToList();
|
// .ThenByDescending(s => s.Method).ThenByDescending(s => s.Qty).ToList();
|
||||||
response.Details.ForEach(f => f.IndexNumber = response.Details.IndexOf(f) + 1);
|
// 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);
|
return Result<OutStockTaskInfoResponse>.ReSuccess(response);
|
||||||
}
|
}
|
||||||
@@ -640,11 +656,11 @@ namespace WMS.Web.Domain.Services
|
|||||||
MaterialName = d.MaterialName,
|
MaterialName = d.MaterialName,
|
||||||
MaterialNumber = d.MaterialNumber,
|
MaterialNumber = d.MaterialNumber,
|
||||||
BarCode = d.BarCode,
|
BarCode = d.BarCode,
|
||||||
IndexNumber=d.IndexNumber,
|
IndexNumber = d.IndexNumber,
|
||||||
BoxLength=d.BoxLength,
|
BoxLength = d.BoxLength,
|
||||||
BoxWide=d.BoxWide,
|
BoxWide = d.BoxWide,
|
||||||
BoxHigh=d.BoxHigh,
|
BoxHigh = d.BoxHigh,
|
||||||
BoxWeight=d.BoxWeight,
|
BoxWeight = d.BoxWeight,
|
||||||
SerialNumbers = ""
|
SerialNumbers = ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user