Esempio n. 1
0
        public static int SetLowestLimitPrice(string PID, decimal?oldprice, decimal LowestLimitPrice, string Operator, string type)
        {
            var result = DALThirdShop.SetLowestLimitPrice(PID, LowestLimitPrice, type);

            if (result > 0)
            {
                DALThirdShop.AddLowestLimitPriceLog(PID, oldprice, LowestLimitPrice, Operator, type);
            }
            return(result);
        }
Esempio n. 2
0
        public static int DeleteTireCoupon(int pkid, string Operator)
        {
            var result = DALThirdShop.DeleteTireCoupon(pkid);

            if (result.PKID > 0)
            {
                var CouponName = $"满{result.QualifiedPrice.ToString("00")}减{result.Reduce.ToString("00")}券";
                DALThirdShop.AddTireCouponLog(result.ShopName, result.CouponType, CouponName, result.EndTime, Operator, "删除");
                RemoveCache(result.ShopName);
            }
            return(result.PKID);
        }
Esempio n. 3
0
        public static int AddTireCoupon(TireCouponModel request, string Operator)
        {
            var result = DALThirdShop.AddTireCoupon(request);

            if (result > 0)
            {
                var CouponName = request.Description;
                DALThirdShop.AddTireCouponLog(request.ShopName, request.CouponType, CouponName, request.EndTime, Operator, "添加");
                RemoveCache(request.ShopName);
            }
            return(result);
        }
Esempio n. 4
0
        public static List <TireCouponResultModel> TireCouponManage(string shopName = null)
        {
            var data = DALThirdShop.TireCouponManage(shopName);

            return(data?.GroupBy(g => g.ShopName).Select(g => new TireCouponResultModel
            {
                ShopName = g.Key,
                CouponA = g.Where(t => t.CouponType == 1).ToList(),
                CouponB = g.Where(t => t.CouponType == 2).ToList(),
                CouponC = g.Where(t => t.CouponType == 3).ToList()
            })?.ToList() ?? new List <TireCouponResultModel>());
        }
Esempio n. 5
0
 public static int FetchPurchaseRestriction()
 => DALThirdShop.FetchPurchaseRestriction();
Esempio n. 6
0
 public static List <LowestLimitLogModel> GetLowestLimitLog(string PID, string type)
 => DALThirdShop.GetLowestLimitLog(PID, type);
Esempio n. 7
0
 public static List <TireCouponLogModel> FetchCouponLogByShopName(string ShopName)
 => DALThirdShop.FetchCouponLogByShopName(ShopName);
Esempio n. 8
0
        public static List <ProductPriceModel> FetchProductList(ProductListRequest request, PagerModel pager,
                                                                bool isExport = false)
        {
            var result = DALThirdShop.FetchProductList(request, pager, isExport);

            Parallel.ForEach(result, new ParallelOptions()
            {
                MaxDegreeOfParallelism = 4
            }, item =>
            {
                var lowestCouponPrice = new List <decimal>();
                if (item.Price != null)
                {
                    if (item.CanUseCoupon.HasValue && !item.CanUseCoupon.Value)
                    {
                        item.LowestPrice = item.Price;
                    }
                    else
                    {
                        item.LowestPrice = FetchLowestPrice("自有平台", item.Price ?? 0, request.MaxTireCount)?.Item1 ?? item.Price;
                    }
                    if (item.LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.LowestPrice.Value);
                    }
                }
                if (item.TBPrice != null)
                {
                    item.TBLowestPrice = FetchLowestPrice("途虎淘宝", item.TBPrice ?? 0, request.MaxTireCount)?.Item1 ?? item.TBPrice;
                    if (item.TBLowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TBLowestPrice.Value);
                    }
                }
                if (item.TB2Price != null)
                {
                    item.TB2LowestPrice =
                        FetchLowestPrice("途虎淘宝2", item.TB2Price ?? 0, request.MaxTireCount)?.Item1 ?? item.TB2Price;
                    if (item.TB2LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TB2LowestPrice.Value);
                    }
                }
                if (item.TM1Price != null)
                {
                    item.TM1LowestPrice =
                        FetchLowestPrice("途虎天猫1", item.TM1Price ?? 0, request.MaxTireCount)?.Item1 ?? item.TM1Price;
                    if (item.TM1LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TM1LowestPrice.Value);
                    }
                }
                if (item.TM2Price != null)
                {
                    item.TM2LowestPrice =
                        FetchLowestPrice("途虎天猫2", item.TM2Price ?? 0, request.MaxTireCount)?.Item1 ?? item.TM2Price;
                    if (item.TM2LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TM2LowestPrice.Value);
                    }
                }
                if (item.TM3Price != null)
                {
                    item.TM3LowestPrice =
                        FetchLowestPrice("途虎天猫3", item.TM3Price ?? 0, request.MaxTireCount)?.Item1 ?? item.TM3Price;
                    if (item.TM3LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TM3LowestPrice.Value);
                    }
                }
                if (item.TM4Price != null)
                {
                    item.TM4LowestPrice =
                        FetchLowestPrice("途虎天猫4", item.TM4Price ?? 0, request.MaxTireCount)?.Item1 ?? item.TM4Price;
                    if (item.TM4LowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.TM4LowestPrice.Value);
                    }
                }
                if (item.JDPrice != null)
                {
                    item.JDLowestPrice = FetchLowestPrice("途虎京东", item.JDPrice ?? 0, request.MaxTireCount)?.Item1 ?? item.JDPrice;
                    if (item.JDLowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.JDLowestPrice.Value);
                    }
                }
                if (item.JDFlagShipPrice != null)
                {
                    item.JDFlagShipLowestPrice =
                        FetchLowestPrice("途虎京东旗舰", item.JDFlagShipPrice ?? 0, request.MaxTireCount)?.Item1 ?? item.JDFlagShipPrice;
                    if (item.JDFlagShipLowestPrice != null)
                    {
                        lowestCouponPrice.Add(item.JDFlagShipLowestPrice.Value);
                    }
                }
                if (lowestCouponPrice.Any() && item.Cost != null)
                {
                    item.Min_maoliValue = lowestCouponPrice.Min() - item.Cost;
                }
            });
            return(result.OrderByDescending(x => x.num_threemonth).ToList());
        }
Esempio n. 9
0
        public static Dictionary <string, decimal> SelectProductCouponPrice(IEnumerable <string> pids)
        {
            var result = DALThirdShop.SelectProductCouponPrice(pids);

            return(result);
        }
Esempio n. 10
0
 public static List <ThirdPartyMiaoShaModel> FetchThirdPartyMiaoShaItems(PriceSelectModel selectModel, PagerModel pager, string shopCode, int PriceDifStatus)
 {
     pager.TotalItem = DALThirdShop.GetMiaoShaItemCount(selectModel, shopCode, PriceDifStatus);
     return(DALThirdShop.GetThirdPartyMiaoShaItems(selectModel, PriceDifStatus, shopCode, pager)?.ToList());
 }