public async Task <OutsideLogisticsControlResult> LogisticsControl([FromBody] OutsideLogisticsControlArg arg) { string equipmentId = "E" + DateTime.Now.ToString("HHmmss"); string equipmentName = "设备" + DateTime.Now.ToString("HHmmss"); lock (_logistics) { if (!_logistics.ContainsKey(arg.LogisticsId)) { _logistics.Add(arg.LogisticsId, new LogisticsTask() { EquipmentId = equipmentId, EquipmentName = equipmentName }); } } OutsideLogisticsControlResult result = new OutsideLogisticsControlResult() { Success = true, EquipmentId = equipmentId, EquipmentName = equipmentName, IsNormalExecution = true }; _eventBus.Post(new KeyValuePair <OutsideLogisticsControlArg, OutsideLogisticsControlResult>(arg, result), TimeSpan.Zero); return(result); }
public WCSLogisticsTaskItemViewModel(OutsideLogisticsControlArg data, OutsideLogisticsControlResult result) { _data = data; _result = result; this.Title = "物流控制任务:" + data.LogisticsId; this.Datas.Add(new TaskItemData("收到消息", JsonConvert.SerializeObject(data))); this.Datas.Add(new TaskItemData("回复消息", JsonConvert.SerializeObject(result))); }
public async void ReSend(object parameter) { this.Datas.Add(new TaskItemData("发送控制", JsonConvert.SerializeObject(_data))); string response = await _mesHook.LogisticsControlAsync(_data.LogisticsId, _data.StartPoint, _data.Destination1, _data.Destination2, "1"); _result = JsonConvert.DeserializeObject <OutsideLogisticsControlResult>(response); this.Datas.Add(new TaskItemData("发送结果", JsonConvert.SerializeObject(_result))); }