|
|
@@ -1,4 +1,5 @@ |
|
|
|
using DataVAPI.Controllers; |
|
|
|
using DataVApi.Order; |
|
|
|
using DataVAPI.Controllers; |
|
|
|
using DataVAPI.Model; |
|
|
|
using DataVAPI.Tool; |
|
|
|
using DataVAPI.Tool.IOT; |
|
|
@@ -23,8 +24,10 @@ namespace DataVAPI.UpAndDown |
|
|
|
public DeviceController deviceController { get; set; } |
|
|
|
public LogController logController { get; set; } |
|
|
|
public ScreenController screenController { get; set; } |
|
|
|
public AlarmController alarmController { get; set; } |
|
|
|
public OrderProvider orderProvider { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 不需要监听 |
|
|
|
private static ProcessServer _instance; |
|
|
|
public static ProcessServer Instance |
|
|
@@ -40,8 +43,9 @@ namespace DataVAPI.UpAndDown |
|
|
|
{ |
|
|
|
deviceController = new DeviceController(); |
|
|
|
logController = new LogController(); |
|
|
|
alarmController = new AlarmController(); |
|
|
|
screenController = new ScreenController(); |
|
|
|
|
|
|
|
orderProvider = new OrderProvider(); |
|
|
|
} |
|
|
|
#endregion |
|
|
|
/// <summary> |
|
|
@@ -69,9 +73,53 @@ namespace DataVAPI.UpAndDown |
|
|
|
Subscribe(IOTDevServer.HeartbeatSubTopic); |
|
|
|
|
|
|
|
IOTDevServer.DevIOTAction += DevIOTActionHandler; |
|
|
|
|
|
|
|
//执行队列任务 |
|
|
|
QueueTask(); |
|
|
|
ConsoleHelper.WriteSuccessLine("开始接收数据,执行队列任务!"); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 队列任务 |
|
|
|
/// </summary> |
|
|
|
private void QueueTask() |
|
|
|
{ |
|
|
|
Executer.GetInstance().Start(new Action(() => |
|
|
|
{ |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
if (IOTDevServer.GetInstance().GetIsConnected()) |
|
|
|
{ |
|
|
|
|
|
|
|
SentData(null); |
|
|
|
|
|
|
|
FindDataAlarm(); |
|
|
|
|
|
|
|
Thread.Sleep(3000); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
ConsoleHelper.WriteErrorLine(ex.Message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}), "队列任务执行"); |
|
|
|
} |
|
|
|
|
|
|
|
public void FindDataAlarm() |
|
|
|
{ |
|
|
|
devModel?.operatingDeviceStatus.data?.ForEach(par => |
|
|
|
{ |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(par.clientId)) |
|
|
|
{ |
|
|
|
JsonMsg<List<AlarmTable>> jsonMsg = alarmController.QueryClientId(par.clientId); |
|
|
|
par.IsAlarm = (jsonMsg.obj != null && jsonMsg.obj.data != null && jsonMsg.obj.data.Count > 0)?true:false;//ApiGetAlarm(par.clientId); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 加载店铺信息 |
|
|
@@ -173,6 +221,12 @@ namespace DataVAPI.UpAndDown |
|
|
|
LoadingShopInformation(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
devModel.OrderLine = orderProvider.OrderLine(new DataVApi.Order.RequestModel.FullScreenBasic()); |
|
|
|
devModel.OrderDataState = orderProvider.GetAllOrderDataState(new DataVApi.Order.RequestModel.FullScreenInput()); devModel.OrderDataState = orderProvider.GetAllOrderDataState(new DataVApi.Order.RequestModel.FullScreenInput()); |
|
|
|
devModel.LocSale = orderProvider.GetLocSale(); |
|
|
|
devModel.OrderNumber = orderProvider.OrderNumber(new DataVApi.Order.RequestModel.FullScreenBasic()); |
|
|
|
|
|
|
|
ScreenMonitorModel screen1Monitor = Tools.JsonToObjectTools<ScreenMonitorModel>(devModel.ToJSON()); |
|
|
|
#region 1.设置data默认值 |
|
|
|
if (screen1Monitor.operatingDeviceStatus.data.Count == 0) |
|
|
|