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
7294c520
Commit
7294c520
authored
Mar 18, 2021
by
桂前礼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1004442] 超级作者资源按与书的匹配度排序
parent
963b9d30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+45
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
7294c520
...
...
@@ -5,6 +5,8 @@ package com.pcloud.book.book.biz.impl;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
...
...
@@ -694,6 +696,28 @@ public class BookBizImpl implements BookBiz {
bookDto
.
setUniqueNumber
(
"BK"
+
bookDto
.
getBookId
());
// 设置二维码个数
bookDto
.
setQrcodeCount
(
qrcodeSceneConsr
.
getBookQRCountByMap
(
adviserId
,
channelId
,
bookId
));
// 异步发起书刊推荐超级作者资源计算
BookDto
finalBookDto
=
bookDto
;
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
Map
<
String
,
String
>
params
=
MapUtil
.
of
(
"bookName"
,
Optional
.
ofNullable
(
finalBookDto
.
getBookName
()).
orElse
(
""
));
// 教辅类图书 通过年纪、科目、版本、上下册计算
if
(
Objects
.
equals
(
534L
,
finalBookDto
.
getTempletId
()))
{
Map
<
Long
,
String
>
labelMapByIds
=
bookLabelBiz
.
getLabelMapByIds
(
CollUtil
.
toList
(
finalBookDto
.
getGraLabelId
(),
finalBookDto
.
getSubLabelId
(),
finalBookDto
.
getVerLabelId
(),
finalBookDto
.
getVolLabelId
()));
params
.
put
(
"labelName2"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
finalBookDto
.
getGraLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName1"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
finalBookDto
.
getSubLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName3"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
finalBookDto
.
getVerLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName4"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
finalBookDto
.
getVolLabelId
())).
orElse
(
""
));
}
else
{
// 其他图书通过 专业、深度、目的 计算
params
.
put
(
"labelName1"
,
Optional
.
ofNullable
(
finalBookDto
.
getProLabelName
()).
orElse
(
""
));
params
.
put
(
"labelName2"
,
Optional
.
ofNullable
(
finalBookDto
.
getDepLabelName
()).
orElse
(
""
));
params
.
put
(
"labelName3"
,
Optional
.
ofNullable
(
finalBookDto
.
getPurLabelName
()).
orElse
(
""
));
params
.
put
(
"labelName4"
,
""
);
}
HttpUtil
.
post
(
"http://192.168.83.42:8888/getMatchResourceIds"
,
JSONObject
.
toJSONString
(
params
));
});
return
bookDto
;
}
...
...
@@ -1637,6 +1661,27 @@ public class BookBizImpl implements BookBiz {
bookGroupBiz
.
updateBookGroupRaysClassify
(
book
);
insertEdition
(
book
.
getLastModifiedUser
(),
book
.
getEdition
(),
book
.
getBookId
());
LOGGER
.
info
(
"修改图书基本信息与类型[END]"
);
// 异步发起书刊推荐超级作者资源计算
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
Map
<
String
,
String
>
params
=
MapUtil
.
of
(
"bookName"
,
Optional
.
ofNullable
(
book
.
getBookName
()).
orElse
(
""
));
// 教辅类图书 通过年纪、科目、版本、上下册计算
if
(
Objects
.
equals
(
book
.
getTempletId
(),
534L
))
{
Map
<
Long
,
String
>
labelMapByIds
=
bookLabelBiz
.
getLabelMapByIds
(
CollUtil
.
toList
(
book
.
getGraLabelId
(),
book
.
getSubLabelId
(),
book
.
getVerLabelId
(),
book
.
getVolLabelId
()));
params
.
put
(
"labelName2"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
book
.
getGraLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName1"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
book
.
getSubLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName3"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
book
.
getVerLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName4"
,
Optional
.
ofNullable
(
labelMapByIds
.
get
(
book
.
getVolLabelId
())).
orElse
(
""
));
}
else
{
// 其他图书通过 专业、深度、目的 计算
Map
<
Long
,
String
>
labelName
=
labelConsr
.
getLabelName
(
CollUtil
.
toList
(
book
.
getProLabelId
(),
book
.
getDepLabelId
(),
book
.
getPurLabelId
()));
params
.
put
(
"labelName1"
,
Optional
.
ofNullable
(
labelName
.
get
(
bookDto
.
getProLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName2"
,
Optional
.
ofNullable
(
labelName
.
get
(
bookDto
.
getDepLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName3"
,
Optional
.
ofNullable
(
labelName
.
get
(
bookDto
.
getPurLabelId
())).
orElse
(
""
));
params
.
put
(
"labelName4"
,
""
);
}
HttpUtil
.
post
(
"http://192.168.83.42:8888/getMatchResourceIds"
,
JSONObject
.
toJSONString
(
params
));
});
}
/**
...
...
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