Commit caa5e30f authored by 黄奎's avatar 黄奎

新增字段

parent d0eecf82
...@@ -568,5 +568,10 @@ namespace Mall.Model.Entity.Product ...@@ -568,5 +568,10 @@ namespace Mall.Model.Entity.Product
/// 门店编号 /// 门店编号
/// </summary> /// </summary>
public string StoresIds { get; set; } public string StoresIds { get; set; }
/// <summary>
/// 服务时长
/// </summary>
public decimal ServiceTime { get; set; }
} }
} }
...@@ -55,6 +55,7 @@ namespace Mall.Model.Extend.Product ...@@ -55,6 +55,7 @@ namespace Mall.Model.Extend.Product
/// 版面类型 /// 版面类型
/// </summary> /// </summary>
public string CategoryPageTypeStr { get; set; } public string CategoryPageTypeStr { get; set; }
} }
/// <summary> /// <summary>
......
...@@ -199,6 +199,11 @@ namespace Mall.Module.Product ...@@ -199,6 +199,11 @@ namespace Mall.Module.Product
/// </summary> /// </summary>
private readonly RB_Reserve_ServicePersonalRepository reserve_ServicePersonalRepository = new RB_Reserve_ServicePersonalRepository(); private readonly RB_Reserve_ServicePersonalRepository reserve_ServicePersonalRepository = new RB_Reserve_ServicePersonalRepository();
/// <summary>
/// 门店仓储层对象
/// </summary>
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
#region 小程序接口 #region 小程序接口
/// <summary> /// <summary>
...@@ -250,7 +255,7 @@ namespace Mall.Module.Product ...@@ -250,7 +255,7 @@ namespace Mall.Module.Product
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Extend> GetAppletGoodsPageListForZY(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel, int IsGetShare = 0, int GoodsClassify = 0) public List<RB_Goods_Extend> GetAppletGoodsPageListForZY(int pageIndex, int pageSize, out long count, RB_Goods_Extend demodel, int IsGetShare = 0, int GoodsClassify = 0)
{ {
var list = goodsRepository.GetAppletGoodsPageList(pageIndex, pageSize, out count, demodel,GoodsClassify:GoodsClassify); var list = goodsRepository.GetAppletGoodsPageList(pageIndex, pageSize, out count, demodel, GoodsClassify: GoodsClassify);
if (list.Any()) if (list.Any())
{ {
var SpecificationList = new List<RB_Goods_Specification_Extend>(); var SpecificationList = new List<RB_Goods_Specification_Extend>();
...@@ -576,7 +581,8 @@ namespace Mall.Module.Product ...@@ -576,7 +581,8 @@ namespace Mall.Module.Product
} }
RList = list; RList = list;
} }
else { else
{
demodel.GoodsId = 0; demodel.GoodsId = 0;
list = goodsRepository.GetAppletGoodsPageList(pageIndex, pageSize, out long count, demodel); list = goodsRepository.GetAppletGoodsPageList(pageIndex, pageSize, out long count, demodel);
RList = list; RList = list;
...@@ -2563,6 +2569,73 @@ namespace Mall.Module.Product ...@@ -2563,6 +2569,73 @@ namespace Mall.Module.Product
#endregion #endregion
} }
/// <summary>
/// 获取线下服务一级分类列表
/// </summary>
/// <returns></returns>
public List<RB_Product_Category_Extend> GetAppletOfflineCategoryListModule(int TenantId, int MallBaseId)
{
var list = product_CategoryRepository.GetList(new RB_Product_Category_Extend()
{
TenantId = TenantId,
MallBaseId = MallBaseId,
Tier = 1
});
return list;
}
/// <summary>
/// 根据分类获取所有商品列表
/// </summary>
/// <param name="TenantId"></param>
/// <param name="MallBaseId"></param>
/// <param name="categoryIds"></param>
/// <param name="storeId"></param>
/// <returns></returns>
public object GetAppletOfflineGoodsListModule(int TenantId, int MallBaseId, string categoryIds, int storeId = 0)
{
List<object> list = new List<object>();
string qCategoryIds = "";
if (!string.IsNullOrEmpty(categoryIds))
{
var allCateList = product_CategoryRepository.GetCurrentAndChildCategoryListRepository(categoryIds);
if (allCateList != null && allCateList.Count > 0)
{
qCategoryIds = string.Join(",", allCateList.Select(qitem => qitem.Id));
}
}
var goodsList = GetAppletGoodsPageListForZY(1, 100000, out long rowsCount, new RB_Goods_Extend()
{
TenantId = TenantId,
MallBaseId = MallBaseId,
GoodsStatus = 1,
StoresIds = storeId.ToString(),
CategoryIds = qCategoryIds
}, GoodsClassify: 3);
if (goodsList != null && goodsList.Count > 0)
{
foreach (var model in goodsList)
{
model.CoverImage = "";
if (!string.IsNullOrEmpty(model.CarouselImage) && model.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(model.CarouselImage);
//封面图
model.CoverImage = CarouselIdList[0];
}
var obj = new
{
id = model.Id,
name=model.Name,
cover_pic = model.CoverImage,
};
list.Add(obj);
}
}
return list;
}
/// <summary> /// <summary>
/// 获取线下服务商品预定详情 /// 获取线下服务商品预定详情
/// </summary> /// </summary>
...@@ -2573,7 +2646,7 @@ namespace Mall.Module.Product ...@@ -2573,7 +2646,7 @@ namespace Mall.Module.Product
/// <param name="MallBaseId"></param> /// <param name="MallBaseId"></param>
/// <param name="storeId">门店编号</param> /// <param name="storeId">门店编号</param>
/// <returns></returns> /// <returns></returns>
public object GetAppletOfflineGoodsInfoModule(int goodsId, int UserId, int SmallShopsId, int TenantId, int MallBaseId,int storeId=0) public object GetAppletOfflineGoodsInfoModule(int goodsId, int UserId, int SmallShopsId, int TenantId, int MallBaseId, int storeId = 0)
{ {
var model = goodsRepository.GetEntity(goodsId).RefMapperTo<RB_Goods_Extend>(); var model = goodsRepository.GetEntity(goodsId).RefMapperTo<RB_Goods_Extend>();
if (model == null || model.TenantId != TenantId || model.MallBaseId != MallBaseId) if (model == null || model.TenantId != TenantId || model.MallBaseId != MallBaseId)
...@@ -2608,7 +2681,7 @@ namespace Mall.Module.Product ...@@ -2608,7 +2681,7 @@ namespace Mall.Module.Product
model.CategoryList = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId }); model.CategoryList = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
//2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W //2020-08-05 根据分类查找商品对应的分类包邮规则 add by :W
#region 微店价格 #region 微店价格
RB_SmallShops_Info smallModel = new RB_SmallShops_Info(); RB_SmallShops_Info smallModel = new RB_SmallShops_Info();
List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>(); List<RB_SmallShops_Price_Extend> smallPList = new List<RB_SmallShops_Price_Extend>();
...@@ -2849,7 +2922,7 @@ namespace Mall.Module.Product ...@@ -2849,7 +2922,7 @@ namespace Mall.Module.Product
model.Favorite = false; model.Favorite = false;
if (UserId > 0) if (UserId > 0)
{ {
List<WhereHelper> wheres = new List<WhereHelper>() List<WhereHelper> wheres = new List<WhereHelper>()
{ {
new WhereHelper(nameof(RB_Member_Collection_Extend.UserId),UserId), new WhereHelper(nameof(RB_Member_Collection_Extend.UserId),UserId),
new WhereHelper(nameof(RB_Member_Collection_Extend.GoodsId),goodsId) , new WhereHelper(nameof(RB_Member_Collection_Extend.GoodsId),goodsId) ,
...@@ -3304,8 +3377,8 @@ namespace Mall.Module.Product ...@@ -3304,8 +3377,8 @@ namespace Mall.Module.Product
attr_name = model.DefaultSpecificationName attr_name = model.DefaultSpecificationName
} }, } },
price_member, price_member,
isChooseServicePerson= model.IsChooseServicePerson, isChooseServicePerson = model.IsChooseServicePerson,
depositMoney= model.DepositMoney, depositMoney = model.DepositMoney,
member_price_list member_price_list
}); });
} }
...@@ -3396,7 +3469,7 @@ namespace Mall.Module.Product ...@@ -3396,7 +3469,7 @@ namespace Mall.Module.Product
} }
price_member_max = Math.Round(price_member_max, 2, MidpointRounding.AwayFromZero); price_member_max = Math.Round(price_member_max, 2, MidpointRounding.AwayFromZero);
price_member_min = Math.Round(price_member_min, 2, MidpointRounding.AwayFromZero); price_member_min = Math.Round(price_member_min, 2, MidpointRounding.AwayFromZero);
price_min = price_member_min; price_min = price_member_min;
price_max = price_member_max; price_max = price_member_max;
#endregion #endregion
...@@ -3447,7 +3520,7 @@ namespace Mall.Module.Product ...@@ -3447,7 +3520,7 @@ namespace Mall.Module.Product
ImagePath = "" ImagePath = ""
} }
}; };
model.SpecificationList = new List<RB_Goods_Specification_Extend> model.SpecificationList = new List<RB_Goods_Specification_Extend>
{ {
new RB_Goods_Specification_Extend() new RB_Goods_Specification_Extend()
{ {
...@@ -3457,10 +3530,16 @@ namespace Mall.Module.Product ...@@ -3457,10 +3530,16 @@ namespace Mall.Module.Product
} }
}; };
} }
var servicePersionList= reserve_ServicePersonalRepository.GetServicePersonalList(new Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend() var servicePersionList = reserve_ServicePersonalRepository.GetServicePersonalList(new Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend()
{ {
StoreId = storeId, StoreId = storeId,
})?.ToList()??new List<Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend>(); })?.ToList() ?? new List<Model.Extend.Reserve.RB_Reserve_ServicePersonal_Extend>();
var storeModel = storesRepository.GetEntity(storeId);
if (storeModel != null && storeModel.Id > 0)
{
}
return new return new
{ {
goods = new goods = new
...@@ -3586,8 +3665,8 @@ namespace Mall.Module.Product ...@@ -3586,8 +3665,8 @@ namespace Mall.Module.Product
x.CategoryName x.CategoryName
}), }),
video_type = model.VideoType, video_type = model.VideoType,
isChooseServicePerson=model.IsChooseServicePerson, isChooseServicePerson = model.IsChooseServicePerson,
depositMoney=model.DepositMoney, depositMoney = model.DepositMoney,
persionList = servicePersionList?.Where(qitem => qitem.ServiceStatus == 1).Select(qitem => new persionList = servicePersionList?.Where(qitem => qitem.ServiceStatus == 1).Select(qitem => new
{ {
qitem.ServiceLogo, qitem.ServiceLogo,
...@@ -3814,7 +3893,8 @@ namespace Mall.Module.Product ...@@ -3814,7 +3893,8 @@ namespace Mall.Module.Product
item.SalesNum += (orderlist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0); item.SalesNum += (orderlist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0);
if (demodel.UserId > 0) { if (demodel.UserId > 0)
{
var omodel = opaylist.Where(x => x.GoodsId == item.Id).FirstOrDefault(); var omodel = opaylist.Where(x => x.GoodsId == item.Id).FirstOrDefault();
if (omodel != null) if (omodel != null)
{ {
...@@ -4166,7 +4246,7 @@ namespace Mall.Module.Product ...@@ -4166,7 +4246,7 @@ namespace Mall.Module.Product
} }
#region 组装价格 #region 组装价格
decimal price_member = model.SellingPrice ?? 0;//未设会员价格的话 就为销售价格 decimal price_member = model.SellingPrice ?? 0;//未设会员价格的话 就为销售价格
List<object> member_price_list = new List<object>(); List<object> member_price_list = new List<object>();
if (model.EnjoyMember == 1 && model.SeparateSetMember == 1) if (model.EnjoyMember == 1 && model.SeparateSetMember == 1)
...@@ -4332,9 +4412,11 @@ namespace Mall.Module.Product ...@@ -4332,9 +4412,11 @@ namespace Mall.Module.Product
if (UserId > 0) if (UserId > 0)
{ {
var omodel = goods_OrderRepository.GetCourseOrderIsPay(GoodsIds: goodsId.ToString(), UserId: UserId).FirstOrDefault(); var omodel = goods_OrderRepository.GetCourseOrderIsPay(GoodsIds: goodsId.ToString(), UserId: UserId).FirstOrDefault();
if (omodel != null) { if (omodel != null)
{
IsOrders = true; IsOrders = true;
if (omodel.PaymentTime.HasValue) { if (omodel.PaymentTime.HasValue)
{
IsPay = true; IsPay = true;
} }
} }
...@@ -4361,8 +4443,8 @@ namespace Mall.Module.Product ...@@ -4361,8 +4443,8 @@ namespace Mall.Module.Product
status = model.GoodsStatus, status = model.GoodsStatus,
isAllowShare = IsAllowShare,//是否可以分享 isAllowShare = IsAllowShare,//是否可以分享
advertising = model.Advertising,//广告词 advertising = model.Advertising,//广告词
price = model.SellingPrice, price = model.SellingPrice,
give_integral = model.IntegralPresent, give_integral = model.IntegralPresent,
give_integral_type = model.IntegralPresentType, give_integral_type = model.IntegralPresentType,
forehead_integral = model.PointsDeduction,//暂 积分抵扣 forehead_integral = model.PointsDeduction,//暂 积分抵扣
...@@ -4380,7 +4462,7 @@ namespace Mall.Module.Product ...@@ -4380,7 +4462,7 @@ namespace Mall.Module.Product
course_score = model.CourseScore, course_score = model.CourseScore,
created_at = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", created_at = model.CreateDate.HasValue ? model.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
updated_at = model.UpdateDate.HasValue ? model.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", updated_at = model.UpdateDate.HasValue ? model.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
sales = (model.SalesNum ?? 0) + payment_num,//已售出数量 + 订单商品数量// sales = (model.SalesNum ?? 0) + payment_num,//已售出数量 + 订单商品数量//
name = model.Name, name = model.Name,
original_price = model.OriginalPrice, original_price = model.OriginalPrice,
...@@ -4424,7 +4506,8 @@ namespace Mall.Module.Product ...@@ -4424,7 +4506,8 @@ namespace Mall.Module.Product
x.CategoryName x.CategoryName
}), }),
video_type = model.VideoType, video_type = model.VideoType,
teacher_list = model.TeacherList.Select(x=>new { teacher_list = model.TeacherList.Select(x => new
{
teacher_id = x.TeacherId, teacher_id = x.TeacherId,
teacher_logo = x.TeacherLogo, teacher_logo = x.TeacherLogo,
teacher_name = x.Name teacher_name = x.Name
...@@ -4502,13 +4585,15 @@ namespace Mall.Module.Product ...@@ -4502,13 +4585,15 @@ namespace Mall.Module.Product
/// <param name="tenantId"></param> /// <param name="tenantId"></param>
/// <param name="mallBaseId"></param> /// <param name="mallBaseId"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_WK_Course_Extend> GetAppletGoodsCourseList(int pageIndex, int pageSize, out long count, int goodsId,int userId, int tenantId, int mallBaseId) public List<RB_Goods_WK_Course_Extend> GetAppletGoodsCourseList(int pageIndex, int pageSize, out long count, int goodsId, int userId, int tenantId, int mallBaseId)
{ {
var list = goods_WK_CourseRepository.GetPageList(pageIndex, pageSize, out count, new RB_Goods_WK_Course_Extend() { GoodsId = goodsId, TenantId = tenantId, MallBaseId = mallBaseId }); var list = goods_WK_CourseRepository.GetPageList(pageIndex, pageSize, out count, new RB_Goods_WK_Course_Extend() { GoodsId = goodsId, TenantId = tenantId, MallBaseId = mallBaseId });
if (userId > 0 && list.Any()) { if (userId > 0 && list.Any())
{
//查询用户课程章节 阅读情况 //查询用户课程章节 阅读情况
var slist = goods_WK_CourseStudyRepository.GetList(new RB_Goods_WK_CourseStudy_Extend() { UserId = userId, CourseIds = string.Join(",", list.Select(x => x.Id)) }); var slist = goods_WK_CourseStudyRepository.GetList(new RB_Goods_WK_CourseStudy_Extend() { UserId = userId, CourseIds = string.Join(",", list.Select(x => x.Id)) });
foreach (var item in list) { foreach (var item in list)
{
item.IsRead = 2; item.IsRead = 2;
if (slist.Where(x => x.CourseId == item.Id).Any()) if (slist.Where(x => x.CourseId == item.Id).Any())
{ {
...@@ -4525,15 +4610,19 @@ namespace Mall.Module.Product ...@@ -4525,15 +4610,19 @@ namespace Mall.Module.Product
/// <param name="goodsId"></param> /// <param name="goodsId"></param>
/// <param name="UserId"></param> /// <param name="UserId"></param>
/// <returns></returns> /// <returns></returns>
public int GetAppletCourseIsPay(int goodsId, int UserId) { public int GetAppletCourseIsPay(int goodsId, int UserId)
if (UserId <= 0) { {
if (UserId <= 0)
{
return 0; return 0;
} }
var goodsModel = goodsRepository.GetEntity(goodsId); var goodsModel = goodsRepository.GetEntity(goodsId);
if (goodsModel == null) { if (goodsModel == null)
{
return 0; return 0;
} }
if (goodsModel.SellingPrice == 0) { if (goodsModel.SellingPrice == 0)
{
return 1; return 1;
} }
......
...@@ -742,6 +742,7 @@ namespace Mall.Module.Product ...@@ -742,6 +742,7 @@ namespace Mall.Module.Product
{ nameof(RB_Goods.IsChooseServicePerson),demodel.IsChooseServicePerson }, { nameof(RB_Goods.IsChooseServicePerson),demodel.IsChooseServicePerson },
{ nameof(RB_Goods.StoresIds),demodel.StoresIds }, { nameof(RB_Goods.StoresIds),demodel.StoresIds },
{ nameof(RB_Goods.Remark),demodel.Remark }, { nameof(RB_Goods.Remark),demodel.Remark },
{ nameof(RB_Goods.ServiceTime),demodel.ServiceTime },
}; };
List<WhereHelper> wheres = new List<WhereHelper>() List<WhereHelper> wheres = new List<WhereHelper>()
{ {
......
...@@ -137,5 +137,26 @@ namespace Mall.Repository.Product ...@@ -137,5 +137,26 @@ namespace Mall.Repository.Product
} }
return Execute(sql) > 0; return Execute(sql) > 0;
} }
/// <summary>
/// 获取当前分类和当前分类的所有下级分类
/// </summary>
/// <param name="categoryIds"></param>
/// <returns></returns>
public List<RB_Product_Category_Extend> GetCurrentAndChildCategoryListRepository(string categoryIds)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Product_Category WHERE Status=0 and Enabled=1 and IsShow=1 AND ParentId IN({0})
UNION ALL
SELECT *
FROM RB_Product_Category WHERE Status=0 and Enabled=1 and IsShow=1 AND ParentId IN( SELECT Id FROM RB_Product_Category WHERE Status=0 and Enabled=1 and IsShow=1 AND ParentId IN({0}))
UNION ALL
SELECT *
FROM RB_Product_Category WHERE Status=0 and Enabled=1 and IsShow=1 AND Id IN({0})
", categoryIds);
return Get<RB_Product_Category_Extend>(builder.ToString()).ToList();
}
} }
} }
...@@ -16,6 +16,7 @@ using Newtonsoft.Json.Linq; ...@@ -16,6 +16,7 @@ using Newtonsoft.Json.Linq;
using Mall.Common; using Mall.Common;
using Mall.Module.Product; using Mall.Module.Product;
using Mall.Model.Extend.User; using Mall.Model.Extend.User;
using Google.Protobuf.WellKnownTypes;
namespace Mall.WebApi.Controllers.MallBase namespace Mall.WebApi.Controllers.MallBase
{ {
...@@ -421,13 +422,55 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -421,13 +422,55 @@ namespace Mall.WebApi.Controllers.MallBase
JObject prams = JObject.Parse(req.msg.ToString()); JObject prams = JObject.Parse(req.msg.ToString());
int GoodsId = prams.GetInt("GoodsId", 0); int GoodsId = prams.GetInt("GoodsId", 0);
int StoreId = prams.GetInt("StoreId", 0); int StoreId = prams.GetInt("StoreId", 0);
if (GoodsId <= 0|| StoreId<=0) if (StoreId<=0 || GoodsId<=0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull(message:"请选择门店");
} }
int UserId = req.UserId; int UserId = req.UserId;
object Robj = productModule.GetAppletOfflineGoodsInfoModule(GoodsId, UserId, req.SmallShopsId, req.TenantId, req.MallBaseId, storeId: StoreId);
return ApiResult.Success("", Robj);
}
/// <summary>
/// 预定页面获取商品分类列表
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
[HttpPost]
public ApiResult GetAppletOfflineCate(object requestMsg)
{
var req = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (req.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
object Robj = productModule.GetAppletOfflineCategoryListModule(req.TenantId, req.MallBaseId);
return ApiResult.Success("", Robj);
}
var Robj = productModule.GetAppletOfflineGoodsInfoModule(GoodsId, UserId, req.SmallShopsId, req.TenantId, req.MallBaseId, storeId: StoreId); /// <summary>
/// 预定页面获取商品分类
/// </summary>
/// <param name="requestMsg"></param>
/// <returns></returns>
///
[HttpPost]
public ApiResult GetAppletOfflineGoodsList(object requestMsg)
{
var req = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (req.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
JObject prams = JObject.Parse(req.msg.ToString());
int StoreId = prams.GetInt("StoreId", 0);
string categoryIds= prams.GetStringValue("categoryIds");
if (StoreId <= 0)
{
return ApiResult.ParamIsNull(message: "请选择门店");
}
object Robj = productModule.GetAppletOfflineGoodsListModule(req.TenantId, req.MallBaseId, categoryIds, storeId: StoreId);
return ApiResult.Success("", Robj); return ApiResult.Success("", Robj);
} }
......
...@@ -324,6 +324,7 @@ namespace Mall.WebApi.Controllers.Reserve ...@@ -324,6 +324,7 @@ namespace Mall.WebApi.Controllers.Reserve
model?.Remark, model?.Remark,
model?.VideoType, model?.VideoType,
model?.LimitBuyGoodsNum, model?.LimitBuyGoodsNum,
model?.ServiceTime,
}); });
} }
......
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