Commit 825be94e authored by liudong1993's avatar liudong1993

用户管理

parent d38534dc
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.User
{
/// <summary>
/// 用户导出选项枚举
/// </summary>
public enum UserExportEnum
{
/// <summary>
/// 所属平台
/// </summary>
[EnumField("所属平台")]
SSPT = 1,
/// <summary>
/// 用户ID
/// </summary>
[EnumField("用户ID")]
YHID = 2,
/// <summary>
/// 平台标识ID
/// </summary>
[EnumField("平台标识ID")]
PTBSID = 3,
/// <summary>
/// 昵称
/// </summary>
[EnumField("昵称")]
NC = 4,
/// <summary>
/// 绑定手机号
/// </summary>
[EnumField("绑定手机号")]
BDSJH = 5,
/// <summary>
/// 联系方式
/// </summary>
[EnumField("联系方式")]
LXFS = 6,
/// <summary>
/// 备注
/// </summary>
[EnumField("备注")]
BZ = 7,
/// <summary>
/// 加入时间
/// </summary>
[EnumField("加入时间")]
JRSJ = 8,
/// <summary>
/// 会员等级
/// </summary>
[EnumField("会员等级")]
HYDJ = 9,
/// <summary>
/// 订单数
/// </summary>
[EnumField("订单数")]
DDS = 10,
/// <summary>
/// 优惠卷总数
/// </summary>
[EnumField("优惠卷总数")]
YHJZS = 11,
/// <summary>
/// 卡卷总数
/// </summary>
[EnumField("卡卷总数")]
KJZS = 12,
/// <summary>
/// 积分
/// </summary>
[EnumField("积分")]
JF = 13,
/// <summary>
/// 余额
/// </summary>
[EnumField("余额")]
YE = 14,
/// <summary>
/// 总消费
/// </summary>
[EnumField("总消费")]
ZXF = 15
}
}
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_Member_Balance
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 用户id
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 类型 1增加 2减少
/// </summary>
public int? Type
{
get;
set;
}
/// <summary>
/// 充值金额
/// </summary>
public decimal? Balance
{
get;
set;
}
/// <summary>
/// Image
/// </summary>
public string Image
{
get;
set;
}
/// <summary>
/// 描述
/// </summary>
public string Description
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 商户号id
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
}
}
...@@ -57,7 +57,7 @@ namespace Mall.Model.Entity.User ...@@ -57,7 +57,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 商户号 /// 商户号
/// </summary> /// </summary>
public int? TenantId public int TenantId
{ {
get; get;
set; set;
...@@ -78,5 +78,13 @@ namespace Mall.Model.Entity.User ...@@ -78,5 +78,13 @@ namespace Mall.Model.Entity.User
get; get;
set; set;
} }
/// <summary>
/// 删除状态
/// </summary>
public int? Status { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
} }
} }
...@@ -46,6 +46,11 @@ namespace Mall.Model.Entity.User ...@@ -46,6 +46,11 @@ namespace Mall.Model.Entity.User
get; get;
set; set;
} }
/// <summary>
/// 启用 1是 2否
/// </summary>
public int? Enabled { get; set; }
/// <summary> /// <summary>
/// 状态 /// 状态
/// </summary> /// </summary>
...@@ -113,7 +118,7 @@ namespace Mall.Model.Entity.User ...@@ -113,7 +118,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 商户号 /// 商户号
/// </summary> /// </summary>
public int? TenantId public int TenantId
{ {
get; get;
set; set;
...@@ -134,5 +139,9 @@ namespace Mall.Model.Entity.User ...@@ -134,5 +139,9 @@ namespace Mall.Model.Entity.User
get; get;
set; set;
} }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { 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_Member_Integral
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 用户id
/// </summary>
public int? UserId { get; set; }
/// <summary>
/// 类型 1增加 2减少
/// </summary>
public int? Type
{
get;
set;
}
/// <summary>
/// 积分
/// </summary>
public int? Integral
{
get;
set;
}
/// <summary>
/// Image
/// </summary>
public string Image
{
get;
set;
}
/// <summary>
/// 描述
/// </summary>
public string Description
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 商户号id
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
}
}
...@@ -113,12 +113,16 @@ namespace Mall.Model.Entity.User ...@@ -113,12 +113,16 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 积分 /// 积分
/// </summary> /// </summary>
public decimal? Integral public int? Integral
{ {
get; get;
set; set;
} }
/// <summary> /// <summary>
/// 总消费
/// </summary>
public decimal? TotalConsumption { get; set; }
/// <summary>
/// CreateDate /// CreateDate
/// </summary> /// </summary>
public DateTime? CreateDate public DateTime? CreateDate
...@@ -161,7 +165,7 @@ namespace Mall.Model.Entity.User ...@@ -161,7 +165,7 @@ namespace Mall.Model.Entity.User
/// <summary> /// <summary>
/// 商户号id /// 商户号id
/// </summary> /// </summary>
public int? TenantId public int TenantId
{ {
get; get;
set; set;
...@@ -174,5 +178,9 @@ namespace Mall.Model.Entity.User ...@@ -174,5 +178,9 @@ namespace Mall.Model.Entity.User
get; get;
set; set;
} }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
} }
} }
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 商户分销基础表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_Basics_Extend : RB_Distributor_Basics
{
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 用户余额表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Balance_Extend : RB_Member_Balance
{
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 商户会员权益表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Equity_Extend : RB_Member_Equity
{
/// <summary>
/// 等级ids
/// </summary>
public string GradeIds { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 商户会员等级表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Grade_Extend : RB_Member_Grade
{
/// <summary>
/// 等级ids
/// </summary>
public string GradeIds { get; set; }
/// <summary>
/// 权益列表
/// </summary>
public List<RB_Member_Equity_Extend> EquityList { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 用户积分表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Integral_Extend : RB_Member_Integral
{
}
}
...@@ -13,6 +13,14 @@ namespace Mall.Model.Extend.User ...@@ -13,6 +13,14 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")] [DB(ConnectionName = "DefaultConnection")]
public class RB_Member_User_Extend : RB_Member_User public class RB_Member_User_Extend : RB_Member_User
{ {
/// <summary>
/// 会员等级名称
/// </summary>
public string MemberGradeName { get; set; }
/// <summary>
/// 导出枚举ids
/// </summary>
public List<int> ExcelEnumIds { get; set; }
} }
} }
This diff is collapsed.
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_Member_BalanceRepository : RepositoryBase<RB_Member_Balance>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_Balance_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_Balance_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_Balance.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Member_Balance.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Member_Balance.Id)}={dmodel.Id}";
}
if (dmodel.Type > 0) {
where += $@" and {nameof(RB_Member_Balance.Type)}={dmodel.Type}";
}
if (dmodel.UserId > 0) {
where += $@" and {nameof(RB_Member_Balance.UserId)}={dmodel.UserId}";
}
string sql = $@"select * from RB_Member_Balance where {where} order by Id desc";
return GetPage<RB_Member_Balance_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Member_Balance_Extend> GetList(RB_Member_Balance_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_Balance.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Balance.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Member_Balance.Id)}={dmodel.Id}";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Member_Balance.Type)}={dmodel.Type}";
}
if (dmodel.UserId > 0)
{
where += $@" and {nameof(RB_Member_Balance.UserId)}={dmodel.UserId}";
}
string sql = $@"select * from RB_Member_Balance where {where} order by Id desc";
return Get<RB_Member_Balance_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_Member_EquityRepository : RepositoryBase<RB_Member_Equity>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_Equity_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_Equity_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Member_Equity.Status)}=0";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_Equity.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Equity.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Title)) {
where += $@" and {nameof(RB_Member_Equity.Title)} like '%{dmodel.Title}%'";
}
if (dmodel.GradeId > 0) {
where += $@" and {nameof(RB_Member_Equity.GradeId)} ={dmodel.GradeId}";
}
string sql = $@"select * from RB_Member_Equity where {where} order by Id desc";
return GetPage<RB_Member_Equity_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Member_Equity_Extend> GetList(RB_Member_Equity_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Member_Equity.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_Equity.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Equity.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Title))
{
where += $@" and {nameof(RB_Member_Equity.Title)} like '%{dmodel.Title}%'";
}
if (dmodel.GradeId > 0)
{
where += $@" and {nameof(RB_Member_Equity.GradeId)} ={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.GradeIds)) {
where += $@" and {nameof(RB_Member_Equity.GradeId)} in({dmodel.GradeIds})";
}
string sql = $@"select * from RB_Member_Equity where {where} order by Id desc";
return Get<RB_Member_Equity_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_Member_GradeRepository : RepositoryBase<RB_Member_Grade>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_Grade_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_Grade_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Member_Grade.Status)}=0 ";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_Grade.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Grade.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Grade > 0) {
where += $@" and {nameof(RB_Member_Grade.Grade)} ={(int)dmodel.Grade}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Member_Grade.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Enabled > 0) {
where += $@" and {nameof(RB_Member_Grade.Enabled)} ={(int)dmodel.Enabled}";
}
string sql = $@"select * from RB_Member_Grade where {where} order by Id desc";
return GetPage<RB_Member_Grade_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Member_Grade_Extend> GetList(RB_Member_Grade_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Member_Grade.Status)}=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_Grade.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Grade.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Grade > 0)
{
where += $@" and {nameof(RB_Member_Grade.Grade)} ={(int)dmodel.Grade}";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and {nameof(RB_Member_Grade.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Enabled > 0)
{
where += $@" and {nameof(RB_Member_Grade.Enabled)} ={(int)dmodel.Enabled}";
}
string sql = $@"select * from RB_Member_Grade where {where} order by Id desc";
return Get<RB_Member_Grade_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_Member_IntegralRepository : RepositoryBase<RB_Member_Integral>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_Integral_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_Integral_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_Integral.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Member_Integral.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Member_Integral.Id)}={dmodel.Id}";
}
if (dmodel.Type > 0) {
where += $@" and {nameof(RB_Member_Integral.Type)}={dmodel.Type}";
}
if (dmodel.UserId > 0) {
where += $@" and {nameof(RB_Member_Integral.UserId)}={dmodel.UserId}";
}
string sql = $@"select * from RB_Member_Integral where {where} order by Id desc";
return GetPage<RB_Member_Integral_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Member_Integral_Extend> GetList(RB_Member_Integral_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_Integral.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Integral.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Member_Integral.Id)}={dmodel.Id}";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Member_Integral.Type)}={dmodel.Type}";
}
if (dmodel.UserId > 0)
{
where += $@" and {nameof(RB_Member_Integral.UserId)}={dmodel.UserId}";
}
string sql = $@"select * from RB_Member_Integral where {where} order by Id desc";
return Get<RB_Member_Integral_Extend>(sql).ToList();
}
}
}
...@@ -27,6 +27,12 @@ namespace Mall.Repository.User ...@@ -27,6 +27,12 @@ namespace Mall.Repository.User
if (dmodel.TenantId > 0) { if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}"; where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Member_User.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) { if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'"; where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'";
} }
...@@ -63,6 +69,10 @@ select * from RB_Member_User where {where} order by CreateDate desc ...@@ -63,6 +69,10 @@ select * from RB_Member_User where {where} order by CreateDate desc
{ {
where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}"; where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) if (!string.IsNullOrEmpty(dmodel.Name))
{ {
where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'"; where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'";
......
This diff is collapsed.
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