private void SetOrderTotalProduct(RunQueueInfo model) { try { switch (model.RunName) { case "ShelfMission": var smBll = new ShelfMission(); smBll.SetTotalProduct(model.RunValue); break; case "OrderPicked": var opBll = new OrderPicked(); opBll.SetTotalProduct(model.RunValue); break; default: break; } } catch (Exception ex) { new CustomException(ex.Message, ex); } }
private void SetRFID(RunQueueInfo model) { RFIDInfo info = JsonConvert.DeserializeObject <RFIDInfo>(model.RunValue); info.LastUpdatedDate = DateTime.Now; new CustomException(string.Format("info--:{0}", JsonConvert.SerializeObject(info))); var bll = new RFID(); var oldInfo = bll.GetModel(info.TID, info.EPC); if (oldInfo == null) { bll.Insert(info); } else { bll.Update(info); } }
public void Send(RunQueueInfo model) { base.transactionType = MessageQueueTransactionType.Single; base.Send(model); }
public void Insert(RunQueueInfo model) { runQueue.Send(model); }
private void DoBaiduMapRestApi(RunQueueInfo model) { try { if (model.RunType == EnumData.EnumRunQueue.BaiduMapRestApi.ToString()) { JObject json = JObject.Parse(model.RunValue); var orderProcessId = Guid.Empty; Guid.TryParse((string)json["OrderProcessId"], out orderProcessId); var sLatlng = (string)json["Latlng"]; var sIp = (string)json["Ip"]; var ipAddress = ""; var latlngAddress = ""; if (!string.IsNullOrWhiteSpace(sIp)) { var ipResult = HttpHelper.DoGet(string.Format(IpUri, sIp)); new CustomException("ipResult--" + ipResult); JObject ipJson = JObject.Parse(ipResult); ipAddress = (string)ipJson["content"]["address"]; } if (!string.IsNullOrWhiteSpace(sLatlng)) { //var latlngResult = HttpHelper.DoGet(string.Format(LatlngUri, sLatlng)); //new CustomException("latlngResult--" + latlngResult); //JObject latlngJson = JObject.Parse(latlngResult); //var baiduLatlng = string.Format("{0},{1}", (string)latlngJson["result"][0]["x"], (string)latlngJson["result"][0]["y"]); var geocodingResult = HttpHelper.DoGet(string.Format(GeocodingUri, sLatlng)); new CustomException("geocodingResult--" + geocodingResult); JObject geocodingJson = JObject.Parse(geocodingResult); latlngAddress = (string)geocodingJson["result"]["formatted_address"]; } var opBll = new OrderProcess(); var opInfo = opBll.GetModel(orderProcessId); if (opInfo != null) { if (string.IsNullOrWhiteSpace(opInfo.IpPlace) && string.IsNullOrWhiteSpace(opInfo.LatlngPlace)) { opInfo.IpPlace = ipAddress; opInfo.LatlngPlace = latlngAddress; opBll.Update(opInfo); } else { if (string.IsNullOrWhiteSpace(opInfo.IpPlace)) { opInfo.IpPlace = ipAddress; opBll.Update(opInfo); } if (string.IsNullOrWhiteSpace(opInfo.LatlngPlace)) { opInfo.LatlngPlace = latlngAddress; opBll.Update(opInfo); } } } } } catch (Exception ex) { new CustomException(string.Format("来自方法“{0}”异常:{1}", "AfdRunQueue--DoBaiduMapRestApi", ex.Message), ex); } }