예제 #1
0
        public void test()
        {
            Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
            var dict = new Dictionary <string, object>();

            dict["baidu_shop_id"] = "2147052144";
            List <object> delivery_region = new List <object>();

            delivery_region.Add(new
            {
                name            = "西二旗配送区",
                delivery_time   = "60",
                delivery_fee    = "600",
                min_buy_free    = 6000,
                min_order_price = 1000,
                region          = new object[] {
                    new object[] {
                        new { latitude = "39.988619", longitude = "116.280034" }, //116.280034,39.988619
                        new { latitude = "39.997906", longitude = "116.58014" },  //116.58014,39.997906
                        new { latitude = "39.824791", longitude = "116.635907" }, //116.635907,39.824791
                        new { latitude = "39.836316", longitude = "116.246401" }, //116.246401,39.836316
                        new { latitude = "39.988619", longitude = "116.280034" }
                    }
                },
            });
            dict["delivery_region"] = delivery_region;

            var result = baidu.Post("shop.update", dict);
        }
예제 #2
0
 public void ConfirmOrder()
 {
     //15143471287383
     Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
     baidu.ConfirmOrder(new ConfirmOrderParameter()
     {
         OrderID = "15143471287383"
     });
 }
예제 #3
0
 public void CancelOrder()
 {
     //
     Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
     baidu.CancelOrder(new CancelOrderParameter()
     {
         OrderID = "15143471287383",
         Reason  = CancelOrderReason.AddressError
     });
 }
예제 #4
0
        public void CreateDishCategory()
        {
            var baidu = new Impls.Baidu.BaiduResturant();

            baidu.CreateDishCategory(new CreateDishCategoryParameter()
            {
                CategoryName = "凉菜2",
                ErpStoreId   = ErpShopId,
                Sequence     = 1
            });
        }
예제 #5
0
        public void SetStoreOpenTimes()
        {
            var baidu = new Impls.Baidu.BaiduResturant();

            baidu.SetStoreOpenTimes(ErpShopId, null, new List <DayOpenTime>()
            {
                new DayOpenTime()
                {
                    Times = new List <string>(new string[] { "02:00-11:00", "12:30-20:00" })
                }
            });
        }
예제 #6
0
        public void UpdateDishCategory()
        {
            var baidu = new Impls.Baidu.BaiduResturant();

            baidu.UpdateDishCategory(new UpdateDishCategoryParameter()
            {
                CategoryName         = "凉菜3",
                ErpStoreId           = ErpShopId,
                OriginalCategoryName = "凉菜2",
                Sequence             = 2
            });
        }
예제 #7
0
        public void UploadDish()
        {
            Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
            var dishes = new List <DishInfo>();
            var dish   = new DishInfo();

            dishes.Add(dish);
            dish.Attributes.Add(new DishAttribute()
            {
                Name   = "辣度",
                Values = new List <string>(new string[] { "微辣", "超辣" })
            });
            dish.Attributes.Add(new DishAttribute()
            {
                Name   = "甜度",
                Values = new List <string>(new string[] { "无糖", "少糖" })
            });
            dish.CategoryName = "凉菜";
            dish.Description  = "我的测试蔡";
            dish.ErpDishId    = "2";
            dish.DishName     = "宫保鸡丁";
            dish.Price        = 18;
            dish.Sequence     = 0;
            dish.Unit         = "份";
            dish.Picture      = "https://img.waimai.baidu.com/pb/996b20261afba57226d98b22ae1d93b528";
            dish.Skus.Add(new DishSkuInfo()
            {
                Price = 30,
                Spec  = "大份",
                Stock = 8888
            });
            dish.Skus.Add(new DishSkuInfo()
            {
                Price = 18,
                Spec  = "小份",
                Stock = 8888
            });
            for (int i = 0; i < 7; i++)
            {
                dish.AvailableTimes.Add(new DayOpenTime()
                {
                    Times = new List <string>(new string[] { "08:00-13:00", "14:30-19:00" })
                });
            }
            dish.AvailableTimes[3].Times[0] = "08:00-10:00";
            // baidu.GetDish(1, "1510018544");

            baidu.UploadDish(ErpShopId, null, dishes);
        }
예제 #8
0
        public void DishMap()
        {
            var baidu     = new Impls.Baidu.BaiduResturant();
            var dishes    = baidu.GetDishList(ErpShopId, null);
            var parameter = new DishMapParameter();

            parameter.ErpStoreID = ErpShopId;
            foreach (var dish in dishes)
            {
                parameter.DishMapItems.Add(new DishMapParameter.DishMapItem()
                {
                    DishId    = dish.DishId,
                    ErpDishId = (Convert.ToInt32(dish.ErpDishId) + 100).ToString()
                });
            }

            baidu.DishMap(parameter);
        }
예제 #9
0
 public void GetStoreInfo()
 {
     var baidu  = new Impls.Baidu.BaiduResturant();
     var result = baidu.GetStoreInfo(ErpShopId, null);
 }
예제 #10
0
 public void GetDishList()
 {
     var baidu  = new Impls.Baidu.BaiduResturant();
     var result = baidu.GetDishList(ErpShopId, null);
 }
예제 #11
0
        public void DeleteDishCategory()
        {
            var baidu = new Impls.Baidu.BaiduResturant();

            baidu.DeleteDishCategory(ErpShopId, null, "凉菜3");
        }
예제 #12
0
 public void GetDishCategoryList()
 {
     //
     Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
     var result = baidu.GetDishCategoryList(ErpShopId, null);
 }
예제 #13
0
 public void Close()
 {
     //
     Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
     baidu.SetStoreStatus(112, null, StoreStatus.Opened);
 }
예제 #14
0
 public void GetOrder()
 {
     //
     Jack.Resturant.Impls.Baidu.BaiduResturant baidu = new Impls.Baidu.BaiduResturant();
     var result = baidu.GetOrder("15101281300071");
 }