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

dev
liuwf 3 weeks ago
parent fd63392361
commit 249d0c6be0

@ -36,7 +36,7 @@ namespace SlnMesnac.Repository.service.Impl
{
private AppConfig _appConfig;
public MesProductPlanServiceImpl(Repository<MesProductPlan> rep, AppConfig appConfig):base(rep)
public MesProductPlanServiceImpl(Repository<MesProductPlan> rep, AppConfig appConfig) : base(rep)
{
_appConfig = appConfig;
}
@ -172,10 +172,13 @@ namespace SlnMesnac.Repository.service.Impl
{
try
{
// plan.StationId == _appConfig.stationId &&
var info = base._rep.AsQueryable()
.LeftJoin<MesProductOrder>((plan, order) => plan.ProductOrderId == order.ProductOrderId)
.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
{
PlanId = plan.PlanId,
@ -202,7 +205,8 @@ namespace SlnMesnac.Repository.service.Impl
MaterialUnitId = material.MaterialUnitId,
}).ToList();
return info;
}catch(Exception ex)
}
catch (Exception ex)
{
throw new InvalidOperationException($"获取MES计划详细信息异常:{ex.Message}");
}

@ -240,8 +240,8 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<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}" 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 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}" 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>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

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

Loading…
Cancel
Save