Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
524237cd
Commit
524237cd
authored
Aug 09, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
e1d1869e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+28
-0
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+19
-0
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
524237cd
...
...
@@ -195,6 +195,34 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return
ObjectRestResponse
.
succ
(
result
);
}
//获取我的优惠卷
public
ObjectRestResponse
getUserCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
)
{
if
(
userId
==
null
||
userId
==
0
)
{
log
.
error
(
"----参数不能为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Long
time
=
System
.
currentTimeMillis
();
List
<
UserCouponVo
>
list
=
mapper
.
getUserCouponsByType
(
userId
,
type
,
time
,
channel
);
if
(
list
.
size
()
>
0
)
{
for
(
UserCouponVo
couponVo
:
list
)
{
Integer
status
=
2
;
if
(
amout
.
compareTo
(
new
BigDecimal
(
"0.00"
))
>
0
)
{
if
(
couponVo
.
getType
()
==
1
)
{
if
(
amout
.
compareTo
(
couponVo
.
getWithAmount
())
>=
0
)
{
status
=
1
;
}
}
else
if
(
couponVo
.
getType
()
==
3
)
{
status
=
1
;
}
}
couponVo
.
setStatus
(
status
);
}
list
.
sort
(
Comparator
.
comparing
(
UserCouponVo:
:
getStatus
));
}
return
ObjectRestResponse
.
succ
(
list
);
}
//获取单个优惠卷
public
UserCouponVo
getUserCoupon
(
String
tickerNo
){
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
524237cd
...
...
@@ -45,6 +45,25 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
if
(
userId
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
}
return
baseBiz
.
getUserCouponList
(
userId
,
type
,
channel
,
amount
);
}
/**
*
* @param type 0-未使用;1-已使用;3-已过期
* @param channel 1-租车;2-旅游;null-全部
* @return
*/
@ApiOperation
(
"订单我的优惠卷"
)
@RequestMapping
(
value
=
"/coupon/typelist"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
typelist
(
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"channel"
,
required
=
false
)
Integer
channel
,
@RequestParam
(
value
=
"amount"
,
defaultValue
=
"0.00"
)
BigDecimal
amount
)
{
AppUserDTO
userInfo
=
getUserInfo
();
Integer
userId
=
userInfo
.
getUserid
();
if
(
userId
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
}
return
baseBiz
.
getCouponList
(
userId
,
type
,
channel
,
amount
);
}
...
...
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