public Spiders(Suborders _suborder, SpidersFamilies _family, Gender _gender, int _lenght, string _bornDate) { Suborder = _suborder; Families = _family; Gender = _gender; Lenght = _lenght; BornDate = _bornDate; }
/// <summary> /// 查询子订单信息 /// </summary> /// <returns></returns> public static List <Suborders> SearchJdOrderlist(string jdOrderId) { List <Suborders> objlist = new List <Suborders>(); try { string token = GetToken(); string data = "token=" + token + "&jdOrderId=" + jdOrderId; string url = UrlBase + "order/selectJdOrder"; if (!string.IsNullOrWhiteSpace(jdOrderId)) { string obj = WebRequestHelper.SendPostInfo(url, data); if (!string.IsNullOrEmpty(obj)) { JObject objwlgs = JObject.Parse(obj); if (objwlgs["success"].ToString() == "True") { string jsonstr = objwlgs["result"]["cOrder"].ToString(); Suborders suborders = new Suborders(); if (!string.IsNullOrEmpty(jsonstr)) { JArray array = JArray.Parse(jsonstr); if (array.Count() > 0) { foreach (var arr in array) { JObject firstObject = JObject.Parse(arr.ToString()); suborders = new Suborders(); suborders.pOrder = firstObject["pOrder"].ToString(); suborders.orderState = int.Parse(firstObject["orderState"].ToString()); suborders.jdOrderId = firstObject["jdOrderId"].ToString(); suborders.freight = decimal.Parse(firstObject["freight"].ToString()); suborders.state = int.Parse(firstObject["state"].ToString()); suborders.submitState = int.Parse(firstObject["submitState"].ToString()); suborders.orderPrice = decimal.Parse(firstObject["orderPrice"].ToString()); suborders.orderNakedPrice = decimal.Parse(firstObject["orderNakedPrice"].ToString()); suborders.type = int.Parse(firstObject["type"].ToString()); suborders.orderTaxPrice = decimal.Parse(firstObject["orderTaxPrice"].ToString()); JArray secondObject = JArray.Parse(firstObject["sku"].ToString()); if (secondObject.Count > 0) { List <goodssku> goodsskulist = new List <goodssku>(); foreach (var item in secondObject) { goodssku model = new goodssku() { category = item["category"].ToString(), num = int.Parse(item["num"].ToString()), price = decimal.Parse(item["price"].ToString()), tax = decimal.Parse(item["tax"].ToString()), oid = int.Parse(item["oid"].ToString()), taxPrice = decimal.Parse(item["taxPrice"].ToString()), skuId = item["skuId"].ToString(), nakedPrice = decimal.Parse(item["nakedPrice"].ToString()), type = int.Parse(item["type"].ToString()) }; goodsskulist.Add(model); } suborders.sku = goodsskulist; } objlist.Add(suborders); } } } } } } } catch (Exception ex) { LogHelper.Error(string.Format("查询京东SearchJdOrder异常信息:{0}", ex.Message), ex); } return(objlist); }