Commit 8d96b883 authored by 吴春's avatar 吴春

提交代码

parent 470d4242
......@@ -1200,39 +1200,39 @@ namespace Mall.Module.Education
}
if (demodel.SmallShopsId > 0)
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
{
if ((smallModel.UpPrice ?? 0) > 0 || smallPList.Where(x => x.GoodsId == item.Id && x.UpPrice > 0).Any())
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
{
var sspModel = smallPList.Where(x => x.GoodsId == item.Id && x.SpecificationKey == "").FirstOrDefault();
if (sspModel != null)
//单商品设置的
if (sspModel.PriceType == 1)
{
//单商品设置的
if (sspModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else if (sspModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (sspModel.UpPrice ?? 0) / 100);
}
else
else if (sspModel.PriceType == 2)
{
if ((smallModel.UpPrice ?? 0) > 0)
item.SellingPrice = (item.SellingPrice ?? 0) + (sspModel.UpPrice ?? 0);
}
}
else
{
if ((smallModel.UpPrice ?? 0) > 0)
{
if (smallModel.PriceType == 1)
{
if (smallModel.PriceType == 1)
{
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
item.SellingPrice = (item.SellingPrice ?? 0) + Math.Ceiling((item.SellingPrice ?? 0) * (smallModel.UpPrice ?? 0) / 100);
}
else if (smallModel.PriceType == 2)
{
item.SellingPrice = (item.SellingPrice ?? 0) + (smallModel.UpPrice ?? 0);
}
}
}
}
}
if (item.EnjoyMember == 1 && item.SeparateSetMember == 1)
{
item.MemberPriceList = MemberPriceList.Where(x => x.GoodsId == item.Id).ToList();
......@@ -2089,6 +2089,19 @@ namespace Mall.Module.Education
}
/// <summary>
/// 获取资讯实体
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public RB_Education_Article GetArticleEntity(int id)
{
return educationArticleRepository.GetEntity(id);
}
/// <summary>
/// 资讯配置
/// </summary>
......
......@@ -269,5 +269,62 @@ namespace Mall.WebApi.Controllers.Education
}
}
#endregion
#region 资讯留言
/// <summary>
/// 管理新增评论
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetArticleCommentInfo()
{
var req = RequestParm;
var userInfo = AppletUserInfo;
RB_Education_ArticleComment_Extend demodel = JsonConvert.DeserializeObject<RB_Education_ArticleComment_Extend>(req.msg.ToString());
if (demodel.ArticleId <= 0)
{
return ApiResult.ParamIsNull("请选择资讯");
}
if (string.IsNullOrEmpty(demodel.Content))
{
return ApiResult.ParamIsNull("请输入评价内容");
}
var articleModle = educationModule.GetArticleEntity(demodel.ArticleId);
if (articleModle == null)
{
return ApiResult.ParamIsNull("资讯信息不存在");
}
if (articleModle.IsComment == 0)
{
return ApiResult.ParamIsNull("资讯不允许留言");
}
demodel.CommentGrade ??= Common.Enum.Goods.GoodsCommentTypeEnum.Praise;
demodel.CommentScore ??= 5;
demodel.CommentImage = "";
if (demodel.CommentImgList != null && demodel.CommentImgList.Any())
{
demodel.CommentImage = JsonConvert.SerializeObject(demodel.CommentImgList);
}
demodel.UserId = userInfo.UserId;
demodel.UserName = userInfo.Name;
demodel.PlatformSource = userInfo.Source;
demodel.UserPhoto ??= 0;
demodel.Is_Top ??= 2;
demodel.Is_Show ??= 1;
demodel.Is_Anonymity ??= 2;
demodel.Reply ??= "";
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
demodel.Status = 0;
demodel.UpdateDate = DateTime.Now;
demodel.CreateDate = DateTime.Now;
bool flag = educationModule.SetArticleCommentInfo(demodel);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
}
#endregion
}
}
\ No newline at end of file
......@@ -278,6 +278,47 @@ namespace Mall.WebApi.Controllers.Education
return ApiResult.Success("", oldLogisticsModel);
}
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetArticleCommentPageList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(parms.msg.ToString());
RB_Education_ArticleComment_Extend demodel = JsonConvert.DeserializeObject<RB_Education_ArticleComment_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
var list = educationModule.GetArticleCommentPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
x.ID,
x.UserId,
x.UserName,
x.ArticleId,
x.ArticleName,
x.CommentScore,
x.CommentGrade,
CommentGradeName = x.CommentGrade.GetEnumName(),
x.CommentImgList,
x.Content,
x.Reply,
x.Is_Top,
x.Is_Show,
x.Is_Anonymity,
x.PlatformSource,
x.TenantId,
x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
});
return ApiResult.Success("", pagelist);
}
#endregion
}
}
\ No newline at end of file
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