/// <summary>
        /// 批量导出淘宝助理文件
        /// </summary>
        public void ExportToCsv(List <string> itemList)
        {
            ControlsUtils.OperationLog("开始生成淘宝助理CSV格式数据文件");
            string timeStamp = Utils.GetTimeStamp();
            //csv保存路径
            string csvPath = Path.Combine(ConfigHelper.GetCsvPath(), timeStamp + ".csv");
            //图片保存路径
            string contentPath = Path.Combine(ConfigHelper.GetCsvPath(), timeStamp);

            if (!Directory.Exists(contentPath))
            {
                Directory.CreateDirectory(contentPath);
            }
            TaoBaoExport    export      = new TaoBaoExport();
            List <string[]> _outputList = new List <string[]>();

            _outputList.Add(new string[] { "version 1.00" });
            _outputList.Add(ConfigHelper.TaoBaoHeaderFieldRow);
            _outputList.Add(ConfigHelper.TaoBaoHeaderRow);
            string             ids  = string.Join(",", itemList.ToArray());
            List <ProductItem> list = DataHelper.GetProductItemList(ids);

            MaxVal = list.Count;
            CurVal = 0;
            //切割10份开一个线程
            List <E_Range> rangeList = Utils.PrepareData(0, list.Count, 2);

            Task[] tasks = new Task[rangeList.Count];
            for (int i = 0; i < rangeList.Count; i++)
            {
                E_Range item = rangeList[i];
                tasks[i] = Task.Factory.StartNew(() =>
                {
                    for (int j = item.begin - 1; j < item.end; j++)
                    {
                        ProductItem productItem = list[j];
                        ControlsUtils.OperationLog("处理宝贝主体信息:" + productItem.Name);
                        string[] tempStr = export.ConvertProductToDic(productItem, contentPath);
                        lock (obj)
                        {
                            _outputList.Add(tempStr);
                        }
                        CurVal++;
                        ControlsUtils.OperationLog("宝贝处理完毕:" + productItem.Name);
                        ControlsUtils.SetProgressBarValue(MaxVal, CurVal);
                    }
                });
            }
            Task.WaitAll(tasks);//等待线程执行完毕
            export.WriteDicToFile(csvPath, _outputList);
            DataHelper.DeleteItemByIds(ids);
            ControlsUtils.SetProgressBarValue(list.Count, list.Count);
            ControlsUtils.OperationLog("淘宝助理CSV格式数据文件全部生成完毕!保存路径:" + csvPath);
            //for (int i = 0; i < list.Count; i++)
            //{

            //    ProductItem item = list[i];
            //    ControlsUtils.OperationLog("处理宝贝主体信息:" + item.Name);
            //    Task<string[]> taskResult = new Task<string[]>(() =>
            //    {
            //        return export.ConvertProductToDic(item, contentPath);
            //    });
            //    taskResult.Start();
            //    taskResult.Wait();
            //    _outputList.Add(taskResult.Result);
            //    ControlsUtils.OperationLog("宝贝处理完毕:" + item.Name);
            //    ControlsUtils.SetProgressBarValue(list.Count, i);
            //}
            //export.WriteDicToFile(csvPath, _outputList);
            //ControlsUtils.SetProgressBarValue(list.Count, list.Count);
        }