change-条码绑定添加数据采集模块

main
liuwf 10 months ago
parent abc138f620
commit 9cbadc5a7e

@ -68,7 +68,7 @@ namespace Admin.Core.Socket
return EasyTask.CompletedTask;
};//有客户端正在连接
service.Connected = (client, e) => { client.Logger.Info($"{client.IP}:{client.Port} 客户端连接成功!目前客户端连接数{service.Count}");
log.Info($"{client.IP}:{client.Port} 客户端连接成功!目前客户端连接数{service.Count}");
SetProdStoreClientId(client);
return EasyTask.CompletedTask;
@ -89,6 +89,7 @@ namespace Admin.Core.Socket
try
{
var mes = Encoding.UTF8.GetString(e.ByteBlock.Buffer, 0, e.ByteBlock.Len);//注意数据长度是byteBlock.Len
log.Info("原始报文:"+mes);
//心跳包
if (mes== "heartbeat")
{
@ -104,6 +105,7 @@ namespace Admin.Core.Socket
}
else
{
log.Info("条码报文:" + mes);
ReceiveCodeDelegateEvent?.Invoke(client.IP,mes);
client.Logger.Info($"已从{client.IP}:{client.Port}》接收到信息:{mes}");
}

@ -223,7 +223,7 @@
"Enabled": true,
//"IP": "127.0.0.1",
// "Port": 6000
"IP": "10.10.92.72",
"IP": "10.10.92.70",
"Port": 2014
},
{
@ -232,7 +232,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.92.22",
"Port": 2015
"Port": 2014
},
{
"Id": 3,
@ -240,7 +240,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.92.29",
"Port": 2015
"Port": 2014
},
{
"Id": 4,
@ -248,7 +248,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.92.10",
"Port": 2015
"Port": 2014
},
{
"Id": 5,
@ -256,7 +256,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.92.1",
"Port": 2015
"Port": 2014
},
{
"Id": 6,
@ -264,7 +264,7 @@
"PlcType": "Melsec",
"Enabled": true,
"IP": "10.10.92.49",
"Port": 2015
"Port": 2014
},
{
"Id": 7,

@ -26,7 +26,7 @@ namespace Aucma.Core.Palletiz.ViewModels
/// <summary>
/// 扫描记录刷新
/// </summary>
public delegate void RefreshInfo();
public delegate Task RefreshInfo();
public static event RefreshInfo? RefreshInfoEvent;

@ -32,15 +32,15 @@ namespace Aucma.Core.Palletiz.ViewModels
#region 加载DataGrid数据
private async void LoadData()
private async Task LoadData()
{
//Task.Run(() =>
//{
await Task.Run(() =>
{
try
{
List<RecordInStore> list = await _recordInstoreServices.QueryAsync(x => (x.StoreCode == storeCodeA || x.StoreCode == storeCodeB) && x.InStoreTime >= DateTime.Today);
List<RecordInStore> list = _recordInstoreServices.QueryAsync(x => (x.StoreCode == storeCodeA || x.StoreCode == storeCodeB) && x.InStoreTime >= DateTime.Today).Result;
if (list != null && list.Count > 0)
{
list.OrderByDescending(x => x.InStoreTime);
@ -58,7 +58,7 @@ namespace Aucma.Core.Palletiz.ViewModels
Console.WriteLine("" + ex.Message.ToString());
}
// });
});
//MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
@ -84,8 +84,10 @@ namespace Aucma.Core.Palletiz.ViewModels
/// 查询
/// </summary>
[RelayCommand]
private void ExecQuery(object obj)
private async Task ExecQuery(object obj)
{
await Task.Run(() =>
{
string result = (string)obj;
List<RecordInStore> list = _recordInstoreServices.QueryAsync(x => (x.StoreCode == storeCodeA || x.StoreCode == storeCodeB) && x.BarCodeCode.Contains(result)).Result;
@ -100,11 +102,7 @@ namespace Aucma.Core.Palletiz.ViewModels
});
}
}
});
}
#endregion
}

Loading…
Cancel
Save