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
f7e28cbd
Commit
f7e28cbd
authored
Jul 19, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改领取优惠卷
parent
a6794c9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
ActivityUserJoinBiz.java
...a/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
+7
-4
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+1
-2
No files found.
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/ActivityUserJoinBiz.java
View file @
f7e28cbd
...
@@ -2,6 +2,8 @@ package com.xxfc.platform.activity.biz;
...
@@ -2,6 +2,8 @@ package com.xxfc.platform.activity.biz;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.activity.entity.ActivityRule
;
import
com.xxfc.platform.activity.entity.ActivityRule
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -53,11 +55,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -53,11 +55,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
//领取优惠卷
//领取优惠卷
public
void
receiveCoupn
(
Integer
userId
)
{
public
ObjectRestResponse
receiveCoupn
(
Integer
userId
)
{
ActivityRule
rule
=
ruleBiz
.
getActity
();
ActivityRule
rule
=
ruleBiz
.
getActity
();
if
(
rule
==
null
)
{
if
(
rule
==
null
)
{
log
.
error
(
"----没有开启的活动----"
);
log
.
error
(
"----没有开启的活动----"
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"没有开启的活动"
)
;
}
}
Integer
activityId
=
rule
.
getId
();
Integer
activityId
=
rule
.
getId
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
ActivityUserJoin
userJoin
=
new
ActivityUserJoin
();
...
@@ -66,11 +68,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -66,11 +68,11 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
userJoin
=
selectOne
(
userJoin
);
userJoin
=
selectOne
(
userJoin
);
if
(
userJoin
==
null
)
{
if
(
userJoin
==
null
)
{
log
.
error
(
"----用户没有此参与活动----userId===="
+
userId
);
log
.
error
(
"----用户没有此参与活动----userId===="
+
userId
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"不是新用户,无法参与此活动"
)
;
}
}
if
(
userJoin
.
getStatus
()!=
0
){
if
(
userJoin
.
getStatus
()!=
0
){
log
.
error
(
"----用户已领取----userId===="
+
userId
);
log
.
error
(
"----用户已领取----userId===="
+
userId
);
return
;
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"用户已领取"
)
;
}
}
String
value
=
rule
.
getValue
();
String
value
=
rule
.
getValue
();
JSONObject
json
=
JSONObject
.
parseObject
(
value
);
JSONObject
json
=
JSONObject
.
parseObject
(
value
);
...
@@ -88,6 +90,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
...
@@ -88,6 +90,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
userJoin
.
setStatus
(
1
);
userJoin
.
setStatus
(
1
);
updateById
(
userJoin
);
updateById
(
userJoin
);
return
ObjectRestResponse
.
succ
();
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
f7e28cbd
...
@@ -82,8 +82,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -82,8 +82,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
joinBiz
.
receiveCoupn
(
userId
);
return
joinBiz
.
receiveCoupn
(
userId
);
return
ObjectRestResponse
.
succ
();
}
}
...
...
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