|
|
|
|
@ -398,9 +398,10 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
List<WcsTask> wcsTasks = dbContext.WcsTask.Where(t => t.taskType == 30).Where(t => orderIds.Contains(t.orderId)).ToList();
|
|
|
|
|
List<string> containerNos = wcsTasks.Select(t => t.containerNo).ToList();
|
|
|
|
|
List<WmsRawStock> wmsRawStocks = dbContext.WmsRawStock.Where(t => containerNos.Contains(t.palletInfoCode)).ToList();
|
|
|
|
|
var thisOutList = wmsRawStocks.GroupBy(t => new { t.materialId, t.saleOrderId })
|
|
|
|
|
var thisOutList = wmsRawStocks.GroupBy(t => new { t.materialId, t.saleOrderId,t.palletInfoCode })
|
|
|
|
|
.Select(t => new
|
|
|
|
|
{
|
|
|
|
|
palletInfoCode = t.Key.palletInfoCode,
|
|
|
|
|
materialId = t.Key.materialId,
|
|
|
|
|
saleOrderId = t.Key.saleOrderId,
|
|
|
|
|
thisOutAmount = t.Sum(x => x.totalAmount) - t.Sum(x => x.frozenAmount)
|
|
|
|
|
@ -420,17 +421,19 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
var orderNumber = from a in bill
|
|
|
|
|
from b in thisOutList
|
|
|
|
|
from c in mesBaseMaterialInfos
|
|
|
|
|
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId
|
|
|
|
|
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId && a.materialId ==c.MaterialId
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
palletInfoCode = b.palletInfoCode,
|
|
|
|
|
materialBatch = a.materialBatch,
|
|
|
|
|
saleOrderId = b.saleOrderId,
|
|
|
|
|
outstockAmount = a.outstockAmount,
|
|
|
|
|
materialSpec = c.MaterialSpec,
|
|
|
|
|
realOutstockAmount = a.realOutstockAmount,
|
|
|
|
|
thisOutAmount = b.thisOutAmount,
|
|
|
|
|
thisOutAmount = b.thisOutAmount,
|
|
|
|
|
isSendOver = a.outstockAmount <= (a.realOutstockAmount + b.thisOutAmount) ? "已出完" : "未出完"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
this.OutTaskNumber.ItemsSource = orderNumber;
|
|
|
|
|
|