public void Compare(string pFileName, string sFileName, string createDir, bool isload = false)
        {
            ReadPlatFormWebPageValue flatform = new ReadPlatFormWebPageValue();
            BaseReadWebPage          platform = new BaseReadWebPage();
            BaseReadWebPage          shop     = new BaseReadWebPage();

            if (!string.IsNullOrEmpty(pFileName))
            {
                platform.ReadBaseItemInfo(pFileName, true);
            }


            shop.ReadBaseItemInfo(sFileName, true);

            foreach (BaseItemInfo item in shop.ShopAllItems.Values)
            {
                bool   isEixst  = false;
                string itemName = item.Name;

                if (item.Name.Contains("】"))
                {
                    int itemNameIndex = item.Name.LastIndexOf("】") + 1;
                    itemName = item.Name.Substring(itemNameIndex, item.Name.Length - itemNameIndex);
                }

                if (itemName.Contains("("))
                {
                    int itemNameIndex = itemName.IndexOf('(');

                    itemName = itemName.Substring(0, itemNameIndex);
                }

                foreach (BaseItemInfo platformItem in platform.ShopAllItems.Values)
                {
                    bool isSame = false;
                    if (!string.IsNullOrEmpty(item.ID) && !string.IsNullOrEmpty(platformItem.ID))
                    {
                        if (item.ID.Trim() == platformItem.ID.Trim())
                        {
                            isSame = true;
                        }
                    }


                    if (isSame || (itemName == platformItem.Name && item.Created == platformItem.Created))
                    {
                        if (CommonFun.IsSameFormat(platformItem.Format, item.Format, platformItem.Name, item.Name))
                        {
                            isEixst = true;
                            if (ComparePrice(platformItem, item))
                            {
                                break;
                            }
                        }
                    }
                }

                if (!isEixst && isload)
                {
                    List <BaseItemInfo> seachItems = flatform.SeachInfoByID(item.ID);

                    Dictionary <string, BaseItemInfo> saveInfos = new Dictionary <string, BaseItemInfo>();

                    foreach (BaseItemInfo info in seachItems)
                    {
                        string key = info.Name + info.Format + info.Created;

                        if (!platform.ShopAllItems.ContainsKey(key))
                        {
                            if (item.ID == info.ID || (itemName == info.Name && item.Created == info.Created))
                            {
                                if (CommonFun.IsSameFormat(info.Format, item.Format, info.Name, item.Name))
                                {
                                    isEixst = true;
                                    ComparePrice(info, item);
                                }
                            }

                            platform.ShopAllItems.Add(key, info);
                            saveInfos.Add(key, info);
                        }
                        else if (platform.ShopAllItems[key].ShopSelaPrice > info.ShopSelaPrice)
                        {
                            if (item.ID == info.ID || (itemName == info.Name && item.Created == info.Created))
                            {
                                if (CommonFun.IsSameFormat(info.Format, item.Format, info.Name, item.Name))
                                {
                                    isEixst = true;
                                    ComparePrice(info, item);
                                }
                            }

                            platform.ShopAllItems[key] = info;
                            saveInfos[key]             = info;
                        }
                    }

                    foreach (BaseItemInfo saveInfo in saveInfos.Values)
                    {
                        string name = string.IsNullOrEmpty(pFileName) ? "Platform/Platform" + ticks + ".csv" : pFileName;
                        CommonFun.WriteCSV(name, saveInfo);
                    }
                }

                if (!isEixst)
                {
                    CommonFun.WriteCSV(createDir + "/NotIsEixst" + ticks + ".csv", item);
                }
            }
        }
        /// <summary>
        /// 对比价格(在线数据)
        /// </summary>
        public void OnlineComparePrice()
        {
            ReadPlatFormWebPageValue flatform = new ReadPlatFormWebPageValue();

            Dictionary <string, BaseItemInfo> platItems = new Dictionary <string, BaseItemInfo>();

            Dictionary <string, List <BaseItemInfo> > seachItems = new Dictionary <string, List <BaseItemInfo> >();

            Dictionary <string, string> seachedItemName = new Dictionary <string, string>();

            foreach (BaseItemInfo item in ShopAllItems.Values)
            {
                string key = item.Name + item.Format + item.Created;

                //查找该商品
                if (!seachedItemName.ContainsKey(item.Name))
                {
                    seachedItemName.Add(item.Name, item.Name);

                    List <BaseItemInfo> item_list = flatform.SeachInfoByID(item.Name);

                    Dictionary <string, BaseItemInfo> minPricItems = new Dictionary <string, BaseItemInfo>();


                    foreach (BaseItemInfo sItem in item_list)
                    {
                        string sItemKey = sItem.Name + sItem.Format + sItem.Created;

                        if (!platItems.ContainsKey(sItemKey))
                        {
                            platItems.Add(sItemKey, sItem);
                            minPricItems.Add(sItemKey, sItem);
                        }
                        else if (platItems[sItemKey].ShopSelaPrice > sItem.ShopSelaPrice)
                        {
                            platItems[sItemKey]    = sItem;
                            minPricItems[sItemKey] = sItem;
                        }
                    }

                    seachItems.Add(item.Name, minPricItems.Values.ToList());
                }

                //对比价格
                if (seachItems.ContainsKey(item.Name))
                {
                    List <BaseItemInfo> compareItems = seachItems[item.Name];
                    bool isExist = false;
                    foreach (BaseItemInfo compareItem in compareItems)
                    {
                        if (item.Created == compareItem.Created)
                        {
                            if (CommonFun.IsSameFormat(item.Format, compareItem.Format, item.Name, compareItem.Name))
                            {
                                isExist = true;
                                //价格对比
                                if (item.ShopPrice > 0 && item.ShopPrice * (decimal)0.75 >= compareItem.ShopSelaPrice)
                                {
                                    //浏览量对比
                                    if (!string.IsNullOrEmpty(compareItem.ViewCount) && Convert.ToInt32(compareItem.ViewCount) >= 500)
                                    {
                                        item.ID            = compareItem.ID;
                                        item.ShopSelaPrice = compareItem.ShopSelaPrice;
                                        item.Type          = compareItem.Type;
                                        item.ViewCount     = compareItem.ViewCount;

                                        CommonFun.WriteCSV("25%" + ticks + ".csv", item);
                                    }
                                }
                                break;
                            }
                        }
                    }
                    if (!isExist)
                    {
                        CommonFun.WriteCSV("YaoTu/NoFormat" + ticks + ".csv", item);
                    }
                }
                else
                {
                    CommonFun.WriteCSV("YaoTu/NotExist" + ticks + ".csv", item);
                }
            }

            foreach (BaseItemInfo item in platItems.Values)
            {
                CommonFun.WriteCSV("YaoTu/Plateform" + ticks + ".csv", item);
            }
        }