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
0d2f5ecb
Commit
0d2f5ecb
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
b92c6246
5f76c13a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
263 additions
and
8 deletions
+263
-8
RB_Share_Category.cs
Mall.Model/Entity/MarketingCenter/RB_Share_Category.cs
+5
-0
RB_Share_Friend.cs
Mall.Model/Entity/MarketingCenter/RB_Share_Friend.cs
+5
-0
RB_Share_Category_Extend.cs
....Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
+4
-0
RB_Share_Friend_Extend.cs
Mall.Model/Extend/MarketingCenter/RB_Share_Friend_Extend.cs
+29
-0
ShareModule.cs
Mall.Module.MarketingCenter/ShareModule.cs
+89
-7
RB_Share_CategoryRepository.cs
...Repository/MarketingCenter/RB_Share_CategoryRepository.cs
+36
-0
RB_Share_FriendRepository.cs
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
+40
-1
ShareController.cs
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
+55
-0
No files found.
Mall.Model/Entity/MarketingCenter/RB_Share_Category.cs
View file @
0d2f5ecb
...
...
@@ -31,6 +31,11 @@ namespace Mall.Model.Entity.MarketingCenter
/// </summary>
public
int
ParentId
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
/// <summary>
/// 删除状态(1-删除)
/// </summary>
...
...
Mall.Model/Entity/MarketingCenter/RB_Share_Friend.cs
View file @
0d2f5ecb
...
...
@@ -58,6 +58,11 @@ namespace Mall.Model.Entity.MarketingCenter
/// </summary>
public
int
SortNum
{
get
;
set
;
}
/// <summary>
/// 启用-1,禁用-0
/// </summary>
public
int
IsUse
{
get
;
set
;
}
/// <summary>
/// 删除状态(1-删除)
/// </summary>
...
...
Mall.Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
View file @
0d2f5ecb
...
...
@@ -12,5 +12,9 @@ namespace Mall.Model.Extend.MarketingCenter
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Share_Category_Extend
:
RB_Share_Category
{
/// <summary>
/// 分类Id
/// </summary>
public
string
QCateIds
{
get
;
set
;
}
}
}
Mall.Model/Extend/MarketingCenter/RB_Share_Friend_Extend.cs
View file @
0d2f5ecb
...
...
@@ -11,6 +11,35 @@ namespace Mall.Model.Extend.MarketingCenter
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Share_Friend_Extend
:
RB_Share_Friend
{
/// <summary>
/// 关键字
/// </summary>
public
string
KeyWords
{
get
;
set
;
}
/// <summary>
/// 开始时间
/// </summary>
public
string
QStartDate
{
get
;
set
;
}
/// <summary>
/// 结束时间
/// </summary>
public
string
QEndDate
{
get
;
set
;
}
/// <summary>
/// 分类Ids【逗号分割】
/// </summary>
public
string
CateIds
{
get
;
set
;
}
/// <summary>
/// 创建时间字符串
/// </summary>
public
string
CreateDateStr
{
get
{
return
Convert
.
ToDateTime
(
this
.
CreateDate
).
ToString
(
"yyyy-MM-dd HH:mm:ss"
);
}
}
}
}
\ No newline at end of file
Mall.Module.MarketingCenter/ShareModule.cs
View file @
0d2f5ecb
...
...
@@ -37,6 +37,15 @@ namespace Mall.Module.MarketingCenter
return
share_CategoryRepository
.
GetShareCategoryPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
}
/// <summary>
/// 根据上级编号获取所有子级分类
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Share_Category_Extend
>
GetChildCategoryListModule
(
RB_Share_Category_Extend
query
)
{
return
share_CategoryRepository
.
GetChildCategoryListRepository
(
query
);
}
/// <summary>
/// 获取分享分类列表
...
...
@@ -50,10 +59,10 @@ namespace Mall.Module.MarketingCenter
if
(
list
!=
null
)
{
var
leavelList
=
list
.
GroupBy
(
qitem
=>
new
{
qitem
.
Level
}).
OrderBy
(
qitem
=>
qitem
.
Key
.
Level
);
foreach
(
var
item
in
list
.
Where
(
qitem
=>
qitem
.
Level
==
1
))
foreach
(
var
item
in
list
.
Where
(
qitem
=>
qitem
.
Level
==
1
)
.
OrderBy
(
qitem
=>
qitem
.
SortNum
)
)
{
List
<
object
>
secondList
=
new
List
<
object
>();
var
subList
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
2
&&
qitem
.
ParentId
==
item
.
Id
).
ToList
();
var
subList
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
2
&&
qitem
.
ParentId
==
item
.
Id
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
ToList
();
foreach
(
var
subItem
in
subList
)
{
var
subModel
=
new
...
...
@@ -62,19 +71,16 @@ namespace Mall.Module.MarketingCenter
subItem
.
Level
,
subItem
.
Name
,
subItem
.
ParentId
,
hasChildren
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
3
&&
qitem
.
ParentId
==
subItem
.
Id
)?.
Count
()
>
0
,
children
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
3
&&
qitem
.
ParentId
==
subItem
.
Id
).
Select
(
qitem
=>
new
{
qitem
.
Id
,
qitem
.
Name
,
qitem
.
Level
,
qitem
.
ParentId
})
children
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
3
&&
qitem
.
ParentId
==
subItem
.
Id
).
OrderBy
(
qitem
=>
qitem
.
SortNum
).
Select
(
qitem
=>
new
{
qitem
.
Id
,
qitem
.
Name
,
qitem
.
Level
,
qitem
.
ParentId
})
};
secondList
.
Add
(
subModel
);
}
var
rootModel
=
new
{
item
.
Id
,
item
.
Level
,
item
.
Name
,
item
.
ParentId
,
hasChildren
=
secondList
?.
Count
>
0
,
children
=
secondList
};
resultList
.
Add
(
rootModel
);
...
...
@@ -93,7 +99,14 @@ 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
)
{
return
share_FriendRepository
.
GetShareFriendPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
query
.
CateId
>
0
)
{
var
cateList
=
GetChildCategoryListModule
(
new
RB_Share_Category_Extend
()
{
QCateIds
=
query
.
CateId
.
ToString
()
});
query
.
CateId
=
0
;
query
.
CateIds
=
string
.
Join
(
","
,
cateList
.
Select
(
qitem
=>
qitem
.
Id
));
}
var
list
=
share_FriendRepository
.
GetShareFriendPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
return
list
;
}
...
...
@@ -123,6 +136,7 @@ namespace Mall.Module.MarketingCenter
{
nameof
(
RB_Share_Category_Extend
.
Level
),
extModel
.
Level
},
{
nameof
(
RB_Share_Category_Extend
.
ParentId
),
extModel
.
ParentId
},
{
nameof
(
RB_Share_Category_Extend
.
UpdateDate
),
extModel
.
UpdateDate
},
{
nameof
(
RB_Share_Category_Extend
.
SortNum
),
extModel
.
SortNum
},
};
flag
=
share_CategoryRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Category_Extend
.
Id
),
extModel
.
Id
));
}
...
...
@@ -220,5 +234,73 @@ namespace Mall.Module.MarketingCenter
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新是否置顶
/// </summary>
/// <param name="Id"></param>
/// <param name="IsTop"></param>
/// <returns></returns>
public
bool
SetShareFriendIsTopModule
(
object
Id
,
int
IsTop
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Share_Friend_Extend
.
IsTop
),
IsTop
},
};
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新是否启用
/// </summary>
/// <param name="Id"></param>
/// <param name="IsUse"></param>
/// <returns></returns>
public
bool
SetShareFriendIsUseModule
(
object
Id
,
int
IsUse
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Share_Friend_Extend
.
IsUse
),
IsUse
},
};
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新排序
/// </summary>
/// <param name="Id"></param>
/// <param name="SortNum"></param>
/// <returns></returns>
public
bool
SetShareFriendSortNumModule
(
object
Id
,
int
SortNum
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Share_Friend_Extend
.
SortNum
),
SortNum
},
};
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
/// <summary>
/// 更新文案
/// </summary>
/// <param name="Id"></param>
/// <param name="MaterialInfo"></param>
/// <returns></returns>
public
bool
SetShareFriendMaterialInfoModule
(
object
Id
,
string
MaterialInfo
)
{
bool
flag
=
false
;
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Share_Friend_Extend
.
MaterialInfo
),
MaterialInfo
},
};
flag
=
share_FriendRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Share_Friend_Extend
.
Id
),
Id
));
return
flag
;
}
}
}
Mall.Repository/MarketingCenter/RB_Share_CategoryRepository.cs
View file @
0d2f5ecb
...
...
@@ -42,6 +42,14 @@ WHERE 1=1 AND Status=0
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Category_Extend
.
Name
)}
like '%
{
query
.
Name
}
%'"
);
}
if
(
query
.
Id
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Category_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QCateIds
))
{
builder
.
AppendFormat
(
" AND {0} IN ({1}) "
,
nameof
(
RB_Share_Category_Extend
.
Id
),
query
.
QCateIds
);
}
}
return
GetPage
<
RB_Share_Category_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
...
...
@@ -74,7 +82,35 @@ WHERE 1=1 AND Status=0
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Category_Extend
.
Name
)}
like '%
{
query
.
Name
}
%'"
);
}
if
(
query
.
Id
>
0
)
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Category_Extend
.
Id
)}
=
{
query
.
Id
}
"
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QCateIds
))
{
builder
.
AppendFormat
(
" AND {0} IN ({1}) "
,
nameof
(
RB_Share_Category_Extend
.
Id
),
query
.
QCateIds
);
}
}
return
Get
<
RB_Share_Category_Extend
>(
builder
.
ToString
()).
ToList
();
}
/// <summary>
/// 根据上级编号获取所有子级分类
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_Share_Category_Extend
>
GetChildCategoryListRepository
(
RB_Share_Category_Extend
query
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT tabA.*
FROM (SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId>0) tabA,
(SELECT @pid := '{0}') pd
WHERE FIND_IN_SET(ParentId, @pid) > 0 AND @pid := concat(@pid, ',', id)
UNION
SELECT *
FROM rb_share_category
WHERE `Status`=0 AND FIND_IN_SET(Id,@pid) > 0 "
,
query
.
QCateIds
);
return
Get
<
RB_Share_Category_Extend
>(
builder
.
ToString
()).
ToList
();
}
}
...
...
Mall.Repository/MarketingCenter/RB_Share_FriendRepository.cs
View file @
0d2f5ecb
...
...
@@ -38,6 +38,26 @@ WHERE 1=1 AND Status=0
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Friend_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CateId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CateIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateIds
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
KeyWords
))
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Share_Friend_Extend
.
MaterialInfo
),
query
.
KeyWords
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
))
{
builder
.
AppendFormat
(
" AND {0}>='{1}' "
,
nameof
(
RB_Share_Friend_Extend
.
CreateDate
),
Convert
.
ToDateTime
(
query
.
QStartDate
).
ToString
(
"yyyy-MM-dd"
));
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QEndDate
))
{
builder
.
AppendFormat
(
" AND {0}<='{1} 23:59:59' "
,
nameof
(
RB_Share_Friend_Extend
.
CreateDate
),
Convert
.
ToDateTime
(
query
.
QEndDate
).
ToString
(
"yyyy-MM-dd"
));
}
}
return
GetPage
<
RB_Share_Friend_Extend
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
}
...
...
@@ -66,7 +86,26 @@ WHERE 1=1 AND Status=0
{
builder
.
Append
(
$" AND
{
nameof
(
RB_Share_Friend_Extend
.
MallBaseId
)}
=
{
query
.
MallBaseId
}
"
);
}
if
(
query
.
CateId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
CateIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Share_Friend_Extend
.
CateId
),
query
.
CateIds
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
KeyWords
))
{
builder
.
AppendFormat
(
" AND {0} LIKE '%{1}%' "
,
nameof
(
RB_Share_Friend_Extend
.
MaterialInfo
),
query
.
KeyWords
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QStartDate
))
{
builder
.
AppendFormat
(
" AND {0}>='{1}' "
,
nameof
(
RB_Share_Friend_Extend
.
CreateDate
),
Convert
.
ToDateTime
(
query
.
QStartDate
).
ToString
(
"yyyy-MM-dd"
));
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
QEndDate
))
{
builder
.
AppendFormat
(
" AND {0}<='{1} 23:59:59' "
,
nameof
(
RB_Share_Friend_Extend
.
CreateDate
),
Convert
.
ToDateTime
(
query
.
QEndDate
).
ToString
(
"yyyy-MM-dd"
));
}
}
return
Get
<
RB_Share_Friend_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
Mall.WebApi/Controllers/MarketingCenter/ShareController.cs
View file @
0d2f5ecb
...
...
@@ -137,6 +137,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
extModel
.
MallBaseId
=
RequestParm
.
MallBaseId
;
extModel
.
CreateDate
=
DateTime
.
Now
;
extModel
.
UpdateDate
=
DateTime
.
Now
;
extModel
.
IsUse
=
1
;
bool
flag
=
shareModule
.
SetShareFriendModule
(
extModel
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
...
...
@@ -164,5 +165,59 @@ namespace Mall.WebApi.Controllers.MarketingCenter
var
extModel
=
shareModule
.
GetShareFriendModule
(
Id
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
/// <summary>
/// 更新置顶状态
/// </summary>
/// <returns></returns>
public
ApiResult
SetShareFriendIsTop
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
Id
=
parm
.
GetInt
(
"Id"
,
0
);
int
IsTop
=
parm
.
GetInt
(
"IsTop"
,
0
);
bool
flag
=
shareModule
.
SetShareFriendIsTopModule
(
Id
,
IsTop
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新是否启用
/// </summary>
/// <returns></returns>
public
ApiResult
SetShareFriendIsUse
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
Id
=
parm
.
GetInt
(
"Id"
,
0
);
int
IsUse
=
parm
.
GetInt
(
"IsUse"
,
0
);
bool
flag
=
shareModule
.
SetShareFriendIsUseModule
(
Id
,
IsUse
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新排序
/// </summary>
/// <returns></returns>
public
ApiResult
SetShareFriendSortNum
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
Id
=
parm
.
GetInt
(
"Id"
,
0
);
int
SortNum
=
parm
.
GetInt
(
"SortNum"
,
0
);
bool
flag
=
shareModule
.
SetShareFriendSortNumModule
(
Id
,
SortNum
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
/// <summary>
/// 更新文案
/// </summary>
/// <returns></returns>
public
ApiResult
SetShareFriendMaterialInfo
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
Id
=
parm
.
GetInt
(
"Id"
,
0
);
var
MaterialInfo
=
parm
.
GetStringValue
(
"MaterialInfo"
);
bool
flag
=
shareModule
.
SetShareFriendMaterialInfoModule
(
Id
,
MaterialInfo
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
}
\ 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