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 OutsideLogisticsControlResult LogisticsControl([FromBody]OutsideLogisticsControlArg arg) public string LogisticsControl(string LogisticsId, string StartPoint, string Destination1, string Destination2, string InventoryBoxSize) { var result = WCSApiAccessor.Instance.LogisticsControl( OutsideLogisticsControlArg.Create(LogisticsId, StartPoint, Destination1, Destination2, InventoryBoxSize)).Result; //var result = new OutsideLogisticsControlResult() { EquipmentId = "1", EquipmentName = "EquipmentName-1" }; return(JsonConvert.SerializeObject(result)); }
public MesLogisticsTaskItemViewModel(OutsideLogisticsControlArg data) { _data = data; this.Title = "物流控制任务:" + data.LogisticsId; var binding = new BasicHttpBinding(); var factory = new ChannelFactory <WMSService.IMESHookController>(binding, "http://localhost:23456/Outside/MesHook.asmx"); //var factory = new ChannelFactory<WMSSoap>(binding, "http://localhost:5713/WMS.asmx"); _mesHook = factory.CreateChannel(); ReSend(null); }
private void MesLogisticsControl_Click(object sender, RoutedEventArgs e) { this.Dispatcher.BeginInvoke((Action)(() => { OutsideLogisticsControlArg data = new OutsideLogisticsControlArg() { LogisticsId = "L" + DateTime.Now.Ticks.ToString(), StartPoint = "Start1", Destination1 = "Dest1", Destination2 = "Dest1", InventoryBoxSize = "2" }; TaskItemControl taskControl = new TaskItemControl(new MesLogisticsTaskItemViewModel(data)); ctlMESTasks.Children.Add(taskControl); })); }
public async Task <OutsideLogisticsControlResult> LogisticsControl([JsonContent] OutsideLogisticsControlArg arg) { try { return(await _apiProxy.LogisticsControl(arg)); } catch (Exception ex) { return(new OutsideLogisticsControlResult() { ErrorId = "-1", ErrorInfo = ex.Message }); } }