Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
E
event
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
陈世强
event
Commits
0efb697b
提交
0efb697b
authored
2月 27, 2025
作者:
zgz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
资讯分页列表(不加标签获取列表数据)
上级
04f9ab67
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
28 行增加
和
6 行删除
+28
-6
InformationController.java
...m/zzsn/event/controller/common/InformationController.java
+1
-2
InformationService.java
src/main/java/com/zzsn/event/service/InformationService.java
+2
-1
InformationServiceImpl.java
...a/com/zzsn/event/service/impl/InformationServiceImpl.java
+25
-3
没有找到文件。
src/main/java/com/zzsn/event/controller/common/InformationController.java
浏览文件 @
0efb697b
...
...
@@ -223,8 +223,7 @@ public class InformationController {
return
Result
.
FAIL
(
"专题id/专题分类id不能为空"
);
}
UserVo
userVo
=
UserUtil
.
getLoginUser
();
List
<
HashMap
>
pageList
=
informationService
.
subjectPageListGroupByLabel
(
userVo
,
searchCondition
);
return
Result
.
OK
(
pageList
);
return
informationService
.
subjectPageListGroupByLabel
(
userVo
,
searchCondition
);
}
/**
...
...
src/main/java/com/zzsn/event/service/InformationService.java
浏览文件 @
0efb697b
...
...
@@ -2,6 +2,7 @@ package com.zzsn.event.service;
import
com.alibaba.fastjson2.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.ClbFileOperationLog
;
import
com.zzsn.event.util.user.UserVo
;
import
com.zzsn.event.vo.*
;
...
...
@@ -40,7 +41,7 @@ public interface InformationService {
/**
* 资讯分页列表(根据标签分类分组)
*/
List
<
HashMap
>
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
subjectInfo
);
Result
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
subjectInfo
);
/**
* 保存数据集-研究中心
...
...
src/main/java/com/zzsn/event/service/impl/InformationServiceImpl.java
浏览文件 @
0efb697b
...
...
@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.zzsn.event.constant.Constants
;
import
com.zzsn.event.constant.Result
;
import
com.zzsn.event.entity.*
;
import
com.zzsn.event.enums.EnumHandlerStatus
;
import
com.zzsn.event.enums.EnumOperateWay
;
...
...
@@ -155,7 +156,7 @@ public class InformationServiceImpl implements InformationService {
@Override
public
List
<
HashMap
>
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
searchCondition
)
{
public
Result
subjectPageListGroupByLabel
(
UserVo
userVo
,
InfoDataSearchCondition
searchCondition
)
{
List
<
HashMap
>
list
=
new
ArrayList
<>();
Integer
category
=
searchCondition
.
getCategory
();
List
<
String
>
subjectIdList
=
new
ArrayList
<>();
...
...
@@ -176,7 +177,7 @@ public class InformationServiceImpl implements InformationService {
}
}
if
(
CollectionUtils
.
isEmpty
(
subjectIdList
))
{
return
list
;
return
Result
.
OK
(
list
)
;
}
try
{
IPage
<
SpecialInformation
>
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
...
...
@@ -202,11 +203,32 @@ public class InformationServiceImpl implements InformationService {
map
.
put
(
"infoList"
,
displayInfos
);
list
.
add
(
map
);
});
}
else
{
//不加标签获取列表数据
searchCondition
.
setLabelMark
(
null
);
specialInformationIPage
=
esService
.
pageListByCondition
(
searchCondition
,
subjectIdList
);
long
totalT
=
specialInformationIPage
.
getTotal
();
if
(
totalT
>
0
)
{
List
<
DisplayInfo
>
dataList
=
new
ArrayList
<>();
List
<
LabelModelVo
>
labelModelVos
=
commonService
.
subjectModelBindLabels
(
subjectIdList
);
Map
<
String
,
List
<
LabelModelVo
>>
modelMap
=
labelModelVos
.
stream
().
collect
(
Collectors
.
groupingBy
(
LabelModelVo:
:
getSubjectId
));
List
<
SpecialInformation
>
records
=
specialInformationIPage
.
getRecords
();
for
(
SpecialInformation
specialInformation
:
records
)
{
DisplayInfo
info
=
new
DisplayInfo
();
BeanUtils
.
copyProperties
(
specialInformation
,
info
);
info
.
setPublishDate
(
EsDateUtil
.
esFieldDateMapping
(
info
.
getPublishDate
()));
//标签处理
List
<
LabelModelVo
>
modelVoList
=
modelMap
.
get
(
info
.
getSubjectId
());
formatLabel
(
modelVoList
,
info
);
dataList
.
add
(
info
);
}
return
Result
.
OK
(
dataList
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
list
;
return
Result
.
OK
(
list
)
;
}
public
Map
<
String
,
List
<
DisplayInfo
>>
groupedByLabelMark
(
List
<
DisplayInfo
>
dataList
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论