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
c414f2c5
Commit
c414f2c5
authored
Mar 02, 2022
by
guiq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug: [none] 接口优化 fixbug/getBookById
parent
72213187
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+18
-2
CacheConstants.java
...rc/main/java/com/pcloud/book/constant/CacheConstants.java
+10
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
c414f2c5
...
...
@@ -113,6 +113,7 @@ import com.pcloud.book.book.vo.request.BookQualifyInfoVO;
import
com.pcloud.book.book.vo.request.BookSearchParamVO
;
import
com.pcloud.book.book.vo.request.SyncRelateDataToRaysVO
;
import
com.pcloud.book.book.vo.request.UpdateBookRobotProcessDto
;
import
com.pcloud.book.constant.CacheConstants
;
import
com.pcloud.book.consumer.analysisengine.SceneRecordConsr
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.app.AssistTempletConsr
;
...
...
@@ -490,6 +491,9 @@ public class BookBizImpl implements BookBiz {
BookDto
bookDto
=
this
.
getBaseById
(
book
.
getBookId
());
checkIsUpdateCoverImgAndSendTopic
(
bookDto
,
book
.
getCoverImg
());
checkIsUpdateBookNameAndSendTopic
(
bookDto
,
book
.
getBookName
());
String
cacheKey
=
CacheConstants
.
BOOK_TEMPLET_CACHE
+
CacheConstants
.
SEPARATOR
+
bookDto
.
getAdviserId
()
+
CacheConstants
.
SEPARATOR
+
bookDto
.
getChannelId
()
+
CacheConstants
.
SEPARATOR
+
bookDto
.
getBookId
();
JedisClusterUtils
.
del
(
cacheKey
);
bookDao
.
update
(
book
);
//修改版次信息
insertEdition
(
book
.
getLastModifiedUser
(),
book
.
getEdition
(),
book
.
getBookId
());
...
...
@@ -556,6 +560,9 @@ public class BookBizImpl implements BookBiz {
if
(
BookConstant
.
DEFAULT_BOOK_ISBN
.
equals
(
book
.
getIsbn
())
&&
StringUtils
.
isEmpty
(
book
.
getSerialNumber
()))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"默认图书不能修改!"
);
}
String
cacheKey
=
CacheConstants
.
BOOK_TEMPLET_CACHE
+
CacheConstants
.
SEPARATOR
+
book
.
getCreatedUser
()
+
CacheConstants
.
SEPARATOR
+
book
.
getChannelId
()
+
CacheConstants
.
SEPARATOR
+
book
.
getBookId
();
JedisClusterUtils
.
del
(
cacheKey
);
// 修改书籍
bookDao
.
update
(
book
);
esBookAndAdviserBiz
.
updateBookAndAdviserToES
(
Collections
.
singletonList
(
book
.
getBookId
()));
...
...
@@ -1744,11 +1751,20 @@ public class BookBizImpl implements BookBiz {
"获取图书基本信息(编辑 - 运营 - 图书)<START>adviserId="
+
adviserId
+
"channelId="
+
channelId
+
"bookId="
+
bookId
);
BookDto
bookDto
=
this
.
getBaseById
(
bookId
);
if
(
bookDto
!=
null
)
{
String
cacheKey
=
CacheConstants
.
BOOK_TEMPLET_CACHE
+
CacheConstants
.
SEPARATOR
+
adviserId
+
CacheConstants
.
SEPARATOR
+
channelId
+
CacheConstants
.
SEPARATOR
+
bookId
;
BookDto
cacheBookDto
=
JedisClusterUtils
.
getJson
(
cacheKey
,
BookDto
.
class
);
if
(
Objects
.
nonNull
(
cacheBookDto
))
{
bookDto
.
setTempletId
(
cacheBookDto
.
getTempletId
());
bookDto
.
setTempletName
(
cacheBookDto
.
getTempletName
());
cacheBookDto
.
setQrRemark
(
cacheBookDto
.
getQrRemark
());
}
else
{
// 获取图书类型
Long
templetId
=
bookDao
.
getTempletId
(
adviserId
,
channelId
,
bookId
);
bookDto
.
setTempletId
(
templetId
);
bookDto
.
setTempletId
(
bookDao
.
getTempletId
(
adviserId
,
channelId
,
bookId
));
// 设置图书类型名称
bookSet
.
setTemplateName
(
bookDto
);
JedisClusterUtils
.
setJson
(
cacheKey
,
bookDto
,
Math
.
toIntExact
(
TimeUnit
.
HOURS
.
toSeconds
(
2
)));
}
}
return
bookDto
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/constant/CacheConstants.java
0 → 100644
View file @
c414f2c5
package
com
.
pcloud
.
book
.
constant
;
public
class
CacheConstants
{
private
static
final
String
APP_NAME
=
"BOOK"
;
public
static
final
String
SEPARATOR
=
"::"
;
public
static
final
String
BOOK_TEMPLET_CACHE
=
APP_NAME
+
SEPARATOR
+
"BOOK_TEMPLET_CACHE"
+
SEPARATOR
;
}
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