增加取消任务接口
This commit is contained in:
@ -143,6 +143,12 @@ namespace WCS.BLL.DbModels
|
||||
[SugarColumn(ColumnName = "is_suspended", IsNullable = false, ColumnDescription = "任务是否被挂起 用于入库时取消入库,还没切换库位时 认为任务被挂起")]
|
||||
public bool IsSuspended { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 任务是否被取消
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "is_cancel", IsNullable = false, ColumnDescription = "任务是否被取消")]
|
||||
public bool IsCancel { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// 任务是否已发送至标签
|
||||
/// </summary>
|
||||
|
@ -26,22 +26,6 @@ namespace WCS.BLL.Manager
|
||||
public static void InitBackgroundThread()
|
||||
{
|
||||
#region 调用WMS接口获取具体的库存列表并展示在液晶标签上
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// while (true)
|
||||
// {
|
||||
// //每5秒同步一次
|
||||
// Thread.Sleep(5000);
|
||||
// try
|
||||
// {
|
||||
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Logs.Write("【定时任务】刷新库存显示时发生异常!" + ex.Message);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
#endregion
|
||||
|
||||
#region 定时任务:回传数据至WMS系统
|
||||
@ -244,71 +228,6 @@ namespace WCS.BLL.Manager
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
//#region 定时任务:监测警示灯关灯机制
|
||||
////判断灯颜色和模式是否对应
|
||||
//Task.Run(() =>
|
||||
//{
|
||||
// while (true)
|
||||
// {
|
||||
// //间隔5秒查询一次
|
||||
// Thread.Sleep(5000);
|
||||
// try
|
||||
// {
|
||||
// //待机模式未关灯
|
||||
// var shelves = ShelfManager.Shelves.Where(t => t.CurrentMode == TaskModeEnum.待机模式 && t.LightColor != WarningLight.LightColorEnum.关闭)
|
||||
// .Where(t => t.SetCurrentModeTime < DateTime.Now.AddSeconds(-5))
|
||||
// .ToList();
|
||||
// foreach (var shelf in shelves)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// if (shelf is SmartShelf)
|
||||
// {
|
||||
// var smartShelf = (SmartShelf)shelf;
|
||||
// if (smartShelf.IsWarning == false)
|
||||
// {
|
||||
// smartShelf?.WarningLight.CloseLight(smartShelf.TcpCleint);
|
||||
// Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发送指令成功!");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Logs.Write($"【定时任务】:监测警示灯关灯机制,关【{shelf.ShelfCode}】灯发生异常" + ex.Message);
|
||||
// }
|
||||
// }
|
||||
|
||||
// //出库模式未亮灯
|
||||
// var outShelves = ShelfManager.Shelves.Where(t => t.CurrentMode == TaskModeEnum.出库模式 && t.LightColor == WarningLight.LightColorEnum.关闭)
|
||||
// .Where(t => t.SetCurrentModeTime < DateTime.Now.AddSeconds(-5))
|
||||
// .ToList();
|
||||
// foreach (var shelf in outShelves)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// if (shelf is SmartShelf)
|
||||
// {
|
||||
// var smartShelf = (SmartShelf)shelf;
|
||||
// smartShelf?.WarningLight.GreenLight(smartShelf.TcpCleint);
|
||||
// Logs.Write($"【定时任务】:监测警示灯关灯机制,出库开灯【{shelf.ShelfCode}】发送指令成功!");
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Logs.Write($"【定时任务】:监测警示灯关灯机制,出库开灯【{shelf.ShelfCode}】发生异常" + ex.Message);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Logs.Write("【定时任务】:监测警示灯关灯机制发生异常" + ex.Message);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
//#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user