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
d80d8a74
Commit
d80d8a74
authored
Sep 28, 2020
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[none]接口优化getBookLabels
parent
ffc593a3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
6 deletions
+21
-6
BookConstant.java
...main/java/com/pcloud/book/book/constant/BookConstant.java
+6
-0
AnswerSubscribeBizImpl.java
...m/pcloud/book/applet/biz/impl/AnswerSubscribeBizImpl.java
+1
-1
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+7
-1
BookLabelBizImpl.java
.../java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
+7
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/constant/BookConstant.java
View file @
d80d8a74
...
@@ -384,4 +384,10 @@ public class BookConstant {
...
@@ -384,4 +384,10 @@ public class BookConstant {
public
static
final
String
BOOK_CITY_MAP
=
CacheConstant
.
BOOK
+
"BOOK_CITY_MAP"
;
public
static
final
String
BOOK_CITY_MAP
=
CacheConstant
.
BOOK
+
"BOOK_CITY_MAP"
;
public
static
final
Integer
DEFAULT_DAY_TIMEOUT
=
24
*
60
*
60
;
public
static
final
Integer
DEFAULT_DAY_TIMEOUT
=
24
*
60
*
60
;
/**
* 书刊标签缓存
*/
public
static
final
String
BOOK_LABEL_CACHE
=
CacheConstant
.
BOOK
+
"BOOK_LABEL"
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/biz/impl/AnswerSubscribeBizImpl.java
View file @
d80d8a74
...
@@ -104,7 +104,7 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
...
@@ -104,7 +104,7 @@ public class AnswerSubscribeBizImpl implements AnswerSubscribeBiz {
if
(
ListUtils
.
isEmpty
(
answerList
))
{
if
(
ListUtils
.
isEmpty
(
answerList
))
{
if
(
"pro"
.
equals
(
BookProps
.
getSystemEnv
())
&&
AppletConstants
.
NO_ANSWER_BOOK
.
contains
(
bookId
))
{
if
(
"pro"
.
equals
(
BookProps
.
getSystemEnv
())
&&
AppletConstants
.
NO_ANSWER_BOOK
.
contains
(
bookId
))
{
hasAnswer
=
false
;
hasAnswer
=
false
;
}
else
{
}
else
if
(!
"pro"
.
equals
(
BookProps
.
getSystemEnv
()))
{
hasAnswer
=
false
;
hasAnswer
=
false
;
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
d80d8a74
...
@@ -1967,7 +1967,13 @@ public class BookBizImpl implements BookBiz {
...
@@ -1967,7 +1967,13 @@ public class BookBizImpl implements BookBiz {
@Override
@Override
public
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
(
Long
partyId
)
{
public
Map
<
Integer
,
List
<
BookLabel
>>
getBookLabels
(
Long
partyId
)
{
Map
<
Integer
,
List
<
BookLabel
>>
map
=
new
HashMap
<>();
Map
<
Integer
,
List
<
BookLabel
>>
map
=
new
HashMap
<>();
List
<
BookLabel
>
bookLabels
=
bookLabelDao
.
getAll
(
partyId
);
String
key
=
BookConstant
.
BOOK_LABEL_CACHE
;
List
<
BookLabel
>
bookLabels
=
JedisClusterUtils
.
hgetJson2List
(
key
,
partyId
.
toString
(),
BookLabel
.
class
);
if
(
ListUtils
.
isEmpty
(
bookLabels
)){
bookLabels
=
bookLabelDao
.
getAll
(
partyId
);
JedisClusterUtils
.
hset2Json
(
key
,
partyId
.
toString
(),
bookLabels
);
JedisClusterUtils
.
expire
(
key
,
24
*
3600
);
}
if
(!
ListUtils
.
isEmpty
(
bookLabels
))
{
if
(!
ListUtils
.
isEmpty
(
bookLabels
))
{
map
=
bookLabels
.
stream
().
collect
(
Collectors
.
groupingBy
(
BookLabel:
:
getType
));
map
=
bookLabels
.
stream
().
collect
(
Collectors
.
groupingBy
(
BookLabel:
:
getType
));
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookLabelBizImpl.java
View file @
d80d8a74
...
@@ -2,6 +2,7 @@ package com.pcloud.book.book.biz.impl;
...
@@ -2,6 +2,7 @@ package com.pcloud.book.book.biz.impl;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.biz.BookLabelBiz
;
import
com.pcloud.book.book.constant.BookConstant
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.dao.BookLabelDao
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.book.entity.BookLabel
;
import
com.pcloud.book.book.enums.BookLabelAuditState
;
import
com.pcloud.book.book.enums.BookLabelAuditState
;
...
@@ -11,6 +12,7 @@ import com.pcloud.common.core.constant.SystemCode;
...
@@ -11,6 +12,7 @@ import com.pcloud.common.core.constant.SystemCode;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
...
@@ -45,17 +47,15 @@ public class BookLabelBizImpl implements BookLabelBiz {
...
@@ -45,17 +47,15 @@ public class BookLabelBizImpl implements BookLabelBiz {
bookLabel
.
setAuditState
(
BookLabelAuditState
.
pass
.
code
);
bookLabel
.
setAuditState
(
BookLabelAuditState
.
pass
.
code
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabelDao
.
insert
(
bookLabel
);
bookLabelDao
.
insert
(
bookLabel
);
return
;
}
else
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
systemCode
)){
//编辑端要审核
}
if
(
SystemCode
.
adviser
.
code
.
equalsIgnoreCase
(
systemCode
)){
//编辑端要审核
if
(
StringUtil
.
isEmpty
(
bookLabel
.
getRemark
())){
if
(
StringUtil
.
isEmpty
(
bookLabel
.
getRemark
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少标签申请说明"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"缺少标签申请说明"
);
}
}
bookLabel
.
setAuditState
(
BookLabelAuditState
.
wait
.
code
);
bookLabel
.
setAuditState
(
BookLabelAuditState
.
wait
.
code
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabel
.
setSeq
(
seq
+
1
);
bookLabelDao
.
insert
(
bookLabel
);
bookLabelDao
.
insert
(
bookLabel
);
return
;
}
}
JedisClusterUtils
.
del
(
BookConstant
.
BOOK_LABEL_CACHE
);
}
}
@Override
@Override
...
@@ -82,11 +82,13 @@ public class BookLabelBizImpl implements BookLabelBiz {
...
@@ -82,11 +82,13 @@ public class BookLabelBizImpl implements BookLabelBiz {
updateLabel
.
setUpdateLabelId
(
labelId
);
updateLabel
.
setUpdateLabelId
(
labelId
);
}
}
bookLabelDao
.
update
(
updateLabel
);
bookLabelDao
.
update
(
updateLabel
);
JedisClusterUtils
.
del
(
BookConstant
.
BOOK_LABEL_CACHE
);
}
}
@Override
@Override
public
void
deleteById
(
Long
labelId
)
{
public
void
deleteById
(
Long
labelId
)
{
bookLabelDao
.
deleteById
(
labelId
);
bookLabelDao
.
deleteById
(
labelId
);
JedisClusterUtils
.
del
(
BookConstant
.
BOOK_LABEL_CACHE
);
}
}
@Override
@Override
...
@@ -95,6 +97,7 @@ public class BookLabelBizImpl implements BookLabelBiz {
...
@@ -95,6 +97,7 @@ public class BookLabelBizImpl implements BookLabelBiz {
updateLabel
.
setId
(
labelId
);
updateLabel
.
setId
(
labelId
);
updateLabel
.
setSeq
(
seq
);
updateLabel
.
setSeq
(
seq
);
bookLabelDao
.
update
(
updateLabel
);
bookLabelDao
.
update
(
updateLabel
);
JedisClusterUtils
.
del
(
BookConstant
.
BOOK_LABEL_CACHE
);
}
}
@Override
@Override
...
...
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