protected  override void Do()
        {
            int index = 0;
            var request = new QueryItemListRequest();
            request.Put("startIndex", index++);
            request.Put("pageSize", 100);
            request.Put("defStockId", "200091");
            //request.Put("orderType", "7");
            var rsp = Client.Execute<dynamic>(request);
            int cursor = 1;

            if (rsp.errorCode == 0)
            {
                int totalNum = rsp.totalNum;
                var ps = ProcessorFactory.CreateProcessor<QueryItemListResponseProcessor>();
                Logger.Info(ps.Process(rsp, true) ? "load successfully" : ps.ErrorMessage);
                cursor += 100;
                
                while (cursor < totalNum)
                {
                    request.Remove("sign");
                    request.Put("startIndex",index ++);
                    rsp = Client.Execute<dynamic>(request);
                    ps = ProcessorFactory.CreateProcessor<QueryItemListResponseProcessor>();
                    Logger.Info(ps.Process(rsp, true) ? "load successfully" : ps.ErrorMessage);
                    cursor += 100;
                }
            }
            else
            {
                Logger.Error(rsp.errorMessage);
            }
        }
        private void UploadProduct(int productId)
        {
            using (var db = DbContextHelper.GetDbContext())
            {
                var item = db.Products.FirstOrDefault(t => t.Id == productId);

                try
                {
                    var builder = RequestParamsBuilderFactory.CreateBuilder(new AddItemRequest());
                    var result = Client.Execute<dynamic>(builder.BuildParameters(item));
                    if (result.errorCode == 0)
                    {
                        var processor = ProcessorFactory.CreateProcessor<ItemResponseProcessor>();
                        if (processor.Process(result, item.Id))
                        {
                            Console.WriteLine("成功上传商品");
                            return;
                        }
                        Logger.Error(string.Format("Failed to upload product to wgw {0}({1}) Error Message: {2}", item.Name,
                            item.Id, processor.ErrorMessage));
                    }
                    else //if (result.errorCode == 50005) //图片读取问题导致的失败实际上商品有可能已经上传成功需要补救下
                    {
                        var request = new QueryItemListRequest();
                        request.Put("defStockId", item.Id);
                        request.Put("startIndex", 0);
                        request.Put("pageSize", 1);
                        request.Put("orderType", "7");
                        var rsp = Client.Execute<dynamic>(request);
                        if (rsp.errorCode == 0)
                        {
                            var ps = ProcessorFactory.CreateProcessor<QueryItemListResponseProcessor>();
                            if (ps.Process(rsp, item))
                            {
                                Console.WriteLine("成功上传商品");
                                return;
                            }
                            Logger.Error(ps.ErrorMessage);
                        }
                        else
                        {
                            Logger.Error(string.Format("Failed to upload product to wgw {0}({1}) Error Message: {2}", item.Name,
                            item.Id, result.errorMessage));
                        }
                    }

                }
                catch (Exception ex)
                {
                    Logger.Error(string.Format("Failed to upload product {0}({1}) Error Message: {2}", item.Name, item.Id, ex.Message));
                    Console.WriteLine("上传商品过程出现错误,请查看日志");
                }
            }
        }
 private bool Upload(ProductEntity item)
 {
     try
     {
         var builder = RequestParamsBuilderFactory.CreateBuilder(new AddItemRequest());
         var result = Client.Execute<dynamic>(builder.BuildParameters(item));
         if (result.errorCode == 0)
         {
             if (result.warnMessage != null && result.warnMessage.ToString().Length > 0)
             {
                 Logger.Error(string.Format("Succeed upload product,but some warnning message :{0}", result.warnMessage));
             }
             var processor = ProcessorFactory.CreateProcessor<ItemResponseProcessor>();
             if (processor.Process(result, item.Id))
             {
                 return true;
             }
             Logger.Error(string.Format("Failed to upload product to wgw {0}({1}) Error Message: {2}", item.Name,
                 item.Id, processor.ErrorMessage));
         }
         else //if (result.errorCode == 50005) //图片读取问题导致的失败实际上商品有可能已经上传成功需要补救下
         {
             var request = new QueryItemListRequest();
             request.Put("defStockId",item.Id);
             request.Put("startIndex",0);
             request.Put("pageSize",1);
             request.Put("orderType","7");
             var rsp = Client.Execute<dynamic>(request);
             if (rsp.errorCode == 0)
             {
                 var ps = ProcessorFactory.CreateProcessor<QueryItemListResponseProcessor>();
                 if (ps.Process(rsp,null))
                 {
                     return true;
                 }
                 Logger.Error(ps.ErrorMessage);
             }
             else
             {
                 Logger.Error(string.Format("Failed to upload product to wgw {0} Error Message: {1}",item.Id, result.errorMessage));
             }
         }
     }
     catch (Exception ex)
     {
         Logger.Error(string.Format("Failed to upload product {0} Error Message: {1}", item.Id, ex.Message));
     }
     return false;
 }