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
ae661fd1
Commit
ae661fd1
authored
Nov 06, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hz_master' into master_pay
parents
b5f4ac88
d1753bbc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
UserCouponVo.java
...main/java/com/xxfc/platform/activity/vo/UserCouponVo.java
+6
-0
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+4
-1
UserCouponMapper.xml
...ity-server/src/main/resources/mapper/UserCouponMapper.xml
+4
-3
No files found.
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/vo/UserCouponVo.java
View file @
ae661fd1
...
@@ -59,11 +59,17 @@ public class UserCouponVo {
...
@@ -59,11 +59,17 @@ public class UserCouponVo {
@ApiModelProperty
(
value
=
"开始时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"开始时间"
,
hidden
=
true
)
private
Long
startTime
;
private
Long
startTime
;
/**
/**
* 到期时间
* 到期时间
*/
*/
@ApiModelProperty
(
value
=
"到期时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"到期时间"
,
hidden
=
true
)
private
Long
expireTime
;
private
Long
expireTime
;
@ApiModelProperty
(
value
=
"到期时间字符串"
)
private
String
expireDate
;
/**
/**
* 使用时间
* 使用时间
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
ae661fd1
...
@@ -124,9 +124,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -124,9 +124,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
if
(
type
==
1
){
if
(
type
==
1
){
startTime
=
coupon
.
getStartTime
();
startTime
=
coupon
.
getStartTime
();
expireTime
=
coupon
.
getValidEndTime
();
expireTime
=
coupon
.
getValidEndTime
();
}
else
{
}
else
if
(
type
==
2
)
{
startTime
=
expireTime
;
startTime
=
expireTime
;
expireTime
+=
DAY
*
coupon
.
getValidDays
();
expireTime
+=
DAY
*
coupon
.
getValidDays
();
}
else
{
startTime
=
expireTime
;
expireTime
=-
1L
;
}
}
String
ticker_no
=
Snowflake
.
build
()+
""
;
String
ticker_no
=
Snowflake
.
build
()+
""
;
UserCoupon
userCoupon
=
new
UserCoupon
();
UserCoupon
userCoupon
=
new
UserCoupon
();
...
...
xx-activity/xx-activity-server/src/main/resources/mapper/UserCouponMapper.xml
View file @
ae661fd1
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"expireTime"
column=
"expire_time"
/>
<result
property=
"expireTime"
column=
"expire_time"
/>
<result
property=
"expireDate"
column=
"expireDate"
/>
<result
property=
"useTime"
column=
"use_time"
/>
<result
property=
"useTime"
column=
"use_time"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"title"
column=
"title"
/>
<result
property=
"subtitle"
column=
"subtitle"
/>
<result
property=
"subtitle"
column=
"subtitle"
/>
...
@@ -32,20 +33,20 @@
...
@@ -32,20 +33,20 @@
<select
id=
"getUserCouponsByType"
resultMap=
"userCouponMap"
>
<select
id=
"getUserCouponsByType"
resultMap=
"userCouponMap"
>
SELECT
SELECT
*
*
,IF(expire_time=-1,'永久有效',CONCAT('有效期至',FROM_UNIXTIME(expire_time/1000,'%Y-%m-%d'))) as expireDate
FROM
FROM
user_coupon u
user_coupon u
LEFT JOIN coupon c ON u.coupon_id = c.id
LEFT JOIN coupon c ON u.coupon_id = c.id
WHERE
WHERE
u.is_del = 0 and u.user_id=#{userId}
u.is_del = 0 and u.user_id=#{userId}
<if
test=
"type==0"
>
<if
test=
"type==0"
>
and u.is_use=0 and
u.expire_time >=#{time}
and u.is_use=0 and
(u.expire_time >=#{time} or u.expire_time=-1)
</if>
</if>
<if
test=
"type==1"
>
<if
test=
"type==1"
>
and u.is_use=1
and u.is_use=1
</if>
</if>
<if
test=
"type==2"
>
<if
test=
"type==2"
>
and u.is_use=0 and u.expire_time
<
#{time}
and u.is_use=0 and u.expire_time
<
#{time}
and u.expire_time!=-1
</if>
</if>
<if
test=
"channel!=null and channel!=''"
>
<if
test=
"channel!=null and channel!=''"
>
and (c.channel=#{channel} or c.channel=0 )
and (c.channel=#{channel} or c.channel=0 )
...
...
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