Skip to content

Commit 62ac779

Browse files
tknsnail
authored andcommitted
feat: ✨ 营销管理
1 parent f6aee1b commit 62ac779

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1125
-38
lines changed

assets/res/NetAdmin.Fields.ln

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ USDT
5757
已校验
5858
已读
5959
并且
60+
归属角色
61+
归属部门
6062
微信支付
6163
成功
6264
或者
63-
归属角色
64-
归属部门
6565
手机
6666
手机号
6767
执行耗时
@@ -108,6 +108,7 @@ USDT
108108
用户代理
109109
用户名
110110
用户导出
111+
用户邀请导出
111112
用户钱包导出
112113
电子邮箱
113114

assets/seed-data/Sys_Menu.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@
107107
"Title": "充值订单",
108108
"Type": 1
109109
},
110+
// ------------------------------ 营销管理 ------------------------------
111+
{
112+
"Icon": "el-icon-share",
113+
"Id": 692575802241032,
114+
"Name": "market",
115+
"Path": "/market",
116+
"Sort": 98,
117+
"Title": "营销管理",
118+
"Type": 1
119+
},
120+
{
121+
"Component": "sys/invite",
122+
"Icon": "el-icon-connection",
123+
"Id": 692575802245126,
124+
"Name": "sys/invite",
125+
"ParentId": 692575802241032,
126+
"Path": "/market/invite",
127+
"Sort": 100,
128+
"Title": "邀请管理",
129+
"Type": 1
130+
},
110131
// ------------------------------ 系统管理 ------------------------------
111132
{
112133
"Icon": "sc-icon-App",

assets/seed-data/Sys_RoleApi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,9 @@
102102
{
103103
"ApiId": "api/sys/deposit.order/pay.confirm",
104104
"RoleId": 371729946431493,
105+
},
106+
{
107+
"ApiId": "api/sys/user.invite/query",
108+
"RoleId": 371729946431493,
105109
}
106110
]

assets/seed-data/Sys_RoleMenu.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,13 @@
3030
{
3131
"MenuId": 690907673255944,
3232
"RoleId": 371729946431493
33+
},
34+
{
35+
"MenuId": 692575802241032,
36+
"RoleId": 371729946431493
37+
},
38+
{
39+
"MenuId": 692575802245126,
40+
"RoleId": 371729946431493
3341
}
3442
]

assets/seed-data/Sys_User.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,27 @@
33
"DeptId": 372119301627909,
44
"Enabled": true,
55
"Id": 370942943322181,
6+
"InviteCode": "Q09Y8O",
67
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
78
"Token": "A9AFD92E-A33D-4152-9A6C-A9C141D24887",
8-
"UserName": "root"
9+
"UserName": "root",
910
},
1011
{
1112
"DeptId": 372119301627909,
1213
"Enabled": true,
1314
"Id": 560217289236492,
15+
"InviteCode": "7ZH5PB",
1416
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
1517
"Token": "4208EA97-B32F-4E39-A290-4C0D27B61EBF",
16-
"UserName": "user"
18+
"UserName": "user",
1719
},
1820
{
1921
"DeptId": 372119301627909,
2022
"Enabled": true,
2123
"Id": 664362432344581,
24+
"InviteCode": "47Q56H",
2225
"Password": "A8E87D23-49BC-25A1-1C7C-59186BEF5D15",
2326
"Token": "751D599B-2B8C-417C-9565-CCF2363F5F6F",
24-
"UserName": "jobs"
27+
"UserName": "jobs",
2528
}
2629
]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[
2+
{
3+
"Id": 370942943322181,
4+
},
5+
{
6+
"Id": 560217289236492,
7+
"OwnerDeptId": 372119301627909,
8+
"OwnerId": 370942943322181,
9+
},
10+
{
11+
"Id": 664362432344581,
12+
"OwnerDeptId": 372119301627909,
13+
"OwnerId": 370942943322181,
14+
}
15+
]

src/backend/NetAdmin/NetAdmin.Application/Services/RepositoryService.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,23 @@ protected static async Task<IActionResult> ExportAsync<TQuery, TExport>( //
7171
/// <param name="whereExp">查询表达式</param>
7272
/// <param name="whereSql">查询sql</param>
7373
/// <param name="ignoreVersion">是否忽略版本锁</param>
74+
/// <param name="disableGlobalDataFilter">是否忽略全局数据权限过滤</param>
7475
/// <returns>更新行数</returns>
7576
protected Task<int> UpdateAsync( //
7677
TEntity newValue //
7778
, List<string> includeFields = null //
7879
, List<string> excludeFields = null //
7980
, Expression<Func<TEntity, bool>> whereExp = null //
8081
, string whereSql = null //
81-
, bool ignoreVersion = false)
82+
, bool ignoreVersion = false, bool disableGlobalDataFilter = false)
8283
{
8384
// 默认匹配主键
8485
whereExp ??= a => a.Id.Equals(newValue.Id);
8586
var update = BuildUpdate(newValue, includeFields, excludeFields, ignoreVersion).Where(whereExp).Where(whereSql);
87+
if (disableGlobalDataFilter) {
88+
update = update.DisableGlobalFilter(nameof(Chars.FLG_FREE_SQL_GLOBAL_FILTER_DATA));
89+
}
90+
8691
return update.ExecuteEffectsAsync();
8792
}
8893

@@ -101,8 +106,8 @@ protected Task<List<TEntity>> UpdateReturnListAsync( //
101106
TEntity newValue //
102107
, List<string> includeFields = null //
103108
, List<string> excludeFields = null //
104-
, Expression<Func<TEntity, bool>> whereExp = null //
105-
, string whereSql = null //
109+
, Expression<Func<TEntity, bool>> whereExp = null //
110+
, string whereSql = null //
106111
, bool ignoreVersion = false)
107112
{
108113
// 默认匹配主键

src/backend/NetAdmin/NetAdmin.Domain/DbMaps/Sys/Sys_Config.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ public record Sys_Config : VersionEntity, IFieldEnabled
2222
[JsonIgnore]
2323
public virtual bool Enabled { get; init; }
2424

25+
/// <summary>
26+
/// 必须邀请注册
27+
/// </summary>
28+
[Column]
29+
[CsvIgnore]
30+
[JsonIgnore]
31+
public virtual bool RegisterInviteRequired { get; init; }
32+
33+
/// <summary>
34+
/// 必须手机号注册
35+
/// </summary>
36+
[Column]
37+
[CsvIgnore]
38+
[JsonIgnore]
39+
public virtual bool RegisterMobileRequired { get; init; }
40+
2541
/// <summary>
2642
/// Trc20收款地址
2743
/// </summary>

src/backend/NetAdmin/NetAdmin.Domain/DbMaps/Sys/Sys_User.cs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ namespace NetAdmin.Domain.DbMaps.Sys;
55
/// <summary>
66
/// 用户基本信息表
77
/// </summary>
8-
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(Email), nameof(Email), true)]
9-
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(Mobile), nameof(Mobile), true)]
10-
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(UserName), nameof(UserName), true)]
8+
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(Email), nameof(Email), true)]
9+
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(Mobile), nameof(Mobile), true)]
10+
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(InviteCode), nameof(InviteCode), true)]
11+
[SqlIndex(Chars.FLG_DB_INDEX_PREFIX + nameof(UserName), nameof(UserName), true)]
1112
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_User))]
1213
public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
1314
{
@@ -51,6 +52,21 @@ public record Sys_User : VersionEntity, IFieldSummary, IFieldEnabled, IRegister
5152
[JsonIgnore]
5253
public virtual bool Enabled { get; init; }
5354

55+
/// <summary>
56+
/// 用户邀请
57+
/// </summary>
58+
[CsvIgnore]
59+
[JsonIgnore]
60+
public Sys_UserInvite Invite { get; init; }
61+
62+
/// <summary>
63+
/// 邀请码
64+
/// </summary>
65+
[Column(DbType = Chars.FLG_DB_FIELD_TYPE_CHAR_6)]
66+
[CsvIgnore]
67+
[JsonIgnore]
68+
public virtual string InviteCode { get; init; }
69+
5470
/// <summary>
5571
/// 最后登录时间
5672
/// </summary>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
namespace NetAdmin.Domain.DbMaps.Sys;
2+
3+
/// <summary>
4+
/// 用户邀请表
5+
/// </summary>
6+
[Table(Name = Chars.FLG_DB_TABLE_NAME_PREFIX + nameof(Sys_UserInvite))]
7+
public record Sys_UserInvite : VersionEntity, IFieldOwner
8+
{
9+
/// <summary>
10+
/// 子节点
11+
/// </summary>
12+
[CsvIgnore]
13+
[JsonIgnore]
14+
[Navigate(nameof(OwnerId))]
15+
public IEnumerable<Sys_UserInvite> Children { get; init; }
16+
17+
/// <summary>
18+
/// 归属
19+
/// </summary>
20+
[CsvIgnore]
21+
[JsonIgnore]
22+
[Navigate(nameof(OwnerId))]
23+
public Sys_User Owner { get; init; }
24+
25+
/// <summary>
26+
/// 归属部门编号
27+
/// </summary>
28+
[Column]
29+
[CsvIgnore]
30+
[JsonIgnore]
31+
public virtual long? OwnerDeptId { get; init; }
32+
33+
/// <summary>
34+
/// 归属用户编号
35+
/// </summary>
36+
[Column]
37+
[CsvIgnore]
38+
[JsonIgnore]
39+
public virtual long? OwnerId { get; init; }
40+
41+
/// <summary>
42+
/// 用户
43+
/// </summary>
44+
[CsvIgnore]
45+
[JsonIgnore]
46+
[Navigate(nameof(Id))]
47+
public Sys_User User { get; init; }
48+
}

0 commit comments

Comments
 (0)