dev
liuwf 7 days ago
parent f3de131ca6
commit 8405d6a397

@ -285,15 +285,11 @@ namespace SlnMesnac.Business
Thread.Sleep(3000); Thread.Sleep(3000);
continue; continue;
} }
// plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), "JYHB01010125", 12);
if (!plc.readBoolByAddress(GetPlcAddressByConfigKey("2楼小包出口到位信号"))) if (!plc.readBoolByAddress(GetPlcAddressByConfigKey("2楼小包出口到位信号")))
{ {
// _logger.LogInformation("等待小包出口信号触发......");
// 清空RFID
plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), "", 12); plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), "", 12);
Thread.Sleep(5000); Thread.Sleep(5000);
continue; continue;
@ -357,7 +353,7 @@ namespace SlnMesnac.Business
continue; continue;
} }
RefreshMessage($"2F小包出口读取到RFID条码{epcStr},开始绑定流程:"); RefreshMessage($"2F小包出口读取到RFID条码{epcStr},开始入库:");
_mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto); _mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto);
if (productPlanDto == null) if (productPlanDto == null)
@ -382,8 +378,8 @@ namespace SlnMesnac.Business
UpdatePlanInfoAndOrder(productPlanDto); UpdatePlanInfoAndOrder(productPlanDto);
// 删除正在使用的数据库托盘号 // 删除所有数据库托盘号
List<RealPalletTask> realPalletList = _realPalletTaskService.Query(x => x.PalletCode == epcStr); List<RealPalletTask> realPalletList = _realPalletTaskService.Query();
if (realPalletList != null && realPalletList.Count > 0) if (realPalletList != null && realPalletList.Count > 0)
{ {
sqlSugarClient.AsTenant().GetConnection("mes").Deleteable(realPalletList).ExecuteCommand(); sqlSugarClient.AsTenant().GetConnection("mes").Deleteable(realPalletList).ExecuteCommand();

@ -48,7 +48,7 @@ namespace SlnMesnac.Repository.service.Impl
{ {
try try
{ {
return base._rep.GetFirst(x => x.planCode == planCode); return base._rep.GetFirst(x => x.planCode == planCode && x.executeStatus!="2");
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -20,7 +20,7 @@
<Button Content="查 询" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding QuerySearchCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" /> <Button Content="查 询" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding QuerySearchCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" />
<Button Content="重 置" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding ResetSearchCommand}" /> <Button Content="重 置" FontSize="16" Visibility="Collapsed" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding ResetSearchCommand}" />
</StackPanel> </StackPanel>
</Border> </Border>
@ -43,7 +43,7 @@
<TextBox Text="{Binding SelectedItem.IsFlag, ElementName=dgvMH}" x:Name="ConfigFlag" Foreground="White" FontSize="18" Width="200" Height="35"/> <TextBox Text="{Binding SelectedItem.IsFlag, ElementName=dgvMH}" x:Name="ConfigFlag" Foreground="White" FontSize="18" Width="200" Height="35"/>
<!--<Button Content="保存" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding QuerySearchCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" />--> <!--<Button Content="保存" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Command="{Binding QuerySearchCommand}" CommandParameter="{Binding Text, ElementName=queryParam}" />-->
<Button Content="添加" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Click="SaveButton_Click" /> <Button Content="添加" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Visibility="Collapsed" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Click="SaveButton_Click" />
<Button Content="修改" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Click="EditButton_Click" /> <Button Content="修改" FontSize="16" Style="{StaticResource BUTTON_AGREE}" Width="120" Height="35" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Click="EditButton_Click" />
</StackPanel> </StackPanel>
@ -68,7 +68,7 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Button Content="删除" CommandParameter="{Binding ConfigId}" Background="Red" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="Red" BorderThickness="0" Width="100" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/> <Button Content="删除" CommandParameter="{Binding ConfigId}" Visibility="Collapsed" Background="Red" Foreground="White" Margin="10,0,0,0" Height="25" BorderBrush="Red" BorderThickness="0" Width="100" Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn.CellTemplate>

@ -41,13 +41,20 @@ namespace SlnMesnac.WPF.Page
private void EditButton_Click(object sender, RoutedEventArgs e) private void EditButton_Click(object sender, RoutedEventArgs e)
{ {
string configId = ConfigId.Text; var result = MessageBox.Show("确认修改吗","确认框", MessageBoxButton.YesNo, MessageBoxImage.Question);
string configKey = ConfigKey.Text;
string configName = ConfigName.Text; if (result == MessageBoxResult.Yes)
string configValue = ConfigValue.Text; {
string configFlag = ConfigFlag.Text; string configId = ConfigId.Text;
// 调用 ViewModel 中的方法并传递参数 string configKey = ConfigKey.Text;
ViewModel.Edit(configId,configKey, configName, configValue, configFlag); string configName = ConfigName.Text;
string configValue = ConfigValue.Text;
string configFlag = ConfigFlag.Text;
// 调用 ViewModel 中的方法并传递参数
ViewModel.Edit(configId, configKey, configName, configValue, configFlag);
}
} }
} }
} }

@ -838,13 +838,13 @@ namespace SlnMesnac.WPF.Page
if (unpackStatus) if (unpackStatus)
{ {
recipeManageCache.SystemStatus = "1"; recipeManageCache.SystemStatus = "1";
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StartButton.IsEnabled = true;
}));
MessageBoxAndLog("一键启动所有机器成功!"); MessageBoxAndLog("一键启动所有机器成功!");
} }
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StartButton.IsEnabled = true;
}));
}); });
} }
@ -853,9 +853,9 @@ namespace SlnMesnac.WPF.Page
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
Msg.MsgShow($"一键启动异常:{ex.Message}", 2, 5); Msg.MsgShow($"一键启动异常:{ex.Message}", 2, 5);
StartButton.IsEnabled = true;
}); });
StartButton.IsEnabled = true;
} }
} }
@ -896,13 +896,14 @@ namespace SlnMesnac.WPF.Page
runtime.ConfigValue = timeRangeSet.ConfigValue; runtime.ConfigValue = timeRangeSet.ConfigValue;
_configInfoBusiness.UpdateConfigInfo(runtime); _configInfoBusiness.UpdateConfigInfo(runtime);
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StopButton.IsEnabled = true;
}));
} }
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StopButton.IsEnabled = true;
}));
}); });
#endregion #endregion
@ -912,9 +913,10 @@ namespace SlnMesnac.WPF.Page
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
Msg.MsgShow($"一键停止:{ex.Message}", 2, 5); Msg.MsgShow($"一键停止:{ex.Message}", 2, 5);
StopButton.IsEnabled = true;
}); });
StopButton.IsEnabled = true;
} }
} }
} }

@ -6,7 +6,8 @@
xmlns:local="clr-namespace:SlnMesnac.WPF.Page" xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
xmlns:local1="clr-namespace:SlnMesnac.WPF.Converter.ProdMgmt" xmlns:local1="clr-namespace:SlnMesnac.WPF.Converter.ProdMgmt"
mc:Ignorable="d" Topmost="True" mc:Ignorable="d" Topmost="True"
Title="投料管理" Height="750" Width="1000" Background="White" Name="window" WindowStartupLocation="CenterOwner"> Title="投料管理" Height="750" Width="1000" Background="White" Name="window" WindowStartupLocation="CenterOwner"
StateChanged="Window_StateChanged">
<Control.Resources> <Control.Resources>
<local1:PlanStatusConverter x:Key="PlanStatusConverter" /> <local1:PlanStatusConverter x:Key="PlanStatusConverter" />
<local1:PlanAmountConverter x:Key="PlanAmountConverter" /> <local1:PlanAmountConverter x:Key="PlanAmountConverter" />

@ -26,5 +26,13 @@ namespace SlnMesnac.WPF.Page
this.DataContext = new ManualDeliveryViewModel(); this.DataContext = new ManualDeliveryViewModel();
} }
private void Window_StateChanged(object sender, EventArgs e)
{
if (this.WindowState == WindowState.Minimized)
{
this.Close(); // 当窗口最小化时关闭窗口
}
}
} }
} }

Loading…
Cancel
Save