前端:增加自动自检和手动重新自检

This commit is contained in:
hehaibing-1996
2024-06-11 22:25:54 +08:00
parent a40c17e5dc
commit 7f35077c07
3 changed files with 44 additions and 8 deletions

View File

@ -104,11 +104,6 @@ namespace WCS.WebApi.Controllers
{
try
{
//var shelfs = ShelfManager.Shelves
// .WhereIF(request.GroupNames?.Count > 0, t => request.GroupNames!.Contains(t.GroupName))
// .Select(t => t.ShelfCode)
// .ToList();
//直接返回当前内存中缓存的货架和状态
return await _selfCheckService.StartSelfCheckByGroupName(request.GroupNames);
}
catch (Exception ex)

View File

@ -16,6 +16,7 @@ using 货架标准上位机.Api;
using WCS.Model;
using System.Diagnostics;
using System.Security.Cryptography;
using WCS.Model.ApiModel.Home;
namespace .ViewModel
{
@ -38,6 +39,10 @@ namespace 货架标准上位机.ViewModel
Thread.Sleep(2000);
}
});
#region
SelfCheck();
#endregion
}
#region
@ -63,7 +68,6 @@ namespace 货架标准上位机.ViewModel
WarnInfo.RemoveAll(WarnInfoType.AlwayWarn);
}
public ICommand AddUserControlCommand { get => new DelegateCommand(RefreshUserControl); }
public WrapPanel wrapPanel;
public async void RefreshUserControl()
{
@ -72,7 +76,7 @@ namespace 货架标准上位机.ViewModel
{
var body = new GetShelfStatusRequest()
{
UserName = "xxx",
UserName = LocalStatic.CurrentUser,
DeviceType = "WCS前端",
GroupNames = LocalFile.Config.GroupName,
};
@ -100,6 +104,43 @@ namespace 货架标准上位机.ViewModel
}
}
public ICommand SelfCheckCommand { get => new DelegateCommand(SelfCheck); }
public void SelfCheck()
{
#region
lock (this)
{
try
{
var body = new GetShelfStatusRequest()
{
UserName = LocalStatic.CurrentUser,
DeviceType = "WCS前端",
GroupNames = LocalFile.Config.GroupName,
};
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "home/shelfCheckAll", body, "POST",true);
if (Result != null && Result.Code == 200)
{
}
else
{
}
Thread.Sleep(20);
}
catch (Exception ex)
{
}
finally
{
}
}
#endregion
}
#endregion
#region

View File

@ -48,7 +48,7 @@
<GroupBox.Header>
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">日志</TextBlock>
<Button Grid.Row="2" Command="{Binding AddUserControlCommand}" Background="AliceBlue" Content="手动自检"></Button>
<Button Grid.Row="2" Command="{Binding SelfCheckCommand}" Background="AliceBlue" Content="手 动 自 检" ></Button>
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}">&#xe652; 清空</Button>
</Grid>
</GroupBox.Header>