Commit e0efde1a authored by 黄奎's avatar 黄奎

新增字段

parent f1b81fcd
...@@ -658,5 +658,10 @@ namespace Mall.Model.Entity.Product ...@@ -658,5 +658,10 @@ namespace Mall.Model.Entity.Product
/// 耗材对应的ID /// 耗材对应的ID
/// </summary> /// </summary>
public int MaterialId { get; set; } public int MaterialId { get; set; }
/// <summary>
/// 教育扩展json对象
/// </summary>
public string EduJsonData { get; set; }
} }
} }
...@@ -1162,6 +1162,11 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -1162,6 +1162,11 @@ namespace Mall.Model.Extend.MarketingCenter
/// </summary> /// </summary>
public string name { get; set; } public string name { get; set; }
/// <summary>
/// 商品副标
/// </summary>
public string subname { get; set; }
/// <summary> /// <summary>
/// 商品图片 /// 商品图片
/// </summary> /// </summary>
...@@ -1181,6 +1186,16 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -1181,6 +1186,16 @@ namespace Mall.Model.Extend.MarketingCenter
/// 课程评分 2020-10-13 ld /// 课程评分 2020-10-13 ld
/// </summary> /// </summary>
public decimal courseScore { get; set; } public decimal courseScore { get; set; }
/// <summary>
/// 老师头像
/// </summary>
public string eduteachericon { get; set; }
/// <summary>
/// 老师名称
/// </summary>
public string eduteachername { get; set; }
} }
/// <summary> /// <summary>
...@@ -3362,9 +3377,7 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -3362,9 +3377,7 @@ namespace Mall.Model.Extend.MarketingCenter
/// <summary> /// <summary>
/// 购买按钮颜色 /// 购买按钮颜色
/// </summary> /// </summary>
#pragma warning disable IDE1006 // 命名样式
public string buttonColor { get; set; } public string buttonColor { get; set; }
#pragma warning restore IDE1006 // 命名样式
/// <summary> /// <summary>
/// 显示评分 ld 2020-10-13 /// 显示评分 ld 2020-10-13
......
...@@ -417,4 +417,65 @@ namespace Mall.Model.Extend.Product ...@@ -417,4 +417,65 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public string ico { get; set; } public string ico { get; set; }
} }
/// <summary>
/// 商品附加属性
/// </summary>
public class GoodsJsonItem
{
/// <summary>
/// 班级编号
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 上课次数
/// </summary>
public decimal ClassNum { get; set; }
/// <summary>
/// 上课地址
/// </summary>
public string ClassAddress { get; set; }
/// <summary>
/// 上课时间
/// </summary>
public string ClassTime { get; set; }
/// <summary>
/// 开班日期
/// </summary>
public string OpenTime { get; set; }
/// <summary>
/// 节课日期
/// </summary>
public string EndClassDate { get; set; }
/// <summary>
/// 教师名称
/// </summary>
public string TeacherName { get; set; }
/// <summary>
/// 教师头像
/// </summary>
public string TeacherIcon { get; set; }
/// <summary>
/// 限招人数
/// </summary>
public int ClassPersion { get; set; }
/// <summary>
/// 教师介绍
/// </summary>
public string TeacherInfo { get; set; }
/// <summary>
/// 截止报名日期
/// </summary>
public string EndOrderTime { get; set; }
}
} }
...@@ -14,6 +14,7 @@ using Mall.Repository.Product; ...@@ -14,6 +14,7 @@ using Mall.Repository.Product;
using Mall.Repository.Reserve; using Mall.Repository.Reserve;
using Mall.Repository.User; using Mall.Repository.User;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -2477,9 +2478,16 @@ namespace Mall.Module.Product ...@@ -2477,9 +2478,16 @@ namespace Mall.Module.Product
} }
} }
var goodsRelevanceList = goods_RelevanceRepository.GetGoodsRelevanceListRepository(new RB_Goods_Relevance_Extend()
{
MallBaseId=model.MallBaseId,
TenantId=model.TenantId,
GoodsId=model.Id
});
List<RB_Goods_Preferential_Extend> goodsPreferentialList = new List<RB_Goods_Preferential_Extend>(); List<RB_Goods_Preferential_Extend> goodsPreferentialList = new List<RB_Goods_Preferential_Extend>();
goodsPreferentialList = RB_Goods_PreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId, GoodsId = model.Id }); goodsPreferentialList = RB_Goods_PreferentialRepository.GetGoodsPreferentialListRepostory(new RB_Goods_Preferential_Extend { TenantId = model.TenantId, MallBaseId = model.MallBaseId, GoodsId = model.Id });
//教育商品扩展对象属性
var eduDataJson = ParsingEduJsonModule(model.EduJsonData);
return new return new
{ {
goods = new goods = new
...@@ -2492,14 +2500,18 @@ namespace Mall.Module.Product ...@@ -2492,14 +2500,18 @@ namespace Mall.Module.Product
categoryIdList = model?.CategoryList?.Select(x => x.CategoryId ?? 0).ToList(), categoryIdList = model?.CategoryList?.Select(x => x.CategoryId ?? 0).ToList(),
status = model.GoodsStatus, status = model.GoodsStatus,
isAllowShare = IsAllowShare,//是否可以分享 isAllowShare = IsAllowShare,//是否可以分享
advertising = model?.Advertising??"",//广告词 advertising = model?.Advertising ?? "",//广告词
price = model.SellingPrice, price = model.SellingPrice,
sendArea = model?.SendArea??"", sendArea = model?.SendArea ?? "",
use_attr = model.IsCustomSpecification, use_attr = model.IsCustomSpecification,
remark = model?.Remark ?? "",
edu_data = eduDataJson,
attr_groups = model.SpecificationList.Select(x => new attr_groups = model.SpecificationList.Select(x => new
{ {
attr_group_id = x.Sort, attr_group_id = x.Sort,
attr_group_name = x.Name, attr_group_name = x.Name,
//购买次数(进阶小课堂使用)
service_time= model.ServiceTime,
attr_list = x.SpecificationValueList.Select(z => new attr_list = x.SpecificationValueList.Select(z => new
{ {
attr_id = z.Sort, attr_id = z.Sort,
...@@ -2507,6 +2519,13 @@ namespace Mall.Module.Product ...@@ -2507,6 +2519,13 @@ namespace Mall.Module.Product
pic_url = z.ImagePath pic_url = z.ImagePath
}) })
}), }),
goodsRelevanceList = goodsRelevanceList?.Select(qitem => new
{
qitem.RelevanceId,
qitem.RelevanceName,
qitem.RelevancePrice,
qitem.Unit
}),
goods_stock = model.InventoryNum, goods_stock = model.InventoryNum,
virtual_sales = (model.SalesNum ?? 0), virtual_sales = (model.SalesNum ?? 0),
confine_count = model.LimitBuyGoodsNum, confine_count = model.LimitBuyGoodsNum,
...@@ -2635,7 +2654,8 @@ namespace Mall.Module.Product ...@@ -2635,7 +2654,8 @@ namespace Mall.Module.Product
x.PriceMoney x.PriceMoney
}) })
}, },
delivery = "" delivery = "",
}; };
#endregion #endregion
#endregion #endregion
...@@ -6172,6 +6192,16 @@ namespace Mall.Module.Product ...@@ -6172,6 +6192,16 @@ namespace Mall.Module.Product
return model; return model;
} }
/// <summary>
/// 解析教育商品对象
/// </summary>
/// <param name="EduJsonData"></param>
/// <returns></returns>
public GoodsJsonItem ParsingEduJsonModule(string eduJsonData)
{
return goodsRepository.ParsingEduJsonRepository(eduJsonData);
}
/// <summary> /// <summary>
/// 保存推荐设置 /// 保存推荐设置
/// </summary> /// </summary>
......
...@@ -5,6 +5,8 @@ using Mall.Model.Entity.Product; ...@@ -5,6 +5,8 @@ using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product; using Mall.Model.Extend.Product;
using System.Linq; using System.Linq;
using VT.FW.DB.Dapper; using VT.FW.DB.Dapper;
using Newtonsoft.Json.Linq;
using Mall.Common.Plugin;
namespace Mall.Repository.Product namespace Mall.Repository.Product
{ {
...@@ -180,9 +182,10 @@ namespace Mall.Repository.Product ...@@ -180,9 +182,10 @@ namespace Mall.Repository.Product
orderBy = " g.InventoryNum desc"; orderBy = " g.InventoryNum desc";
} }
string sql = $@"select g.*,s.`Name` as SupplierName from RB_Goods g string sql = $@"
inner join rb_goods_category c on g.Id=c.GoodsId select g.*,s.`Name` as SupplierName
LEFT JOIN rb_supplier as s on g.SupplierId=s.ID from RB_Goods g inner join rb_goods_category c on g.Id=c.GoodsId
LEFT JOIN rb_supplier as s on g.SupplierId=s.ID
where {where} group by g.Id order by {orderBy}"; where {where} group by g.Id order by {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql, parameters).ToList(); return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out rowCount, sql, parameters).ToList();
} }
...@@ -663,6 +666,39 @@ WHERE {where} group by g.Id order by g.CreateDate desc"; ...@@ -663,6 +666,39 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
return Get<RB_Goods_Extend>(sql).ToList(); return Get<RB_Goods_Extend>(sql).ToList();
} }
/// <summary>
/// 解析教育商品对象
/// </summary>
/// <param name="EduJsonData"></param>
/// <returns></returns>
public GoodsJsonItem ParsingEduJsonRepository(string eduJsonData)
{
GoodsJsonItem jsonItem = new GoodsJsonItem();
try
{
if (eduJsonData != null && !string.IsNullOrEmpty(eduJsonData))
{
JObject jObj = JObject.Parse(eduJsonData);
jsonItem.ClassId = jObj.GetInt("ClassId");
jsonItem.ClassNum = jObj.GetInt("ClassNum");
jsonItem.ClassAddress = jObj.GetStringValue("ClassAddress");
jsonItem.ClassTime = jObj.GetStringValue("ClassTime");
jsonItem.OpenTime = jObj.GetStringValue("OpenTime");
jsonItem.EndClassDate = jObj.GetStringValue("EndClassDate");
jsonItem.TeacherName = jObj.GetStringValue("TeacherName");
jsonItem.TeacherIcon = jObj.GetStringValue("TeacherIcon");
jsonItem.ClassPersion = jObj.GetInt("ClassPersion");
jsonItem.TeacherInfo = jObj.GetStringValue("TeacherInfo");
jsonItem.EndOrderTime = jObj.GetStringValue("EndOrderTime");
}
}
catch
{
}
return jsonItem;
}
/// <summary> /// <summary>
/// 获取列表 /// 获取列表
/// </summary> /// </summary>
......
...@@ -73,7 +73,8 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -73,7 +73,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
[HttpPost] [HttpPost]
[AllowAnonymous] [RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)] [AllowAnonymous]
[RateValve(Policy = Policy.Ip, Limit = 10, Duration = 60)]
public ApiResult GetHome() public ApiResult GetHome()
{ {
JObject parms = JObject.Parse(RequestParm.msg.ToString()); JObject parms = JObject.Parse(RequestParm.msg.ToString());
......
...@@ -1869,12 +1869,17 @@ namespace Mall.WebApi.Controllers ...@@ -1869,12 +1869,17 @@ namespace Mall.WebApi.Controllers
var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault(); var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0) if (tempGood != null && tempGood.Id > 0)
{ {
var eduJson = productModule.ParsingEduJsonModule(tempGood.EduJsonData);
lastItem.id = tempGood.Id; lastItem.id = tempGood.Id;
lastItem.name = tempGood.Name; lastItem.name = tempGood.Name;
lastItem.subname = tempGood?.SubName ?? "";
lastItem.price = Math.Round((tempGood?.SellingPrice ?? 0), 2); lastItem.price = Math.Round((tempGood?.SellingPrice ?? 0), 2);
lastItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : ""; lastItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : "";
lastItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2); lastItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2);
lastItem.courseScore = (tempGood.CourseScore ?? 0); lastItem.courseScore = (tempGood.CourseScore ?? 0);
//HK 2022-10-10新增字段
lastItem.eduteachericon = eduJson?.TeacherIcon ?? "";
lastItem.eduteachername = eduJson?.TeacherName ?? "";
newGoodsList.Add(lastItem); newGoodsList.Add(lastItem);
} }
} }
...@@ -1900,14 +1905,18 @@ namespace Mall.WebApi.Controllers ...@@ -1900,14 +1905,18 @@ namespace Mall.WebApi.Controllers
{ {
foreach (var gItem in catGoodsList) foreach (var gItem in catGoodsList)
{ {
var eduJson = productModule.ParsingEduJsonModule(gItem.EduJsonData);
childItem.goodsList.Add(new GoodsDetailsItem2() childItem.goodsList.Add(new GoodsDetailsItem2()
{ {
id = gItem.Id, id = gItem.Id,
price = Math.Round((gItem?.SellingPrice ?? 0), 2), price = Math.Round((gItem?.SellingPrice ?? 0), 2),
name = gItem.Name, name = gItem.Name,
subname=gItem.SubName,
picUrl = Common.Config.GetFileUrl(gItem.CoverImage), picUrl = Common.Config.GetFileUrl(gItem.CoverImage),
OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2), OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2),
courseScore = gItem.CourseScore ?? 0 courseScore = gItem.CourseScore ?? 0,
eduteachericon=eduJson?.TeacherIcon??"",
eduteachername=eduJson?.TeacherName??"",
}); });
} }
} }
...@@ -2028,14 +2037,18 @@ namespace Mall.WebApi.Controllers ...@@ -2028,14 +2037,18 @@ namespace Mall.WebApi.Controllers
{ {
foreach (var gItem in goodsList) foreach (var gItem in goodsList)
{ {
var eduJson = productModule.ParsingEduJsonModule(gItem.EduJsonData);
goodsData.list.Add(new GoodsDetailsItem2() goodsData.list.Add(new GoodsDetailsItem2()
{ {
id = gItem.Id, id = gItem.Id,
price = Math.Round((gItem?.SellingPrice ?? 0), 2), price = Math.Round((gItem?.SellingPrice ?? 0), 2),
name = gItem.Name, name = gItem.Name,
subname=gItem.SubName,
picUrl = Common.Config.GetFileUrl(gItem.CoverImage), picUrl = Common.Config.GetFileUrl(gItem.CoverImage),
OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2), OriginalPrice = Math.Round((gItem?.OriginalPrice ?? 0), 2),
courseScore = gItem.CourseScore ?? 0 courseScore = gItem.CourseScore ?? 0,
eduteachericon=eduJson?.TeacherIcon??"",
eduteachername=eduJson?.TeacherName??"",
}); });
} }
} }
...@@ -2155,12 +2168,16 @@ namespace Mall.WebApi.Controllers ...@@ -2155,12 +2168,16 @@ namespace Mall.WebApi.Controllers
var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault(); var tempGood = tempGoodsList?.Where(qitem => qitem.Id == goodItem.id)?.FirstOrDefault();
if (tempGood != null && tempGood.Id > 0) if (tempGood != null && tempGood.Id > 0)
{ {
var eduJson = productModule.ParsingEduJsonModule(tempGood.EduJsonData);
childItem.id = tempGood.Id; childItem.id = tempGood.Id;
childItem.name = tempGood?.Name ?? ""; childItem.name = tempGood?.Name ?? "";
childItem.subname = tempGood?.SubName ?? "";
childItem.price = Math.Round((tempGood?.SellingPrice ?? 0), 2); childItem.price = Math.Round((tempGood?.SellingPrice ?? 0), 2);
childItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : ""; childItem.picUrl = tempGood?.CoverImage != null ? Common.Config.GetFileUrl(tempGood.CoverImage) : "";
childItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2); childItem.OriginalPrice = Math.Round((tempGood?.OriginalPrice ?? 0), 2);
childItem.courseScore = (tempGood.CourseScore ?? 0); childItem.courseScore = (tempGood.CourseScore ?? 0);
childItem.eduteachericon = eduJson?.TeacherIcon ?? "";
childItem.eduteachername = eduJson?.TeacherName ?? "";
newGoodsList.Add(childItem); newGoodsList.Add(childItem);
} }
} }
......
...@@ -778,7 +778,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -778,7 +778,6 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult SetOfflineOrderServicepersion() public ApiResult SetOfflineOrderServicepersion()
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
int OrderId = parms.GetInt("OrderId"); int OrderId = parms.GetInt("OrderId");
int ServicepersonalId = parms.GetInt("ServicepersonalId"); int ServicepersonalId = parms.GetInt("ServicepersonalId");
...@@ -1043,7 +1042,6 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1043,7 +1042,6 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult GetAppletMyOrderAfterSaleInfo() public ApiResult GetAppletMyOrderAfterSaleInfo()
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
int OrderDetailId = parms.GetInt("OrderDetailId", 0); int OrderDetailId = parms.GetInt("OrderDetailId", 0);
if (OrderDetailId <= 0) if (OrderDetailId <= 0)
...@@ -1148,14 +1146,12 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1148,14 +1146,12 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult GetAppletOrderBuyerToDeliverInfo() public ApiResult GetAppletOrderBuyerToDeliverInfo()
{ {
var req = RequestParm; var req = RequestParm;
var userInfo = AppletUserInfo;
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
int ReOrderId = parms.GetInt("ReOrderId", 0); int ReOrderId = parms.GetInt("ReOrderId", 0);
if (ReOrderId <= 0) if (ReOrderId <= 0)
{ {
return ApiResult.ParamIsNull(); return ApiResult.ParamIsNull();
} }
return orderModule.GetAppletOrderBuyerToDeliverInfo(ReOrderId); return orderModule.GetAppletOrderBuyerToDeliverInfo(ReOrderId);
} }
......
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