fix-统计界面图表日期排序问题

dev
liuwf 3 weeks ago
parent fd63392361
commit 249d0c6be0

@ -172,10 +172,13 @@ namespace SlnMesnac.Repository.service.Impl
{ {
try try
{ {
// plan.StationId == _appConfig.stationId &&
var info = base._rep.AsQueryable() var info = base._rep.AsQueryable()
.LeftJoin<MesProductOrder>((plan, order) => plan.ProductOrderId == order.ProductOrderId) .LeftJoin<MesProductOrder>((plan, order) => plan.ProductOrderId == order.ProductOrderId)
.LeftJoin<BaseMaterialInfo>((plan, order, material) => plan.MaterialId == material.MaterialId) .LeftJoin<BaseMaterialInfo>((plan, order, material) => plan.MaterialId == material.MaterialId)
.Where(plan => plan.StationId == _appConfig.stationId && plan.PlanStatus != PlanStatusEnum.) .Where((plan, order) =>
plan.PlanStatus != PlanStatusEnum. &&
(order.DispatchId ==2))
.Select((plan, order, material) => new MesProductPlanDto .Select((plan, order, material) => new MesProductPlanDto
{ {
PlanId = plan.PlanId, PlanId = plan.PlanId,
@ -202,7 +205,8 @@ namespace SlnMesnac.Repository.service.Impl
MaterialUnitId = material.MaterialUnitId, MaterialUnitId = material.MaterialUnitId,
}).ToList(); }).ToList();
return info; return info;
}catch(Exception ex) }
catch (Exception ex)
{ {
throw new InvalidOperationException($"获取MES计划详细信息异常:{ex.Message}"); throw new InvalidOperationException($"获取MES计划详细信息异常:{ex.Message}");
} }

@ -240,8 +240,8 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Button Content="开始" CommandParameter="{Binding PlanCode}" Background="#007DFA" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="DeepSkyBlue" BorderThickness="0" Width="45" Command="{Binding DataContext.StartProdPlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/> <Button Content="开始" CommandParameter="{Binding PlanCode}" IsEnabled="{Binding StartEnable}" Background="#007DFA" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="DeepSkyBlue" BorderThickness="0" Width="45" Command="{Binding DataContext.StartProdPlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/>
<Button Content="暂停" CommandParameter="{Binding PlanCode}" Background="#007DFA" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="DeepSkyBlue" BorderThickness="0" Width="45" Command="{Binding DataContext.StopProdPlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" /> <Button Content="暂停" CommandParameter="{Binding PlanCode}" IsEnabled="{Binding StopEnable}" Background="#007DFA" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="DeepSkyBlue" BorderThickness="0" Width="45" Command="{Binding DataContext.StopProdPlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>

@ -244,6 +244,8 @@ namespace SlnMesnac.WPF.ViewModel
} }
})); }));
// 刷新图表 // 刷新图表
RefreshWmsRawOutstockDetailChart(list); RefreshWmsRawOutstockDetailChart(list);
@ -256,6 +258,7 @@ namespace SlnMesnac.WPF.ViewModel
/// <param name="list"></param> /// <param name="list"></param>
private void RefreshWmsRawOutstockDetailChart(List<WmsRawOutstockDetail> list) private void RefreshWmsRawOutstockDetailChart(List<WmsRawOutstockDetail> list)
{ {
list = list.OrderBy(x => x.CreateDate).ToList();
App.Current.Dispatcher.BeginInvoke((Action)(() => App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
OutAchievement.Clear(); OutAchievement.Clear();
@ -318,6 +321,7 @@ namespace SlnMesnac.WPF.ViewModel
private void RefreshProductChart(List<WmsProductInstock> list) private void RefreshProductChart(List<WmsProductInstock> list)
{ {
list = list.OrderBy(x => x.updateDate).ToList();
App.Current.Dispatcher.BeginInvoke((Action)(() => App.Current.Dispatcher.BeginInvoke((Action)(() =>
{ {
ProductAchievement.Clear(); ProductAchievement.Clear();

Loading…
Cancel
Save