Commit 04e62a54 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents feaf5d53 575b41e6
...@@ -230,5 +230,10 @@ namespace Mall.Model.Extend.Product ...@@ -230,5 +230,10 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public List<object> SupplierSpecificationList { get; set; } public List<object> SupplierSpecificationList { get; set; }
/// <summary>
/// 是否直查询有视频商品(1-是)HK0902新增
/// </summary>
public int IsVideo { get; set; }
} }
} }
...@@ -24,5 +24,10 @@ namespace Mall.Model.Extend.Product ...@@ -24,5 +24,10 @@ namespace Mall.Model.Extend.Product
/// 路径 /// 路径
/// </summary> /// </summary>
public string Path { get; set; } public string Path { get; set; }
/// <summary>
/// 1-视频
/// </summary>
public int Type { get; set; }
} }
} }
...@@ -6956,14 +6956,14 @@ namespace Mall.Module.Product ...@@ -6956,14 +6956,14 @@ namespace Mall.Module.Product
if (model.Type == 2) if (model.Type == 2)
{ {
var oeModel = goods_OrderExpressRepository.GetList(new RB_Goods_OrderExpress_Extend() { AfterSaleOrderId = model.ReOrderId, TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault(); var oeModel = goods_OrderExpressRepository.GetList(new RB_Goods_OrderExpress_Extend() { AfterSaleOrderId = model.ReOrderId, TenantId = tenantId, MallBaseId = mallBaseId }).FirstOrDefault();
if (oeModel.Type == 1) if (oeModel!=null&&oeModel.Type == 1)
{ {
var leModel = logistics_ExpressRepository.GetEntity(oeModel.ExpressId); var leModel = logistics_ExpressRepository.GetEntity(oeModel.ExpressId);
ExpressList.Add(new ExpressList.Add(new
{ {
Name = uModel.Name ?? "", Name = uModel.Name ?? "",
ExpressName = leModel.Name ?? "", ExpressName = leModel.Name ?? "",
oeModel.ExpressNumber, ExpressNumber=oeModel?.ExpressNumber??"",
Type = 1 Type = 1
}); });
} }
...@@ -6973,7 +6973,7 @@ namespace Mall.Module.Product ...@@ -6973,7 +6973,7 @@ namespace Mall.Module.Product
{ {
Name = uModel.Name ?? "", Name = uModel.Name ?? "",
ExpressName = "", ExpressName = "",
ExpressNumber = oeModel.Remark, ExpressNumber = oeModel?.Remark??"",
Type = 2 Type = 2
}); });
} }
......
...@@ -1572,6 +1572,16 @@ namespace Mall.Module.Product ...@@ -1572,6 +1572,16 @@ namespace Mall.Module.Product
//轮播 //轮播
model.CarouselImageList = new List<RB_ImageCommonModel>(); model.CarouselImageList = new List<RB_ImageCommonModel>();
if (!string.IsNullOrWhiteSpace(model.VideoAddress))
{
model.CarouselImageList.Add(new RB_ImageCommonModel()
{
Id = 0,
Name = "",
Type = 1,
Path = model.VideoAddress
});
}
if (!string.IsNullOrEmpty(model.CarouselImage) && model.CarouselImage != "[]") if (!string.IsNullOrEmpty(model.CarouselImage) && model.CarouselImage != "[]")
{ {
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(model.CarouselImage); List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(model.CarouselImage);
...@@ -2370,7 +2380,8 @@ namespace Mall.Module.Product ...@@ -2370,7 +2380,8 @@ namespace Mall.Module.Product
pic_url = model.CarouselImageList.Select(x => new pic_url = model.CarouselImageList.Select(x => new
{ {
id = x.Id, id = x.Id,
pic_url = x.Path pic_url = x.Path,
type = x.Type
}), }),
share = model.MaxShare,//分销佣金 share = model.MaxShare,//分销佣金
myBuyCommission = MyBuyCommission,//粉象模式 自购返利 myBuyCommission = MyBuyCommission,//粉象模式 自购返利
...@@ -4020,7 +4031,7 @@ namespace Mall.Module.Product ...@@ -4020,7 +4031,7 @@ namespace Mall.Module.Product
/// <param name="count"></param> /// <param name="count"></param>
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsPageList_V2(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel) public List<RB_Goods_Extend> GetProductGoodsPageList_V2(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel, int SmallShopsId = 0)
{ {
if (!string.IsNullOrEmpty(demodel.CategoryIds) && !demodel.CategoryIds.Contains(',')) if (!string.IsNullOrEmpty(demodel.CategoryIds) && !demodel.CategoryIds.Contains(','))
{ {
...@@ -4050,8 +4061,17 @@ namespace Mall.Module.Product ...@@ -4050,8 +4061,17 @@ namespace Mall.Module.Product
var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel); var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) if (list.Any())
{ {
//查询分类 RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
List<RB_Goods_SpecificationPrice_Extend> spriceList = new List<RB_Goods_SpecificationPrice_Extend>();
//商品Id
string ids = string.Join(",", list.Select(x => x.Id)); string ids = string.Join(",", list.Select(x => x.Id));
if (SmallShopsId > 0)
{
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = ids });
spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids });
}
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var olist = goods_OrderRepository.GetGoodsOrderNum(ids); var olist = goods_OrderRepository.GetGoodsOrderNum(ids);
foreach (var item in list) foreach (var item in list)
...@@ -4068,6 +4088,89 @@ namespace Mall.Module.Product ...@@ -4068,6 +4088,89 @@ namespace Mall.Module.Product
} }
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0; item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
#region 微店价格
if (SmallShopsId > 0)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{
var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (spList.Any())
{
foreach (var qitem in spList)
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
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);
}
}
}
}
item.SellingPrice = spList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{
item.OriginalPrice = MaxPrice;
}
}
else
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{
//单商品设置的
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) + (sspModel.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);
}
}
}
}
}
}
#endregion
} }
} }
return list; return list;
...@@ -4122,13 +4225,22 @@ namespace Mall.Module.Product ...@@ -4122,13 +4225,22 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
/// <param name="demodel"></param> /// <param name="demodel"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsList(RB_Goods_Extend demodel) public List<RB_Goods_Extend> GetProductGoodsList(RB_Goods_Extend demodel, int SmallShopsId = 0)
{ {
var list = goodsRepository.GetList(demodel); var list = goodsRepository.GetList(demodel);
if (list.Any()) if (list.Any())
{ {
//查询分类 //查询分类
string ids = string.Join(",", list.Select(x => x.Id)); string ids = string.Join(",", list.Select(x => x.Id));
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
List<RB_Goods_SpecificationPrice_Extend> spriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (SmallShopsId > 0)
{
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
smallPList = smallShops_PriceRepository.GetList(new RB_SmallShops_Price_Extend() { SmallShopsId = SmallShopsId, GoodsIds = ids });
spriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = ids });
}
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var item in list) foreach (var item in list)
{ {
...@@ -4142,6 +4254,90 @@ namespace Mall.Module.Product ...@@ -4142,6 +4254,90 @@ namespace Mall.Module.Product
item.CoverImage = CarouselIdList[0]; item.CoverImage = CarouselIdList[0];
//轮播图 //轮播图
} }
#region 微店价格
if (SmallShopsId > 0)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{
var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (spList.Any())
{
foreach (var qitem in spList)
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
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);
}
}
}
}
item.SellingPrice = spList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{
item.OriginalPrice = MaxPrice;
}
}
else
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{
//单商品设置的
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) + (sspModel.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);
}
}
}
}
}
}
#endregion
} }
} }
return list; return list;
...@@ -4349,7 +4545,7 @@ namespace Mall.Module.Product ...@@ -4349,7 +4545,7 @@ namespace Mall.Module.Product
{ nameof(RB_Goods.EnjoyMember),demodel.EnjoyMember}, { nameof(RB_Goods.EnjoyMember),demodel.EnjoyMember},
{ nameof(RB_Goods.SeparateSetMember),demodel.SeparateSetMember}, { nameof(RB_Goods.SeparateSetMember),demodel.SeparateSetMember},
{ nameof(RB_Goods.IsQuickBuy),demodel.IsQuickBuy}, { nameof(RB_Goods.IsQuickBuy),demodel.IsQuickBuy},
}; };
} }
List<WhereHelper> wheres = new List<WhereHelper>() { List<WhereHelper> wheres = new List<WhereHelper>() {
...@@ -6716,7 +6912,6 @@ namespace Mall.Module.Product ...@@ -6716,7 +6912,6 @@ namespace Mall.Module.Product
} }
#endregion #endregion
#region 分类包邮规则信息 #region 分类包邮规则信息
/// <summary> /// <summary>
/// 物流规则列表 /// 物流规则列表
......
...@@ -233,7 +233,7 @@ namespace Mall.Module.User ...@@ -233,7 +233,7 @@ namespace Mall.Module.User
{ {
{ nameof(RB_Employee_Extend.Status),1}, { nameof(RB_Employee_Extend.Status),1},
}; };
bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId)); bool flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
return flag; return flag;
} }
......
...@@ -411,6 +411,11 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -411,6 +411,11 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{ {
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'"; where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
} }
if (dmodel.IsVideo > 0)
{
where += $@" and IFNULL(g.{nameof(RB_Goods_Extend.VideoAddress)} <>'' ";
}
//默认综合【升序】 //默认综合【升序】
string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc"; string orderBy = $" order by g.{nameof(RB_Goods_Extend.Sort)} asc";
//上架时间【降序】 //上架时间【降序】
......
...@@ -197,98 +197,8 @@ namespace Mall.WebApi.Controllers ...@@ -197,98 +197,8 @@ namespace Mall.WebApi.Controllers
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
GoodsIds = Ids, GoodsIds = Ids,
GoodsStatus = 1 GoodsStatus = 1
}); }, SmallShopsId: SmallShopsId);
#region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
if (SmallShopsId > 0 && tempGoodsList.Any())
{
string goodsId = string.Join(",", tempGoodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
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)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{
var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (spList.Any())
{
foreach (var qitem in spList)
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
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);
}
}
}
}
item.SellingPrice = spList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice) {
item.OriginalPrice = MaxPrice;
}
}
else
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{
//单商品设置的
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) + (sspModel.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);
}
}
}
}
}
}
}
#endregion
List<GoodsDetailsItem2> newGoodsList = new List<GoodsDetailsItem2>(); List<GoodsDetailsItem2> newGoodsList = new List<GoodsDetailsItem2>();
foreach (var goodItem in childItem.goodsList) foreach (var goodItem in childItem.goodsList)
{ {
...@@ -317,99 +227,7 @@ namespace Mall.WebApi.Controllers ...@@ -317,99 +227,7 @@ namespace Mall.WebApi.Controllers
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
CategoryIds = childItem.id.ToString(), CategoryIds = childItem.id.ToString(),
GoodsStatus = 1 GoodsStatus = 1
}); },SmallShopsId:SmallShopsId);
#region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
if (SmallShopsId > 0 && catGoodsList.Any())
{
string goodsId = string.Join(",", catGoodsList.Select(x => x.Id));
smallModel = smallShops_InfoRepository.GetEntity<RB_SmallShops_Info_Extend>(SmallShopsId);
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)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{
var spList = spriceList.Where(x => x.GoodsId == item.Id).ToList();
if (spList.Any())
{
foreach (var qitem in spList)
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == qitem.SpecificationSort).FirstOrDefault();
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);
}
}
}
}
item.SellingPrice = spList.Min(x => x.SellingPrice ?? 0);
decimal MaxPrice = spList.Max(x => x.SellingPrice ?? 0);
MaxPrice += Math.Ceiling(MaxPrice / 10);
if (MaxPrice > item.OriginalPrice)
{
item.OriginalPrice = MaxPrice;
}
}
else
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{
//单商品设置的
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) + (sspModel.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);
}
}
}
}
}
}
}
#endregion
if (catGoodsList != null && catGoodsList.Count > 0) if (catGoodsList != null && catGoodsList.Count > 0)
{ {
foreach (var gItem in catGoodsList) foreach (var gItem in catGoodsList)
......
...@@ -88,9 +88,13 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -88,9 +88,13 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
return ApiResult.ParamIsNull("请传递文件路径"); return ApiResult.ParamIsNull("请传递文件路径");
} }
//HK2020-09-01修改
demodel.Path = Config.GetFilePath(demodel.Path); if (demodel.Type == 1)
demodel.Image = Config.GetFilePath(demodel.Image); {
demodel.Path = Config.GetFilePath(demodel.Path);
demodel.Image = Config.GetFilePath(demodel.Image);
}
demodel.TenantId = Convert.ToInt32(parms.uid); demodel.TenantId = Convert.ToInt32(parms.uid);
demodel.MallBaseId = parms.MallBaseId; demodel.MallBaseId = parms.MallBaseId;
demodel.CreateDate = DateTime.Now; demodel.CreateDate = DateTime.Now;
...@@ -1447,150 +1451,155 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1447,150 +1451,155 @@ namespace Mall.WebApi.Controllers.MallBase
} }
var model = productModule.GetProductGoodsInfo(GoodsId, req.TenantId, req.MallBaseId); var model = productModule.GetProductGoodsInfo(GoodsId, req.TenantId, req.MallBaseId);
return ApiResult.Success("", new object obj = new object();
if (model != null)
{ {
model?.Id, obj = new
model?.Name,
model?.CarouselImage,
model?.VideoAddress,
model?.CustomShareTitles,
model?.CustomShareImage,
model?.CustomShareImagePath,
model?.GoodsStatus,
model?.InventoryNum,
model?.DefaultSpecificationName,
model?.IsCustomSpecification,
model?.Sort,
model?.SellingPrice,
model?.OriginalPrice,
model?.Unit,
model?.CostPrice,
model?.IsGoodsNegotiable,
model?.SalesNum,
model?.GoodsNumbers,
model?.GoodsWeight,
model?.IsDefaultService,
model?.GoodsService,
model?.FreightId,
model?.FreightName,
model?.FormsId,
model?.FormsName,
model?.LimitBuyGoodsNum,
model?.LimitBuyOrderNum,
model?.FullNumPinkage,
model?.FullMoneyPinkage,
model?.IsAreaBuy,
model?.IntegralPresent,
model?.IntegralPresentType,
model?.PointsDeduction,
model?.PointsDeductionType,
model?.IsMultipleDeduction,
model?.GoodsDetails,
model?.SeparateDistribution,
model?.SeparateDistributionType,
model?.SeparateDistributionMoneyType,
model?.EnjoyMember,
model?.SeparateSetMember,
model?.IsQuickBuy,
model?.SupplierId,
model?.IsProxy,
model?.ProxyType,
model?.ProxyRises,
model?.ProxyMoney,
model?.IsProcurement,
model?.Commission,
model?.IsLiveGoods,
model.SendArea,
CategoryList = model?.CategoryList.Select(x => new
{
x.Id,
x.CategoryId,
x.CategoryName
}),
SpecificationList = model?.SpecificationList.Select(x => new
{ {
x.Id, model?.Id,
x.EnabledImage, model?.Name,
x.Name, model?.CarouselImage,
x.Sort, model?.VideoAddress,
SpecificationValueList = x.SpecificationValueList.Select(y => new model?.CustomShareTitles,
model?.CustomShareImage,
model?.CustomShareImagePath,
model?.GoodsStatus,
model?.InventoryNum,
model?.DefaultSpecificationName,
model?.IsCustomSpecification,
model?.Sort,
model?.SellingPrice,
model?.OriginalPrice,
model?.Unit,
model?.CostPrice,
model?.IsGoodsNegotiable,
model?.SalesNum,
model?.GoodsNumbers,
model?.GoodsWeight,
model?.IsDefaultService,
model?.GoodsService,
model?.FreightId,
model?.FreightName,
model?.FormsId,
model?.FormsName,
model?.LimitBuyGoodsNum,
model?.LimitBuyOrderNum,
model?.FullNumPinkage,
model?.FullMoneyPinkage,
model?.IsAreaBuy,
model?.IntegralPresent,
model?.IntegralPresentType,
model?.PointsDeduction,
model?.PointsDeductionType,
model?.IsMultipleDeduction,
model?.GoodsDetails,
model?.SeparateDistribution,
model?.SeparateDistributionType,
model?.SeparateDistributionMoneyType,
model?.EnjoyMember,
model?.SeparateSetMember,
model?.IsQuickBuy,
model?.SupplierId,
model?.IsProxy,
model?.ProxyType,
model?.ProxyRises,
model?.ProxyMoney,
model?.IsProcurement,
model?.Commission,
model?.IsLiveGoods,
model?.SendArea,
CategoryList = model?.CategoryList.Select(x => new
{ {
y.Id, x.Id,
y.Image, x.CategoryId,
y.ImagePath, x.CategoryName
y.Name, }),
y.Sort SpecificationList = model?.SpecificationList.Select(x => new
})
}),
SpecificationPriceList = model?.SpecificationPriceList.Select(x => new
{
x.Id,
x.GoodsNumbers,
x.GoodsWeight,
x.InventoryNum,
x.SellingPrice,
x.SpecificationSort,
x.AttrList,
x.Commission,
x.CostMoney
}),
AreaList = model?.AreaList.Select(x => new
{
x.Id,
x.AreaId,
x.AreaName,
x.AreaType
}),
DistributionCommissionList = model?.DistributionCommissionList.Select(x => new
{
x.Id,
x.DistributorGrade,
x.OneCommission,
x.SpecificationSort,
x.ThreeCommission,
x.TwoCommission
}),
DistributionCommissionTreeList = model?.DistributionCommissionTreeList.Select(x => new
{
x.Id,
x.SpecificationSort,
x.AttrList,
GradeCommissionList = x.GradeCommissionList.Select(y => new
{ {
y.DistributorGrade, x.Id,
y.OneCommission, x.EnabledImage,
y.ThreeCommission, x.Name,
y.TwoCommission x.Sort,
}) SpecificationValueList = x.SpecificationValueList.Select(y => new
}), {
MemberPriceList = model?.MemberPriceList.Select(x => new y.Id,
{ y.Image,
x.Id, y.ImagePath,
x.MemberGrade, y.Name,
x.MemberPrice, y.Sort
x.SpecificationSort })
}), }),
MemberPriceTreeList = model?.MemberPriceTreeList.Select(x => new SpecificationPriceList = model?.SpecificationPriceList.Select(x => new
{
x.Id,
x.SpecificationSort,
x.AttrList,
GradePriceList = x.GradePriceList.Select(y => new
{ {
y.MemberGrade, x.Id,
y.MemberPrice x.GoodsNumbers,
}) x.GoodsWeight,
}), x.InventoryNum,
model?.CarouselImageList, x.SellingPrice,
model?.ServiceList, x.SpecificationSort,
model?.PresentFXGrade, x.AttrList,
model?.PresentFXMonth, x.Commission,
model?.Advertising, x.CostMoney
model?.SubName, }),
model?.MarketingLogo, AreaList = model?.AreaList.Select(x => new
model?.ShelvesDate, {
model?.DownDate, x.Id,
}); x.AreaId,
x.AreaName,
x.AreaType
}),
DistributionCommissionList = model?.DistributionCommissionList.Select(x => new
{
x.Id,
x.DistributorGrade,
x.OneCommission,
x.SpecificationSort,
x.ThreeCommission,
x.TwoCommission
}),
DistributionCommissionTreeList = model?.DistributionCommissionTreeList.Select(x => new
{
x.Id,
x.SpecificationSort,
x.AttrList,
GradeCommissionList = x.GradeCommissionList.Select(y => new
{
y.DistributorGrade,
y.OneCommission,
y.ThreeCommission,
y.TwoCommission
})
}),
MemberPriceList = model?.MemberPriceList.Select(x => new
{
x.Id,
x.MemberGrade,
x.MemberPrice,
x.SpecificationSort
}),
MemberPriceTreeList = model?.MemberPriceTreeList.Select(x => new
{
x.Id,
x.SpecificationSort,
x.AttrList,
GradePriceList = x.GradePriceList.Select(y => new
{
y.MemberGrade,
y.MemberPrice
})
}),
model?.CarouselImageList,
model?.ServiceList,
model?.PresentFXGrade,
model?.PresentFXMonth,
model?.Advertising,
model?.SubName,
model?.MarketingLogo,
model?.ShelvesDate,
model?.DownDate,
};
}
return ApiResult.Success("", obj);
} }
/// <summary> /// <summary>
......
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