Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
aedca692
Commit
aedca692
authored
Jun 13, 2022
by
guiq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [none] 编辑端首页热门应用列表过滤工具型APP
parent
345f928d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+17
-17
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
aedca692
...
...
@@ -6654,25 +6654,25 @@ public class BookGroupBizImpl implements BookGroupBiz {
return
counts
.
stream
().
filter
(
x
->
Objects
.
nonNull
(
x
)
&&
Objects
.
nonNull
(
x
.
getTypeCode
()))
.
collect
(
Collectors
.
toMap
(
AppTypeUseCount:
:
getTypeCode
,
t
->
t
));
});
CompletableFuture
<
Map
<
String
,
Integer
>>
bookCount
=
CompletableFuture
.
supplyAsync
(()
->
{
List
<
HotAppDTO
>
hotAppDTOS
=
Optional
.
ofNullable
(
bookGroupDao
.
listHotApp
()).
orElse
(
new
ArrayList
<>());
return
hotAppDTOS
.
stream
().
filter
(
x
->
Objects
.
nonNull
(
x
)
&&
Objects
.
nonNull
(
x
.
getTypeCode
()))
.
collect
(
Collectors
.
toMap
(
HotAppDTO:
:
getTypeCode
,
HotAppDTO:
:
getCount
));
});
CompletableFuture
<
Map
<
String
,
Integer
>>
bookIncrement
=
CompletableFuture
.
supplyAsync
(()
->
{
List
<
HotAppDTO
>
hotAppDTOS
=
Optional
.
ofNullable
(
bookGroupDao
.
listHotAppIncrement
()).
orElse
(
new
ArrayList
<>());
return
hotAppDTOS
.
stream
().
filter
(
x
->
Objects
.
nonNull
(
x
)
&&
Objects
.
nonNull
(
x
.
getTypeCode
()))
.
collect
(
Collectors
.
toMap
(
HotAppDTO:
:
getTypeCode
,
HotAppDTO:
:
getIncrement
));
});
//
CompletableFuture<Map<String, Integer>> bookCount = CompletableFuture.supplyAsync(() -> {
//
List<HotAppDTO> hotAppDTOS = Optional.ofNullable(bookGroupDao.listHotApp()).orElse(new ArrayList<>());
//
return hotAppDTOS.stream().filter(x -> Objects.nonNull(x) && Objects.nonNull(x.getTypeCode()))
//
.collect(Collectors.toMap(HotAppDTO::getTypeCode, HotAppDTO::getCount));
//
});
//
CompletableFuture<Map<String, Integer>> bookIncrement = CompletableFuture.supplyAsync(() -> {
//
List<HotAppDTO> hotAppDTOS = Optional.ofNullable(bookGroupDao.listHotAppIncrement()).orElse(new ArrayList<>());
//
return hotAppDTOS.stream().filter(x -> Objects.nonNull(x) && Objects.nonNull(x.getTypeCode()))
//
.collect(Collectors.toMap(HotAppDTO::getTypeCode, HotAppDTO::getIncrement));
//
});
CompletableFuture
<
Map
<
String
,
AppTypeDto
>>
appInfo
=
CompletableFuture
.
supplyAsync
(()
->
appConsr
.
listAllCode
());
// 聚合
CompletableFuture
<
Void
>
completableFuture
=
CompletableFuture
.
allOf
(
channel
,
bookCount
,
bookIncrement
,
appInfo
);
CompletableFuture
<
Void
>
completableFuture
=
CompletableFuture
.
allOf
(
channel
,
/*bookCount, bookIncrement,*/
appInfo
);
try
{
completableFuture
.
get
();
Map
<
String
,
AppTypeUseCount
>
channelMap
=
Optional
.
ofNullable
(
channel
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
String
,
Integer
>
bookCountMap
=
Optional
.
ofNullable
(
bookCount
.
get
()).
orElse
(
new
HashMap
<>());
Map
<
String
,
Integer
>
bookIncrementMap
=
Optional
.
ofNullable
(
bookIncrement
.
get
()).
orElse
(
new
HashMap
<>());
//
Map<String, Integer> bookCountMap = Optional.ofNullable(bookCount.get()).orElse(new HashMap<>());
//
Map<String, Integer> bookIncrementMap = Optional.ofNullable(bookIncrement.get()).orElse(new HashMap<>());
Map
<
String
,
AppTypeDto
>
appInfoMap
=
Optional
.
ofNullable
(
appInfo
.
get
()).
orElse
(
new
HashMap
<>());
List
<
HotAppDTO
>
hotAppDTOS
=
new
ArrayList
<>();
...
...
@@ -6684,15 +6684,15 @@ public class BookGroupBizImpl implements BookGroupBiz {
hotAppDTO
.
setTypeName
(
Optional
.
ofNullable
(
appInfoMap
.
get
(
key
)).
map
(
AppTypeDto:
:
getTypeName
).
orElse
(
""
));
hotAppDTO
.
setTypeCode
(
key
);
hotAppDTO
.
setCount
(
Optional
.
ofNullable
(
channelMap
.
get
(
key
)).
map
(
AppTypeUseCount:
:
getCount
).
orElse
(
0
)
+
Optional
.
ofNullable
(
bookCountMap
.
get
(
key
)).
orElse
(
0
)
Optional
.
ofNullable
(
channelMap
.
get
(
key
)).
map
(
AppTypeUseCount:
:
getCount
).
orElse
(
0
)
// +
Optional.ofNullable(bookCountMap.get(key)).orElse(0)
);
if
(
hasOldData
){
hotAppDTO
.
setIncrement
(
hotAppDTO
.
getCount
()
-
Optional
.
ofNullable
(
oldMap
.
get
(
key
)).
orElse
(
0
));
}
else
{
hotAppDTO
.
setIncrement
(
Optional
.
ofNullable
(
channelMap
.
get
(
key
)).
map
(
AppTypeUseCount:
:
getIncrement
).
orElse
(
0
)
+
Optional
.
ofNullable
(
bookIncrementMap
.
get
(
key
)).
orElse
(
0
)
Optional
.
ofNullable
(
channelMap
.
get
(
key
)).
map
(
AppTypeUseCount:
:
getIncrement
).
orElse
(
0
)
// +
Optional.ofNullable(bookIncrementMap.get(key)).orElse(0)
);
}
...
...
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