提供给员工手动处理货架状态不一致的按钮
This commit is contained in:
@ -124,6 +124,11 @@ namespace WCS.BLL.HardWare
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void Reset();
|
public void Reset();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 板子与货架状态不一致的复位(未响应的复位)
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 货架自检
|
/// 货架自检
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -95,6 +95,11 @@ namespace WCS.BLL.HardWare
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCurrentMode(Mode mode)
|
public void SetCurrentMode(Mode mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -923,6 +923,31 @@ namespace WCS.BLL.HardWare
|
|||||||
SetCurrentMode(Mode.待机模式);
|
SetCurrentMode(Mode.待机模式);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 板子与货架状态不一致的复位(未响应的复位)
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
//不是待机模式不发送指令
|
||||||
|
if (CurrentMode != Mode.待机模式)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//获取状态不一致的板子
|
||||||
|
var modules = Modules.Where(t => t.IsEnable && t.CurrentMode != Mode.待机模式)
|
||||||
|
.ToList();
|
||||||
|
if (modules != null && modules.Count > 0)
|
||||||
|
{
|
||||||
|
modules.ForEach(t =>
|
||||||
|
{
|
||||||
|
//复位状态不一致的板子
|
||||||
|
Logs.Write($"复位模组【{t.ModuleCode}({t.CurrentMode})】发送指令成功!");
|
||||||
|
t.Reset(TcpCleint);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void QueryVoltage(int moduleId)
|
public void QueryVoltage(int moduleId)
|
||||||
{
|
{
|
||||||
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
|
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
|
||||||
|
@ -239,6 +239,42 @@ namespace WCS.WebApi.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 重置货架的状态 使其回到待机模式
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[Route("noResponseReset")]
|
||||||
|
[HttpPost(Name = "noResponseReset")]
|
||||||
|
public async Task<ResponseBase> noResponseReset(RequestBase request)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var shelfs = new List<IShelfBase>();
|
||||||
|
shelfs = ShelfManager.Shelves
|
||||||
|
.Where(t => t.CurrentMode == Mode.待机模式)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var shelf in shelfs)
|
||||||
|
{
|
||||||
|
shelf.NoResponseReset();
|
||||||
|
}
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 200,
|
||||||
|
Message = "success",
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return new ResponseBase()
|
||||||
|
{
|
||||||
|
Code = 300,
|
||||||
|
Message = ex.Message,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -61,6 +61,37 @@ namespace 智能仓储WCS管理系统.ViewModel
|
|||||||
Growl.Error("打开文件夹失败。");
|
Growl.Error("打开文件夹失败。");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICommand NoResponseResetCommand { get => new DelegateCommand(NoResponseReset); }
|
||||||
|
/// <summary>
|
||||||
|
/// 打开用户
|
||||||
|
/// </summary>
|
||||||
|
public void NoResponseReset()
|
||||||
|
{
|
||||||
|
var result = HandyControl.Controls.MessageBox.Show("此功能用于“未成功退出入库、出库”等异常提示\r\n建议所有货架都处于待机模式时使用,继续复位请点击[确定]", "提示", MessageBoxButton.OKCancel);
|
||||||
|
if (result == MessageBoxResult.Cancel)
|
||||||
|
return;
|
||||||
|
#region 调用接口 请求重置所有货架的状态
|
||||||
|
var body = new RequestBase()
|
||||||
|
{
|
||||||
|
UserName = LocalStatic.CurrentUser,
|
||||||
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
|
};
|
||||||
|
var Result = ApiHelp.GetDataFromHttp<ResponseBase>(LocalFile.Config.ApiIpHost + "home/noResponseReset", body, "POST");
|
||||||
|
if (Result != null && Result.Code == 200)
|
||||||
|
{
|
||||||
|
Growl.Warning("已给状态不一致的板子发送复位指令,建议点击第一个按钮[货架状态初始化]重置所有货架状态!");
|
||||||
|
}
|
||||||
|
else if (Result != null)
|
||||||
|
{
|
||||||
|
Growl.Warning(Result.Message);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Growl.Warning("调用接口失败!");
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeviceReadModel : BindableBase
|
public class DeviceReadModel : BindableBase
|
||||||
|
@ -18,6 +18,11 @@
|
|||||||
<Button Margin="5,3" Padding="30,0" Name="resetShelf" Content="货架状态初始化" Command="{Binding ResetAllShelfCommand}"></Button>
|
<Button Margin="5,3" Padding="30,0" Name="resetShelf" Content="货架状态初始化" Command="{Binding ResetAllShelfCommand}"></Button>
|
||||||
|
|
||||||
<Button Margin="5,3" Padding="30,0" Content="打开打印模板路径" Command="{Binding BarcodePrintTemplateCommand}"></Button>
|
<Button Margin="5,3" Padding="30,0" Content="打开打印模板路径" Command="{Binding BarcodePrintTemplateCommand}"></Button>
|
||||||
|
|
||||||
|
<Button Margin="5,3"
|
||||||
|
Padding="30,0"
|
||||||
|
Content="未成功退出模式的模组复位"
|
||||||
|
Command="{Binding NoResponseResetCommand}"></Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user