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
102a2913
Commit
102a2913
authored
Jul 22, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
cabb1410
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
ActivityUserJoinBiz.java
...a/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
+23
-0
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+11
-0
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
View file @
102a2913
...
@@ -93,6 +93,29 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -93,6 +93,29 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
//判断用户是否已领取或无法领取优惠卷
public
ObjectRestResponse
checkUserCoupon
(
Integer
userId
){
ActivityRule
rule
=
ruleBiz
.
getActity
();
if
(
rule
==
null
)
{
log
.
error
(
"----没有开启的活动----"
);
return
ObjectRestResponse
.
createFailedResult
(
101
,
"无有效活动"
);
}
Integer
activityId
=
rule
.
getId
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
userJoin
.
setActivityId
(
activityId
);
userJoin
.
setUserId
(
userId
);
userJoin
=
selectOne
(
userJoin
);
if
(
userJoin
==
null
)
{
log
.
error
(
"----用户没有此参与活动----userId===="
+
userId
);
return
ObjectRestResponse
.
createFailedResult
(
102
,
"不是新用户,无法参与此活动"
);
}
if
(
userJoin
.
getStatus
()!=
0
){
log
.
error
(
"----用户已领取----userId===="
+
userId
);
return
ObjectRestResponse
.
createFailedResult
(
103
,
"用户已领取"
);
}
return
ObjectRestResponse
.
succ
();
}
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
102a2913
...
@@ -85,6 +85,17 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -85,6 +85,17 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
return
joinBiz
.
receiveCoupn
(
userId
);
return
joinBiz
.
receiveCoupn
(
userId
);
}
}
@ApiOperation
(
"检查用户是否可领取"
)
@RequestMapping
(
value
=
"/coupon/check"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
check
()
{
AppUserDTO
userInfo
=
getUserInfo
();
Integer
userId
=
userInfo
.
getUserid
();
if
(
userId
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
return
joinBiz
.
checkUserCoupon
(
userId
);
}
...
...
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