1.该订单最后一个货架结束入库

This commit is contained in:
hehaibing-1996
2024-05-31 17:03:54 +08:00
parent 46321e340b
commit a87a93ea11
9 changed files with 78 additions and 21 deletions

View File

@ -449,9 +449,28 @@ namespace WCS.BLL.HardWare
CurrentOutStoreMatSNs.Clear(); CurrentOutStoreMatSNs.Clear();
WarningLight.CloseLight(TcpCleint); WarningLight.CloseLight(TcpCleint);
//this.CurrentMode = Mode.待机模式;
SetCurrentMode(Mode.); SetCurrentMode(Mode.);
Logs.Write($"货架【{ShelfCode}】,结束退出出库", LogsType.Outstore); Logs.Write($"货架【{ShelfCode}】,结束退出出库", LogsType.Outstore);
Task.Run(() =>
{
//判断是否是当前订单最后一个出库货架
var isOuting = ShelfManager.Shelves.Where(t => t.CurrentMode == Mode. && t.OrderNumber == OrderNumber)
.Any();
//WebSocket通知前台以更新左侧出库单列表的状态
if (!isOuting )
{
#region WebSocket
var messageMode = new WebSocketMessageModel()
{
IsWarning = false,
ClientIp = WebSocketIpAddress,
WarningType = WarningTypeEnum.,
};
WarningManager.SendWarning(messageMode);
#endregion
}
});
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1551,6 +1570,7 @@ namespace WCS.BLL.HardWare
{ {
GoOutOutstore(); GoOutOutstore();
}); });
//看是否是分批次出库的情况 分批次亮灯 //看是否是分批次出库的情况 分批次亮灯
Task.Run(async () => Task.Run(async () =>
{ {
@ -1628,7 +1648,6 @@ namespace WCS.BLL.HardWare
shelf.GoInOutstore(matDetails, outOrder); shelf.GoInOutstore(matDetails, outOrder);
shelf.OrderNumber = outOrder.OrderNumber; shelf.OrderNumber = outOrder.OrderNumber;
}); });
} }
else else
{ {

View File

@ -34,17 +34,18 @@ namespace WCS.BLL.Manager
}; };
}); });
DbHelp.dbLog = new SqlSugarScope(new ConnectionConfig() //sqlserver保存接口日志时因为每个字段要限制长度当接口返回内容长度过长会报错
{ //DbHelp.dbLog = new SqlSugarScope(new ConnectionConfig()
ConnectionString = LocalFile.Config.LogDbPath, //{
DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite]; // ConnectionString = LocalFile.Config.LogDbPath,
IsAutoCloseConnection = true // DbType = DbType.SqlServer,//[Sqlite]安装[System.Data.SQLite];
}, db => // IsAutoCloseConnection = true
{ //}, db =>
db.Aop.OnError = ex => //{
{ // db.Aop.OnError = ex =>
}; // {
}); // };
//});
AuthDbHelp.db = new SqlSugarScope(new ConnectionConfig() AuthDbHelp.db = new SqlSugarScope(new ConnectionConfig()
{ {

View File

@ -82,6 +82,30 @@ namespace WCS.BLL.Tool
return data.ToArray(); return data.ToArray();
} }
public static byte[] Query()
{
byte[] data2 = new byte[4];
data2[0] = 0xff;
data2[1] = 0x03;
data2[2] = 0x00;
data2[3] = 0x06;
byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
return senddata2;
}
public static byte[] SetId()
{
byte[] data2 = new byte[6];
data2[0] = 0xff;
data2[1] = 0x04;
data2[2] = 0x00;
data2[3] = 0x08;
data2[4] = 0x03;
data2[5] = 0x01;
byte[] senddata2 = Tool.Helper.Crc16(data2, data2.Length, true);
return senddata2;
}
//出库库位灯亮灯 //出库库位灯亮灯
public static byte[] OutstoreLight(List<int> board_id, string lightcolor,int status) public static byte[] OutstoreLight(List<int> board_id, string lightcolor,int status)
{ {
@ -201,7 +225,8 @@ namespace WCS.BLL.Tool
data1[4] = (byte)lightid; data1[4] = (byte)lightid;
data1[5] = 0x03; data1[5] = 0x03;
data1[6] = 0x02; data1[6] = 0x02;
data1[7] = 0x02; //data1[7] = 0x02;
data1[7] = 0x00;
byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true); byte[] senddata1 = Tool.Helper.Crc16(data1, data1.Length, true);
return senddata1; return senddata1;
} }

View File

@ -56,11 +56,13 @@ namespace WCS.Model.WebSocketModel
= 12, = 12,
= 13, = 13,
退 = 14, 退 = 14,
//通知类 //通知类
= 50, = 50,
= 51, = 51,
= 52, = 52,
= 53, = 53,
= 54, = 54,
= 55,
} }
} }

View File

@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
using WCS.BLL.HardWare; using WCS.BLL.HardWare;
using WCS.BLL.Manager; using WCS.BLL.Manager;
using WCS.BLL.Services.IService; using WCS.BLL.Services.IService;
using WCS.BLL.Tool;
using WCS.Model; using WCS.Model;
namespace WebApi.Controllers namespace WebApi.Controllers
@ -141,9 +142,12 @@ namespace WebApi.Controllers
//TODO:<3A><><EFBFBD><EFBFBD> <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD> //TODO:<3A><><EFBFBD><EFBFBD> <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
try try
{ {
var aa = Helper.Query();
var bb = Helper.SetId();
return await _instoreService.queryInstoreStatusSingle(request); return await _instoreService.queryInstoreStatusSingle(request);
//ShelfManager. //ShelfManager.
// //
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -82,7 +82,7 @@ namespace WCS.WebApi.Controllers
var logRecord = new SystemApiLogRecord() var logRecord = new SystemApiLogRecord()
{ {
DeviceIp = context?.Connection?.RemoteIpAddress?.ToString(), DeviceIp = context?.Connection?.RemoteIpAddress?.ToString(),
RequestUrl = context.Request?.Path, RequestUrl = context.Request?.Path.ToString(),
RequestBody = requestBody, RequestBody = requestBody,
QueryString = context.Request?.QueryString.ToString(), QueryString = context.Request?.QueryString.ToString(),
IsResponse = true, IsResponse = true,

View File

@ -281,6 +281,10 @@ namespace 货架标准上位机.ViewModel
{ {
DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data); DataGridItemSource = new ObservableCollection<OutOrderMatDetailModel>(Result.Data);
OrderStatus = Result.Message; OrderStatus = Result.Message;
if (OrderStatus == OutOrderStatus..ToString())
{
//全部发料就默认所有货架结束了这个单子
}
} }
else else
{ {

View File

@ -15,8 +15,6 @@
<RowDefinition Height="0.9*"></RowDefinition> <RowDefinition Height="0.9*"></RowDefinition>
<RowDefinition Height="0.9*"></RowDefinition> <RowDefinition Height="0.9*"></RowDefinition>
<RowDefinition Height="9*"></RowDefinition> <RowDefinition Height="9*"></RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0"> <Border Grid.Row="0" Margin="0" Background="AliceBlue" Padding="0">
@ -28,12 +26,9 @@
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15" <Button Style="{StaticResource ButtonSuccess}" hc:BorderElement.CornerRadius="15"
Grid.Column="3" MinHeight="45" FontSize="28" Content="&#xec61;完整发料" FontFamily="{StaticResource IconFont}" Grid.Column="3" MinHeight="45" FontSize="28" Content="&#xec61;完整发料" FontFamily="{StaticResource IconFont}"
Command="{Binding BtnStartCommand}" Command="{Binding BtnStartCommand}">
>
</Button> </Button>
<Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15" <Button Style="{StaticResource ButtonWarning}" hc:BorderElement.CornerRadius="15"
Grid.Column="4" MinHeight="45" FontSize="28" Content="&#xe61b;取消发料" FontFamily="{StaticResource IconFont}" Grid.Column="4" MinHeight="45" FontSize="28" Content="&#xe61b;取消发料" FontFamily="{StaticResource IconFont}"

View File

@ -105,6 +105,13 @@ namespace 货架标准上位机
OutVentoryView.viewModel.RefreshDataGridItemSource(); OutVentoryView.viewModel.RefreshDataGridItemSource();
client.Send(e.DataFrame.ToText()); client.Send(e.DataFrame.ToText());
break; break;
case WarningTypeEnum.:
if (LocalFile.Config.IsMx)
MXOutInventoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
else
OutVentoryView.viewModel.RefreshOutOrderList(MXOutInventoryView.viewModel.SelectedOutOrderNumber);
client.Send(e.DataFrame.ToText());
break;
case WarningTypeEnum.: case WarningTypeEnum.:
StockTakingView.viewModel.RefreshDataGridItemSource(); StockTakingView.viewModel.RefreshDataGridItemSource();
client.Send(e.DataFrame.ToText()); client.Send(e.DataFrame.ToText());