Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
cms-ci-test
Commits
cee54e75
提交
cee54e75
authored
10月 27, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
活动邀请详情修改
上级
e50ca1c0
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
38 行增加
和
5 行删除
+38
-5
ActivityController.java
...mmc/iuav/user/controller/activity/ActivityController.java
+9
-0
ActivityService.java
.../main/java/com/mmc/iuav/user/service/ActivityService.java
+3
-0
ActivityServiceImpl.java
...a/com/mmc/iuav/user/service/impl/ActivityServiceImpl.java
+24
-1
activity.xml
...e/cms-service-user/src/main/resources/mapper/activity.xml
+2
-4
没有找到文件。
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/controller/activity/ActivityController.java
浏览文件 @
cee54e75
...
...
@@ -18,6 +18,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @description: 当前时间只能有一个活动有效,活动requireNum为0时,不限制发放积分人数,人人可以获得积分
* @author: zj
...
...
@@ -72,4 +74,11 @@ public class ActivityController extends BaseController {
return
activityService
.
inviteDetail
(
activityQO
);
}
@ApiOperation
(
value
=
"小程序活动详情页-当前正在进行的活动"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"currentActivity"
)
public
ResultBody
<
ActivityDTO
>
currentActivity
(
@RequestParam
Integer
activityType
,
HttpServletRequest
request
)
{
return
activityService
.
currentActivity
(
activityType
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/ActivityService.java
浏览文件 @
cee54e75
package
com
.
mmc
.
iuav
.
user
.
service
;
import
com.mmc.iuav.response.ResultBody
;
import
com.mmc.iuav.user.model.dto.activity.ActivityDTO
;
import
com.mmc.iuav.user.model.qo.ActivityQO
;
import
com.mmc.iuav.user.model.vo.activity.ActivityVO
;
...
...
@@ -28,4 +29,6 @@ public interface ActivityService {
ResultBody
delete
(
Integer
id
);
ResultBody
inviteDetail
(
ActivityQO
activityQO
);
ResultBody
<
ActivityDTO
>
currentActivity
(
Integer
activityType
,
Integer
userAccountId
);
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/ActivityServiceImpl.java
浏览文件 @
cee54e75
...
...
@@ -138,6 +138,29 @@ public class ActivityServiceImpl implements ActivityService {
Integer
pageNo
=
activityQO
.
getPageNo
();
activityQO
.
buildCurrentPage
();
List
<
ActivityPartDO
>
activityPartDOS
=
activityDao
.
activityPartDetail
(
activityQO
);
List
<
ActivityPartDTO
>
activityPartDTOS
=
this
.
buildActivityPartDTOS
(
activityPartDOS
);
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
activityQO
.
getPageSize
(),
count
,
activityPartDTOS
));
}
@Override
public
ResultBody
<
ActivityDTO
>
currentActivity
(
Integer
activityType
,
Integer
userAccountId
)
{
ActivityDO
activityDO
=
activityDao
.
currentActivity
(
activityType
);
if
(
activityDO
==
null
)
{
return
ResultBody
.
success
();
}
ActivityDTO
activityDTO
=
activityDO
.
buildActivityDTO
();
ActivityQO
activityQO
=
new
ActivityQO
();
activityQO
.
setActivityId
(
activityDO
.
getId
());
activityQO
.
setUserAccountId
(
userAccountId
);
activityQO
.
setPageNo
(
0
);
activityQO
.
setPageSize
(
999999
);
List
<
ActivityPartDO
>
activityPartDOS
=
activityDao
.
activityPartDetail
(
activityQO
);
List
<
ActivityPartDTO
>
activityPartDTOList
=
this
.
buildActivityPartDTOS
(
activityPartDOS
);
activityDTO
.
setActivityPartDTOS
(
activityPartDTOList
);
return
ResultBody
.
success
(
activityDTO
);
}
public
List
<
ActivityPartDTO
>
buildActivityPartDTOS
(
List
<
ActivityPartDO
>
activityPartDOS
)
{
List
<
ActivityPartDTO
>
activityPartDTOS
=
activityPartDOS
.
stream
().
map
(
ActivityPartDO:
:
buildActivityPartDTO
).
collect
(
Collectors
.
toList
());
// 邀请人id
List
<
Integer
>
userIds
=
activityPartDTOS
.
stream
().
map
(
ActivityPartDTO:
:
getUserAccountId
).
collect
(
Collectors
.
toList
());
...
...
@@ -157,6 +180,6 @@ public class ActivityServiceImpl implements ActivityService {
activityPartDTO
.
setPAccountSimpleDTO
(
pUserMap
.
get
(
activityPartDTO
.
getPUserAccountId
()));
}
}
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
activityQO
.
getPageSize
(),
count
,
activityPartDTOS
))
;
return
activityPartDTOS
;
}
}
csm-service/cms-service-user/src/main/resources/mapper/activity.xml
浏览文件 @
cee54e75
...
...
@@ -120,10 +120,8 @@
and ac.id != #{id}
</if>
<if
test=
"startTime != null"
>
and ( #{startTime} >= ac.start_time and ac.end_time >= #{startTime} )
</if>
<if
test=
"endTime != null"
>
and ( #{endTime} >= ac.start_time and ac.end_time >= #{endTime} )
and ( ( #{startTime} >= ac.start_time and ac.end_time >= #{startTime} ) or ( #{endTime} >= ac.start_time and
ac.end_time >= #{endTime} ) )
</if>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论