add-添加RFID读取不到手动处理

dev
liuwf 6 days ago
parent 8adda8043b
commit dcf435df4e

@ -322,6 +322,9 @@ namespace SlnMesnac.Business
if (realPalletTask != null) if (realPalletTask != null)
{ {
epcStr = realPalletTask.PalletCode; epcStr = realPalletTask.PalletCode;
}else if (!string.IsNullOrEmpty(debugConfig.MdjOutRFID))
{ //判断人工是否有输入条码
epcStr = debugConfig.MdjOutRFID;
} }
else else
{ {
@ -394,6 +397,7 @@ namespace SlnMesnac.Business
plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), epcStr, 12); plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), epcStr, 12);
// plc.writeByteByAddress(GetPlcAddressByConfigKey("2楼小包出口到位信号"), 2); // plc.writeByteByAddress(GetPlcAddressByConfigKey("2楼小包出口到位信号"), 2);
readRfidAmount = 0; readRfidAmount = 0;
debugConfig.MdjOutRFID = "";
sqlSugarClient.AsTenant().CommitTran(); sqlSugarClient.AsTenant().CommitTran();
#endregion #endregion
} }

@ -169,5 +169,16 @@ namespace SlnMesnac.Config
set { iniHelper.IniWriteValue("system", "ConfigInfoPassWprd", value); } set { iniHelper.IniWriteValue("system", "ConfigInfoPassWprd", value); }
} }
/// <summary>
///小包出口RFID人工输入备用
///读取不到时,人工可以手动输入
/// </summary>
public string MdjOutRFID
{
get { return iniHelper.IniReadValue("system", "MdjOutRFID"); }
set { iniHelper.IniWriteValue("system", "MdjOutRFID", value); }
}
} }
} }

@ -20,6 +20,10 @@
<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="手动输入RFID(异常处理)" x:Name="InputRFIDButton" Foreground="White" FontSize="16" Width="250" Height="50" Background="#007DFA" BorderBrush="#007DFA" Margin="20,0,10,0" Click="InputRFIDButton_Click" />
<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}" /> <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>

@ -1,8 +1,11 @@
using SlnMesnac.WPF.ViewModel; using Microsoft.AspNetCore.Mvc.RazorPages;
using SlnMesnac.Config;
using SlnMesnac.WPF.ViewModel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -21,6 +24,7 @@ namespace SlnMesnac.WPF.Page
/// </summary> /// </summary>
public partial class BaseConfigInfoPage : UserControl public partial class BaseConfigInfoPage : UserControl
{ {
private DebugConfig debugConfig = DebugConfig.Instance;
private BaseConfigInfoViewModel ViewModel; private BaseConfigInfoViewModel ViewModel;
public BaseConfigInfoPage() public BaseConfigInfoPage()
{ {
@ -56,5 +60,27 @@ namespace SlnMesnac.WPF.Page
} }
private void InputRFIDButton_Click(object sender, RoutedEventArgs e)
{
string RFID = Microsoft.VisualBasic.Interaction.InputBox("请输入小包出口RFID", "人工处理", "", -1, -1);
// 定义正则表达式模式
string pattern = @"^JYHB\d{8}$";
// 创建正则表达式对象
Regex regex = new Regex(pattern);
// 校验输入字符串是否符合模式
if (regex.IsMatch(RFID))
{
debugConfig.MdjOutRFID = RFID;
MessageBox.Show("保存成功");
}
else
{
MessageBox.Show($"输入的RFID:{RFID}无效JYHB开头后接8位数字");
}
}
} }
} }

Loading…
Cancel
Save