Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fill-system
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
fill-system
Commits
bc92650f
Commit
bc92650f
authored
Dec 08, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改热门词汇
parent
d1728327
Pipeline
#2411
canceled with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
fill-manager/src/main/java/com/mortals/xhx/module/baseset/service/impl/BasesetServiceImpl.java
...s/xhx/module/baseset/service/impl/BasesetServiceImpl.java
+16
-1
No files found.
fill-manager/src/main/java/com/mortals/xhx/module/baseset/service/impl/BasesetServiceImpl.java
View file @
bc92650f
...
@@ -4,6 +4,7 @@ import com.mortals.framework.model.PageInfo;
...
@@ -4,6 +4,7 @@ import com.mortals.framework.model.PageInfo;
import
com.mortals.xhx.module.hotword.model.HotwordEntity
;
import
com.mortals.xhx.module.hotword.model.HotwordEntity
;
import
com.mortals.xhx.module.hotword.model.HotwordQuery
;
import
com.mortals.xhx.module.hotword.model.HotwordQuery
;
import
com.mortals.xhx.module.hotword.service.HotwordService
;
import
com.mortals.xhx.module.hotword.service.HotwordService
;
import
com.mortals.xhx.module.matter.model.MatterEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
...
@@ -16,6 +17,8 @@ import org.springframework.util.ObjectUtils;
...
@@ -16,6 +17,8 @@ import org.springframework.util.ObjectUtils;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
/**
/**
* BasesetService
* BasesetService
...
@@ -43,7 +46,13 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base
...
@@ -43,7 +46,13 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base
@Override
@Override
protected
void
saveAfter
(
BasesetEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
BasesetEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getHotwordList
())){
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getHotwordList
())){
//更新新增热门词汇
//更新新增热门词汇,差集删除不在列表中的
List
<
HotwordEntity
>
allHotWords
=
hotwordService
.
find
(
new
HotwordQuery
().
siteId
(
entity
.
getSiteId
()));
//求差集 删除
List
<
HotwordEntity
>
delList
=
this
.
subList
(
allHotWords
,
entity
.
getHotwordList
());
if
(!
ObjectUtils
.
isEmpty
(
delList
)){
hotwordService
.
removeList
(
delList
,
context
);
}
entity
.
getHotwordList
().
forEach
(
item
->
{
entity
.
getHotwordList
().
forEach
(
item
->
{
HotwordEntity
hotwordEntity
=
hotwordService
.
selectOne
(
new
HotwordQuery
().
siteId
(
item
.
getSiteId
()).
hotwords
(
item
.
getHotwords
()));
HotwordEntity
hotwordEntity
=
hotwordService
.
selectOne
(
new
HotwordQuery
().
siteId
(
item
.
getSiteId
()).
hotwords
(
item
.
getHotwords
()));
if
(!
ObjectUtils
.
isEmpty
(
hotwordEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
hotwordEntity
))
{
...
@@ -63,4 +72,10 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base
...
@@ -63,4 +72,10 @@ public class BasesetServiceImpl extends AbstractCRUDServiceImpl<BasesetDao, Base
super
.
saveAfter
(
entity
,
context
);
super
.
saveAfter
(
entity
,
context
);
}
}
public
List
<
HotwordEntity
>
subList
(
List
<
HotwordEntity
>
firstList
,
List
<
HotwordEntity
>
secondList
)
{
Set
<
String
>
secondSet
=
secondList
.
parallelStream
().
map
(
e
->
e
.
getHotwords
()).
collect
(
Collectors
.
toSet
());
return
firstList
.
parallelStream
().
filter
(
item
->
!
secondSet
.
contains
(
item
.
getHotwords
())).
collect
(
Collectors
.
toList
());
}
}
}
\ 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