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
7eff8193
Commit
7eff8193
authored
Aug 19, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
4ccb2bf9
c47bbd5d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
2 deletions
+88
-2
RB_Share_Category_Extend.cs
....Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
+15
-0
RB_Share_Friend_Extend.cs
Mall.Model/Extend/MarketingCenter/RB_Share_Friend_Extend.cs
+6
-0
ShareModule.cs
Mall.Module.MarketingCenter/ShareModule.cs
+56
-2
ShareController.cs
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
+11
-0
No files found.
Mall.Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
View file @
7eff8193
...
...
@@ -16,5 +16,20 @@ namespace Mall.Model.Extend.MarketingCenter
/// 分类Id
/// </summary>
public
string
QCateIds
{
get
;
set
;
}
/// <summary>
/// 分类列表
/// </summary>
public
List
<
RB_Share_Category_Extend
>
CateList
{
get
;
set
;
}
/// <summary>
/// 一级分类名称
/// </summary>
public
string
FirstLevelName
{
get
;
set
;
}
/// <summary>
/// 二级分类名称
/// </summary>
public
string
SecondLevelName
{
get
;
set
;
}
}
}
Mall.Model/Extend/MarketingCenter/RB_Share_Friend_Extend.cs
View file @
7eff8193
using
Mall.Model.Entity.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.MarketingCenter
...
...
@@ -41,5 +42,10 @@ namespace Mall.Model.Extend.MarketingCenter
return
Convert
.
ToDateTime
(
this
.
CreateDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
}
}
/// <summary>
/// 分类列表
/// </summary>
public
List
<
RB_Share_Category_Extend
>
CateList
{
get
;
set
;
}
}
}
\ No newline at end of file
Mall.Module.MarketingCenter/ShareModule.cs
View file @
7eff8193
...
...
@@ -99,6 +99,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public
List
<
RB_Share_Friend_Extend
>
GetShareFriendPageListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Share_Friend_Extend
query
)
{
var
cateAllList
=
share_CategoryRepository
.
GetShareCategoryListRepository
(
new
RB_Share_Category_Extend
()
{
MallBaseId
=
query
.
MallBaseId
,
TenantId
=
query
.
TenantId
});
if
(
query
.
CateId
>
0
)
{
var
cateList
=
GetChildCategoryListModule
(
new
RB_Share_Category_Extend
()
{
QCateIds
=
query
.
CateId
.
ToString
()
});
...
...
@@ -106,10 +111,28 @@ namespace Mall.Module.MarketingCenter
query
.
CateIds
=
string
.
Join
(
","
,
cateList
.
Select
(
qitem
=>
qitem
.
Id
));
}
var
list
=
share_FriendRepository
.
GetShareFriendPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
item
.
CateList
=
GetFatherList
(
cateAllList
,
item
.
CateId
).
OrderBy
(
qitem
=>
qitem
.
Level
).
ToList
();
}
return
list
;
}
/// <summary>
/// 获取所有上级分类
/// </summary>
/// <param name="list"></param>
/// <param name="Id"></param>
/// <returns></returns>
public
static
IEnumerable
<
RB_Share_Category_Extend
>
GetFatherList
(
IList
<
RB_Share_Category_Extend
>
list
,
int
Id
)
{
var
query
=
list
.
Where
(
p
=>
p
.
Id
==
Id
).
ToList
();
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetFatherList
(
list
,
t
.
ParentId
)));
}
/// <summary>
/// 获取分享详情列表
/// </summary>
...
...
@@ -120,6 +143,25 @@ namespace Mall.Module.MarketingCenter
return
share_FriendRepository
.
GetShareFriendListRepository
(
query
);
}
/// <summary>
/// 批量修改排序
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public
bool
SetShareCategorySortListModule
(
List
<
RB_Share_Category_Extend
>
list
)
{
bool
flag
=
false
;
foreach
(
var
extModel
in
list
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Share_Category_Extend
.
SortNum
),
extModel
.
SortNum
},
};
flag
=
share_CategoryRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Category_Extend
.
Id
),
extModel
.
Id
));
}
return
flag
;
}
/// <summary>
/// 新增修改分类
/// </summary>
...
...
@@ -172,7 +214,19 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public
RB_Share_Category_Extend
GetShareCategoryModule
(
object
Id
)
{
return
share_CategoryRepository
.
GetEntity
<
RB_Share_Category_Extend
>(
Id
);
var
extModel
=
share_CategoryRepository
.
GetEntity
<
RB_Share_Category_Extend
>(
Id
);
if
(
extModel
!=
null
)
{
var
cateAllList
=
share_CategoryRepository
.
GetShareCategoryListRepository
(
new
RB_Share_Category_Extend
()
{
MallBaseId
=
extModel
.
MallBaseId
,
TenantId
=
extModel
.
TenantId
});
var
list
=
GetFatherList
(
cateAllList
,
extModel
.
Id
).
OrderBy
(
qitem
=>
qitem
.
Level
).
ToList
();
extModel
.
FirstLevelName
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
1
)?.
FirstOrDefault
()?.
Name
??
""
;
extModel
.
SecondLevelName
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
2
)?.
FirstOrDefault
()?.
Name
??
""
;
}
return
extModel
;
}
/// <summary>
...
...
@@ -241,7 +295,7 @@ namespace Mall.Module.MarketingCenter
/// <param name="Id"></param>
/// <param name="IsTop"></param>
/// <returns></returns>
public
bool
SetShareFriendIsTopModule
(
object
Id
,
int
IsTop
)
public
bool
SetShareFriendIsTopModule
(
object
Id
,
int
IsTop
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
...
...
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
View file @
7eff8193
...
...
@@ -71,6 +71,17 @@ namespace Mall.WebApi.Controllers.MarketingCenter
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 批量修改排序
/// </summary>
/// <returns></returns>
public
ApiResult
SetShareCategorySortList
()
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
RB_Share_Category_Extend
>>(
RequestParm
.
msg
.
ToString
());
bool
flag
=
shareModule
.
SetShareCategorySortListModule
(
list
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 删除分享分类
/// </summary>
...
...
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