Commit e0dda873 authored by 黄奎's avatar 黄奎

商品修改

parent c220f5d9
......@@ -38,14 +38,41 @@ namespace Mall.Model.Entity.Product
public int GoodsStatus { get; set; }
/// <summary>
/// 排序
/// 售价
/// </summary>
public int Sort { get; set; }
public decimal SellingPrice { get; set; }
/// <summary>
///
///
/// </summary>
public decimal SellingPrice { get; set; }
public decimal Original_Price { get; set; }
/// <summary>
/// 商品总库存
/// </summary>
public int Goods_Stock { get; set; }
/// <summary>
/// 商品默认规格
/// </summary>
public string Goods_unit { get; set; }
/// <summary>
/// 商品货号
/// </summary>
public string Goods_no { get; set; }
/// <summary>
/// 商品重量
/// </summary>
public string Goods_weight { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 是否开启虚拟成团(1-开启)
......
......@@ -295,6 +295,11 @@ namespace Mall.Model.Extend.MarketingCenter
/// 左右边距
/// </summary>
public string leftAndRight { get; set; }
/// <summary>
/// 背景颜色
/// </summary>
public string background { get; set; }
}
/// <summary>
......
......@@ -53,11 +53,7 @@ namespace Mall.Model.Extend.Product
}
}
/// <summary>
/// 商品库存
/// </summary>
public decimal Goods_stock { get; set; }
/// <summary>
/// 活动开始时间
/// </summary>
......
......@@ -67,8 +67,13 @@ namespace Mall.Module.Product
{ nameof(RB_Groupbuy_Activity_Extend.EndTime),extModel.EndTime},
{ nameof(RB_Groupbuy_Activity_Extend.GoodId),extModel.GoodId},
{ nameof(RB_Groupbuy_Activity_Extend.GoodsStatus),extModel.GoodsStatus},
{ nameof(RB_Groupbuy_Activity_Extend.Sort),extModel.Sort},
{ nameof(RB_Groupbuy_Activity_Extend.SellingPrice),extModel.SellingPrice},
{ nameof(RB_Groupbuy_Activity_Extend.Original_Price),extModel.Original_Price},
{ nameof(RB_Groupbuy_Activity_Extend.Goods_Stock),extModel.Goods_Stock},
{ nameof(RB_Groupbuy_Activity_Extend.Goods_unit),extModel.Goods_unit},
{ nameof(RB_Groupbuy_Activity_Extend.Goods_no),extModel.Goods_no},
{ nameof(RB_Groupbuy_Activity_Extend.Goods_weight),extModel.Goods_weight},
{ nameof(RB_Groupbuy_Activity_Extend.Sort),extModel.Sort},
{ nameof(RB_Groupbuy_Activity_Extend.Is_Auto_Add_Robot),extModel.Is_Auto_Add_Robot},
{ nameof(RB_Groupbuy_Activity_Extend.Virtual_Sales),extModel.Virtual_Sales},
{ nameof(RB_Groupbuy_Activity_Extend.Is_Alone_Buy),extModel.Is_Alone_Buy},
......
......@@ -3405,8 +3405,9 @@ namespace Mall.Module.Product
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <param name="IsGetSpec">是否获取规格</param>
/// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel)
public List<RB_Goods_Extend> GetProductGoodsPageList(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel,int IsGetSpec=0)
{
var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any())
......@@ -3415,6 +3416,16 @@ namespace Mall.Module.Product
string ids = string.Join(",", list.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var olist = goods_OrderRepository.GetGoodsOrderNum(ids);
//规格列表
List<RB_Goods_Specification_Extend> SpecificationList = new List<RB_Goods_Specification_Extend>();
//规格值
List<RB_Goods_SpecificationValue_Extend> svlist = new List<RB_Goods_SpecificationValue_Extend>();
if (IsGetSpec == 1)
{
SpecificationList= goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
svlist = goods_SpecificationValueRepository.GetList(new RB_Goods_SpecificationValue_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
}
foreach (var item in list)
{
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
......@@ -3429,7 +3440,19 @@ namespace Mall.Module.Product
}
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
if (IsGetSpec==1)
{
item.SpecificationList = SpecificationList?.Where(qitem => qitem.GoodsId == item.Id)?.ToList()??new List<RB_Goods_Specification_Extend>();
if (item.SpecificationList != null && item.SpecificationList.Count > 0)
{
foreach (var subItem in item.SpecificationList)
{
subItem.SpecificationValueList = svlist.Where(x => x.SpecificationId == subItem.Id).ToList();
}
}
}
}
}
return list;
}
......
......@@ -24,7 +24,7 @@ namespace Mall.Repository.Product
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.Name AS QGoodName,B.CarouselImage AS CarouselImage,B.InventoryNum AS Goods_stock
SELECT A.*,B.Name AS QGoodName,B.CarouselImage AS CarouselImage
FROM RB_Groupbuy_Activity AS A LEFT JOIN rb_goods AS B ON A.GoodId=B.Id
WHERE 1=1
");
......
......@@ -1376,10 +1376,11 @@ namespace Mall.WebApi.Controllers.MallBase
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(parms.msg.ToString());
JObject parameters = JObject.Parse(RequestParm.msg.ToString());
int IsGetSpec = parameters.GetInt("IsGetSpec", 0);
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = productModule.GetProductGoodsPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
var list = productModule.GetProductGoodsPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel, IsGetSpec: IsGetSpec);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
......@@ -1388,7 +1389,16 @@ namespace Mall.WebApi.Controllers.MallBase
x.CoverImage,
x.SellingPrice,
x.SalesNum,
CategoryList = x.CategoryList.Select(y => new { y.Id, y.CategoryName })
CategoryList = x.CategoryList.Select(y => new { y.Id, y.CategoryName }),
x.InventoryNum,
x.Sort,
x.OriginalPrice,
x.DefaultSpecificationName,
x.GoodsNumbers,
x.GoodsWeight,
x.IsDefaultService,
x.GoodsService,
x.SpecificationList
});
return ApiResult.Success("", pagelist);
}
......
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