Ejemplo n.º 1
0
        //public OutsideLogisticsEnquiryResult LogisticsEnquiry(OutsideLogisticsEnquiryArg arg)
        public string LogisticsEnquiry(string LogisticsId, string EquipmentId, string EquipmentName)
        {
            var result = WCSApiAccessor.Instance.LogisticsEnquiry(
                OutsideLogisticsEnquiryArg.Create(LogisticsId, EquipmentId, EquipmentName)).Result;

            //var result = new OutsideLogisticsEnquiryArg() { LogisticsId = LogisticsId, EquipmentId = "1", EquipmentName = "EquipmentName-1" };
            return(JsonConvert.SerializeObject(result));
        }
Ejemplo n.º 2
0
 public async Task <OutsideLogisticsEnquiryResult> LogisticsEnquiry([JsonContent] OutsideLogisticsEnquiryArg arg)
 {
     try
     {
         return(await _apiProxy.LogisticsEnquiry(arg));
     }
     catch (Exception ex) {
         return(new OutsideLogisticsEnquiryResult()
         {
             Status = ex.Message
         });
     }
 }
Ejemplo n.º 3
0
        public async void Search(object parameter)
        {
            OutsideLogisticsEnquiryArg arg = new OutsideLogisticsEnquiryArg()
            {
                LogisticsId   = _data.LogisticsId,
                EquipmentId   = _result == null ? null : _result.EquipmentId,
                EquipmentName = _result == null ? null : _result.EquipmentName
            };

            //LogisticsEnquiryRequest arg = new LogisticsEnquiryRequest()
            //{
            //    Body = new LogisticsEnquiryRequestBody()
            //    {
            //        equipmentid = _result == null ? null : _result.EquipmentId,
            //        equipmentname = _result == null ? null : _result.EquipmentName
            //    }
            //};

            this.Datas.Add(new TaskItemData("发送查询", JsonConvert.SerializeObject(arg)));

            var result = await _mesHook.LogisticsEnquiryAsync(_data.LogisticsId, arg.EquipmentId, arg.EquipmentName);

            this.Datas.Add(new TaskItemData("查询结果", JsonConvert.SerializeObject(result)));
        }
Ejemplo n.º 4
0
        public async Task <OutsideLogisticsEnquiryResult> LogisticsEnquiry([FromBody] OutsideLogisticsEnquiryArg arg)
        {
            LogisticsTask task = null;

            lock (_logistics)
            {
                if (_logistics.ContainsKey(arg.LogisticsId))
                {
                    task = _logistics[arg.LogisticsId];
                }
            }
            if (task == null)
            {
                return(new OutsideLogisticsEnquiryResult()
                {
                    Status = "Fail",
                    EquipmentId = arg.EquipmentId,
                    EquipmentName = arg.EquipmentName,
                    Position = null
                });
            }
            OutsideLogisticsEnquiryResult result = new OutsideLogisticsEnquiryResult()
            {
                Status        = task.Step == -1 ? "OK" : "Processing",
                EquipmentId   = task.EquipmentId,
                EquipmentName = task.EquipmentName,
                Position      = task.Step == -1 ? "终点" : $"坐标{task.Step}"
            };

            if (task.Step >= 0)
            {
                task.Step++;
            }
            _eventBus.Post(new KeyValuePair <OutsideLogisticsEnquiryArg, OutsideLogisticsEnquiryResult>(arg, result), TimeSpan.Zero);
            return(result);
        }