Ejemplo 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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 跟据模板、运送方式和省份计算最终的运费
        /// </summary>
        public static string GetDefaultTemplate()
        {
            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 result = HttpApiUtils.ReqJavaApiForJson <dynamic>(args, url, memberId, memberpwd);

            return(result);
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 跟据店铺信息列表得到每个店铺的运费信息
        /// </summary>
        /// <param name="orderStoreInfo"></param>
        /// <returns></returns>
        public static string CountTemplateOrder(string areaName, dynamic[] storeInfos)
        {
            var url       = Config.JavaApiUri + "product/template/freightTemplate/countAllTemplateTypeCharge";
            var memberId  = Config.JavaAnonymousMemberId;
            var memberpwd = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    memberId   = memberId,
                    areaName   = areaName,
                    storeInfos = storeInfos
                }
            };
            var result = HttpApiUtils.ReqJavaApiForJson <dynamic>(args, url, memberId, memberpwd);

            return(result);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 根据模板ID和城市名称(或城市的ID)查询快递方式列表
        /// </summary>
        public static string GetFreightTypeByTemplateIdAndArea(string goodsId, string templateId, string areaName)
        {
            var url       = Config.JavaApiUri + "product/template/freightTemplate/getFreightTypeByTemplateIdAndArea";
            var memberId  = Config.JavaAnonymousMemberId;
            var memberpwd = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    area       = areaName,
                    memberId   = memberId,
                    goodsId    = goodsId,
                    templateId = templateId
                }
            };
            var result = HttpApiUtils.ReqJavaApiForJson <dynamic>(args, url, memberId, memberpwd);

            return(result);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 最终的运费计算接口
        /// </summary>
        public static string CountTemplateCost(string templateId, string areaName, string freightTypeId)
        {
            var url       = Config.JavaApiUri + "product/template/freightTemplate/countTemplateCost";
            var memberId  = Config.JavaAnonymousMemberId;
            var memberpwd = Config.JavaAnonymousMemberPwd;

            var args = new JavaApiReqArgs <dynamic>()
            {
                dataMap = new
                {
                    memberId      = memberId,
                    areaName      = areaName,
                    freightTypeId = freightTypeId,
                    orderCount    = 5,
                    templateId    = templateId
                }
            };
            var result = HttpApiUtils.ReqJavaApiForJson <dynamic>(args, url, memberId, memberpwd);

            return(result);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
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);
        }