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
a3897a98
Commit
a3897a98
authored
Jul 23, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
cd8251db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
ActivityUserJoinBiz.java
...a/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
+2
-0
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+7
-1
UserCouponMapper.java
...a/com/xxfc/platform/activity/mapper/UserCouponMapper.java
+5
-0
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
View file @
a3897a98
...
...
@@ -42,6 +42,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
log
.
error
(
"----活动已超过参与人数----number==="
+
number
);
return
;
}
rule
.
setJoinNumber
(
joinNumber
+
1
);
Integer
activityId
=
rule
.
getId
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
userJoin
.
setActivityId
(
activityId
);
...
...
@@ -52,6 +53,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
return
;
}
insertSelective
(
userJoin
);
ruleBiz
.
updateById
(
rule
);
}
//领取优惠卷
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
a3897a98
...
...
@@ -96,6 +96,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon
.
setStartTime
(
startTime
);
userCoupon
.
setExpireTime
(
expireTime
);
insertSelective
(
userCoupon
);
coupon
.
setTakeCount
(
coupon
.
getTakeCount
()+
1
);
couponBiz
.
updateById
(
coupon
);
return
ticker_no
;
}
...
...
@@ -170,13 +172,16 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
log
.
error
(
userId
+
"----该优惠卷已使用--tickerNo=="
);
continue
;
}
Integer
couponId
=
userCoupon
.
getCouponId
();
if
(
type
==
1
){
userCoupon
.
setIsUse
(
1
);
userCoupon
.
setOrderNo
(
orderNo
);
userCoupon
.
setUseTime
(
System
.
currentTimeMillis
());
updateSelectiveById
(
userCoupon
);
mapper
.
upUsedCount
(
couponId
,
1
);
}
couponAmout
=
couponAmout
.
add
(
getCouponAmout
(
userCoupon
.
getCouponId
()
,
channel
,
amout
));
couponAmout
=
couponAmout
.
add
(
getCouponAmout
(
couponId
,
channel
,
amout
));
}
return
couponAmout
;
}
...
...
@@ -224,6 +229,7 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
userCoupon
.
setOrderNo
(
""
);
userCoupon
.
setUseTime
(
0L
);
updateSelectiveById
(
userCoupon
);
mapper
.
upUsedCount
(
userCoupon
.
getCouponId
(),-
1
);
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/UserCouponMapper.java
View file @
a3897a98
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.activity.mapper;
import
com.xxfc.platform.activity.entity.UserCoupon
;
import
com.xxfc.platform.activity.vo.UserCouponVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
...
...
@@ -21,5 +22,9 @@ public interface UserCouponMapper extends Mapper<UserCoupon> {
//单个优惠卷
public
UserCouponVo
getUserCoupon
(
@Param
(
"tickerNo"
)
String
tickerNo
);
//已使用的优惠券数量数量加减
@Update
(
"update coupon set used_count=used_count+#{count} where `id`=#{id}"
)
int
upUsedCount
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"count"
)
Integer
count
);
}
\ 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