1.WebSocket登录注册

2.数据重发机制
This commit is contained in:
hehaibing-1996
2024-05-17 15:12:07 +08:00
parent c8ce453f74
commit 649e22b4ce
17 changed files with 200 additions and 163 deletions

View File

@ -28,6 +28,7 @@ using System.Collections.ObjectModel;
using WCS.BLL.DbModels;
using WCS.Model.ApiModel.MatBaseInfo;
using System.Security.Cryptography;
using Ping9719.WpfEx;
namespace .ViewModel
{
@ -259,6 +260,33 @@ namespace 货架标准上位机.ViewModel
if (Result != null && Result.Code == 200)
{
scanner.MatSn = Result.Data.MatSN;
#region
Task.Run(() =>
{
try
{
var body = new QueryByMatSnRequest()
{
MatSn = scanner.MatSn,
ShelfCode = scanner.ShelfCode,
IpAddress = scanner.COM,
DeviceType = LocalFile.Config.DeviceType,
UserName = LocalStatic.CurrentUser,
};
var Result = ApiHelp.GetDataFromHttp<ResponseCommon<MatInfoModel>>(LocalFile.Config.ApiIpHost + "instore/queryInstoreStatus", body, "POST");
if (Result != null && !string.IsNullOrEmpty(Result.Message))
{
TextBoxLog.AddLog(Result.Message, "InstoreLog", DateTime.Now);
scanner.MatSn = string.Empty;
scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn);
}
}
catch (Exception ex)
{
Growl.Warning(ex.Message);
}
});
#endregion
}
else if (Result != null && !string.IsNullOrEmpty(Result.Message))
{

View File

@ -291,10 +291,10 @@
<!--状态栏-->
<Border Margin="5,3" Grid.Row="2" Grid.ColumnSpan="2" Background="AliceBlue" CornerRadius="3">
<Grid>
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
<!--<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Left">
<pi:IotState Content="WebSocket连接" IsOk="False" Height="auto" Width="auto" InteriorHeight="13" Foreground="Gray" Background="{x:Null}"></pi:IotState>
<Button Content="手动重连" ></Button>
</StackPanel>
</StackPanel>-->
<StackPanel Margin="5" Orientation="Horizontal" HorizontalAlignment="Right">
<TextBlock Margin="0,0" Text="{Binding Time,StringFormat=yyyy-MM-dd HH:mm:ss,FallbackValue=2000-01-01 00:00:00}" Foreground="#FF3A90C1" VerticalAlignment="Center"></TextBlock>
</StackPanel>

View File

@ -69,6 +69,7 @@ namespace 货架标准上位机
{
UserName = loginName,
DeviceType = LocalFile.Config.DeviceType,
GroupNames = LocalFile.Config.GroupName,
PassWord = pass,
IsNoLogin = false,
};

View File

@ -4,13 +4,13 @@
//货架服务器的IP和端口号
"ApiIpHost": "http://localhost:8888/",
//货架分区
"GroupName": [ "A", "B", "C" ],
"GroupName": [ "13寸智能货架", "7寸智能货架"],
//设备类型 可以配置为每个电脑不一样
"DeviceType": "WCS前端-开发电脑",
"DeviceType": "WCS前端",
//货架类型的是否开机自检
"IsBootSelfTest": false,
//扫码枪COM口列表
"ScannerComList": [ "COM1", "COM2" ],
"ScannerComList": [],
//串口扫码枪延时
"ScannerTimeOut": 2000,
//系统配置