Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1-office-web-sit
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1-office-web-sit
Commits
cef23b7f
Commit
cef23b7f
authored
Dec 13, 2021
by
吴迪
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
31eed3e5
db8c4476
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
6 deletions
+139
-6
NewsController.java
...a/io/office/modules/manage/controller/NewsController.java
+16
-6
NewsDao.java
src/main/java/io/office/modules/manage/dao/NewsDao.java
+1
-0
NewsService.java
...in/java/io/office/modules/manage/service/NewsService.java
+1
-0
NewsServiceImpl.java
...o/office/modules/manage/service/impl/NewsServiceImpl.java
+105
-0
NewsDao.xml
src/main/resources/mapper/manage/NewsDao.xml
+16
-0
No files found.
src/main/java/io/office/modules/manage/controller/NewsController.java
View file @
cef23b7f
...
...
@@ -380,16 +380,26 @@ public class NewsController extends AbstractController {
@Login
@GetMapping
(
"/api/knowledgeinfo/{id}"
)
public
R
getInfo
(
@PathVariable
(
"id"
)
Integer
id
)
{
KnowledgeinfoEntity
retMap
=
this
.
knowledgeinfoService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
retMap
);
}
/**资讯排行TOP10*/
@Login
@GetMapping
(
"/api/newsTop10"
)
KnowledgeinfoEntity
retMap
=
this
.
knowledgeinfoService
.
getById
(
id
);
return
R
.
ok
().
put
(
"data"
,
retMap
);
}
/**资讯排行TOP10*/
@Login
@GetMapping
(
"/api/newsTop10"
)
public
R
newsTop10
()
{
List
<
NewsEntity
>
list
=
this
.
newsService
.
newsTop10
();
return
R
.
ok
().
put
(
"data"
,
list
);
}
/**知识检索分页列表*/
@Login
@PostMapping
(
"/api/searchKnowledgePageList"
)
public
R
searchKnowledgePageList
(
@RequestBody
NewsParams
params
)
{
Page
<
List
<
Map
<
String
,
Object
>>>
page
=
this
.
newsService
.
searchKnowledgePageList
(
params
,
new
Page
(
params
.
getPage
(),
params
.
getLimit
()));
PageUtils
pageUtils
=
new
PageUtils
(
page
);
return
R
.
ok
().
put
(
"data"
,
pageUtils
);
}
}
src/main/java/io/office/modules/manage/dao/NewsDao.java
View file @
cef23b7f
...
...
@@ -74,4 +74,5 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List
<
NewsEntity
>
newsTop10
();
List
<
Map
<
String
,
Object
>>
searchKnowledgeInfoNewList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
map
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/NewsService.java
View file @
cef23b7f
...
...
@@ -73,5 +73,6 @@ public interface NewsService extends IService<NewsEntity> {
List
<
NewsEntity
>
newsTop10
();
Page
<
List
<
Map
<
String
,
Object
>>>
searchKnowledgePageList
(
NewsParams
params
,
Page
page
);
}
src/main/java/io/office/modules/manage/service/impl/NewsServiceImpl.java
View file @
cef23b7f
...
...
@@ -2,6 +2,7 @@ package io.office.modules.manage.service.impl;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.qiniu.util.StringUtils
;
import
io.office.common.utils.R
;
import
io.office.modules.manage.entity.*
;
import
io.office.modules.manage.entity.dto.NewsParams
;
...
...
@@ -10,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -216,6 +218,9 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
@Override
public
List
<
GlossaryEntity
>
glossaryList
(
NewsParams
newsParams
)
{
List
<
GlossaryEntity
>
list
=
this
.
newsDao
.
glossaryList
(
newsParams
);
if
(
"4"
.
equals
(
newsParams
.
getType
())){
list
=
list
.
stream
().
filter
(
item
->
item
.
getTitleEn
().
substring
(
0
,
1
).
equals
(
newsParams
.
getTitle
())).
collect
(
Collectors
.
toList
());
}
return
list
;
}
...
...
@@ -359,6 +364,106 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return
list
;
}
@Override
public
Page
<
List
<
Map
<
String
,
Object
>>>
searchKnowledgePageList
(
NewsParams
newsParams
,
Page
page
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"sptm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"40"
);
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"sptm"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ewtm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"45"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ewtm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"zxcbm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"93"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"zxcbm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"dwbm"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"94"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"dwbm"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"gln"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"95"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"gln"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"epc"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"83"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"rfid"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"77"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"gds"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"85"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"gds"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ecr"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"81"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ecr"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
else
if
(
"ebXML"
.
equals
(
newsParams
.
getType
())){
map
=
new
HashMap
<>();
map
.
put
(
"name"
,
"79"
);
map
.
put
(
"title"
,
newsParams
.
getTitle
());
List
<
String
>
child
=
getChild
(
map
);
map
.
put
(
"list"
,
child
);
map
.
put
(
"typeName"
,
"ebXML"
);
List
<
Map
<
String
,
Object
>>
dataList
=
getDataListNew
(
map
,
page
);
page
.
setRecords
(
dataList
);
}
return
page
;
}
private
List
<
Map
<
String
,
Object
>>
getDataListNew
(
Map
<
String
,
Object
>
map
,
Page
page
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfoNewList
(
map
,
page
);
return
list
;
}
private
List
<
Map
<
String
,
Object
>>
getDataList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
newsDao
.
searchKnowledgeInfo
(
map
);
return
list
;
...
...
src/main/resources/mapper/manage/NewsDao.xml
View file @
cef23b7f
...
...
@@ -478,4 +478,19 @@
ORDER BY
hits DESC
</select>
<select
id=
"searchKnowledgeInfoNewList"
resultType=
"java.util.Map"
>
SELECT
Title,knowledgeInfoID,#{params.typeName} as type
FROM
knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1
<if
test=
"params.title !=null and params.title !=''"
>
and t.Title like concat(concat('%',#{title}),'%')
</if>
and t.knowledgeCategoryID in
<foreach
collection=
"params.list"
index=
"index"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
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