Example #1
0
        /// <summary>
        /// Json方式 查询订单物流轨迹(即时查询)
        /// </summary>
        /// <param name="logisticCode">物流单号</param>
        /// <returns></returns>
        public static KdApiSearchModel GetOrderTracesByJson(string logisticCode)
        {
            OrderDistinguishModel od = OrderTracesByJson(logisticCode);

            if (od.Success != "true" || od.Shipper.Count == 0)
            {
                return(null);
            }

            string shipperCode = od.Shipper[0].ShipperCode;  //快递公司编码
            string requestData = "{'OrderCode':'','ShipperCode':'" + shipperCode + "','LogisticCode':'" + logisticCode + "'}";

            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("RequestData", HttpUtility.UrlEncode(requestData, Encoding.UTF8));
            param.Add("EBusinessID", EBusinessID);
            param.Add("RequestType", "1002");
            string dataSign = KdGoldCommon.Encrypt(requestData, AppKey, "UTF-8");

            param.Add("DataSign", HttpUtility.UrlEncode(dataSign, Encoding.UTF8));
            param.Add("DataType", "2");

            string result = KdGoldCommon.SendPost(ReqURL, param);

            //根据公司业务处理返回的信息......

            return((KdApiSearchModel)JsonConvert.DeserializeObject(result, typeof(KdApiSearchModel)));
        }
Example #2
0
        /// <summary>
        /// Json方式  物流信息订阅
        /// </summary>
        /// <param name="logisticCode">物流单号</param>
        /// <returns></returns>
        public static string OrderTracesSubByJson(string logisticCode)
        {
            OrderDistinguishModel od = OrderTracesByJson(logisticCode);

            if (od == null || od.Success != "true" || od.Shipper == null || od.Shipper.Count == 0)
            {
                return(null);
            }
            string shipperCode = od.Shipper[0].ShipperCode;  //快递公司编码
            string requestData = "{'ShipperCode':'" + shipperCode + "', 'LogisticCode':'" + logisticCode + "'}";

            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("RequestData", HttpUtility.UrlEncode(requestData, Encoding.UTF8));
            param.Add("EBusinessID", EBusinessID);
            param.Add("RequestType", "1008");
            string dataSign = KdGoldCommon.Encrypt(requestData, AppKey, "UTF-8");

            param.Add("DataSign", HttpUtility.UrlEncode(dataSign, Encoding.UTF8));
            param.Add("DataType", "2");

            string result = KdGoldCommon.SendPost("http://api.kdniao.cc/api/dist", param);

            //根据公司业务处理返回的信息......

            return(result);
        }
Example #3
0
        /// <summary>
        /// Json方式  单号识别
        /// </summary>
        /// <param name="logisticCode">物流单号</param>
        /// <returns></returns>
        private static OrderDistinguishModel OrderTracesByJson(string logisticCode)
        {
            string requestData = "{'LogisticCode': '" + logisticCode + "'}";

            Dictionary <string, string> param = new Dictionary <string, string>();

            param.Add("RequestData", HttpUtility.UrlEncode(requestData, Encoding.UTF8));
            param.Add("EBusinessID", EBusinessID);
            param.Add("RequestType", "2002");
            string dataSign = KdGoldCommon.Encrypt(requestData, AppKey, "UTF-8");

            param.Add("DataSign", HttpUtility.UrlEncode(dataSign, Encoding.UTF8));
            param.Add("DataType", "2");

            string result = KdGoldCommon.SendPost(ReqURL, param);

            //根据公司业务处理返回的信息......
            return((OrderDistinguishModel)JsonConvert.DeserializeObject(result, typeof(OrderDistinguishModel)));
        }