Esempio n. 1
0
        /// <summary>
        /// 手续费
        /// </summary>
        /// <returns></returns>
        public static double?GetAddFee(int orderFrom, int orderType, double fee)
        {
            string javafee_uri = Config.JavaApiUri + "business/fee/getFee/";
            string memberId    = Config.JavaAnonymousMemberId;
            string memberPwd   = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    memberId  = memberId,
                    orderType = orderType.ToString(),
                    //providerCode = "P0004",
                    amount = fee.ToString()
                }
            };

            double?amount = null; //值为null,代表获取手续费失败

            try
            {
                var resp = HttpApiUtils.ReqJavaApiForObj <dynamic, AddFeeDatamap>(args, javafee_uri, memberId, memberPwd, orderFrom);
                amount = resp.dataMap.amount;//手续费可以负数
            }
            catch (Exception ex)
            {
                ETong.Log.Sdk.LoggerMgr.Error("获取手续费失败!", ex);
            }
            var result = amount;

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// 获取默认的运费模板Id
        /// </summary>
        public static string GetDefaultTemplateId()
        {
            var url       = Config.JavaApiUri + "product/template/freightTemplate/getDefaultTemplate";
            var memberId  = Config.JavaAnonymousMemberId;
            var memberpwd = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    memberId = memberId,
                }
            };
            var freight = HttpApiUtils.ReqJavaApiForObj <dynamic, dynamic>(args, url, memberId, memberpwd);
            var result  = freight.dataMap.result_key;

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// 查看订单详细
        /// </summary>
        public static JavaApiRespArgs <OrderInfoDatamap> QueryOrdersById(string orderId)
        {
            var url       = Config.JavaApiUri + "orders/queryOrdersById";
            var memberId  = Config.JavaAnonymousMemberId;
            var memberpwd = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    memberId = memberId,
                    orderId  = orderId,
                }
            };
            var result = HttpApiUtils.ReqJavaApiForObj <dynamic, OrderInfoDatamap>(args, url, memberId, memberpwd);

            return(result);
        }
Esempio n. 4
0
        public static JavaApiRespArgs <ChannelCategoryDatamap> GetAllChildCategory(string parentId)
        {
            string url       = Config.JavaApiUri + "channel/category/allChildCategoryMsg";
            var    memberId  = Config.JavaAnonymousMemberId;
            var    memberpwd = Config.JavaAnonymousMemberPwd;
            var    args      = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    requestFrom = 1,
                    categoryId  = parentId,
                }
            };

            Log.Sdk.LoggerMgr.Info("请求参数=>" + ETong.Utility.Converts.Json.Serialize(args));
            var result = HttpApiUtils.ReqJavaApiForObj <dynamic, ChannelCategoryDatamap>(args, url, memberId, memberpwd);

            Log.Sdk.LoggerMgr.Info("返回结果=>" + result);

            return(result);
        }
Esempio n. 5
0
        public static JavaApiRespArgs <ChannelGoodsDetailDatamap> GetGoodsDetail(string channel, string goodsId)
        {
            string url       = Config.JavaApiUri + "product/common/queryGoodsDetail";
            var    memberId  = Config.JavaAnonymousMemberId;
            var    memberpwd = Config.JavaAnonymousMemberPwd;
            var    args      = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    channType = "5",//"频道类型Id"(String类型,必填,2为农民兄弟,5为自定义频道)
                    code      = channel,
                    goodsId   = goodsId
                }
            };

            Log.Sdk.LoggerMgr.Info("请求参数=>" + ETong.Utility.Converts.Json.Serialize(args));
            var result = HttpApiUtils.ReqJavaApiForObj <dynamic, ChannelGoodsDetailDatamap>(args, url, memberId, memberpwd);

            Log.Sdk.LoggerMgr.Info("返回结果=>" + result);

            return(result);
        }
Esempio n. 6
0
        public static JavaApiRespArgs <ChannelGoodsListDatamap> GetIndexGoods(string channel, int pageSize, int pageNo)
        {
            string url       = Config.JavaApiUri + "channel/goods/indexGoodsPage";
            var    memberId  = Config.JavaAnonymousMemberId;
            var    memberpwd = Config.JavaAnonymousMemberPwd;
            var    args      = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    requestFrom = 1,
                    code        = channel,
                    pageSize    = pageSize,
                    curPage     = pageNo
                }
            };

            Log.Sdk.LoggerMgr.Info("请求参数=>" + ETong.Utility.Converts.Json.Serialize(args));
            var result = HttpApiUtils.ReqJavaApiForObj <dynamic, ChannelGoodsListDatamap>(args, url, memberId, memberpwd);

            Log.Sdk.LoggerMgr.Info("返回结果=>" + result);

            return(result);
        }