Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
think-tank
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
张京坤
think-tank
Commits
e5e191de
提交
e5e191de
authored
7月 11, 2024
作者:
zgz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
查询优化
上级
48c6c2a1
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
26 行增加
和
5 行删除
+26
-5
LeaderCategoryServiceImpl.java
...zsn/thinktank/service/impl/LeaderCategoryServiceImpl.java
+1
-0
ThinktankBasicInfoServiceImpl.java
...thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
+25
-5
没有找到文件。
src/main/java/com/zzsn/thinktank/service/impl/LeaderCategoryServiceImpl.java
浏览文件 @
e5e191de
...
...
@@ -275,6 +275,7 @@ public class LeaderCategoryServiceImpl extends ServiceImpl<LeaderCategoryMapper,
map
.
put
(
item
.
getId
(),
item
);
}
else
{
existing
.
setThinktankCount
(
existing
.
getThinktankCount
()
+
item
.
getThinktankCount
());
map
.
put
(
item
.
getId
(),
existing
);
}
}
List
<
ThinktankCategoryStructureVo
>
mergedList
=
new
ArrayList
<>(
map
.
values
());
...
...
src/main/java/com/zzsn/thinktank/service/impl/ThinktankBasicInfoServiceImpl.java
浏览文件 @
e5e191de
...
...
@@ -29,11 +29,13 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.net.URLEncoder
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -82,7 +84,9 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Value
(
"${files.storage}"
)
String
filesStorage
;
@Resource
private
SimRedisUtil
simRedisUtil
;
private
final
static
String
KEY
=
"thinkTank:getList"
;
private
static
final
String
IMPORT_TEMP
=
"think-tank-import-temp.xlsx"
;
private
static
final
String
IMPORT_TEMP_NAME
=
"智库信息导入模板.xlsx"
;
...
...
@@ -300,6 +304,15 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
@Override
public
Result
<?>
getList
(
ThinktankBasicInfoListVo
thinktankBasicInfoListVo
)
{
if
(
thinktankBasicInfoListVo
!=
null
&&
StringUtils
.
isNotBlank
(
thinktankBasicInfoListVo
.
getTypeId
())
&&
StringUtils
.
isBlank
(
thinktankBasicInfoListVo
.
getTagId
())){
IPage
cacheObject
=
(
IPage
)
simRedisUtil
.
getCacheObject
(
KEY
+
"_"
+
thinktankBasicInfoListVo
.
getTypeId
()
+
"_"
+
thinktankBasicInfoListVo
.
getColumn
()
+
"_"
+
thinktankBasicInfoListVo
.
getOrder
());
if
(
cacheObject
!=
null
){
return
Result
.
OK
(
cacheObject
);
}
}
IPage
page
=
new
Page
();
thinktankBasicInfoListVo
.
setColumn
(
StringUtil
.
humpToLine
(
thinktankBasicInfoListVo
.
getColumn
()));
...
...
@@ -386,7 +399,11 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
thinktankTagService
.
addTagTop
(
s
);
}
}
if
(
thinktankBasicInfoListVo
!=
null
&&
StringUtils
.
isNotBlank
(
thinktankBasicInfoListVo
.
getTypeId
())
&&
StringUtils
.
isBlank
(
thinktankBasicInfoListVo
.
getTagId
())){
simRedisUtil
.
setCacheObject
(
KEY
+
"_"
+
thinktankBasicInfoListVo
.
getTypeId
()
+
"_"
+
thinktankBasicInfoListVo
.
getColumn
()
+
"_"
+
thinktankBasicInfoListVo
.
getOrder
(),
page
,
10L
,
TimeUnit
.
DAYS
);
}
return
Result
.
OK
(
page
);
}
...
...
@@ -825,25 +842,28 @@ public class ThinktankBasicInfoServiceImpl extends ServiceImpl<ThinktankBasicInf
}
});
}
if
(
regionalCountriesTypeId
!=
null
&&
regionalCountriesTypeId
.
size
()>
0
){
if
(
regionalCountriesTypeId
!=
null
&&
regionalCountriesTypeId
.
size
()>
0
&&
StringUtils
.
isNotBlank
(
regionalCountriesTypeId
.
get
(
0
))
){
for
(
String
id:
regionalCountriesTypeId
){
SysBaseRegion
region
=
sysBaseRegionService
.
getById
(
id
);
if
(
region
!=
null
&&
region
.
getLevelId
()!=
null
&&
region
.
getLevelId
().
equals
(
"country"
)){
regionalCountriesTypeIds
.
add
(
id
);
}
else
if
(
region
!=
null
&&
region
.
getLevelId
()!=
null
&&
region
.
getLevelId
().
equals
(
"continent"
)){
QueryWrapper
<
SysBaseRegion
>
query
=
new
QueryWrapper
<>();
query
.
eq
(
"pid"
,
"id"
);
query
.
eq
(
"pid"
,
id
);
List
<
SysBaseRegion
>
list
=
sysBaseRegionService
.
list
(
query
);
for
(
SysBaseRegion
obj:
list
){
regionalCountriesTypeIds
.
add
(
obj
.
getId
());
}
}
}
}
else
{
//查询国外智库
queryWrapper
.
ne
(
"belong_country_id"
,
"1405761925932109826"
);
//查询非中国智库
}
if
(
regionalCountriesTypeIds
!=
null
&&
regionalCountriesTypeIds
.
size
()>
0
){
queryWrapper
.
and
(
wreapper
->{
for
(
int
i
=
0
;
i
<
regionalCountriesTypeIds
.
size
();
i
++){
wreapper
.
like
(
"belong_country_id"
,
regionalCountriesTypeIds
.
get
(
i
));
wreapper
.
eq
(
"belong_country_id"
,
regionalCountriesTypeIds
.
get
(
i
));
if
(
i
!=
regionalCountriesTypeIds
.
size
()-
1
){
wreapper
.
or
();
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论