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
8da00cfc
Commit
8da00cfc
authored
Nov 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
3d77e656
4bc8cf54
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
788 additions
and
24 deletions
+788
-24
RB_Marketing_Config.cs
Mall.Model/Entity/BaseSetUp/RB_Marketing_Config.cs
+28
-0
RB_Marketing_Plug.cs
Mall.Model/Entity/BaseSetUp/RB_Marketing_Plug.cs
+54
-0
RB_Menu.cs
Mall.Model/Entity/User/RB_Menu.cs
+4
-6
RB_Tenant_Menu.cs
Mall.Model/Entity/User/RB_Tenant_Menu.cs
+28
-0
RB_Marketing_Config_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_Marketing_Config_Extend.cs
+16
-0
RB_Marketing_Plug_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_Marketing_Plug_Extend.cs
+36
-0
RB_Menu_Extend.cs
Mall.Model/Extend/User/RB_Menu_Extend.cs
+5
-0
RB_Tenant_Menu_Extend.cs
Mall.Model/Extend/User/RB_Tenant_Menu_Extend.cs
+16
-0
MarketingPlugModule.cs
Mall.Module.BaseSetUp/MarketingPlugModule.cs
+132
-0
Mall.Module.User.csproj
Mall.Module.User/Mall.Module.User.csproj
+1
-0
MenuModule.cs
Mall.Module.User/MenuModule.cs
+0
-2
TenantMenuModule.cs
Mall.Module.User/TenantMenuModule.cs
+52
-0
RB_Marketing_ConfigRepository.cs
Mall.Repository/BaseSetUp/RB_Marketing_ConfigRepository.cs
+38
-0
RB_Marketing_PlugRepository.cs
Mall.Repository/BaseSetUp/RB_Marketing_PlugRepository.cs
+90
-0
RB_Share_FriendRepository.cs
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
+4
-3
RB_MenuRepository.cs
Mall.Repository/User/RB_MenuRepository.cs
+4
-0
RB_Tenant_MenuRepository.cs
Mall.Repository/User/RB_Tenant_MenuRepository.cs
+38
-0
MContentController.cs
Mall.WebApi/Controllers/User/MContentController.cs
+230
-1
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+12
-12
No files found.
Mall.Model/Entity/BaseSetUp/RB_Marketing_Config.cs
0 → 100644
View file @
8da00cfc
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 营销中心插件配置实体
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Marketing_Config
{
/// <summary>
/// 商城营销中心插件配置主键
/// </summary>
public
int
PConfigId
{
get
;
set
;
}
/// <summary>
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 插件编号
/// </summary>
public
int
PlugId
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Model/Entity/BaseSetUp/RB_Marketing_Plug.cs
0 → 100644
View file @
8da00cfc
using
Mall.Common.Enum
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 营销中心插件配置实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Marketing_Plug
{
/// <summary>
/// 插件编号
/// </summary>
public
int
PId
{
get
;
set
;
}
/// <summary>
/// 插件类型(1-默认,2-营销工具)
/// </summary>
public
int
PlugType
{
get
;
set
;
}
/// <summary>
/// 插件名称
/// </summary>
public
string
PlugName
{
get
;
set
;
}
/// <summary>
/// 插件子名称
/// </summary>
public
string
PlugSubName
{
get
;
set
;
}
/// <summary>
/// 跳转地址
/// </summary>
public
string
PlugUrl
{
get
;
set
;
}
/// <summary>
/// 图标地址
/// </summary>
public
string
Icon
{
get
;
set
;
}
/// <summary>
/// 样式
/// </summary>
public
string
IconClass
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
}
}
Mall.Model/Entity/User/RB_Menu.cs
View file @
8da00cfc
using
VT.FW.DB
;
using
VT.FW.DB
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Mall.Model.Entity.User
namespace
Mall.Model.Entity.User
{
{
/// <summary>
/// <summary>
/// 菜单实体表
/// 菜单实体表
/// </summary>
/// </summary>
[
Serializable
]
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Menu
public
class
RB_Menu
...
...
Mall.Model/Entity/User/RB_Tenant_Menu.cs
0 → 100644
View file @
8da00cfc
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Entity.User
{
/// <summary>
/// 商户菜单实体表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Tenant_Menu
{
/// <summary>
/// 商户菜单编号【主键】
/// </summary>
public
int
TMenuId
{
get
;
set
;
}
/// <summary>
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
/// <summary>
/// 菜单编号
/// </summary>
public
int
MenuId
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_Marketing_Config_Extend.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 营销中心插件配置扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Marketing_Config_Extend
:
RB_Marketing_Config
{
}
}
\ No newline at end of file
Mall.Model/Extend/BaseSetUp/RB_Marketing_Plug_Extend.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Entity.BaseSetUp
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.BaseSetUp
{
/// <summary>
/// 营销中心插件配置扩展实体类
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Marketing_Plug_Extend
:
RB_Marketing_Plug
{
/// <summary>
/// 插件类型名称
/// </summary>
public
string
PlugTypeName
{
get
{
string
str
=
"默认"
;
switch
(
this
.
PlugType
)
{
case
1
:
str
=
"默认"
;
break
;
case
2
:
str
=
"营销工具"
;
break
;
}
return
str
;
}
}
/// <summary>
/// 商户编号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Model/Extend/User/RB_Menu_Extend.cs
View file @
8da00cfc
...
@@ -32,5 +32,10 @@ namespace Mall.Model.Extend.User
...
@@ -32,5 +32,10 @@ namespace Mall.Model.Extend.User
/// 查询菜单编号
/// 查询菜单编号
/// </summary>
/// </summary>
public
string
QMenuIds
{
get
;
set
;
}
public
string
QMenuIds
{
get
;
set
;
}
/// <summary>
/// 商户号
/// </summary>
public
int
TenantId
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/User/RB_Tenant_Menu_Extend.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Entity.User
;
using
System
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.User
{
/// <summary>
/// 商户菜单扩展实体表
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Tenant_Menu_Extend
:
RB_Tenant_Menu
{
}
}
\ No newline at end of file
Mall.Module.BaseSetUp/MarketingPlugModule.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Repository.BaseSetUp
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
namespace
Mall.Module.BaseSetUp
{
/// <summary>
/// 营销中心插件配置处理类
/// </summary>
public
class
MarketingPlugModule
{
/// <summary>
/// 营销中心插件配置仓储层对象
/// </summary>
private
readonly
RB_Marketing_PlugRepository
marketing_PlugRepository
=
new
RB_Marketing_PlugRepository
();
/// <summary>
/// 营销中心插件配置仓储层对象
/// </summary>
private
readonly
RB_Marketing_ConfigRepository
marketing_ConfigRepository
=
new
RB_Marketing_ConfigRepository
();
/// <summary>
/// 获取营销中心插件配置分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Plug_Extend
>
GetMarketingPlugPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Marketing_Plug_Extend
query
)
{
return
marketing_PlugRepository
.
GetMarketingPlugPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 获取营销中心插件配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Plug_Extend
>
GetMarketingPlugListModule
(
RB_Marketing_Plug_Extend
query
)
{
return
marketing_PlugRepository
.
GetMarketingPlugListRepository
(
query
);
}
/// <summary>
/// 新增修改营销中心插件配置
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public
bool
SetMarketingPlugModule
(
RB_Marketing_Plug_Extend
extModel
)
{
bool
flag
;
if
(
extModel
.
PId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugType
),
extModel
.
PlugType
},
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugName
),
extModel
.
PlugName
},
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugSubName
),
extModel
.
PlugSubName
},
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugUrl
),
extModel
.
PlugUrl
},
{
nameof
(
RB_Marketing_Plug_Extend
.
Icon
),
extModel
.
Icon
},
{
nameof
(
RB_Marketing_Plug_Extend
.
IconClass
),
extModel
.
IconClass
},
};
flag
=
marketing_PlugRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Marketing_Plug_Extend
.
PId
),
extModel
.
PId
));
}
else
{
var
newId
=
marketing_PlugRepository
.
Insert
(
extModel
);
extModel
.
PId
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
/// <summary>
/// 根据编号获取营销中心插件配置实体
/// </summary>
/// <param name="PId"></param>
/// <returns></returns>
public
RB_Marketing_Plug_Extend
GetMarketingPlugModule
(
object
PId
)
{
return
marketing_PlugRepository
.
GetEntity
<
RB_Marketing_Plug_Extend
>(
PId
);
}
/// <summary>
/// 删除营销中心插件配置
/// </summary>
/// <param name="PId"></param>
/// <param name="Status"></param>
/// <returns></returns>
public
bool
RemoveMarketingPlugModule
(
object
PId
,
int
Status
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Marketing_Plug_Extend
.
Status
),
Status
},
};
bool
flag
=
marketing_PlugRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Marketing_Plug_Extend
.
PId
),
PId
));
return
flag
;
}
/// <summary>
/// 获取营销中心插件配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Config_Extend
>
GetMarketingConfigListModule
(
RB_Marketing_Config_Extend
query
)
{
return
marketing_ConfigRepository
.
GetMarketingConfigListRepository
(
query
);
}
/// <summary>
/// 新增修改营销中心插件配置
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
SetMarketingConfigModule
(
List
<
RB_Marketing_Config_Extend
>
list
)
{
bool
flag
=
false
;
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
marketing_ConfigRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Marketing_Config_Extend
.
TenantId
),
list
[
0
].
TenantId
));
foreach
(
var
item
in
list
)
{
flag
=
marketing_ConfigRepository
.
Insert
(
item
)
>
0
;
}
}
return
flag
;
}
}
}
\ No newline at end of file
Mall.Module.User/Mall.Module.User.csproj
View file @
8da00cfc
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
...
...
Mall.Module.User/MenuModule.cs
View file @
8da00cfc
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Text
;
using
Mall.Model.Extend.User
;
using
Mall.Model.Extend.User
;
using
Mall.Repository
;
using
Mall.Repository.User
;
using
Mall.Repository.User
;
using
VT.FW.DB
;
using
VT.FW.DB
;
...
...
Mall.Module.User/TenantMenuModule.cs
0 → 100644
View file @
8da00cfc
using
Mall.AOP.CustomerAttribute
;
using
Mall.Model.Extend.User
;
using
Mall.Repository.User
;
using
NPOI.POIFS.Storage
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Mall.Module.User
{
/// <summary>
/// 商户菜单处理类
/// </summary>
public
class
TenantMenuModule
{
/// <summary>
/// 商户菜单仓储层对象
/// </summary>
private
readonly
RB_Tenant_MenuRepository
tenant_MenuRepository
=
new
RB_Tenant_MenuRepository
();
/// <summary>
/// 获取商户菜单列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Tenant_Menu_Extend
>
GetTenantMenuListModule
(
RB_Tenant_Menu_Extend
query
)
{
return
tenant_MenuRepository
.
GetTenantMenuListRepository
(
query
);
}
/// <summary>
/// 新增修改商户菜单
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
bool
SetTenantMenuModule
(
List
<
RB_Tenant_Menu_Extend
>
list
)
{
bool
flag
=
false
;
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
tenant_MenuRepository
.
DeleteOne
(
new
WhereHelper
(
nameof
(
RB_Tenant_Menu_Extend
.
TenantId
),
list
[
0
].
TenantId
));
foreach
(
var
item
in
list
)
{
flag
=
tenant_MenuRepository
.
Insert
(
item
)
>
0
;
}
}
return
flag
;
}
}
}
Mall.Repository/BaseSetUp/RB_Marketing_ConfigRepository.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.BaseSetUp
{
/// <summary>
/// 营销中心插件配置仓储层
/// </summary>
public
class
RB_Marketing_ConfigRepository
:
BaseRepository
<
RB_Marketing_Config
>
{
/// <summary>
/// 获取营销中心插件配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Config_Extend
>
GetMarketingConfigListRepository
(
RB_Marketing_Config_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@" SELECT * FROM RB_Marketing_Config WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Marketing_Config_Extend
.
TenantId
),
query
.
TenantId
);
}
return
Get
<
RB_Marketing_Config_Extend
>(
builder
.
ToString
()).
ToList
();
}
else
{
return
new
List
<
RB_Marketing_Config_Extend
>();
}
}
}
}
\ No newline at end of file
Mall.Repository/BaseSetUp/RB_Marketing_PlugRepository.cs
0 → 100644
View file @
8da00cfc
using
Mall.Common.Enum
;
using
Mall.Model.Entity.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Mall.Repository.BaseSetUp
{
/// <summary>
/// 营销中心插件配置仓储层
/// </summary>
public
class
RB_Marketing_PlugRepository
:
BaseRepository
<
RB_Marketing_Plug
>
{
/// <summary>
/// 获取营销中心插件配置分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Plug_Extend
>
GetMarketingPlugPageRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Marketing_Plug_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
DynamicParameters
parameters
=
new
DynamicParameters
();
builder
.
Append
(
@" SELECT * FROM rb_marketing_plug WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrEmpty
(
query
.
PlugName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugName
)}
LIKE @PlugName "
);
parameters
.
Add
(
"PlugName"
,
"%"
+
query
.
PlugName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
PlugSubName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugSubName
)}
LIKE @PlugSubName "
);
parameters
.
Add
(
"PlugSubName"
,
"%"
+
query
.
PlugSubName
.
Trim
()
+
"%"
);
}
if
(
query
.
PId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PId
)}
=
{
query
.
PId
}
"
);
}
}
return
GetPage
<
RB_Marketing_Plug_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
/// <summary>
/// 获取营销中心插件配置列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Marketing_Plug_Extend
>
GetMarketingPlugListRepository
(
RB_Marketing_Plug_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
DynamicParameters
parameters
=
new
DynamicParameters
();
builder
.
Append
(
@" SELECT * FROM rb_marketing_plug WHERE 1=1 "
);
builder
.
AppendFormat
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
Status
)}
=
{(
int
)
DateStateEnum
.
Normal
}
"
);
if
(
query
!=
null
)
{
if
(!
string
.
IsNullOrEmpty
(
query
.
PlugName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugName
)}
LIKE @PlugName "
);
parameters
.
Add
(
"PlugName"
,
"%"
+
query
.
PlugName
.
Trim
()
+
"%"
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
PlugSubName
))
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugSubName
)}
LIKE @PlugSubName "
);
parameters
.
Add
(
"PlugSubName"
,
"%"
+
query
.
PlugSubName
.
Trim
()
+
"%"
);
}
if
(
query
.
PId
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PId
)}
=
{
query
.
PId
}
"
);
}
if
(
query
.
PlugType
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Marketing_Plug_Extend
.
PlugType
)}
=
{
query
.
PlugType
}
"
);
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
@" AND PId IN(SELECT PlugId FROM rb_marketing_config WHERE TenantId ={0}) "
,
query
.
TenantId
);
}
}
return
Get
<
RB_Marketing_Plug_Extend
>(
builder
.
ToString
(),
parameters
).
ToList
();
}
}
}
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
View file @
8da00cfc
...
@@ -25,7 +25,7 @@ namespace Mall.Repository.MarketingCenter
...
@@ -25,7 +25,7 @@ namespace Mall.Repository.MarketingCenter
public
List
<
RB_Share_Friend_Extend
>
GetShareFriendPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Share_Friend_Extend
query
,
bool
IsUse
=
false
)
public
List
<
RB_Share_Friend_Extend
>
GetShareFriendPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Share_Friend_Extend
query
,
bool
IsUse
=
false
)
{
{
string
orderBy
=
""
;
string
orderBy
=
""
;
DynamicParameters
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
builder
.
AppendFormat
(
@"
SELECT A.*,B.Name AS GoodsName
SELECT A.*,B.Name AS GoodsName
...
@@ -61,7 +61,8 @@ WHERE 1=1 AND A.Status=0
...
@@ -61,7 +61,8 @@ WHERE 1=1 AND A.Status=0
}
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
KeyWords
))
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
KeyWords
))
{
{
builder
.
AppendFormat
(
" AND A.{0} LIKE '%{1}%' "
,
nameof
(
RB_Share_Friend_Extend
.
MaterialInfo
),
query
.
KeyWords
);
builder
.
AppendFormat
(
" AND A.{0} LIKE @Name "
,
nameof
(
RB_Share_Friend_Extend
.
MaterialInfo
));
parameters
.
Add
(
"Name"
,
"%"
+
query
.
KeyWords
+
"%"
);
}
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
))
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
))
{
{
...
@@ -77,7 +78,7 @@ WHERE 1=1 AND A.Status=0
...
@@ -77,7 +78,7 @@ WHERE 1=1 AND A.Status=0
}
}
}
}
builder
.
AppendFormat
(
orderBy
);
builder
.
AppendFormat
(
orderBy
);
return
GetPage
<
RB_Share_Friend_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Share_Friend_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()
,
parameters
).
ToList
();
}
}
...
...
Mall.Repository/User/RB_MenuRepository.cs
View file @
8da00cfc
...
@@ -35,6 +35,10 @@ namespace Mall.Repository.User
...
@@ -35,6 +35,10 @@ namespace Mall.Repository.User
{
{
builder
.
AppendFormat
(
" AND MenuId IN({0}) "
,
query
.
QMenuIds
.
Trim
());
builder
.
AppendFormat
(
" AND MenuId IN({0}) "
,
query
.
QMenuIds
.
Trim
());
}
}
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND MenuId IN(SELECT MenuId FROM rb_tenant_menu WHERE TenantId={0})"
,
query
.
TenantId
);
}
}
}
return
Get
<
RB_Menu_Extend
>(
builder
.
ToString
()).
ToList
();
return
Get
<
RB_Menu_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.Repository/User/RB_Tenant_MenuRepository.cs
0 → 100644
View file @
8da00cfc
using
Mall.Model.Entity.User
;
using
Mall.Model.Extend.User
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
Mall.Repository.User
{
/// <summary>
/// 商户菜单表仓储层
/// </summary>
public
class
RB_Tenant_MenuRepository
:
BaseRepository
<
RB_Tenant_Menu
>
{
/// <summary>
/// 获取商户菜单列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Tenant_Menu_Extend
>
GetTenantMenuListRepository
(
RB_Tenant_Menu_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
Append
(
@" SELECT * FROM rb_tenant_menu WHERE 1=1 "
);
if
(
query
!=
null
)
{
if
(
query
.
TenantId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Tenant_Menu_Extend
.
TenantId
),
query
.
TenantId
);
}
return
Get
<
RB_Tenant_Menu_Extend
>(
builder
.
ToString
()).
ToList
();
}
else
{
return
new
List
<
RB_Tenant_Menu_Extend
>();
}
}
}
}
Mall.WebApi/Controllers/User/MContentController.cs
View file @
8da00cfc
...
@@ -16,6 +16,9 @@ using Newtonsoft.Json.Linq;
...
@@ -16,6 +16,9 @@ using Newtonsoft.Json.Linq;
using
Mall.Common
;
using
Mall.Common
;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Authorization
;
using
Mall.Model.Entity.User
;
using
Mall.Model.Entity.User
;
using
Mall.AOP
;
using
Mall.Module.BaseSetUp
;
using
Mall.Model.Extend.BaseSetUp
;
namespace
Mall.WebApi.Controllers.User
namespace
Mall.WebApi.Controllers.User
{
{
...
@@ -30,6 +33,21 @@ namespace Mall.WebApi.Controllers.User
...
@@ -30,6 +33,21 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// </summary>
private
Module
.
User
.
ContentModule
contentModule
=
new
ContentModule
();
private
Module
.
User
.
ContentModule
contentModule
=
new
ContentModule
();
/// <summary>
/// 菜单处理类
/// </summary>
private
Module
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
/// <summary>
/// 商户菜单处理类
/// </summary>
private
Module
.
User
.
TenantMenuModule
tenantMenuModule
=
AOPHelper
.
CreateAOPObject
<
TenantMenuModule
>();
/// <summary>
/// 营销中心插件配置处理类
/// </summary>
private
MarketingPlugModule
marketingPlugModule
=
new
MarketingPlugModule
();
#
region
专题分类
#
region
专题分类
/// <summary>
/// <summary>
...
@@ -57,7 +75,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -57,7 +75,7 @@ namespace Mall.WebApi.Controllers.User
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Topic_Type_Extend
>(
RequestParm
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Topic_Type_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
var
list
=
contentModule
.
GetTopicTypeListModule
(
query
);
var
list
=
contentModule
.
GetTopicTypeListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
return
ApiResult
.
Success
(
data
:
list
);
}
}
...
@@ -418,5 +436,216 @@ namespace Mall.WebApi.Controllers.User
...
@@ -418,5 +436,216 @@ namespace Mall.WebApi.Controllers.User
}
}
#
endregion
#
endregion
#
region
商城菜单
/// <summary>
/// 获取小程序分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetTenantMenu
()
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Tenant_Menu_Extend
>>(
RequestParm
.
msg
.
ToString
());
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
item
.
TenantId
=
RequestParm
.
TenantId
;
}
}
var
flag
=
tenantMenuModule
.
SetTenantMenuModule
(
list
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取商户菜单列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetTenantMenuList
()
{
List
<
object
>
result
=
new
List
<
object
>();
var
menuList
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
());
if
(
menuList
!=
null
&&
menuList
.
Count
>
0
)
{
var
tenantMenuList
=
tenantMenuModule
.
GetTenantMenuListModule
(
new
RB_Tenant_Menu_Extend
()
{
TenantId
=
RequestParm
.
TenantId
});
foreach
(
var
item
in
menuList
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
1
))
{
List
<
object
>
secondList
=
new
List
<
object
>();
foreach
(
var
subItem
in
menuList
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
2
&&
qitem
.
ParentId
==
item
.
MenuId
))
{
List
<
object
>
childList
=
new
List
<
object
>();
foreach
(
var
thirdItem
in
menuList
.
Where
(
qitem
=>
qitem
.
MenuLevel
==
3
&&
qitem
.
ParentId
==
subItem
.
MenuId
))
{
childList
.
Add
(
new
{
thirdItem
.
MenuId
,
thirdItem
.
MenuName
,
thirdItem
.
ParentId
,
IsChecked
=
tenantMenuList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
thirdItem
.
MenuId
)?.
Count
()
>
0
,
SubMenuList
=
new
List
<
string
>()
});
}
secondList
.
Add
(
new
{
subItem
.
MenuId
,
subItem
.
MenuName
,
subItem
.
ParentId
,
IsChecked
=
tenantMenuList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
subItem
.
MenuId
)?.
Count
()
>
0
,
SubMenuList
=
childList
});
}
var
obj
=
new
{
item
.
MenuId
,
item
.
MenuName
,
item
.
ParentId
,
IsChecked
=
tenantMenuList
?.
Where
(
qitem
=>
qitem
.
MenuId
==
item
.
MenuId
)?.
Count
()
>
0
,
SubMenuList
=
secondList
};
result
.
Add
(
obj
);
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
#
endregion
#
region
营销中心插件配置
/// <summary>
/// 获取营销中心插件分页列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetMarketingPlugPageList
()
{
ResultPageModel
pageModel
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
msg
.
ToString
());
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Marketing_Plug_Extend
>(
RequestParm
.
msg
.
ToString
());
var
list
=
marketingPlugModule
.
GetMarketingPlugPageModule
(
pageModel
.
pageIndex
,
pageModel
.
pageSize
,
out
long
rowsCount
,
query
);
pageModel
.
count
=
Convert
.
ToInt32
(
rowsCount
);
pageModel
.
pageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 获取营销中心插件列表
/// </summary>
/// <returns></returns>
public
ApiResult
GetMarketingPlugList
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Marketing_Plug_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
RequestParm
.
TenantId
;
var
plugList
=
marketingPlugModule
.
GetMarketingPlugListModule
(
query
);
List
<
object
>
result
=
new
List
<
object
>();
if
(
plugList
!=
null
&&
plugList
.
Count
>
0
)
{
var
typeList
=
plugList
.
GroupBy
(
qitem
=>
new
{
qitem
.
PlugType
,
qitem
.
PlugTypeName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
PlugType
,
qitem
.
Key
.
PlugTypeName
});
foreach
(
var
item
in
typeList
)
{
var
obj
=
new
{
item
.
PlugType
,
item
.
PlugTypeName
,
SubList
=
plugList
.
Where
(
qitem
=>
qitem
.
PlugType
==
item
.
PlugType
).
ToList
()
};
result
.
Add
(
obj
);
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
/// 新增修改营销中心插件
/// </summary>
/// <returns></returns>
public
ApiResult
SetMarketingPlug
()
{
var
extModel
=
JsonConvert
.
DeserializeObject
<
RB_Marketing_Plug_Extend
>(
RequestParm
.
msg
.
ToString
());
extModel
.
Status
=
0
;
var
flag
=
marketingPlugModule
.
SetMarketingPlugModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 获取营销中心插件实体
/// </summary>
/// <returns></returns>
public
ApiResult
GetMarketingPlug
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
PId
=
parms
.
GetInt
(
"PId"
,
0
);
var
extModel
=
marketingPlugModule
.
GetMarketingPlugModule
(
PId
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
/// <summary>
/// 修改营销中心插件状态
/// </summary>
/// <returns></returns>
public
ApiResult
RemoveMarketingPlug
()
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
PId
=
parms
.
GetInt
(
"PId"
,
0
);
var
Status
=
parms
.
GetInt
(
"Status"
);
var
flag
=
marketingPlugModule
.
RemoveMarketingPlugModule
(
PId
,
Status
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 新增修改营销中心插件配置
/// </summary>
/// <returns></returns>
public
ApiResult
GetMarketingConfigList
()
{
var
query
=
JsonConvert
.
DeserializeObject
<
RB_Marketing_Config_Extend
>(
RequestParm
.
msg
.
ToString
());
query
.
TenantId
=
RequestParm
.
TenantId
;
var
plugList
=
marketingPlugModule
.
GetMarketingPlugListModule
(
new
RB_Marketing_Plug_Extend
());
var
configList
=
marketingPlugModule
.
GetMarketingConfigListModule
(
query
);
List
<
object
>
result
=
new
List
<
object
>();
if
(
plugList
!=
null
&&
plugList
.
Count
>
0
)
{
var
typeList
=
plugList
.
GroupBy
(
qitem
=>
new
{
qitem
.
PlugType
,
qitem
.
PlugTypeName
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
PlugType
,
qitem
.
Key
.
PlugTypeName
});
foreach
(
var
item
in
typeList
)
{
List
<
object
>
childList
=
new
List
<
object
>();
var
childDataList
=
plugList
.
Where
(
qitem
=>
qitem
.
PlugType
==
item
.
PlugType
).
ToList
();
foreach
(
var
subItem
in
childDataList
)
{
var
subObj
=
new
{
subItem
.
PId
,
subItem
.
PlugName
,
IsChecked
=
configList
?.
Where
(
qitem
=>
qitem
.
PlugId
==
subItem
.
PId
).
Count
()
>
0
};
childList
.
Add
(
subObj
);
}
var
obj
=
new
{
item
.
PlugType
,
item
.
PlugTypeName
,
IsChecked
=
false
,
SubList
=
childList
};
result
.
Add
(
obj
);
}
}
return
ApiResult
.
Success
(
data
:
result
);
}
/// <summary>
/// 新增修改营销中心插件配置
/// </summary>
/// <returns></returns>
public
ApiResult
SetMarketingConfig
()
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Marketing_Config_Extend
>>(
RequestParm
.
msg
.
ToString
());
foreach
(
var
item
in
list
)
{
item
.
TenantId
=
RequestParm
.
TenantId
;
}
var
flag
=
marketingPlugModule
.
SetMarketingConfigModule
(
list
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/User/TenantController.cs
View file @
8da00cfc
...
@@ -23,6 +23,8 @@ using Mall.Module.Product;
...
@@ -23,6 +23,8 @@ using Mall.Module.Product;
using
Microsoft.AspNetCore.Authorization
;
using
Microsoft.AspNetCore.Authorization
;
using
Mall.Model.Query
;
using
Mall.Model.Query
;
using
Mall.Model.Extend.AppletWeChat
;
using
Mall.Model.Extend.AppletWeChat
;
using
Mall.AOP
;
using
Mall.Module.User
;
namespace
Mall.WebApi.Controllers.User
namespace
Mall.WebApi.Controllers.User
{
{
...
@@ -47,6 +49,8 @@ namespace Mall.WebApi.Controllers.User
...
@@ -47,6 +49,8 @@ namespace Mall.WebApi.Controllers.User
/// </summary>
/// </summary>
private
Module
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
private
Module
.
User
.
MenuModule
menuModule
=
new
Module
.
User
.
MenuModule
();
/// <summary>
/// <summary>
/// 小程序图标处理类对象
/// 小程序图标处理类对象
/// </summary>
/// </summary>
...
@@ -438,10 +442,10 @@ namespace Mall.WebApi.Controllers.User
...
@@ -438,10 +442,10 @@ namespace Mall.WebApi.Controllers.User
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 向微信服务端 使用登录凭证 code 获取 session_key 和 openid
/// </summary>
/// <returns></returns>
public
ApiResult
GetMiniAllTemplent
()
public
ApiResult
GetMiniAllTemplent
()
{
{
//向微信服务端 使用登录凭证 code 获取 session_key 和 openid
//向微信服务端 使用登录凭证 code 获取 session_key 和 openid
...
@@ -517,8 +521,8 @@ namespace Mall.WebApi.Controllers.User
...
@@ -517,8 +521,8 @@ namespace Mall.WebApi.Controllers.User
wenXinResulttemplate
=
GetUsersHelper
.
GetUrltoHtml
(
urltemplate
,
type
);
//获取微信服务器返回字符串
wenXinResulttemplate
=
GetUsersHelper
.
GetUrltoHtml
(
urltemplate
,
type
);
//获取微信服务器返回字符串
jotemplate
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResulttemplate
);
//将字符串转换为json格式
jotemplate
=
(
JObject
)
JsonConvert
.
DeserializeObject
(
wenXinResulttemplate
);
//将字符串转换为json格式
//微信服务器验证成功
//微信服务器验证成功
res
.
data
=
JsonConvert
.
DeserializeObject
<
List
<
templateresultModel
>>(
jotemplate
[
"data"
].
ToString
());
res
.
data
=
JsonConvert
.
DeserializeObject
<
List
<
templateresultModel
>>(
jotemplate
[
"data"
].
ToString
());
if
(
res
.
data
!=
null
&&
res
.
data
.
Any
())
if
(
res
.
data
!=
null
&&
res
.
data
.
Any
())
{
{
foreach
(
var
item
in
res
.
data
)
foreach
(
var
item
in
res
.
data
)
{
{
...
@@ -784,7 +788,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -784,7 +788,7 @@ namespace Mall.WebApi.Controllers.User
{
{
try
try
{
{
var
kidList
=
new
List
<
int
>
{
2
,
1
};
var
kidList
=
new
List
<
int
>
{
2
,
1
};
var
resultInfo
=
new
var
resultInfo
=
new
{
{
tid
=
"3173"
,
tid
=
"3173"
,
...
@@ -842,10 +846,6 @@ namespace Mall.WebApi.Controllers.User
...
@@ -842,10 +846,6 @@ namespace Mall.WebApi.Controllers.User
}
}
/// <summary>
/// <summary>
/// 删除底部导航
/// 删除底部导航
/// </summary>
/// </summary>
...
@@ -1295,7 +1295,7 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1295,7 +1295,7 @@ namespace Mall.WebApi.Controllers.User
public
ApiResult
GetMenuList
()
public
ApiResult
GetMenuList
()
{
{
List
<
object
>
resultList
=
new
List
<
object
>();
List
<
object
>
resultList
=
new
List
<
object
>();
var
menuList
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
});
var
menuList
=
menuModule
.
GetMenuListModule
(
new
RB_Menu_Extend
()
{
TenantId
=
RequestParm
.
TenantId
});
var
list
=
new
List
<
RB_Menu_Extend
>();
var
list
=
new
List
<
RB_Menu_Extend
>();
if
(
RequestParm
.
EmpId
>
0
)
if
(
RequestParm
.
EmpId
>
0
)
{
{
...
...
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