Commit 23c97c57 authored by 吴春's avatar 吴春

提交代码

parent 6bce9490
......@@ -2665,7 +2665,7 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary>
/// 商品列表
/// </summary>
public List<GoodsDetailsItem2> goodsList { get; set; }
public List<StoreGoodsDetailsItem2> goodsList { get; set; }
}
/// <summary>
......@@ -2699,6 +2699,11 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary>
public decimal OriginalPrice { get; set; }
/// <summary>
/// 是否选择服务人员(0-不选,1-选择)前端使用
/// </summary>
public int IsChooseServicePerson { get; set; }
/// <summary>
/// 课程评分 2020-10-13 ld
/// </summary>
......
......@@ -4945,6 +4945,49 @@ namespace Mall.Module.Product
return list;
}
/// <summary>
/// 获取下拉列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Goods_Extend> GetProductGoodsDialogList_V3(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel)
{
var list = goodsRepository.GetProductGoodsDialogList_V3(pageIndex, pageSize, out count, demodel);
if (list.Any())
{
//查询分类
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 });
foreach (var item in list)
{
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
//轮播图
item.CoverImage = "";
item.CarouselImageList = new List<RB_ImageCommonModel>();
if (!string.IsNullOrEmpty(item.CarouselImage) && item.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(item.CarouselImage);
//封面图
item.CoverImage = CarouselIdList[0];
//轮播图
//轮播图
foreach (var qitem in CarouselIdList)
{
item.CarouselImageList.Add(new RB_ImageCommonModel()
{
Id = 0,
Name = "",
Path = qitem
});
}
}
}
}
return list;
}
/// <summary>
/// 获取后台商品分页列表
......
......@@ -88,7 +88,7 @@ namespace Mall.WebApi.Controllers
/// </summary>
/// <param name="item"></param>
/// <returns></returns>
public static object PlusDataToObject(ComponentItem subItem, int TenantId, int MallBaseId, int SmallShopsId, int IsOpenSchool)
public static object PlusDataToObject(ComponentItem subItem, int TenantId, int MallBaseId, int SmallShopsId, int IsOpenSchool, int StoreId)
{
var obj = new object();
switch (subItem.Id)
......@@ -855,13 +855,14 @@ namespace Mall.WebApi.Controllers
GoodsIds = Ids,
GoodsStatus = 1,
GoodsClassify = 3,//查询非司导
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
StoresIds = StoreId.ToString()
// GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}, SmallShopsId: SmallShopsId);
List<GoodsDetailsItem2> newGoodsList = new List<GoodsDetailsItem2>();
List<StoreGoodsDetailsItem2> newGoodsList = new List<StoreGoodsDetailsItem2>();
foreach (var goodItem in childItem.goodsList)
{
var lastItem = new GoodsDetailsItem2();
var lastItem = new StoreGoodsDetailsItem2();
var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0)
{
......@@ -871,6 +872,7 @@ namespace Mall.WebApi.Controllers
lastItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : "";
lastItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2);
lastItem.courseScore = (tempGood.CourseScore ?? 0);
lastItem.IsChooseServicePerson = tempGood.IsChooseServicePerson;
newGoodsList.Add(lastItem);
}
}
......@@ -880,7 +882,7 @@ namespace Mall.WebApi.Controllers
//自动添加商品
else
{
childItem.goodsList = new List<GoodsDetailsItem2>();
childItem.goodsList = new List<StoreGoodsDetailsItem2>();
var catGoodsList = productModule.GetProductGoodsPageList_V2(1, childItem.goodsNum, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
{
TenantId = TenantId,
......@@ -888,20 +890,22 @@ namespace Mall.WebApi.Controllers
CategoryIds = childItem.id.ToString(),
GoodsStatus = 1,
GoodsClassify = 3,//查询非司导
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
StoresIds = StoreId.ToString()
// GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}, SmallShopsId: SmallShopsId);
if (catGoodsList != null && catGoodsList.Count > 0)
{
foreach (var gItem in catGoodsList)
{
childItem.goodsList.Add(new GoodsDetailsItem2()
childItem.goodsList.Add(new StoreGoodsDetailsItem2()
{
id = gItem.Id,
price = Math.Round((gItem?.SellingPrice ?? 0), 2),
name = gItem.Name,
picUrl = Common.Config.GetFileUrl(gItem.CoverImage),
OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2),
courseScore = gItem.CourseScore ?? 0
courseScore = gItem.CourseScore ?? 0,
IsChooseServicePerson = gItem.IsChooseServicePerson
});
}
}
......@@ -921,8 +925,9 @@ namespace Mall.WebApi.Controllers
TenantId = TenantId,
MallBaseId = MallBaseId,
GoodsStatus = 1,
GoodsClassify =3,//查询非司导
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
GoodsClassify = 3,//查询非司导
StoresIds = StoreId.ToString()
// GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
});
#region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
......@@ -1027,8 +1032,9 @@ namespace Mall.WebApi.Controllers
name = gItem.Name,
picUrl = Common.Config.GetFileUrl(gItem.CoverImage),
OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2),
courseScore = gItem.CourseScore ?? 0
});
courseScore = gItem.CourseScore ?? 0,
IsChooseServicePerson = gItem.IsChooseServicePerson
});
}
}
}
......@@ -1045,7 +1051,8 @@ namespace Mall.WebApi.Controllers
GoodsIds = Ids,
GoodsStatus = 1,
GoodsClassify = 3,//查询非司导
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
StoresIds = StoreId.ToString()
// GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
});
#region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
......@@ -1152,6 +1159,7 @@ namespace Mall.WebApi.Controllers
childItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : "";
childItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2);
childItem.courseScore = (tempGood.CourseScore ?? 0);
childItem.IsChooseServicePerson = tempGood.IsChooseServicePerson;
newGoodsList.Add(childItem);
}
}
......
......@@ -1472,6 +1472,33 @@ namespace Mall.WebApi.Controllers.MallBase
}
/// <summary>
/// 获取商品列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetProductGoodsDialogList_V3()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Goods_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = productModule.GetProductGoodsDialogList_V3(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.Id,
x.Name,
x.CoverImage,
x.CarouselImageList,
x.SellingPrice,
CategoryList = x.CategoryList.Select(y => new { y.Id, y.CategoryName })
});
return ApiResult.Success("", pagelist);
}
/// <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