前端:增加自动自检和手动重新自检
This commit is contained in:
@ -104,11 +104,6 @@ namespace WCS.WebApi.Controllers
|
|||||||
{
|
{
|
||||||
try
|
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);
|
return await _selfCheckService.StartSelfCheckByGroupName(request.GroupNames);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -16,6 +16,7 @@ using 货架标准上位机.Api;
|
|||||||
using WCS.Model;
|
using WCS.Model;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
using WCS.Model.ApiModel.Home;
|
||||||
|
|
||||||
namespace 货架标准上位机.ViewModel
|
namespace 货架标准上位机.ViewModel
|
||||||
{
|
{
|
||||||
@ -38,6 +39,10 @@ namespace 货架标准上位机.ViewModel
|
|||||||
Thread.Sleep(2000);
|
Thread.Sleep(2000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#region 启动自检
|
||||||
|
SelfCheck();
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 绑定
|
#region 绑定
|
||||||
@ -63,7 +68,6 @@ namespace 货架标准上位机.ViewModel
|
|||||||
WarnInfo.RemoveAll(WarnInfoType.AlwayWarn);
|
WarnInfo.RemoveAll(WarnInfoType.AlwayWarn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand AddUserControlCommand { get => new DelegateCommand(RefreshUserControl); }
|
|
||||||
public WrapPanel wrapPanel;
|
public WrapPanel wrapPanel;
|
||||||
public async void RefreshUserControl()
|
public async void RefreshUserControl()
|
||||||
{
|
{
|
||||||
@ -72,7 +76,7 @@ namespace 货架标准上位机.ViewModel
|
|||||||
{
|
{
|
||||||
var body = new GetShelfStatusRequest()
|
var body = new GetShelfStatusRequest()
|
||||||
{
|
{
|
||||||
UserName = "xxx",
|
UserName = LocalStatic.CurrentUser,
|
||||||
DeviceType = "WCS前端",
|
DeviceType = "WCS前端",
|
||||||
GroupNames = LocalFile.Config.GroupName,
|
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
|
#endregion
|
||||||
|
|
||||||
#region 页面加载时任务
|
#region 页面加载时任务
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
<GroupBox.Header>
|
<GroupBox.Header>
|
||||||
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
<Grid Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type GroupBox}}}">
|
||||||
<TextBlock Margin="5,0" HorizontalAlignment="Left" VerticalAlignment="Center">日志</TextBlock>
|
<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>
|
<Button HorizontalAlignment="Right" Height="25" Margin="10,0" Padding="10,0" FontFamily="{StaticResource IconFont}" Command="{Binding ClearTextInfoCommand}"> 清空</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox.Header>
|
</GroupBox.Header>
|
||||||
|
Reference in New Issue
Block a user