dev
liuwf 7 days ago
parent f3de131ca6
commit 8405d6a397

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

@ -48,7 +48,7 @@ namespace SlnMesnac.Repository.service.Impl
{
try
{
return base._rep.GetFirst(x => x.planCode == planCode);
return base._rep.GetFirst(x => x.planCode == planCode && x.executeStatus!="2");
}
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 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>
</Border>
@ -43,7 +43,7 @@
<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" 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" />
</StackPanel>
@ -68,7 +68,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<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>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

@ -41,13 +41,20 @@ namespace SlnMesnac.WPF.Page
private void EditButton_Click(object sender, RoutedEventArgs e)
{
string configId = ConfigId.Text;
string configKey = ConfigKey.Text;
string configName = ConfigName.Text;
string configValue = ConfigValue.Text;
string configFlag = ConfigFlag.Text;
// 调用 ViewModel 中的方法并传递参数
ViewModel.Edit(configId,configKey, configName, configValue, configFlag);
var result = MessageBox.Show("确认修改吗","确认框", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
string configId = ConfigId.Text;
string configKey = ConfigKey.Text;
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)
{
recipeManageCache.SystemStatus = "1";
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StartButton.IsEnabled = true;
}));
MessageBoxAndLog("一键启动所有机器成功!");
}
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StartButton.IsEnabled = true;
}));
});
}
@ -853,9 +853,9 @@ namespace SlnMesnac.WPF.Page
Application.Current.Dispatcher.Invoke(() =>
{
Msg.MsgShow($"一键启动异常:{ex.Message}", 2, 5);
StartButton.IsEnabled = true;
});
StartButton.IsEnabled = true;
}
}
@ -896,13 +896,14 @@ namespace SlnMesnac.WPF.Page
runtime.ConfigValue = timeRangeSet.ConfigValue;
_configInfoBusiness.UpdateConfigInfo(runtime);
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StopButton.IsEnabled = true;
}));
}
App.Current.Dispatcher.BeginInvoke((Action)(() =>
{
StopButton.IsEnabled = true;
}));
});
#endregion
@ -912,9 +913,10 @@ namespace SlnMesnac.WPF.Page
Application.Current.Dispatcher.Invoke(() =>
{
Msg.MsgShow($"一键停止:{ex.Message}", 2, 5);
StopButton.IsEnabled = true;
});
StopButton.IsEnabled = true;
}
}
}

@ -6,7 +6,8 @@
xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
xmlns:local1="clr-namespace:SlnMesnac.WPF.Converter.ProdMgmt"
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>
<local1:PlanStatusConverter x:Key="PlanStatusConverter" />
<local1:PlanAmountConverter x:Key="PlanAmountConverter" />

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

Loading…
Cancel
Save