|
|
|
|
@ -294,33 +294,34 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
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 })
|
|
|
|
|
.Select(t =>new
|
|
|
|
|
.Select(t => new
|
|
|
|
|
{
|
|
|
|
|
materialId=t.Key.materialId,
|
|
|
|
|
saleOrderId=t.Key.saleOrderId,
|
|
|
|
|
thisOutAmount=t.Sum(x=>x.totalAmount)-t.Sum(x=>x.frozenAmount)
|
|
|
|
|
materialId = t.Key.materialId,
|
|
|
|
|
saleOrderId = t.Key.saleOrderId,
|
|
|
|
|
thisOutAmount = t.Sum(x => x.totalAmount) - t.Sum(x => x.frozenAmount)
|
|
|
|
|
});
|
|
|
|
|
List<WmsRawOutstock> endStationCodeOutRaw = wmsRawOutstocks.Where(t => t.endStationCode == baseEquip.endStationCode).ToList();
|
|
|
|
|
var bill = endStationCodeOutRaw.GroupBy(t => new { t.materialId,t.materialBatch, t.saleOrderId })
|
|
|
|
|
.Select(t =>new
|
|
|
|
|
var bill = endStationCodeOutRaw.GroupBy(t => new { t.materialId, t.materialBatch, t.saleOrderId })
|
|
|
|
|
.Select(t => new
|
|
|
|
|
{
|
|
|
|
|
materialId=t.Key.materialId,
|
|
|
|
|
materialBatch=t.Key.materialBatch,
|
|
|
|
|
saleOrderId=t.Key.saleOrderId,
|
|
|
|
|
outstockAmount=t.Sum(x=>x.outstockAmount),
|
|
|
|
|
realOutstockAmount=t.Sum(x=>x.realOutstockAmount),
|
|
|
|
|
materialId = t.Key.materialId,
|
|
|
|
|
materialBatch = t.Key.materialBatch,
|
|
|
|
|
saleOrderId = t.Key.saleOrderId,
|
|
|
|
|
outstockAmount = t.Sum(x => x.outstockAmount),
|
|
|
|
|
realOutstockAmount = t.Sum(x => x.realOutstockAmount),
|
|
|
|
|
});
|
|
|
|
|
var orderNumber = from a in bill
|
|
|
|
|
from b in thisOutList
|
|
|
|
|
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
materialBatch=a.materialBatch,
|
|
|
|
|
saleOrderId=b.saleOrderId,
|
|
|
|
|
outstockAmount=a.outstockAmount,
|
|
|
|
|
realOutstockAmount=a.realOutstockAmount,
|
|
|
|
|
thisOutAmount=b.thisOutAmount
|
|
|
|
|
};
|
|
|
|
|
from b in thisOutList
|
|
|
|
|
where a.materialId == b.materialId && a.saleOrderId == b.saleOrderId
|
|
|
|
|
select new
|
|
|
|
|
{
|
|
|
|
|
materialBatch = a.materialBatch,
|
|
|
|
|
saleOrderId = b.saleOrderId,
|
|
|
|
|
outstockAmount = a.outstockAmount,
|
|
|
|
|
realOutstockAmount = a.realOutstockAmount,
|
|
|
|
|
thisOutAmount = b.thisOutAmount,
|
|
|
|
|
isSendOver = outstockAmount <= (realOutstockAmount + thisOutAmount) ? "已出完" : "未出完"
|
|
|
|
|
};
|
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
|
|
|
|
OutTaskNumber.ItemsSource = orderNumber;
|
|
|
|
|
@ -1139,7 +1140,7 @@ namespace Khd.Core.Wpf.Form
|
|
|
|
|
dbContext.Update(baseEquip);
|
|
|
|
|
var wcsCmd = dbContext.WcsTask
|
|
|
|
|
.Where(t => t.taskStatus == 6 || t.taskStatus == 3)
|
|
|
|
|
.Where(t=>t.nextPointId== 10)
|
|
|
|
|
.Where(t => t.nextPointId == 10)
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
if (wcsCmd == null)
|
|
|
|
|
{
|
|
|
|
|
|