Commit 47f29904 authored by liudong1993's avatar liudong1993

1

parent f3b005da
......@@ -260,4 +260,116 @@ namespace Mall.Common.Enum.Goods
[EnumField("佣金金额")]
YJJE = 25
}
/// <summary>
/// 推荐分销订单导出
/// </summary>
public enum DistributionOrdersExportForRecommendEnum
{
/// <summary>
/// 所属平台
/// </summary>
[EnumField("所属平台")]
SSPT = 1,
/// <summary>
/// 订单号
/// </summary>
[EnumField("订单号")]
DDH = 2,
/// <summary>
/// 下单用户
/// </summary>
[EnumField("下单用户")]
XDYH = 4,
/// <summary>
/// 商品名
/// </summary>
[EnumField("商品名")]
SPM = 5,
/// <summary>
/// 规格
/// </summary>
[EnumField("规格")]
GG = 6,
/// <summary>
/// 数量
/// </summary>
[EnumField("数量")]
SL = 7,
/// <summary>
/// 货号
/// </summary>
[EnumField("货号")]
HH = 8,
/// <summary>
/// 收件人
/// </summary>
[EnumField("收件人")]
SJR = 10,
/// <summary>
/// 收件人电话
/// </summary>
[EnumField("收件人电话")]
SJRDH = 11,
/// <summary>
/// 收件人地址
/// </summary>
[EnumField("收件人地址")]
SJRDZ = 12,
/// <summary>
/// 总金额
/// </summary>
[EnumField("总金额")]
ZJE = 13,
/// <summary>
/// 实际付款
/// </summary>
[EnumField("实际付款")]
SJFK = 14,
/// <summary>
/// 下单时间
/// </summary>
[EnumField("下单时间")]
XDSJ = 16,
/// <summary>
/// 订单状态
/// </summary>
[EnumField("订单状态")]
DDZT = 17,
/// <summary>
/// 支付方式
/// </summary>
[EnumField("支付方式")]
ZFFS = 18,
/// <summary>
/// 付款状态
/// </summary>
[EnumField("支付状态")]
FKZT = 19,
/// <summary>
/// 付款时间
/// </summary>
[EnumField("支付时间")]
FKSJ = 20,
/// <summary>
/// 备注/表单
/// </summary>
[EnumField("备注/表单")]
BZBD = 21,
/// <summary>
/// 买家留言
/// </summary>
[EnumField("买家留言")]
MJLY = 22,
/// <summary>
/// 推荐人
/// </summary>
[EnumField("推荐人")]
NCXM = 24,
/// <summary>
/// 佣金金额
/// </summary>
[EnumField("佣金金额")]
YJJE = 25
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 推荐供应商返佣账单表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_Bill
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 期数
/// </summary>
public string Periods { get; set; }
/// <summary>
/// 账单总金额
/// </summary>
public decimal? Money { get; set; }
/// <summary>
/// 账单状态 1待打款 2已打款 3驳回
/// </summary>
public int? BillState { get; set; }
/// <summary>
/// 用户id/分销商id
/// </summary>
public int? UserId
{
get;
set;
}
/// <summary>
/// 供应商id
/// </summary>
public int? SupplierId
{
get;
set;
}
/// <summary>
/// 备注
/// </summary>
public string Remark
{
get;
set;
}
/// <summary>
/// 状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 操作员工
/// </summary>
public int? EmpId { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
///
/// </summary>
public DateTime? UpdateDate { get; set; }
/// <summary>
/// 绑定财务单据id
/// </summary>
public int? FinanceId { get; set; }
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 推荐供应商返佣账单明细表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_BillDetail
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 账单id
/// </summary>
public int? BillId { get; set; }
/// <summary>
/// 订单id
/// </summary>
public int? OrderId { get; set; }
/// <summary>
/// 订单明细id
/// </summary>
public int? OrderDetailId
{
get;
set;
}
/// <summary>
/// 返佣id
/// </summary>
public int? CommissionId
{
get;
set;
}
/// <summary>
/// 状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
///
/// </summary>
public DateTime? UpdateDate { get; set; }
}
}
......@@ -26,6 +26,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public decimal? Express { get; set; }
/// <summary>
/// 推荐返佣
/// </summary>
public RB_Goods_OrderIntroduction_Extend OrderIntroduction { get; set; }
/// <summary>
/// 重量
/// </summary>
public int? GoodsWeight { get; set; }
......
......@@ -49,5 +49,13 @@ namespace Mall.Model.Extend.Product
/// 待返佣金额
/// </summary>
public decimal WaitCommission { get; set; }
/// <summary>
/// 供应商id
/// </summary>
public int? SupplierId { get; set; }
/// <summary>
/// 返佣ids
/// </summary>
public string IntroductionIds { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Common.Enum.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 推荐供应商返佣账单明细扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_BillDetail_Extend : RB_Distributor_BillDetail
{
/// <summary>
/// 返佣ids
/// </summary>
public string CommissionIds { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Common.Enum.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 推荐供应商返佣账单扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_Bill_Extend : RB_Distributor_Bill
{
/// <summary>
/// 用户名称
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 供应商名称
/// </summary>
public string SupplierName { get; set; }
}
}
......@@ -342,6 +342,105 @@ where {where} group by o.OrderId order by o.CreateDate desc";
return GetPage<RB_Goods_Order_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_Order_Extend> GetDistributionOrdersPageListForRecommend(int pageIndex, int pageSize, out long count, RB_Goods_Order_Extend dmodel)
{
string where = $" 1=1 and o.{nameof(RB_Goods_Order.Status)}=0";
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in(1,2,3,4,5,6)";
if (dmodel.TenantId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderId)}={dmodel.OrderId}";
}
if (dmodel.OrderSource > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderSource)}={(int)dmodel.OrderSource}";
}
if (dmodel.OrderType > 0)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.OrderType)}={dmodel.OrderType}";
}
if (dmodel.DeliveryMethod > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.DeliveryMethod)}={(int)dmodel.DeliveryMethod}";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and o.{nameof(RB_Goods_Order.CreateDate)} <='{dmodel.EndTime} 23:59:59'";
}
if (dmodel.OrderStatus > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)dmodel.OrderStatus}";
}
if (!string.IsNullOrEmpty(dmodel.OrderNo))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)} like '%{dmodel.OrderNo}%'";
}
if (!string.IsNullOrEmpty(dmodel.MerchantsNo))
{
where += $@" and o.{nameof(RB_Goods_Order.MerchantsNo)} like '%{dmodel.MerchantsNo}%'";
}
if (!string.IsNullOrEmpty(dmodel.UserName))
{
where += $@" and u.{nameof(RB_Member_User.Name)} like '%{dmodel.UserName}%'";
}
if (dmodel.UserId > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.UserId)}={(int)dmodel.UserId}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)} like '%{dmodel.GoodsName}%'";
}
if (!string.IsNullOrEmpty(dmodel.Consignee))
{
where += $@" and o.{nameof(RB_Goods_Order.Consignee)} like '%{dmodel.Consignee}%'";
}
if (!string.IsNullOrEmpty(dmodel.Mobile))
{
where += $@" and o.{nameof(RB_Goods_Order.Mobile)} like '%{dmodel.Mobile}%'";
}
if (!string.IsNullOrEmpty(dmodel.ProductCode))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.ProductCode)} like '%{dmodel.ProductCode}%'";
}
if (dmodel.Recycled > 0)
{
where += $@" and o.{nameof(RB_Goods_Order.Recycled)}={(int)dmodel.Recycled}";
}
if (dmodel.DistributionUserId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.UserId)}={dmodel.DistributionUserId}";
}
string sql = $@"SELECT o.*,u.Name as UserName FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
INNER JOIN rb_member_user u on o.UserId=u.Id
inner JOIN rb_goods_orderintroduction oc on o.OrderId = oc.OrderId
where {where} group by o.OrderId order by o.CreateDate desc";
return GetPage<RB_Goods_Order_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 清空回收站
/// </summary>
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 推荐供应商返佣账单明细仓储层
/// </summary>
public class RB_Distributor_BillDetailRepository : RepositoryBase<RB_Distributor_BillDetail>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Distributor_BillDetail_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Distributor_BillDetail_Extend dmodel)
{
string where = $@" 1=1 and {nameof(RB_Distributor_BillDetail.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.BillId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.BillId)}={dmodel.BillId}";
}
if (dmodel.CommissionId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.CommissionId)}={dmodel.CommissionId}";
}
if (!string.IsNullOrEmpty(dmodel.CommissionIds))
{
where += $@" and {nameof(RB_Distributor_BillDetail.CommissionId)} in ({dmodel.CommissionIds})";
}
string sql = $@"select * from RB_Distributor_BillDetail where {where} order by Id desc";
return GetPage<RB_Distributor_BillDetail_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Distributor_BillDetail_Extend> GetList(RB_Distributor_BillDetail_Extend dmodel)
{
string where = $@" 1=1 and {nameof(RB_Distributor_BillDetail.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.BillId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.BillId)}={dmodel.BillId}";
}
if (dmodel.CommissionId > 0)
{
where += $@" and {nameof(RB_Distributor_BillDetail.CommissionId)}={dmodel.CommissionId}";
}
if (!string.IsNullOrEmpty(dmodel.CommissionIds))
{
where += $@" and {nameof(RB_Distributor_BillDetail.CommissionId)} in ({dmodel.CommissionIds})";
}
string sql = $@"select * from RB_Distributor_BillDetail where {where} order by Id desc";
return Get<RB_Distributor_BillDetail_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 推荐供应商返佣账单仓储层
/// </summary>
public class RB_Distributor_BillRepository : RepositoryBase<RB_Distributor_Bill>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Distributor_Bill_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Distributor_Bill_Extend dmodel)
{
string where = $@" 1=1 and {nameof(RB_Distributor_Bill.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.UserId)}={dmodel.UserId}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.SupplierId)}={dmodel.SupplierId}";
}
if (!string.IsNullOrEmpty(dmodel.Periods))
{
where += $@" and {nameof(RB_Distributor_Bill.Periods)} like '%{dmodel.Periods}%'";
}
if (dmodel.BillState > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.BillState)}={dmodel.BillState}";
}
string sql = $@"select * from RB_Distributor_Bill where {where} order by Id desc";
return GetPage<RB_Distributor_Bill_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Distributor_Bill_Extend> GetList(RB_Distributor_Bill_Extend dmodel)
{
string where = $@" 1=1 and {nameof(RB_Distributor_Bill.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.UserId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.UserId)}={dmodel.UserId}";
}
if (dmodel.SupplierId > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.SupplierId)}={dmodel.SupplierId}";
}
if (!string.IsNullOrEmpty(dmodel.Periods))
{
where += $@" and {nameof(RB_Distributor_Bill.Periods)} like '%{dmodel.Periods}%'";
}
if (dmodel.BillState > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.BillState)}={dmodel.BillState}";
}
string sql = $@"select * from RB_Distributor_Bill where {where} order by Id desc";
return Get<RB_Distributor_Bill_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