master
1 year ago
parent 5573b86225
commit 4a2fea030a

@ -2157,6 +2157,8 @@ namespace Khd.Core.Wcs.Wcs
dbContext.Add(wcsTask);
dbContext.Update(item);
dbContext.Update(stock);
WcsTaskLog wcsTaskLog1 = CoreMapper.Map<WcsTaskLog>(wcsTask);
dbContext.Add(wcsTaskLog1);
dbContext.SaveChanges();
}

@ -1983,29 +1983,40 @@
<DataGridTextColumn
Header="物料批次"
Binding="{Binding materialBatch}"
ElementStyle="{StaticResource dgCell}"
Width="5*"
/>
<DataGridTextColumn
Header="销售订单"
Binding="{Binding saleOrderId}"
ElementStyle="{StaticResource dgCell}"
Width="*"
/>
<DataGridTextColumn
Header="箱体携带数量"
Binding="{Binding thisOutAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="申请数量"
Binding="{Binding outstockAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="已出数量"
Binding="{Binding realOutstockAmount}"
ElementStyle="{StaticResource dgCell}"
Width="2*"
/>
<DataGridTextColumn
Header="是否出完"
Binding="{Binding isSendOver}"
Width="2*"
ElementStyle="{StaticResource dgCell}"
/>
</DataGrid.Columns>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
@ -2420,8 +2431,7 @@
</StackPanel>
</StackPanel>
</TabItem>
<TabItem
x:Name="AgvManager" Header="Agv信息" Style="{StaticResource DefaultItem}" FontSize="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="#213269" Foreground="White" Width="160" Height="100" Margin="5" >
<TabItem x:Name="AgvManager" Header="Agv信息" Style="{StaticResource DefaultItem}" FontSize="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Background="#213269" Foreground="White" Width="160" Height="100" Margin="5" >
<DataGrid
x:Name="AgvDataGrid"
AlternationCount="2"

@ -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)
{

Loading…
Cancel
Save