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
0c9ee628
Commit
0c9ee628
authored
Jun 11, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
8a4c72c4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
3 deletions
+70
-3
AreaDataHelper.cs
Mall.Common/Data/AreaDataHelper.cs
+2
-0
RB_Destination_Extend.cs
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
+2
-0
DestinationModule.cs
Mall.Module.BaseSetUp/DestinationModule.cs
+2
-2
RB_DestinationRepository.cs
Mall.Repository/BaseSetUp/RB_DestinationRepository.cs
+16
-0
DestinationController.cs
Mall.WebApi/Controllers/MallBase/DestinationController.cs
+40
-1
CouponController.cs
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
+8
-0
No files found.
Mall.Common/Data/AreaDataHelper.cs
View file @
0c9ee628
...
...
@@ -138,5 +138,7 @@ namespace Mall.Common.Data
/// 状态
/// </summary>
public
int
S
{
get
;
set
;
}
public
List
<
Node
>
Children
{
get
;
set
;
}
}
}
Mall.Model/Extend/BaseSetUp/RB_Destination_Extend.cs
View file @
0c9ee628
...
...
@@ -80,5 +80,7 @@ namespace Mall.Model.Extend.BaseSetUp
/// 批量name查询
/// </summary>
public
string
NameStr
{
get
;
set
;
}
public
List
<
RB_Destination_Extend
>
Children
{
get
;
set
;
}
}
}
Mall.Module.BaseSetUp/DestinationModule.cs
View file @
0c9ee628
...
...
@@ -162,9 +162,9 @@ namespace Mall.Module.BaseSetUp
/// 获取列表
/// </summary>
/// <returns></returns>
public
List
<
Mall
.
Common
.
Data
.
Node
>
GetAllList
()
public
List
<
RB_Destination_Extend
>
GetAllList
()
{
return
rb_DestinationRepository
.
GetAllList
();
return
rb_DestinationRepository
.
GetAll
Destination
List
();
}
/// <summary>
...
...
Mall.Repository/BaseSetUp/RB_DestinationRepository.cs
View file @
0c9ee628
...
...
@@ -234,6 +234,22 @@ SELECT * FROM {0} WHERE 1=1 AND ParentID<>2 {1}
return
queryList
;
}
/// <summary>
/// 获取地区列表
/// </summary>
/// <returns></returns>
public
List
<
RB_Destination_Extend
>
GetAllDestinationList
()
{
List
<
Common
.
Data
.
Node
>
queryList
=
new
List
<
Common
.
Data
.
Node
>();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
AppendFormat
(
"SELECT * FROM {0} WHERE 1=1 "
,
TableName
);
sb
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Destination_Extend
.
Status
),
(
int
)
Common
.
Enum
.
DateStateEnum
.
Normal
);
List
<
RB_Destination_Extend
>
list
=
Get
<
RB_Destination_Extend
>(
sb
.
ToString
()).
ToList
();
return
list
;
}
/// <summary>
/// 根据Ids获取地区名称
/// </summary>
...
...
Mall.WebApi/Controllers/MallBase/DestinationController.cs
View file @
0c9ee628
...
...
@@ -3,7 +3,9 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Mall.Common.API
;
using
Mall.Common.Data
;
using
Mall.Common.Plugin
;
using
Mall.Model.Extend.BaseSetUp
;
using
Mall.Module.BaseSetUp
;
using
Mall.WebApi.Filter
;
using
Microsoft.AspNetCore.Cors
;
...
...
@@ -29,7 +31,7 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <param name="ParentID">父节点编号</param>
/// <returns></returns>
public
ApiResult
GetChildList
()
public
ApiResult
GetChildList
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
int
ID
=
parm
.
GetInt
(
"Id"
);
...
...
@@ -48,5 +50,42 @@ namespace Mall.WebApi.Controllers.MallBase
return
ApiResult
.
Failed
(
"未找到相关数据!"
);
}
}
[
HttpPost
]
public
ApiResult
GetAllList
()
{
JObject
parm
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
list
=
destinationModule
.
GetAllList
();
var
result
=
GetData
(
list
);
return
ApiResult
.
Success
(
""
,
result
);
}
public
static
List
<
RB_Destination_Extend
>
GetData
(
List
<
RB_Destination_Extend
>
nodeList
)
{
List
<
RB_Destination_Extend
>
nodes
=
nodeList
.
Where
(
x
=>
x
.
ParentID
==
2
).
ToList
();
foreach
(
RB_Destination_Extend
item
in
nodes
)
{
item
.
Children
=
GetChildrens
(
nodeList
,
item
);
}
return
nodes
;
}
//递归获取子节点
public
static
List
<
RB_Destination_Extend
>
GetChildrens
(
List
<
RB_Destination_Extend
>
nodeList
,
RB_Destination_Extend
node
)
{
List
<
RB_Destination_Extend
>
childrens
=
nodeList
.
Where
(
x
=>
x
.
ParentID
==
node
.
ID
).
ToList
();
foreach
(
RB_Destination_Extend
item
in
childrens
)
{
item
.
Children
=
GetChildrens
(
nodeList
,
item
);
}
return
childrens
;
}
}
}
\ No newline at end of file
Mall.WebApi/Controllers/MarketingCenter/CouponController.cs
View file @
0c9ee628
...
...
@@ -274,6 +274,14 @@ namespace Mall.WebApi.Controllers.MarketingCenter
}
}
if
(
query
.
CouponType
==
CouponTypeEnum
.
Discount
)
{
if
(
query
.
DiscountsPrice
>
10
)
{
return
ApiResult
.
Failed
(
"折扣率的值必须不大于10"
);
}
}
if
(
query
.
UseType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Category
||
query
.
UseType
==
Common
.
Enum
.
MarketingCenter
.
UseTypeEnum
.
Product
)
{
...
...
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