Commit c50c9158 authored by 吴春's avatar 吴春

提交小程序评价标签以及规格日期

parent 649b18d4
...@@ -204,6 +204,6 @@ namespace Mall.Model.Entity.Product ...@@ -204,6 +204,6 @@ namespace Mall.Model.Entity.Product
/// <summary> /// <summary>
/// 评论标签Id /// 评论标签Id
/// </summary> /// </summary>
public int LabelId { get; set; } public string LabelIds { get; set; }
} }
} }
...@@ -7,5 +7,9 @@ namespace Mall.Model.Extend.Product ...@@ -7,5 +7,9 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public class RB_Comment_Label_Extend: RB_Comment_Label public class RB_Comment_Label_Extend: RB_Comment_Label
{ {
/// <summary>
/// 评价数
/// </summary>
public int CommentNum { get; set; }
} }
} }
...@@ -38,7 +38,15 @@ namespace Mall.Model.Extend.Product ...@@ -38,7 +38,15 @@ namespace Mall.Model.Extend.Product
/// </summary> /// </summary>
public int CommentNum { get; set; } public int CommentNum { get; set; }
/// <summary>
/// 评论标签ids 2024-02-18 add by:W
/// </summary>
public List<string> CommentLabelList { get; set; }
/// <summary>
/// 评论标签id 2024-02-18 add by:W
/// </summary>
public int CommentLabelId { get; set; }
/// <summary> /// <summary>
/// 评论总分 /// 评论总分
...@@ -46,6 +54,7 @@ namespace Mall.Model.Extend.Product ...@@ -46,6 +54,7 @@ namespace Mall.Model.Extend.Product
public decimal TotalScore { get; set; } public decimal TotalScore { get; set; }
#region 司导信息 #region 司导信息
/// <summary> /// <summary>
......
...@@ -29,5 +29,15 @@ namespace Mall.Model.Extend.Product ...@@ -29,5 +29,15 @@ namespace Mall.Model.Extend.Product
/// 查询排序 /// 查询排序
/// </summary> /// </summary>
public int? SortNum { get; set; } public int? SortNum { get; set; }
/// <summary>
/// 是否日期格式 2024-02-19 add by:W
/// </summary>
public int IsDateFormat { get; set; }
/// <summary>
/// 日期信息 2024-02-19 add by:W
/// </summary>
public DateTime? DateTimeInfo { get; set; }
} }
} }
...@@ -177,17 +177,20 @@ namespace Mall.Module.Product ...@@ -177,17 +177,20 @@ namespace Mall.Module.Product
List<RB_Education_CouponProduct_Extend> edcpList = new List<RB_Education_CouponProduct_Extend>(); List<RB_Education_CouponProduct_Extend> edcpList = new List<RB_Education_CouponProduct_Extend>();
if (demodel.Use_Education_Id > 0) if (demodel.Use_Education_Id > 0)
{ {
if (demodel.User_Coupon_Id > 0) { if (demodel.User_Coupon_Id > 0)
{
return ApiResult.Failed("课程卡与优惠券不能同时使用"); return ApiResult.Failed("课程卡与优惠券不能同时使用");
} }
if (demodel.Use_Integral > 0) { if (demodel.Use_Integral > 0)
{
return ApiResult.Failed("课程卡与积分抵扣不能同时使用"); return ApiResult.Failed("课程卡与积分抵扣不能同时使用");
} }
eList = education_MemberCouponRepository.GetList(new RB_Education_MemberCoupon_Extend() { Ids = (demodel.Use_Education_Id ?? 0).ToString(), UserId = umodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); eList = education_MemberCouponRepository.GetList(new RB_Education_MemberCoupon_Extend() { Ids = (demodel.Use_Education_Id ?? 0).ToString(), UserId = umodel.Id, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
if (eList.Any()) if (eList.Any())
{ {
var educationModel = eList.FirstOrDefault(); var educationModel = eList.FirstOrDefault();
if (educationModel.HeXiao <= educationModel.UseHeXiao) { if (educationModel.HeXiao <= educationModel.UseHeXiao)
{
return ApiResult.Failed("课程卡剩余次数不足"); return ApiResult.Failed("课程卡剩余次数不足");
} }
string cIds = string.Join(",", eList.Select(x => x.CouponId).Distinct()); string cIds = string.Join(",", eList.Select(x => x.CouponId).Distinct());
...@@ -594,7 +597,8 @@ namespace Mall.Module.Product ...@@ -594,7 +597,8 @@ namespace Mall.Module.Product
} }
} }
} }
if (demodel.Use_Education_Id > 0 && GoodsCouponList.Any()) { if (demodel.Use_Education_Id > 0 && GoodsCouponList.Any())
{
var ccmodel = eList.Where(x => x.Id == demodel.Use_Education_Id).FirstOrDefault(); var ccmodel = eList.Where(x => x.Id == demodel.Use_Education_Id).FirstOrDefault();
GoodsCouponList = GoodsCouponList.OrderBy(x => x.TotalMoney).Take(ccmodel.HeXiao - ccmodel.UseHeXiao).ToList(); GoodsCouponList = GoodsCouponList.OrderBy(x => x.TotalMoney).Take(ccmodel.HeXiao - ccmodel.UseHeXiao).ToList();
} }
...@@ -618,9 +622,11 @@ namespace Mall.Module.Product ...@@ -618,9 +622,11 @@ namespace Mall.Module.Product
} }
} }
bool IsUseEducation = false; bool IsUseEducation = false;
if (demodel.Use_Education_Id > 0) { if (demodel.Use_Education_Id > 0)
{
var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault(); var couponModel = GoodsCouponList.Where(x => x.GoodsId == item.GoodsId).FirstOrDefault();
if (couponModel != null) { if (couponModel != null)
{
EducationNum += 1; EducationNum += 1;
EducationMoney += couponModel.TotalMoney; EducationMoney += couponModel.TotalMoney;
TotalGoodsMoney -= couponModel.TotalMoney;//总价格需减去课程卡金额 TotalGoodsMoney -= couponModel.TotalMoney;//总价格需减去课程卡金额
...@@ -734,7 +740,8 @@ namespace Mall.Module.Product ...@@ -734,7 +740,8 @@ namespace Mall.Module.Product
user_coupon_id = CouponsMoney > 0 ? demodel.User_Coupon_Id ?? 0 : 0 user_coupon_id = CouponsMoney > 0 ? demodel.User_Coupon_Id ?? 0 : 0
}, },
integral = IntegralObj, integral = IntegralObj,
education = new { education = new
{
enabled = true, enabled = true,
use = demodel.Use_Education_Id > 0, use = demodel.Use_Education_Id > 0,
use_education_id = demodel.Use_Education_Id ?? 0, use_education_id = demodel.Use_Education_Id ?? 0,
...@@ -914,7 +921,8 @@ namespace Mall.Module.Product ...@@ -914,7 +921,8 @@ namespace Mall.Module.Product
{ {
return ApiResult.Failed("有商品不存在或者商品已失效"); return ApiResult.Failed("有商品不存在或者商品已失效");
} }
if (gmodel.GoodsClassify != 2) { if (gmodel.GoodsClassify != 2)
{
return ApiResult.Failed("有非网课类商品"); return ApiResult.Failed("有非网课类商品");
} }
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList(); var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
...@@ -1508,7 +1516,8 @@ namespace Mall.Module.Product ...@@ -1508,7 +1516,8 @@ namespace Mall.Module.Product
member_UserRepository.Update(keyValues, wheres, trans); member_UserRepository.Update(keyValues, wheres, trans);
#region 课程卡使用 #region 课程卡使用
if (demodel.Use_Education_Id > 0 && EducationNum > 0) { if (demodel.Use_Education_Id > 0 && EducationNum > 0)
{
education_MemberUseCouponRepository.Insert(new Model.Entity.Education.RB_Education_MemberUseCoupon() education_MemberUseCouponRepository.Insert(new Model.Entity.Education.RB_Education_MemberUseCoupon()
{ {
Id = 0, Id = 0,
...@@ -1523,7 +1532,8 @@ namespace Mall.Module.Product ...@@ -1523,7 +1532,8 @@ namespace Mall.Module.Product
UseHeXiao = EducationNum UseHeXiao = EducationNum
}, trans); }, trans);
var educationModel = eList.FirstOrDefault(); var educationModel = eList.FirstOrDefault();
if (educationModel != null) { if (educationModel != null)
{
//更新用户课程卡 已使用数量 //更新用户课程卡 已使用数量
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Education_MemberCoupon_Extend.UseHeXiao),educationModel.UseHeXiao + EducationNum} { nameof(RB_Education_MemberCoupon_Extend.UseHeXiao),educationModel.UseHeXiao + EducationNum}
...@@ -1644,7 +1654,8 @@ namespace Mall.Module.Product ...@@ -1644,7 +1654,8 @@ namespace Mall.Module.Product
{ {
//修改订单明细 其他收入 //修改订单明细 其他收入
var list = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = orderModel.OrderId, TenantId = tenantId, MallBaseId = mallBaseId }); var list = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { OrderId = orderModel.OrderId, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in list) { foreach (var item in list)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail.YSMoney),0}, { nameof(RB_Goods_OrderDetail.YSMoney),0},
{ nameof(RB_Goods_OrderDetail.ServiceCharge),0} { nameof(RB_Goods_OrderDetail.ServiceCharge),0}
...@@ -1712,7 +1723,7 @@ namespace Mall.Module.Product ...@@ -1712,7 +1723,7 @@ namespace Mall.Module.Product
{ {
TenantId = demodel.TenantId, TenantId = demodel.TenantId,
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
QGoodsIds=GoodsIds QGoodsIds = GoodsIds
}); });
var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true); var GList = goodsRepository.GetSingleListForGoodsSubName(new RB_Goods_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, GoodsIds = GoodsIds }, true);
...@@ -3701,14 +3712,16 @@ namespace Mall.Module.Product ...@@ -3701,14 +3712,16 @@ namespace Mall.Module.Product
#endregion #endregion
#region 储值卡退回 #region 储值卡退回
if (omodel.DepositId > 0) { if (omodel.DepositId > 0)
{
var remodel = goods_OrderAfterSaleRepository.GetEntity(reOrderId); var remodel = goods_OrderAfterSaleRepository.GetEntity(reOrderId);
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = omodel.OrderId }); var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = omodel.OrderId });
if (dlist.Where(x => x.DepositMoney > 0 && x.DepositRefundMoney == 0).Count() == 1) if (dlist.Where(x => x.DepositMoney > 0 && x.DepositRefundMoney == 0).Count() == 1)
{ {
//最后一个退款 对比一下总额 与 明细金额 //最后一个退款 对比一下总额 与 明细金额
var dmodel = dlist.Where(x => x.DepositMoney > 0 && x.DepositRefundMoney == 0).FirstOrDefault(); var dmodel = dlist.Where(x => x.DepositMoney > 0 && x.DepositRefundMoney == 0).FirstOrDefault();
if (dmodel.Id == remodel.OrderDetialId) { if (dmodel.Id == remodel.OrderDetialId)
{
decimal RMoney = omodel.DepositMoney - (dlist.Sum(x => x.DepositRefundMoney));//怕运费产生四舍五入问题,直接用总的 - 其他已退回的 decimal RMoney = omodel.DepositMoney - (dlist.Sum(x => x.DepositRefundMoney));//怕运费产生四舍五入问题,直接用总的 - 其他已退回的
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),RMoney} { nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),RMoney}
...@@ -3758,9 +3771,11 @@ namespace Mall.Module.Product ...@@ -3758,9 +3771,11 @@ namespace Mall.Module.Product
} }
} }
} }
else { else
{
var dmodel = dlist.Where(x => x.Id == remodel.OrderDetialId).FirstOrDefault(); var dmodel = dlist.Where(x => x.Id == remodel.OrderDetialId).FirstOrDefault();
if (dmodel != null && dmodel.DepositMoney > 0 && dmodel.DepositRefundMoney == 0) { if (dmodel != null && dmodel.DepositMoney > 0 && dmodel.DepositRefundMoney == 0)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),dmodel.DepositMoney + dmodel.DepositFreightMoney} { nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),dmodel.DepositMoney + dmodel.DepositFreightMoney}
}; };
...@@ -4725,7 +4740,8 @@ namespace Mall.Module.Product ...@@ -4725,7 +4740,8 @@ namespace Mall.Module.Product
goodsRepository.Update(keyValues1, wheres1, trans); goodsRepository.Update(keyValues1, wheres1, trans);
} }
} }
if (omodel.DepositId > 0) { if (omodel.DepositId > 0)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),item.DepositMoney + item.DepositFreightMoney} { nameof(RB_Goods_OrderDetail_Extend.DepositRefundMoney),item.DepositMoney + item.DepositFreightMoney}
}; };
...@@ -4807,9 +4823,11 @@ namespace Mall.Module.Product ...@@ -4807,9 +4823,11 @@ namespace Mall.Module.Product
} }
} }
//储值卡回滚 //储值卡回滚
if (omodel.DepositId > 0) { if (omodel.DepositId > 0)
{
var depositModel = member_DepositBuyRepository.GetEntity(omodel.DepositId); var depositModel = member_DepositBuyRepository.GetEntity(omodel.DepositId);
if (depositModel != null) { if (depositModel != null)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>() { Dictionary<string, object> keyValues1 = new Dictionary<string, object>() {
{ nameof(RB_Member_DepositBuy_Extend.SurplusPrice),depositModel.SurplusPrice + omodel.DepositMoney} { nameof(RB_Member_DepositBuy_Extend.SurplusPrice),depositModel.SurplusPrice + omodel.DepositMoney}
}; };
...@@ -6137,7 +6155,8 @@ namespace Mall.Module.Product ...@@ -6137,7 +6155,8 @@ namespace Mall.Module.Product
#region 调高成本重新返佣 #region 调高成本重新返佣
// ld 2021-09-17 // ld 2021-09-17
//暂只有 赞羊使用 //暂只有 赞羊使用
if (orderModel.MallBaseId == 1 && orderModel.FXCommission > 0 && orderModel.OriginalCostMoney > 0 && costMoney > orderModel.OriginalCostMoney && (orderModel.Unit_Price ?? 0) - orderModel.OriginalCostMoney > 0) { if (orderModel.MallBaseId == 1 && orderModel.FXCommission > 0 && orderModel.OriginalCostMoney > 0 && costMoney > orderModel.OriginalCostMoney && (orderModel.Unit_Price ?? 0) - orderModel.OriginalCostMoney > 0)
{
//先计算 调高返佣后 应发佣金 //先计算 调高返佣后 应发佣金
decimal NewCommission = (orderModel.FXCommission / ((orderModel.Unit_Price ?? 0) - orderModel.OriginalCostMoney)) * ((orderModel.Unit_Price ?? 0) - costMoney); decimal NewCommission = (orderModel.FXCommission / ((orderModel.Unit_Price ?? 0) - orderModel.OriginalCostMoney)) * ((orderModel.Unit_Price ?? 0) - costMoney);
NewCommission -= Math.Round((orderModel.DeductionCommission ?? 0) / (orderModel.Number ?? 1), 2, MidpointRounding.AwayFromZero);// 减去下单已抵扣的佣金 (这个佣金 需除以数量) NewCommission -= Math.Round((orderModel.DeductionCommission ?? 0) / (orderModel.Number ?? 1), 2, MidpointRounding.AwayFromZero);// 减去下单已抵扣的佣金 (这个佣金 需除以数量)
...@@ -6413,7 +6432,7 @@ namespace Mall.Module.Product ...@@ -6413,7 +6432,7 @@ namespace Mall.Module.Product
} }
} }
//只插入非抵扣类型的佣金 //只插入非抵扣类型的佣金
foreach (var qitem in gocList.Where(x => !((x.Commission ?? 0) == 0 && (x.DeductionCommission??0) >0))) foreach (var qitem in gocList.Where(x => !((x.Commission ?? 0) == 0 && (x.DeductionCommission ?? 0) > 0)))
{ {
qitem.Commission = (qitem.Commission ?? 0) * (item.Number ?? 0); qitem.Commission = (qitem.Commission ?? 0) * (item.Number ?? 0);
goods_OrderCommissionRepository.Insert(qitem, trans); goods_OrderCommissionRepository.Insert(qitem, trans);
...@@ -8095,6 +8114,52 @@ namespace Mall.Module.Product ...@@ -8095,6 +8114,52 @@ namespace Mall.Module.Product
return list; return list;
} }
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletCommentList(RB_Goods_Comment_Extend dmodel)
{
var list = goods_CommentRepository.GetAppletCommentList(dmodel);
if (list.Any())
{
//List<RB_Member_User_Extend> userList = new List<RB_Member_User_Extend>();
//if (list.Where(x => x.UserId > 0).Any())
//{
// string uids = string.Join(",", list.Where(x => x.UserId > 0).Select(x => x.UserId ?? 0));
// userList = member_UserRepository.GetList(new RB_Member_User_Extend() { UserIds = uids, TenantId = dmodel.TenantId, MallBaseId = dmodel.MallBaseId });
//}
foreach (var item in list)
{
item.CommentLabelList = new List<string>();
if (!string.IsNullOrWhiteSpace(item.LabelIds))
{
item.CommentLabelList = item.LabelIds.Split(",")?.ToList() ?? new List<string>();
}
//评论图片
//item.CommentImgList = new List<string>();
//if (!string.IsNullOrEmpty(item.CommentImage))
//{
// item.CommentImgList = JsonConvert.DeserializeObject<List<string>>(item.CommentImage);
//}
//if (item.UserId > 0)
//{
// item.UserPhotoPath = userList.Where(x => x.Id == item.UserId).FirstOrDefault()?.Photo ?? "";
//}
//if (item.UserId == 0 && item.UserPhoto > 0)
//{
// item.UserPhotoPath = material_InfoRepository.GetEntity(item.UserPhoto)?.Path ?? "";
//}
}
}
return list;
}
/// <summary> /// <summary>
/// 管理新增评论 /// 管理新增评论
/// </summary> /// </summary>
...@@ -8475,9 +8540,39 @@ namespace Mall.Module.Product ...@@ -8475,9 +8540,39 @@ namespace Mall.Module.Product
{ {
Id = Convert.ToInt32(item.Value), Id = Convert.ToInt32(item.Value),
Name = item.Key, Name = item.Key,
Count = cmodel?.CommentNum ?? 0 Count = cmodel?.CommentNum ?? 0,
Type = 1,
});
}
if (tenantId == 29)
{
var listComment = GetAppletCommentList(new RB_Goods_Comment_Extend { GoodsId = goodsId, TenantId = tenantId, MallBaseId = mallBaseId });
//获取标签信息
var commentLabelList = GetCommentLabelListModule(new RB_Comment_Label_Extend { TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var itemLabel in commentLabelList)
{
itemLabel.CommentNum = 0;
foreach (var item in listComment)
{
if (item.CommentLabelList != null && item.CommentLabelList.Any(x => x == itemLabel.Id.ToString()))
{
itemLabel.CommentNum += 1;
}
}
if (itemLabel.CommentNum > 0) {
RList.Add(new
{
Id = Convert.ToInt32(itemLabel.Id),
Name = itemLabel.Name,
Count = itemLabel.CommentNum,
Type = 2,
}); });
} }
}
// RList.AddRange(commentLabelList.Where(x => x.CommentNum > 0).Select(x => new { Count = x.CommentNum, x.Name, x.Id, Type = 2 }));
}
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
TotalNum = clist.Sum(x => x.CommentNum), TotalNum = clist.Sum(x => x.CommentNum),
...@@ -9624,9 +9719,11 @@ namespace Mall.Module.Product ...@@ -9624,9 +9719,11 @@ namespace Mall.Module.Product
}, },
}; };
bool flag = eduGoods_OrderRepository.Update(keyValues1, wheres1); bool flag = eduGoods_OrderRepository.Update(keyValues1, wheres1);
if (flag) { if (flag)
{
var eduList = eduGoods_OrderDetailRepository.GetList(new RB_Goods_OrderDetail_ViewModel() { OrderId = eduOrderId }); var eduList = eduGoods_OrderDetailRepository.GetList(new RB_Goods_OrderDetail_ViewModel() { OrderId = eduOrderId });
foreach (var qitem in eduList) { foreach (var qitem in eduList)
{
var dmdoel = dlist.Where(x => x.Id == qitem.MallOrderDetailId).FirstOrDefault(); var dmdoel = dlist.Where(x => x.Id == qitem.MallOrderDetailId).FirstOrDefault();
Dictionary<string, object> keyValues = new Dictionary<string, object>() { Dictionary<string, object> keyValues = new Dictionary<string, object>() {
{ nameof(RB_Goods_OrderDetail_ViewModel.FreightCostMoney), dmdoel?.FreightCostMoney??0} { nameof(RB_Goods_OrderDetail_ViewModel.FreightCostMoney), dmdoel?.FreightCostMoney??0}
......
...@@ -1611,6 +1611,7 @@ namespace Mall.Module.Product ...@@ -1611,6 +1611,7 @@ namespace Mall.Module.Product
decimal MaxSellMoney = model.SellingPrice ?? 0; decimal MaxSellMoney = model.SellingPrice ?? 0;
model.SpecificationList = new List<RB_Goods_Specification_Extend>(); model.SpecificationList = new List<RB_Goods_Specification_Extend>();
model.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>(); model.SpecificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
List<RB_Goods_SpecificationPrice_Extend> specificationPriceList = new List<RB_Goods_SpecificationPrice_Extend>();
if (model.IsCustomSpecification == 1) if (model.IsCustomSpecification == 1)
{ {
model.SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId }); model.SpecificationList = goods_SpecificationRepository.GetList(new RB_Goods_Specification_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
...@@ -2144,6 +2145,7 @@ namespace Mall.Module.Product ...@@ -2144,6 +2145,7 @@ namespace Mall.Module.Product
{ {
if (model.SpecificationPriceList.Any() && model.SpecificationList.Any()) if (model.SpecificationPriceList.Any() && model.SpecificationList.Any())
{ {
List<RB_Goods_Specification_Extend> SpecificationListToPrice = new List<RB_Goods_Specification_Extend>(); List<RB_Goods_Specification_Extend> SpecificationListToPrice = new List<RB_Goods_Specification_Extend>();
List<RB_Goods_SpecificationValue_Extend> SpecificationValueListToPrice = new List<RB_Goods_SpecificationValue_Extend>(); List<RB_Goods_SpecificationValue_Extend> SpecificationValueListToPrice = new List<RB_Goods_SpecificationValue_Extend>();
bool IsHaveSellingPriceZero = false; bool IsHaveSellingPriceZero = false;
...@@ -2175,6 +2177,7 @@ namespace Mall.Module.Product ...@@ -2175,6 +2177,7 @@ namespace Mall.Module.Product
for (int i = 0; i < ssarr.Length; i++) for (int i = 0; i < ssarr.Length; i++)
{ {
var smodel = model.SpecificationList[i]; var smodel = model.SpecificationList[i];
if (IsHaveSellingPriceZero && !SpecificationListToPrice.Where(x => x.Id == smodel.Id).Any()) if (IsHaveSellingPriceZero && !SpecificationListToPrice.Where(x => x.Id == smodel.Id).Any())
{ {
SpecificationListToPrice.Add(smodel); SpecificationListToPrice.Add(smodel);
...@@ -2184,6 +2187,21 @@ namespace Mall.Module.Product ...@@ -2184,6 +2187,21 @@ namespace Mall.Module.Product
{ {
SpecificationValueListToPrice.Add(svmodel); SpecificationValueListToPrice.Add(svmodel);
} }
//2024-02-19 add by:W 日期格式的话过滤掉小于当前日期的价格
if (smodel.IsDateFormat == 1 && !string.IsNullOrWhiteSpace(svmodel?.Name ?? ""))
{
try
{
DateTime startTime = Convert.ToDateTime(svmodel?.Name ?? "");
if (startTime >= Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00")))
{
specificationPriceList.Add(item);
}
}
catch (Exception ex)
{
}
}
attr_list.Add(new attr_list.Add(new
{ {
attr_group_name = smodel.Name, attr_group_name = smodel.Name,
...@@ -2401,7 +2419,16 @@ namespace Mall.Module.Product ...@@ -2401,7 +2419,16 @@ namespace Mall.Module.Product
{ {
if (model.IsCustomSpecification == 1 && model.SpecificationPriceList != null && model.SpecificationPriceList.Count > 0) if (model.IsCustomSpecification == 1 && model.SpecificationPriceList != null && model.SpecificationPriceList.Count > 0)
{ {
var tempList = model.SpecificationPriceList.Where(x => x.SellingPrice > 0)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>(); List<RB_Goods_SpecificationPrice_Extend> tempList = new List<RB_Goods_SpecificationPrice_Extend>();
if (model?.SpecificationList?.Where(x => x.IsDateFormat == 1)?.Count() > 0)//有日期格式的规格
{
tempList = specificationPriceList.Where(x => x.SellingPrice > 0)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>();
}
else
{
tempList = model.SpecificationPriceList.Where(x => x.SellingPrice > 0)?.ToList() ?? new List<RB_Goods_SpecificationPrice_Extend>();
}
if (tempList != null && tempList.Count > 0) if (tempList != null && tempList.Count > 0)
{ {
price_member_min = price_min = tempList?.Min(x => x.SellingPrice ?? 0) ?? 0; price_member_min = price_min = tempList?.Min(x => x.SellingPrice ?? 0) ?? 0;
...@@ -2585,7 +2612,7 @@ namespace Mall.Module.Product ...@@ -2585,7 +2612,7 @@ namespace Mall.Module.Product
attr_group_name = x.Name, attr_group_name = x.Name,
//购买次数(进阶小课堂使用) //购买次数(进阶小课堂使用)
service_time = model.ServiceTime, service_time = model.ServiceTime,
attr_list =attrList, attr_list = attrList,
//dateList, //dateList,
}); });
} }
...@@ -2623,7 +2650,7 @@ namespace Mall.Module.Product ...@@ -2623,7 +2650,7 @@ namespace Mall.Module.Product
// pic_url = z.ImagePath // pic_url = z.ImagePath
// }) // })
//}), //}),
attr_groups= groupsList, attr_groups = groupsList,
attr = priceList, attr = priceList,
goodsRelevanceList = goodsRelevanceList?.Select(qitem => new goodsRelevanceList = goodsRelevanceList?.Select(qitem => new
{ {
...@@ -8194,6 +8221,33 @@ namespace Mall.Module.Product ...@@ -8194,6 +8221,33 @@ namespace Mall.Module.Product
foreach (var item in model.SpecificationList) foreach (var item in model.SpecificationList)
{ {
item.SpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList(); item.SpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList();
#region 注释过期日期对应的规格 2024-02-19 add by:W
//var tempSpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList();
//if (item.IsDateFormat == 1)
//{
// item.SpecificationValueList = new List<RB_Goods_SpecificationValue_Extend>();
// DateTime nowDay = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"));
// foreach (var itemSpecificationValue in tempSpecificationValueList)
// {
// try
// {
// if (!string.IsNullOrWhiteSpace(itemSpecificationValue?.Name ?? "")&&Convert.ToDateTime(itemSpecificationValue?.Name ?? "") >= nowDay)
// {
// item.SpecificationValueList.Add(itemSpecificationValue);
// }
// }
// catch (Exception ex)
// {
// }
// }
//}
//else
//{
// item.SpecificationValueList = tempSpecificationValueList;
//}
#endregion
} }
} }
int SortNum = 1; int SortNum = 1;
......
...@@ -39,6 +39,10 @@ WHERE 1=1 ...@@ -39,6 +39,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId);
} }
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND a.{nameof(RB_Comment_Label_Extend.Name)} like '%{query.Name}%'");
}
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id));
return GetPage<RB_Comment_Label_Extend>(pageIndex, pageSize, out totalCount, builder.ToString()).ToList(); return GetPage<RB_Comment_Label_Extend>(pageIndex, pageSize, out totalCount, builder.ToString()).ToList();
...@@ -69,6 +73,10 @@ WHERE 1=1 ...@@ -69,6 +73,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Comment_Label_Extend.MallBaseId), query.MallBaseId);
} }
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND a.{nameof(RB_Comment_Label_Extend.Name)} like '%{query.Name}%'");
}
} }
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Comment_Label_Extend.Id));
return Get<RB_Comment_Label_Extend>(builder.ToString()).ToList(); return Get<RB_Comment_Label_Extend>(builder.ToString()).ToList();
......
...@@ -70,6 +70,67 @@ where {where} order by c.Id desc"; ...@@ -70,6 +70,67 @@ where {where} order by c.Id desc";
/// <param name="dmodel"></param> /// <param name="dmodel"></param>
/// <returns></returns> /// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletPageList(int pageIndex, int pageSize, out long count, RB_Goods_Comment_Extend dmodel) public List<RB_Goods_Comment_Extend> GetAppletPageList(int pageIndex, int pageSize, out long count, RB_Goods_Comment_Extend dmodel)
{
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.Id)}={dmodel.Id}";
}
if (dmodel.GoodsId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.GoodsId)}={dmodel.GoodsId}";
}
if (dmodel.CommentLabelId > 0)
{
where += $@" AND FIND_IN_SET({dmodel.CommentLabelId},c.{nameof(RB_Goods_Comment.LabelIds)})";
}
if (dmodel.UserId > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.UserId)}={dmodel.UserId}";
}
if (dmodel.PlatformSource > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.PlatformSource)}={(int)dmodel.PlatformSource}";
}
if (dmodel.Is_Show > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.Is_Show)}={dmodel.Is_Show}";
}
if (!string.IsNullOrEmpty(dmodel.UserName))
{
where += $@" and c.{nameof(RB_Goods_Comment.UserName)} like '%{dmodel.UserName}%'";
}
if (!string.IsNullOrEmpty(dmodel.Content))
{
where += $@" and c.{nameof(RB_Goods_Comment.Content)} like '%{dmodel.Content}%'";
}
if (dmodel.CommentGrade.HasValue && dmodel.CommentGrade.Value > 0)
{
where += $@" and c.{nameof(RB_Goods_Comment.CommentGrade)}={(int)dmodel.CommentGrade}";
}
string sql = $@"SELECT c.* FROM RB_Goods_Comment c where {where} order by c.Is_Top asc,c.Id desc";
return GetPage<RB_Goods_Comment_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_Comment_Extend> GetAppletCommentList(RB_Goods_Comment_Extend dmodel)
{ {
string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 "; string where = $" 1=1 and c.{nameof(RB_Goods_Comment.Status)}=0 ";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
...@@ -111,9 +172,11 @@ where {where} order by c.Id desc"; ...@@ -111,9 +172,11 @@ where {where} order by c.Id desc";
} }
string sql = $@"SELECT c.* FROM RB_Goods_Comment c where {where} order by c.Is_Top asc,c.Id desc"; string sql = $@"SELECT c.* FROM RB_Goods_Comment c where {where} order by c.Is_Top asc,c.Id desc";
return GetPage<RB_Goods_Comment_Extend>(pageIndex, pageSize, out count, sql).ToList(); return Get<RB_Goods_Comment_Extend>(sql).ToList();
} }
/// <summary> /// <summary>
/// 获取评论数量统计 /// 获取评论数量统计
/// </summary> /// </summary>
......
...@@ -522,7 +522,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -522,7 +522,7 @@ namespace Mall.WebApi.Controllers.MallBase
} }
if (userInfo.TenantId == 29) if (userInfo.TenantId == 29)
{ {
if (string.IsNullOrWhiteSpace(demodel?.CustomFormInfo??"")) if (string.IsNullOrWhiteSpace(demodel?.CustomFormInfo ?? ""))
{ {
return ApiResult.ParamIsNull("请填写旅客信息"); return ApiResult.ParamIsNull("请填写旅客信息");
} }
...@@ -1385,6 +1385,43 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -1385,6 +1385,43 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetAppletGoodsCommentLabelList()
{
var parms = RequestParm;
RB_Goods_Comment_Extend demodel = JsonConvert.DeserializeObject<RB_Goods_Comment_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.Is_Show = 1;
var list = orderModule.GetAppletCommentList(demodel);
//获取标签信息
var commentLabelList = orderModule.GetCommentLabelListModule(new RB_Comment_Label_Extend { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
foreach (var itemLabel in commentLabelList)
{
itemLabel.CommentNum = 0;
foreach (var item in list)
{
if (item.CommentLabelList != null && item.CommentLabelList.Any(x => x == itemLabel.Id.ToString()))
{
itemLabel.CommentNum += 1;
}
}
}
var result = commentLabelList.Where(x => x.CommentNum > 0).Select(x => new { x.CommentNum, x.Name, x.Id });
return ApiResult.Success("", result);
}
/// <summary> /// <summary>
/// 获取商品评论统计 /// 获取商品评论统计
/// </summary> /// </summary>
......
...@@ -4818,16 +4818,13 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -4818,16 +4818,13 @@ namespace Mall.WebApi.Controllers.MallBase
Name = parm.GetStringValue("Name"), Name = parm.GetStringValue("Name"),
Status = 0, Status = 0,
TenantId = userInfo.TenantId, TenantId = userInfo.TenantId,
MallBaseId = userInfo.MallBaseId, MallBaseId = base.RequestParm.MallBaseId,
}; };
if (extModel.Id > 0) if (extModel.Id == 0)
{
extModel.UpdateDate = DateTime.Now;
}
else
{ {
extModel.CreateDate = DateTime.Now; extModel.CreateDate = DateTime.Now;
} }
extModel.UpdateDate = DateTime.Now;
bool flag = orderModule.SetCommentLabelModule(extModel); bool flag = orderModule.SetCommentLabelModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
...@@ -4869,16 +4866,18 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -4869,16 +4866,18 @@ namespace Mall.WebApi.Controllers.MallBase
var parm = JObject.Parse(base.RequestParm.msg.ToString()); var parm = JObject.Parse(base.RequestParm.msg.ToString());
ResultPageModel pageModel = new ResultPageModel() ResultPageModel pageModel = new ResultPageModel()
{ {
pageIndex=parm.GetInt("pageIndex"), pageIndex = parm.GetInt("pageIndex"),
pageSize=parm.GetInt("pageSize"), pageSize = parm.GetInt("pageSize"),
}; };
var query = new RB_Comment_Label_Extend() var query = new RB_Comment_Label_Extend()
{ {
Name=parm.GetStringValue("Name"), Name = parm.GetStringValue("Name"),
TenantId = base.RequestParm.TenantId,
MallBaseId = base.RequestParm.MallBaseId,
}; };
var dataList = orderModule.GetCommentLabelPageModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query); var dataList = orderModule.GetCommentLabelPageModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount); pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = dataList; pageModel.pageData = dataList.Select(x => new { x.Id, x.MallBaseId, x.TenantId, x.Name, UpdateDate = x.UpdateDate.ToString("yyyy-MM-dd HH:mm:ss") });
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
...@@ -4893,8 +4892,10 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -4893,8 +4892,10 @@ namespace Mall.WebApi.Controllers.MallBase
var query = new RB_Comment_Label_Extend() var query = new RB_Comment_Label_Extend()
{ {
Name = parm.GetStringValue("Name"), Name = parm.GetStringValue("Name"),
// TenantId = base.RequestParm.TenantId,
MallBaseId = base.RequestParm.MallBaseId,
}; };
var dataList = orderModule.GetCommentLabelListModule( query); var dataList = orderModule.GetCommentLabelListModule(query);
return ApiResult.Success(data: dataList); return ApiResult.Success(data: dataList);
} }
#endregion #endregion
......
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