Commit d72c618e authored by 黄奎's avatar 黄奎

页面修改

parent d278f89f
...@@ -375,5 +375,10 @@ namespace Mall.Model.Extend.Product ...@@ -375,5 +375,10 @@ namespace Mall.Model.Extend.Product
/// 服务人员头像 /// 服务人员头像
/// </summary> /// </summary>
public string ServicepersonalHead { get; set; } public string ServicepersonalHead { get; set; }
/// <summary>
/// 进阶小课堂扩展JSON对象
/// </summary>
public string EduJsonData { get; set; }
} }
} }
...@@ -909,9 +909,12 @@ namespace Mall.Module.Product ...@@ -909,9 +909,12 @@ namespace Mall.Module.Product
} }
//查询订单明细 //查询订单明细
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId }); var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
var goodsRelevanceList = new List<RB_Goods_Relevance_Extend>();
if (dlist.Any()) if (dlist.Any())
{ {
string orderDetailIds = string.Join(",", dlist.Select(x => x.Id)); string orderDetailIds = string.Join(",", dlist.Select(x => x.Id));
string goodIds = string.Join(",", dlist.Select(qitem => qitem.GoodsId));
goodsRelevanceList= goods_RelevanceRepository.GetGoodsRelevanceListRepository(new RB_Goods_Relevance_Extend() { QGoodsIds = goodIds });
var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = orderDetailIds, TenantId = tenantId, MallBaseId = mallBaseId }, false); var oasList = goods_OrderAfterSaleRepository.GetList(new RB_Goods_OrderAfterSale_Extend() { OrderDetailIds = orderDetailIds, TenantId = tenantId, MallBaseId = mallBaseId }, false);
foreach (var item in dlist) foreach (var item in dlist)
{ {
...@@ -932,16 +935,7 @@ namespace Mall.Module.Product ...@@ -932,16 +935,7 @@ namespace Mall.Module.Product
model.DistrictAddress = (destinationRepository.GetEntity(model.Province)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.City)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.District)?.Name ?? ""); model.DistrictAddress = (destinationRepository.GetEntity(model.Province)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.City)?.Name ?? "") + " " + (destinationRepository.GetEntity(model.District)?.Name ?? "");
//物流 //物流
var erlist = goods_ExpressRelevanceRepository.GetList(new RB_Goods_ExpressRelevance_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId }); var erlist = goods_ExpressRelevanceRepository.GetList(new RB_Goods_ExpressRelevance_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderId = orderId });
//List<RB_Goods_OrderExpress_Extend> oeList = new List<RB_Goods_OrderExpress_Extend>();
//if (erlist.Any())
//{
// oeList = goods_OrderExpressRepository.GetList(new RB_Goods_OrderExpress_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, OrderExpressIds = string.Join(",", erlist.Select(x => x.OrderExpressId)) });
// foreach (var item in oeList)
// {
// item.ExpressName = logistics_ExpressRepository.GetEntity(item.ExpressId)?.Name ?? "";
// }
//}
//是否可以申请售后 //是否可以申请售后
var mallModel = mallBaseRepository.GetEntity(mallBaseId); var mallModel = mallBaseRepository.GetEntity(mallBaseId);
model.IsCanApplyForAfterSale = 2; model.IsCanApplyForAfterSale = 2;
...@@ -976,7 +970,27 @@ namespace Mall.Module.Product ...@@ -976,7 +970,27 @@ namespace Mall.Module.Product
template_message_list.Add(miniModel.OrderCancelTpl); template_message_list.Add(miniModel.OrderCancelTpl);
} }
} }
List<object> resultList = new List<object>();
foreach (var item in model.DetailList)
{
var EduData = goodsRepository.ParsingEduJsonRepository(item.EduJsonData);
var tempList = goodsRelevanceList?.Where(qitem => qitem.GoodsId == item.GoodsId)?.ToList();
resultList.Add(new
{
DetailId = item.Id,
item.GoodsId,
item.GoodsName,
item.CoverImagePath,
SpecificationList = JsonConvert.DeserializeObject<List<string>>(item.Specification),
item.Number,
item.Final_Price,
item.IsComment,
item.IsApplyForAfterSale,
item.FreeShippingRemarks,
EduData,
GoodsRelevanceList= tempList,
});
}
return ApiResult.Success("", new return ApiResult.Success("", new
{ {
template_message_list, template_message_list,
...@@ -1003,19 +1017,7 @@ namespace Mall.Module.Product ...@@ -1003,19 +1017,7 @@ namespace Mall.Module.Product
model.ShoppingAddress, model.ShoppingAddress,
DeductionCommission = model.DeductionCommission ?? 0, DeductionCommission = model.DeductionCommission ?? 0,
IsHaveExpress = erlist.Any() ? 1 : 2, IsHaveExpress = erlist.Any() ? 1 : 2,
DetailList = model.DetailList.Select(x => new DetailList = resultList,
{
DetailId = x.Id,
x.GoodsId,
x.GoodsName,
x.CoverImagePath,
SpecificationList = JsonConvert.DeserializeObject<List<string>>(x.Specification),
x.Number,
x.Final_Price,
x.IsComment,
x.IsApplyForAfterSale,
x.FreeShippingRemarks
}),
model.IsApplyForCancel, model.IsApplyForCancel,
model.RejectRemark, model.RejectRemark,
model.IsCanApplyForAfterSale, model.IsCanApplyForAfterSale,
...@@ -3143,7 +3145,6 @@ namespace Mall.Module.Product ...@@ -3143,7 +3145,6 @@ namespace Mall.Module.Product
string GoodsIds = ""; string GoodsIds = "";
int TotalIntegralNumber = 0;//总使用积分 int TotalIntegralNumber = 0;//总使用积分
decimal TotalIntegralMoney = 0;//总使用积分抵扣金额 decimal TotalIntegralMoney = 0;//总使用积分抵扣金额
decimal totalRelevancePrice = 0;//总绑定物品金额
List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格) List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格)
decimal CouponsMoney = 0;//优惠卷验证 decimal CouponsMoney = 0;//优惠卷验证
...@@ -3211,6 +3212,7 @@ namespace Mall.Module.Product ...@@ -3211,6 +3212,7 @@ namespace Mall.Module.Product
int DefFreightId = 0;//默认运费id int DefFreightId = 0;//默认运费id
GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId)); GoodsIds = string.Join(",", demodel.DetailList.Select(x => x.GoodsId));
var gList = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var gList = goodsRepository.GetList(new RB_Goods_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
//绑定物品列表 //绑定物品列表
var goodsRelevanceList = goods_RelevanceRepository.GetGoodsRelevanceListRepository(new RB_Goods_Relevance_Extend() var goodsRelevanceList = goods_RelevanceRepository.GetGoodsRelevanceListRepository(new RB_Goods_Relevance_Extend()
{ {
...@@ -3218,8 +3220,6 @@ namespace Mall.Module.Product ...@@ -3218,8 +3220,6 @@ namespace Mall.Module.Product
MallBaseId = demodel.MallBaseId, MallBaseId = demodel.MallBaseId,
QGoodsIds = GoodsIds QGoodsIds = GoodsIds
}); });
//总绑定物品金额
totalRelevancePrice = goodsRelevanceList?.Sum(qitem => qitem.RelevancePrice) ?? 0;
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId }); var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = GoodsIds, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
...@@ -3642,14 +3642,15 @@ namespace Mall.Module.Product ...@@ -3642,14 +3642,15 @@ namespace Mall.Module.Product
item.DiscountRate = gradeModel?.Discount ?? 10; item.DiscountRate = gradeModel?.Discount ?? 10;
} }
} }
//HK 2022-10-11 新增绑定物品金额
var tempRelevancePrice = goodsRelevanceList?.Where(qitem => qitem.GoodsId == gmodel.Id)?.Sum(qitem => qitem.RelevancePrice) ?? 0;
if (umodel.MemberGrade > 0) if (umodel.MemberGrade > 0)
{ {
item.Final_Price = gmodel.MemberPrice * (item.Number ?? 0); item.Final_Price = gmodel.MemberPrice * (item.Number ?? 0)+ tempRelevancePrice;
} }
else else
{ {
item.Final_Price = (gmodel.SellingPrice ?? 0) * (item.Number ?? 0); item.Final_Price = (gmodel.SellingPrice ?? 0) * (item.Number ?? 0)+ tempRelevancePrice;
} }
#endregion #endregion
...@@ -4307,8 +4308,7 @@ namespace Mall.Module.Product ...@@ -4307,8 +4308,7 @@ namespace Mall.Module.Product
return ApiResult.Failed("储值卡抵扣金额有误"); return ApiResult.Failed("储值卡抵扣金额有误");
} }
//验证总额 (2022-10-11 HK新增绑定物品金额) if (demodel.Income != (TotalMoney + TotalExpress - DeductionCommission - TotalDepositMoney))
if (demodel.Income != (TotalMoney + TotalExpress - DeductionCommission - TotalDepositMoney+ totalRelevancePrice))
{ {
return ApiResult.Failed("订单合计金额不正确"); return ApiResult.Failed("订单合计金额不正确");
} }
......
...@@ -63,7 +63,11 @@ namespace Mall.Repository.Product ...@@ -63,7 +63,11 @@ namespace Mall.Repository.Product
where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})"; where += $@" and a.{nameof(RB_Goods_OrderDetail.OrderId)} in({dmodel.OrderIds})";
} }
string sql = $@"SELECT a.*,b.`Name` as SupplierName FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID where {where} order by a.Id asc"; string sql = $@"
SELECT a.*,b.`Name` as SupplierName,C.EduJsonData
FROM rb_goods_orderdetail as a LEFT JOIN rb_supplier as b on a.SupplierId=b.ID
LEFT JOIN rb_goods AS C ON a.GoodsId=C.Id
WHERE {where} order by a.Id asc";
return Get<RB_Goods_OrderDetail_Extend>(sql).ToList(); return Get<RB_Goods_OrderDetail_Extend>(sql).ToList();
} }
......
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