Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
research-project
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
research-project
Commits
2d46e3c0
Commit
2d46e3c0
authored
Nov 25, 2025
by
wangxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页滚动提示
parent
c7bf5538
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
2 deletions
+90
-2
cloud-research-api/src/main/java/com/yizhi/research/application/feign/ResearchClient.java
+8
-0
cloud-research-service/src/main/java/com/yizhi/research/application/controller/ResearchController.java
+10
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
+11
-0
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
+37
-2
cloud-research-service/src/main/java/com/yizhi/research/application/service/IResearchService.java
+7
-0
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
+17
-0
No files found.
cloud-research-api/src/main/java/com/yizhi/research/application/feign/ResearchClient.java
View file @
2d46e3c0
...
...
@@ -230,6 +230,14 @@ public interface ResearchClient {
*/
@GetMapping
(
"/research/details"
)
ResearchVo
getResearchDetails
(
@RequestParam
(
"id"
)
Long
id
);
/**
* 滚动提示接口:投票管理(4天内创建且已上架的数据)
* @param model
* @return
*/
@PostMapping
(
"/research/api/scroll/vote/list"
)
List
<
ResearchVo
>
apiVoteManagementForScroll
(
@RequestBody
BaseModel
<
PageVo
>
model
);
}
cloud-research-service/src/main/java/com/yizhi/research/application/controller/ResearchController.java
View file @
2d46e3c0
...
...
@@ -426,5 +426,15 @@ public class ResearchController {
ResearchVo
getResearchDetails
(
@RequestParam
(
"id"
)
Long
id
)
{
return
researchService
.
getResearchDetails
(
id
);
}
/**
* 滚动提示接口:投票管理(4天内创建且已上架的数据)
* @param model
* @return
*/
@PostMapping
(
"/api/scroll/vote/list"
)
public
List
<
Research
>
apiVoteManagementForScroll
(
@RequestBody
BaseModel
<
PageVo
>
model
)
{
return
researchService
.
apiVoteManagementForScroll
(
model
);
}
}
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.java
View file @
2d46e3c0
...
...
@@ -132,4 +132,15 @@ public interface ResearchMapper extends BaseMapper<Research> {
int
checkTPlanResearchState
(
@Param
(
"idsInRange"
)
List
<
Long
>
idsInRange
,
@Param
(
"id"
)
Long
id
,
@Param
(
"siteId"
)
Long
siteId
);
/**
* 滚动提示接口:投票管理(4天内创建且已上架的数据)
* @param idsInRange
* @param siteId
* @param now
* @return
*/
List
<
Research
>
selectVoteManagementForScroll
(
@Param
(
"idsInRange"
)
List
<
Long
>
idsInRange
,
@Param
(
"siteId"
)
Long
siteId
,
@Param
(
"now"
)
Date
now
);
}
cloud-research-service/src/main/java/com/yizhi/research/application/mapper/ResearchMapper.xml
View file @
2d46e3c0
...
...
@@ -316,8 +316,7 @@
and tb.org_id in
(<foreach collection="range.orgIds" item="item" separator=",">#{item}</foreach>)
</if>
-->
-->
and tb.deleted = 0
</where>
...
...
@@ -617,6 +616,42 @@
AND
<![CDATA[ DATE_FORMAT(c.end_time, '%Y-%m-%d') >= DATE_FORMAT(#{date}, '%Y-%m-%d') ]]>
</select>
<!-- 滚动提示接口:投票管理(4天内创建且已上架的数据) -->
<select
id=
"selectVoteManagementForScroll"
resultType=
"com.yizhi.research.application.vo.domain.Research"
>
select distinct
tb.id AS id
,tb.research_no AS researchNo
,tb.name AS name
,tb.start_time AS startTime
,tb.end_time AS endTime
,tb.visible_range AS visibleRange
,tb.content AS content
,tb.state AS state
,tb.deleted AS deleted
,tb.company_id AS companyId
,tb.org_id AS orgId
,tb.site_id AS siteId
,tb.biz_type
,tb.page_mode,
tb.create_time
from research tb
where
-- 状态、站点
tb.state = 1 and tb.deleted = 0 and tb.site_id = #{siteId}
-- 可见范围
and (tb.visible_range = 1
<if
test=
"idsInRange != null and idsInRange.size > 0"
>
or (tb.visible_range = 2 and tb.id in
(
<foreach
collection=
"idsInRange"
separator=
","
item=
"id"
>
#{id}
</foreach>
))
</if>
)
and tb.biz_type = 2
<!-- 4天内创建的数据过滤 -->
and tb.create_time >= DATE_SUB(NOW(), INTERVAL 4 DAY)
order by tb.create_time desc,tb.end_time
</select>
<select
id=
"getResearchTop"
resultType=
"com.yizhi.research.application.vo.domain.ResearchVo"
>
select tb.id,tb.name,tb.image AS logo_img,tb.create_by_name,tb.create_time
from research tb
...
...
cloud-research-service/src/main/java/com/yizhi/research/application/service/IResearchService.java
View file @
2d46e3c0
...
...
@@ -168,4 +168,11 @@ public interface IResearchService extends IService<Research> {
* @return
*/
ResearchVo
getResearchDetails
(
Long
id
);
/**
* 滚动提示接口:投票管理(4天内创建且已上架的数据)
* @param model
* @return
*/
List
<
Research
>
apiVoteManagementForScroll
(
BaseModel
<
PageVo
>
model
);
}
cloud-research-service/src/main/java/com/yizhi/research/application/service/impl/ResearchServiceImpl.java
View file @
2d46e3c0
...
...
@@ -612,6 +612,23 @@ public class ResearchServiceImpl extends ServiceImpl<ResearchMapper, Research> i
page
.
setRecords
(
researchList
);
return
page
;
}
@Override
public
List
<
Research
>
apiVoteManagementForScroll
(
BaseModel
<
PageVo
>
model
)
{
RequestContext
context
=
model
.
getContext
();
Date
now
=
new
Date
();
// 查出指定学员可见的调研id
List
<
Long
>
researchIdsInRange
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
context
.
getRelationIds
()))
{
researchIdsInRange
=
researchAuthorizeMapper
.
getResearchIdsInRange
(
context
.
getRelationIds
());
}
// 调用Mapper中的新方法获取4天内创建的投票管理数据
List
<
Research
>
researchList
=
this
.
baseMapper
.
selectVoteManagementForScroll
(
researchIdsInRange
,
context
.
getSiteId
(),
now
);
return
researchList
;
}
//设置实际参加人数
public
void
selectRealCount
(
List
<
Research
>
list
)
{
...
...
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