Commit d13fa4b5 authored by 吴春's avatar 吴春

提交

parent 7a9ad4e5
......@@ -92,6 +92,12 @@ namespace Mall.Model.Extend.Product
/// 订单返佣列表
/// </summary>
public List<RB_Goods_OrderCommission_Extend> OrderCommissionList { get; set; }
/// <summary>
/// 订单返佣列表
/// </summary>
public List<RB_SmallShops_Commission_Extend> SmallShopsCommissionOrderList { get; set; }
/// <summary>
/// 是否发放佣金 1是 2否
/// </summary>
......
......@@ -234,6 +234,14 @@ namespace Mall.Module.Product
/// </summary>
private RB_Goods_OrderDetailFreeShippingRepository orderDetailFreeShippingRepository = new RB_Goods_OrderDetailFreeShippingRepository();
/// <summary>
/// 全局包邮记录
/// </summary>
private RB_SmallShops_CommissionRepository smallShopsCommissionRepository = new RB_SmallShops_CommissionRepository();
#region 购物车
/// <summary>
......@@ -9433,5 +9441,85 @@ namespace Mall.Module.Product
}
#endregion
#region 店铺订单
/// <summary>
/// 获取分销订单
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Goods_Order_Extend> GetSmallShopOrdersPageList(int pageIndex, int pageSize, out long count, RB_Goods_Order_Extend demodel)
{
var list = goods_OrderRepository.GetSmallShopOrdersPageList(pageIndex, pageSize, out count, demodel);
if (list.Any())
{
//查询订单明细
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
//查询图片
List<RB_Material_Info_Extend> Mlist = new List<RB_Material_Info_Extend>();
if (dlist.Any())
{
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
}
}
string areaIds1 = string.Join(",", list.Select(x => x.Province ?? 0).Distinct());
string areaIds2 = string.Join(",", list.Select(x => x.City ?? 0).Distinct());
string areaIds3 = string.Join(",", list.Select(x => x.District ?? 0).Distinct());
string areaIds = "0";
if (!string.IsNullOrEmpty(areaIds1))
{
areaIds += "," + areaIds1;
}
if (!string.IsNullOrEmpty(areaIds2))
{
areaIds += "," + areaIds2;
}
if (!string.IsNullOrEmpty(areaIds3))
{
areaIds += "," + areaIds3;
}
var arealist = destinationRepository.GetDictvalueListForIds(areaIds);
//分销情况
var oclist = smallShopsCommissionRepository.GetListGroupByUser(new RB_SmallShops_Commission_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = string.Join(",", list.Select(x => x.OrderId)) });
if (oclist.Any())
{
//获取用户
var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, UserIds = string.Join(",", oclist.Select(x => x.UserId).Distinct()) });
//获取分销商
var dislist = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, UserIds = string.Join(",", oclist.Select(x => x.UserId).Distinct()) });
foreach (var item in oclist)
{
var umodel = ulist.Where(x => x.Id == item.UserId).FirstOrDefault();
item.UserName = umodel?.Name ?? "";
item.Mobile = umodel?.Moblie ?? "";
item.Name = dislist.Where(x => x.UserId == item.UserId).FirstOrDefault()?.Name ?? "";
}
}
foreach (var item in list)
{
item.DetailList = dlist.Where(x => x.OrderId == item.OrderId).ToList();
string areaName = (arealist.Where(x => x.ID == item.Province).FirstOrDefault()?.Name ?? "") + " " + (arealist.Where(x => x.ID == item.City).FirstOrDefault()?.Name ?? "") + " " + (arealist.Where(x => x.ID == item.District).FirstOrDefault()?.Name ?? "");
item.ShoppingAddress = areaName + " " + item.ShoppingAddress;
item.SmallShopsCommissionOrderList = oclist.Where(x => x.OrderId == item.OrderId).ToList();
item.IsOrderCommission = 2;
if (item.SmallShopsCommissionOrderList.Where(x => x.CommissionState == 2).Any())
{
item.IsOrderCommission = 1;
}
}
}
return list;
}
#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