Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
adf05479
authored
May 20, 2019
by
zhangchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加券校验
parent
7aa74767
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
src/main/java/com/ctrip/fun/golf/api/basic/VoucherRuleController.java
src/main/java/com/ctrip/fun/golf/domain/basic/VoucherRule.java
src/main/java/com/ctrip/fun/golf/api/basic/VoucherRuleController.java
View file @
adf05479
...
...
@@ -138,6 +138,7 @@ public class VoucherRuleController extends
ids
=
ids
.
substring
(
0
,
ids
.
length
()
-
1
);
}
VoucherRuleBean
voucherRuleBean
=
voucherRuleService
.
get
(
id
);
if
(
voucherRuleBean
==
null
)
{
reponse
.
setBody
(
false
);
reponse
.
setMessage
(
"新增发放用户失败"
);
...
...
@@ -282,6 +283,26 @@ public class VoucherRuleController extends
return
response
;
}
/**
* 获取券规则是否可以免费领取
*
*/
@ResponseBody
@RequestMapping
(
value
=
"/getVoucherRuleById"
,
method
=
RequestMethod
.
POST
)
public
Response
<
Boolean
>
getVoucherRuleById
(
@RequestBody
Request
<
Integer
>
request
)
{
Response
<
Boolean
>
response
=
new
Response
<
Boolean
>();
VoucherRuleBean
voucherRuleBean
=
voucherRuleService
.
get
(
request
.
getBody
());
if
(
voucherRuleBean
.
getCanFreeReceive
()
==
1
){
response
.
setStatus
(
0
);
response
.
setBody
(
true
);
}
else
{
response
.
setStatus
(
0
);
response
.
setBody
(
false
);
}
return
response
;
}
@Override
public
VoucherRuleService
getEntityService
()
{
return
voucherRuleService
;
...
...
src/main/java/com/ctrip/fun/golf/domain/basic/VoucherRule.java
View file @
adf05479
...
...
@@ -147,6 +147,8 @@ public class VoucherRule {
//每满多少减多少 列:如值为100,则 200<=订单金额<300可以使用两张
private
BigDecimal
fullCutAmount
;
private
int
canFreeReceive
;
//判断券是可以免费领取
@Id
@GeneratedValue
(
strategy
=
IDENTITY
)
...
...
@@ -389,4 +391,13 @@ public class VoucherRule {
this
.
fullCutAmount
=
fullCutAmount
;
}
public
int
getCanFreeReceive
()
{
return
canFreeReceive
;
}
public
void
setCanFreeReceive
(
int
canFreeReceive
)
{
this
.
canFreeReceive
=
canFreeReceive
;
}
}
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