Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
542d91eb
Commit
542d91eb
authored
Apr 20, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增实体类
parent
9fb081ff
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
255 additions
and
6 deletions
+255
-6
RB_Tenant_Plug.cs
Mall.Model/Entity/User/RB_Tenant_Plug.cs
+36
-0
RB_PlugIn_Extend.cs
Mall.Model/Extend/User/RB_PlugIn_Extend.cs
+5
-0
RB_Tenant_Plug_Extend.cs
Mall.Model/Extend/User/RB_Tenant_Plug_Extend.cs
+14
-0
TenantPlugModule.cs
Mall.Module.User/TenantPlugModule.cs
+51
-0
RB_PlugInRepository.cs
Mall.Repository/User/RB_PlugInRepository.cs
+4
-1
RB_Tenant_PlugRepository.cs
Mall.Repository/User/RB_Tenant_PlugRepository.cs
+53
-0
MContentController.cs
Mall.WebApi/Controllers/User/MContentController.cs
+92
-5
No files found.
Mall.Model/Entity/User/RB_Tenant_Plug.cs
0 → 100644
View file @
542d91eb
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 商城插件表实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Tenant_Plug
{
/// <summary>
/// 商城插件主键
/// </summary>
public
int
Id
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 插件编号
/// </summary>
public
int
PlugId
{
get
;
set
;
}
/// <summary>
/// 插件自定义名称
/// </summary>
public
string
PlugName
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_PlugIn_Extend.cs
View file @
542d91eb
...
...
@@ -29,5 +29,10 @@ namespace Mall.Model.Extend.User
return
str
;
}
}
/// <summary>
/// 商城编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
}
}
Mall.Model/Extend/User/RB_Tenant_Plug_Extend.cs
0 → 100644
View file @
542d91eb
using
Mall.Model.Entity.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 商城插件表扩展实体类
/// </summary>
public
class
RB_Tenant_Plug_Extend
:
RB_Tenant_Plug
{
}
}
Mall.Module.User/TenantPlugModule.cs
0 → 100644
View file @
542d91eb
using
Mall.AOP.CustomerAttribute
;
using
Mall.Model.Extend.User
;
using
Mall.Repository.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Module.User
{
/// <summary>
/// 商城插件处理类
/// </summary>
public
class
TenantPlugModule
{
/// <summary>
/// 商城插件表仓储层对象
/// </summary>
private
readonly
RB_Tenant_PlugRepository
tenant_PlugRepository
=
new
RB_Tenant_PlugRepository
();
/// <summary>
/// 获取商城插件列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Tenant_Plug_Extend
>
GetTenantPlugListModule
(
RB_Tenant_Plug_Extend
query
)
{
return
tenant_PlugRepository
.
GetTenantPlugListRepository
(
query
);
}
/// <summary>
/// 新增修改商户插件
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
bool
SetTenantPlugModule
(
List
<
RB_Tenant_Plug_Extend
>
list
)
{
bool
flag
=
false
;
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
tenant_PlugRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Tenant_Menu_Extend
.
TenantId
),
list
[
0
].
TenantId
));
foreach
(
var
item
in
list
)
{
flag
=
tenant_PlugRepository
.
Insert
(
item
)
>
0
;
}
}
return
flag
;
}
}
}
Mall.Repository/User/RB_PlugInRepository.cs
View file @
542d91eb
...
...
@@ -23,7 +23,10 @@ namespace Mall.Repository.User
builder
.
Append
(
" SELECT * FROM RB_PlugIn WHERE 1=1 AND Status=0 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
@" AND Id IN(SELECT PlugId FROM rb_tenant_plug WHERE TenantId={1}) "
,
query
.
TenantId
);
}
}
return
Get
<
RB_PlugIn_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
Mall.Repository/User/RB_Tenant_PlugRepository.cs
0 → 100644
View file @
542d91eb
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Mall.Repository.User
{
/// <summary>
/// 商城插件表仓储层
/// </summary>
public
class
RB_Tenant_PlugRepository
:
BaseRepository
<
RB_Tenant_Plug
>
{
/// <summary>
/// 获取商城插件列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Tenant_Plug_Extend
>
GetTenantPlugListRepository
(
RB_Tenant_Plug_Extend
query
)
{
DynamicParameters
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM rb_tenant_plug
WHERE 1=1
"
);
if
(
query
==
null
)
{
return
new
List
<
RB_Tenant_Plug_Extend
>();
}
else
{
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
@" AND {0}={1} "
,
nameof
(
RB_Tenant_Plug_Extend
.
TenantId
),
query
.
TenantId
);
}
if
(
query
.
Id
>
0
)
{
builder
.
AppendFormat
(
@" AND {0}={1} "
,
nameof
(
RB_Tenant_Plug_Extend
.
Id
),
query
.
Id
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
PlugName
))
{
builder
.
AppendFormat
(
@" AND {0} LIKE @PlugName "
,
nameof
(
RB_Tenant_Plug_Extend
.
PlugName
));
parameters
.
Add
(
"PlugName"
,
"%"
+
query
.
PlugName
.
Trim
()
+
"%"
);
}
}
return
Get
<
RB_Tenant_Plug_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Mall.WebApi/Controllers/User/MContentController.cs
View file @
542d91eb
...
...
@@ -26,17 +26,27 @@ namespace Mall.WebApi.Controllers.User
/// <summary>
/// 内容管理
/// </summary>
private
Module
.
User
.
ContentModule
contentModule
=
new
ContentModule
();
private
ContentModule
contentModule
=
new
ContentModule
();
/// <summary>
/// 菜单处理类
/// </summary>
private
M
odule
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
private
M
enuModule
menuModule
=
new
MenuModule
();
/// <summary>
/// 商户菜单处理类
/// 商户菜单处理类
对象
/// </summary>
private
Module
.
User
.
TenantMenuModule
tenantMenuModule
=
AOPHelper
.
CreateAOPObject
<
TenantMenuModule
>();
private
TenantMenuModule
tenantMenuModule
=
AOPHelper
.
CreateAOPObject
<
TenantMenuModule
>();
/// <summary>
/// 商城插件处理类对象
/// </summary>
private
readonly
TenantPlugModule
tenantPlugModule
=
AOPHelper
.
CreateAOPObject
<
TenantPlugModule
>();
/// <summary>
/// 插件处理类对象
/// </summary>
private
readonly
PlugInModule
plugInModule
=
new
PlugInModule
();
/// <summary>
/// 营销中心插件配置处理类
...
...
@@ -435,7 +445,7 @@ namespace Mall.WebApi.Controllers.User
#
region
商城菜单
/// <summary>
/// 获取小程序
分页
列表
/// 获取小程序
菜单
列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
...
...
@@ -642,5 +652,82 @@ namespace Mall.WebApi.Controllers.User
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
#
region
商城插件
/// <summary>
/// 获取小程序插件列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetTenantPlug
()
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Tenant_Plug_Extend
>>(
RequestParm
.
msg
.
ToString
());
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
item
.
TenantId
=
RequestParm
.
TenantId
;
}
}
var
flag
=
tenantPlugModule
.
SetTenantPlugModule
(
list
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取商户插件列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTenantPlugList
()
{
List
<
object
>
result
=
new
List
<
object
>();
var
plugList
=
plugInModule
.
GetPlugInListModule
(
new
RB_PlugIn_Extend
());
if
(
plugList
!=
null
&&
plugList
.
Count
>
0
)
{
var
tenantPlugList
=
tenantPlugModule
.
GetTenantPlugListModule
(
new
RB_Tenant_Plug_Extend
{
TenantId
=
RequestParm
.
TenantId
});
var
plugTypeList
=
plugList
.
GroupBy
(
qitem
=>
qitem
.
PlugType
).
Select
(
qitem
=>
new
{
qitem
.
Key
});
foreach
(
var
item
in
plugTypeList
)
{
List
<
object
>
secondList
=
new
List
<
object
>();
var
subList
=
plugList
.
Where
(
qitem
=>
qitem
.
PlugType
==
item
.
Key
).
ToList
();
foreach
(
var
subItem
in
subList
)
{
secondList
.
Add
(
new
{
subItem
.
Id
,
subItem
.
Name
,
subItem
.
PlugId
,
subItem
.
PlugType
,
subItem
.
Icon
,
IsChecked
=
tenantPlugList
?.
Where
(
qitem
=>
qitem
.
PlugId
==
subItem
.
PlugId
)?.
Count
()
>
0
,
});
}
string
PlugTypeName
=
""
;
if
(
item
.
Key
==
1
)
{
PlugTypeName
=
"基础组件"
;
}
else
if
(
item
.
Key
==
2
)
{
PlugTypeName
=
"营销组件"
;
}
else
if
(
item
.
Key
==
3
)
{
PlugTypeName
=
"其他组件"
;
}
result
.
Add
(
new
{
Id
=
""
,
Name
=
PlugTypeName
,
PlugId
=
0
,
PlugType
=
item
.
Key
,
Icon
=
""
});
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
#
endregion
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment