Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
cms-ci-test
Commits
b3ab0e7e
提交
b3ab0e7e
authored
10月 26, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
活动邀请详情修改
上级
b22a1970
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
14 行增加
和
4 行删除
+14
-4
ActivityController.java
...mmc/iuav/user/controller/activity/ActivityController.java
+3
-1
ActivityServiceImpl.java
...a/com/mmc/iuav/user/service/impl/ActivityServiceImpl.java
+4
-3
activity.xml
...e/cms-service-user/src/main/resources/mapper/activity.xml
+7
-0
没有找到文件。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/activity/ActivityController.java
浏览文件 @
b3ab0e7e
...
...
@@ -6,6 +6,7 @@ import com.mmc.iuav.group.Update;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.controller.BaseController
;
import
com.mmc.iuav.user.model.dto.activity.ActivityDTO
;
import
com.mmc.iuav.user.model.dto.activity.ActivityPartDTO
;
import
com.mmc.iuav.user.model.qo.ActivityQO
;
import
com.mmc.iuav.user.model.vo.activity.ActivityVO
;
import
com.mmc.iuav.user.service.ActivityService
;
...
...
@@ -18,6 +19,7 @@ import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.*
;
/**
* @description: 当前时间只能有一个活动有效,活动requireNum为0时,不限制发放积分人数,人人可以获得积分
* @author: zj
* @Date: 2023/10/16 15:06
*/
...
...
@@ -66,7 +68,7 @@ public class ActivityController extends BaseController {
@ApiOperation
(
value
=
"活动邀请详情"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"inviteDetail"
)
public
ResultBody
inviteDetail
(
@Validated
(
Page
.
class
)
@RequestBody
ActivityQO
activityQO
)
{
public
ResultBody
<
ActivityPartDTO
>
inviteDetail
(
@Validated
(
Page
.
class
)
@RequestBody
ActivityQO
activityQO
)
{
return
activityService
.
inviteDetail
(
activityQO
);
}
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/ActivityServiceImpl.java
浏览文件 @
b3ab0e7e
...
...
@@ -105,16 +105,17 @@ public class ActivityServiceImpl implements ActivityService {
// 查询是否超过奖励限制
int
count
=
activityDao
.
countActivityPart
(
activityDO
.
getId
(),
userAccountId
);
if
(
activityDO
.
getRequireNum
()
==
0
||
count
<
activityDO
.
getRequireNum
())
{
log
.
info
(
"Activity invite award! userAccountId:{}"
,
userAccountId
);
// 暂时只奖励积分
ChangeUserPointVO
changePoint
=
new
ChangeUserPointVO
();
changePoint
.
setUserAccountId
(
userAccountId
);
changePoint
.
setChangePoint
(
activityDO
.
getRewardValue
());
changePoint
.
setChangeType
(
7
);
userPointsService
.
change
(
changePoint
);
// 记录领取信息(被邀请)
ActivityPartDO
activityPartDO
=
new
ActivityPartDO
(
null
,
activityDO
.
getId
(),
userAccountId
,
pUserAccountId
,
new
Date
());
activityDao
.
insertActivityPart
(
activityPartDO
);
}
// 记录领取信息(被邀请)
ActivityPartDO
activityPartDO
=
new
ActivityPartDO
(
null
,
activityDO
.
getId
(),
userAccountId
,
pUserAccountId
,
new
Date
());
activityDao
.
insertActivityPart
(
activityPartDO
);
return
ResultBody
.
success
();
}
...
...
csm-service/cms-service-user/src/main/resources/mapper/activity.xml
浏览文件 @
b3ab0e7e
...
...
@@ -158,6 +158,9 @@
select
<include
refid=
"activity_part_column"
/>
, ac.reward_value
from activity_part ap inner join activity ac on ap.activity_id = ac.id
where ac.id = #{activityId}
<if
test=
"userAccountId != null"
>
and ap.user_account_id = #{userAccountId}
</if>
order by ap.id desc
limit #{pageNo}, #{pageSize}
</select>
...
...
@@ -167,5 +170,8 @@
select count(*)
from activity_part ap inner join activity ac on ap.activity_id = ac.id
where ac.id = #{activityId}
<if
test=
"userAccountId != null"
>
and ap.user_account_id = #{userAccountId}
</if>
</select>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论