前端:增加自动自检和手动重新自检
This commit is contained in:
@ -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 页面加载时任务
|
||||
|
@ -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}"> 清空</Button>
|
||||
</Grid>
|
||||
</GroupBox.Header>
|
||||
|
Reference in New Issue
Block a user