Commit f6320b7e authored by 黄奎's avatar 黄奎
parents 40d2f34d 48388c5b
...@@ -2689,6 +2689,11 @@ namespace Mall.Module.Product ...@@ -2689,6 +2689,11 @@ namespace Mall.Module.Product
} }
} }
} }
if (dcList.Where(x => x.SmallShopId > 0).Any())
{
IsCommissionCoupons = false;
}
} }
} }
} }
......
...@@ -1489,6 +1489,11 @@ namespace Mall.Module.Product ...@@ -1489,6 +1489,11 @@ namespace Mall.Module.Product
} }
MaxSellMoney = model.SpecificationPriceList.Max(x => x.SellingPrice ?? 0); MaxSellMoney = model.SpecificationPriceList.Max(x => x.SellingPrice ?? 0);
model.SellingPrice = model.SpecificationPriceList.Min(x => x.SellingPrice ?? 0); model.SellingPrice = model.SpecificationPriceList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = MaxSellMoney + Math.Ceiling(MaxSellMoney / 10);
if (MaxPrice > model.OriginalPrice)
{
model.OriginalPrice = MaxPrice;
}
} }
//区域 //区域
model.AreaList = new List<RB_Goods_Area_Extend>(); model.AreaList = new List<RB_Goods_Area_Extend>();
......
...@@ -3,11 +3,13 @@ using Mall.Model.Entity.BaseSetUp; ...@@ -3,11 +3,13 @@ using Mall.Model.Entity.BaseSetUp;
using Mall.Model.Entity.MarketingCenter; using Mall.Model.Entity.MarketingCenter;
using Mall.Model.Extend.BaseSetUp; using Mall.Model.Extend.BaseSetUp;
using Mall.Model.Extend.MarketingCenter; using Mall.Model.Extend.MarketingCenter;
using Mall.Model.Extend.Product;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Mall.Module.BaseSetUp; using Mall.Module.BaseSetUp;
using Mall.Module.MarketingCenter; using Mall.Module.MarketingCenter;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Module.User; using Mall.Module.User;
using Mall.Repository.Product;
using Mall.Repository.User; using Mall.Repository.User;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
...@@ -70,6 +72,10 @@ namespace Mall.WebApi.Controllers ...@@ -70,6 +72,10 @@ namespace Mall.WebApi.Controllers
/// 微店商品价格 /// 微店商品价格
/// </summary> /// </summary>
private static RB_SmallShops_PriceRepository smallShops_PriceRepository = new RB_SmallShops_PriceRepository(); private static RB_SmallShops_PriceRepository smallShops_PriceRepository = new RB_SmallShops_PriceRepository();
/// <summary>
/// 商品规格价格
/// </summary>
private static RB_Goods_SpecificationPriceRepository goods_SpecificationPriceRepository = new RB_Goods_SpecificationPriceRepository();
/// <summary> /// <summary>
...@@ -195,41 +201,87 @@ namespace Mall.WebApi.Controllers ...@@ -195,41 +201,87 @@ namespace Mall.WebApi.Controllers
#region 微店价格 #region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend(); RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>(); List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
if (SmallShopsId > 0 && tempGoodsList.Any()) { if (SmallShopsId > 0 && tempGoodsList.Any())
{
string goodsId = string.Join(",", tempGoodsList.Select(x => x.Id)); string goodsId = string.Join(",", tempGoodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId); smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId }); smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId });
foreach (var item in tempGoodsList) { var spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsId });
foreach (var item in tempGoodsList)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{ {
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault(); var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (sspModel != null) if (spList.Any())
{ {
//单商品设置的 foreach (var qitem in spriceList)
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); var sspModel = smallPList.Where(x => x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); if (sspModel != null)
{
//单商品设置的
if (sspModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
}
}
} }
else if (sspModel.PriceType == 2) item.SellingPrice = spriceList.Min(x => x.SellingPrice ?? 0);
{ decimal MaxPrice = spriceList.Max(x => x.SellingPrice ?? 0);
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0); MaxPrice += Math.Ceiling(MaxPrice / 10);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0); if (MaxPrice > item.OriginalPrice) {
item.OriginalPrice = MaxPrice;
} }
} }
else else
{ {
if ((smallModel.UpPrice ?? 0) > 0) var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{ {
if (smallModel.PriceType == 1) //单商品设置的
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
} }
else if (smallModel.PriceType == 2) else if (sspModel.PriceType == 2)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0); item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0); item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
} }
} }
} }
...@@ -274,38 +326,83 @@ namespace Mall.WebApi.Controllers ...@@ -274,38 +326,83 @@ namespace Mall.WebApi.Controllers
string goodsId = string.Join(",", catGoodsList.Select(x => x.Id)); string goodsId = string.Join(",", catGoodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId); smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId }); smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId });
var spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsId });
foreach (var item in catGoodsList) foreach (var item in catGoodsList)
{ {
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{ {
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault(); var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (sspModel != null) if (spList.Any())
{ {
//单商品设置的 foreach (var qitem in spriceList)
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); var sspModel = smallPList.Where(x => x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); if (sspModel != null)
{
//单商品设置的
if (sspModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
}
}
} }
else if (sspModel.PriceType == 2) item.SellingPrice = spriceList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spriceList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0); item.OriginalPrice = MaxPrice;
item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
} }
} }
else else
{ {
if ((smallModel.UpPrice ?? 0) > 0) var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{ {
if (smallModel.PriceType == 1) //单商品设置的
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
} }
else if (smallModel.PriceType == 2) else if (sspModel.PriceType == 2)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0); item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0); item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
} }
} }
} }
...@@ -352,38 +449,83 @@ namespace Mall.WebApi.Controllers ...@@ -352,38 +449,83 @@ namespace Mall.WebApi.Controllers
string goodsId = string.Join(",", goodsList.Select(x => x.Id)); string goodsId = string.Join(",", goodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId); smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId }); smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId });
var spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsId });
foreach (var item in goodsList) foreach (var item in goodsList)
{ {
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{ {
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault(); var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (sspModel != null) if (spList.Any())
{ {
//单商品设置的 foreach (var qitem in spriceList)
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); var sspModel = smallPList.Where(x => x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); if (sspModel != null)
{
//单商品设置的
if (sspModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
}
}
} }
else if (sspModel.PriceType == 2) item.SellingPrice = spriceList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spriceList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0); item.OriginalPrice = MaxPrice;
item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
} }
} }
else else
{ {
if ((smallModel.UpPrice ?? 0) > 0) var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{ {
if (smallModel.PriceType == 1) //单商品设置的
if (sspModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
} }
else if (smallModel.PriceType == 2) }
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0); if (smallModel.PriceType == 1)
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0); {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
} }
} }
} }
...@@ -427,38 +569,83 @@ namespace Mall.WebApi.Controllers ...@@ -427,38 +569,83 @@ namespace Mall.WebApi.Controllers
string goodsId = string.Join(",", tempGoodsList.Select(x => x.Id)); string goodsId = string.Join(",", tempGoodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId); smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId }); smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = goodsId });
var spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsId });
foreach (var item in tempGoodsList) foreach (var item in tempGoodsList)
{ {
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any()) if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{ {
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault(); var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (sspModel != null) if (spList.Any())
{ {
//单商品设置的 foreach (var qitem in spriceList)
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); var sspModel = smallPList.Where(x => x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100); if (sspModel != null)
{
//单商品设置的
if (sspModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + Math.Ceiling((qitem.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
qitem.SellingPrice = (qitem.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
}
}
} }
else if (sspModel.PriceType == 2) item.SellingPrice = spriceList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spriceList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0); item.OriginalPrice = MaxPrice;
item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
} }
} }
else else
{ {
if ((smallModel.UpPrice ?? 0) > 0) var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{ {
if (smallModel.PriceType == 1) //单商品设置的
if (sspModel.PriceType == 1)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100); item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
} }
else if (smallModel.PriceType == 2) else if (sspModel.PriceType == 2)
{ {
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0); item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0); item.OriginalPrice = (item.OriginalPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
item.OriginalPrice = (item.OriginalPrice ?? 0) + Math.Ceiling((item.OriginalPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
item.OriginalPrice = (item.OriginalPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment