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
5bce4622
Commit
5bce4622
authored
Dec 17, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug/1026859' into 'master'
bug: [1026859] 系列书只有一本不展示 See merge request rays/pcloud-book!1112
parents
2d52f788
8a429f83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
5 deletions
+56
-5
BookDto.java
...-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
+13
-0
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+16
-3
ESBookAndAdviserBizImpl.java
.../com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
+22
-2
ESBookAndAdviser.java
...main/java/com/pcloud/book/es/entity/ESBookAndAdviser.java
+5
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
View file @
5bce4622
...
@@ -757,6 +757,18 @@ public class BookDto extends BaseDto {
...
@@ -757,6 +757,18 @@ public class BookDto extends BaseDto {
* 小睿码自定义跳转链接
* 小睿码自定义跳转链接
*/
*/
private
String
jumpUrl
;
private
String
jumpUrl
;
/**
* 权益id
*/
private
Long
rightsSettingId
;
public
Long
getRightsSettingId
()
{
return
rightsSettingId
;
}
public
void
setRightsSettingId
(
Long
rightsSettingId
)
{
this
.
rightsSettingId
=
rightsSettingId
;
}
public
Integer
getJumpType
()
{
public
Integer
getJumpType
()
{
return
jumpType
;
return
jumpType
;
...
@@ -2282,6 +2294,7 @@ public class BookDto extends BaseDto {
...
@@ -2282,6 +2294,7 @@ public class BookDto extends BaseDto {
", edition='"
+
edition
+
'\''
+
", edition='"
+
edition
+
'\''
+
", jumpType="
+
jumpType
+
", jumpType="
+
jumpType
+
", jumpUrl='"
+
jumpUrl
+
'\''
+
", jumpUrl='"
+
jumpUrl
+
'\''
+
", rightsSettingId="
+
rightsSettingId
+
", bookAdviserDto="
+
bookAdviserDto
+
", bookAdviserDto="
+
bookAdviserDto
+
'}'
;
'}'
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
5bce4622
...
@@ -2247,6 +2247,7 @@ public class BookBizImpl implements BookBiz {
...
@@ -2247,6 +2247,7 @@ public class BookBizImpl implements BookBiz {
bookDto
.
setSubLabelId
(
esBookAndAdviser
.
getSubLabelId
());
bookDto
.
setSubLabelId
(
esBookAndAdviser
.
getSubLabelId
());
bookDto
.
setAreaLabelId
(
esBookAndAdviser
.
getAreaLabelId
());
bookDto
.
setAreaLabelId
(
esBookAndAdviser
.
getAreaLabelId
());
bookDto
.
setVerLabelId
(
esBookAndAdviser
.
getVerLabelId
());
bookDto
.
setVerLabelId
(
esBookAndAdviser
.
getVerLabelId
());
bookDto
.
setRightsSettingId
(
esBookAndAdviser
.
getRightsSettingId
());
bookDtos
.
add
(
bookDto
);
bookDtos
.
add
(
bookDto
);
}
}
return
bookDtos
;
return
bookDtos
;
...
@@ -3597,6 +3598,8 @@ public class BookBizImpl implements BookBiz {
...
@@ -3597,6 +3598,8 @@ public class BookBizImpl implements BookBiz {
if
(
ListUtils
.
isEmpty
(
seriesBooks
))
{
if
(
ListUtils
.
isEmpty
(
seriesBooks
))
{
return
map
;
return
map
;
}
}
List
<
String
>
keywordList
=
new
ArrayList
<>();
Long
seriesBookId
=
null
;
for
(
SeriesBook
seriesBook:
seriesBooks
){
for
(
SeriesBook
seriesBook:
seriesBooks
){
String
[]
keywords
=
seriesBook
.
getSeriesBookKeyword
().
split
(
" "
);
String
[]
keywords
=
seriesBook
.
getSeriesBookKeyword
().
split
(
" "
);
Boolean
hasKeyword
=
true
;
Boolean
hasKeyword
=
true
;
...
@@ -3608,13 +3611,23 @@ public class BookBizImpl implements BookBiz {
...
@@ -3608,13 +3611,23 @@ public class BookBizImpl implements BookBiz {
}
}
if
(
hasKeyword
){
if
(
hasKeyword
){
isSeriesBook
=
true
;
isSeriesBook
=
true
;
map
.
put
(
"seriesBookId"
,
seriesBook
.
getId
());
seriesBookId
=
seriesBook
.
getId
();
keywordList
=
Arrays
.
asList
(
keywords
);
break
;
break
;
}
}
}
}
if
(
isSeriesBook
){
if
(
isSeriesBook
){
map
.
put
(
"subLabelId"
,
bookAdviserDto
.
getSubLabelId
());
List
<
Long
>
adviserIds
=
adviserConsr
.
getByAgentId
(
agentId
);
map
.
put
(
"graLabelId"
,
bookAdviserDto
.
getGraLabelId
());
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
0
,
50
,
adviserIds
,
agentId
,
null
,
bookAdviserDto
.
getGraLabelId
());
List
<
ESBookAndAdviser
>
esBookAndAdvisers
=
esPage
.
getContent
();
//无系列书或只有一本,不展示切换
if
(
ListUtils
.
isEmpty
(
esBookAndAdvisers
)
||
esBookAndAdvisers
.
size
()==
1
)
{
isSeriesBook
=
false
;
}
else
{
map
.
put
(
"seriesBookId"
,
seriesBookId
);
map
.
put
(
"subLabelId"
,
bookAdviserDto
.
getSubLabelId
());
map
.
put
(
"graLabelId"
,
bookAdviserDto
.
getGraLabelId
());
}
}
}
map
.
put
(
"isSeriesBook"
,
isSeriesBook
);
map
.
put
(
"isSeriesBook"
,
isSeriesBook
);
return
map
;
return
map
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
View file @
5bce4622
...
@@ -13,7 +13,9 @@ import com.pcloud.book.es.biz.ESBookAndAdviserBiz;
...
@@ -13,7 +13,9 @@ import com.pcloud.book.es.biz.ESBookAndAdviserBiz;
import
com.pcloud.book.es.entity.ESBookAndAdviser
;
import
com.pcloud.book.es.entity.ESBookAndAdviser
;
import
com.pcloud.book.es.repository.BookAndAdviserRepository
;
import
com.pcloud.book.es.repository.BookAndAdviserRepository
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.YesOrNoEnums
;
import
com.pcloud.book.util.common.YesOrNoEnums
;
import
com.pcloud.book.util.properties.BookProps
;
import
com.pcloud.book.util.properties.BookProps
;
...
@@ -75,6 +77,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
...
@@ -75,6 +77,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
private
TradeConsr
tradeConsr
;
private
TradeConsr
tradeConsr
;
@Autowired
@Autowired
private
ErpConsr
erpConsr
;
private
ErpConsr
erpConsr
;
@Autowired
private
RightsSettingBiz
rightsSettingBiz
;
@ParamLog
(
"导入全部book和bookAdviser"
)
@ParamLog
(
"导入全部book和bookAdviser"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -174,6 +178,18 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
...
@@ -174,6 +178,18 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
if
(!
MapUtils
.
isEmpty
(
erpBookApprovalMap
)
&&
erpBookApprovalMap
.
containsKey
(
key
)){
if
(!
MapUtils
.
isEmpty
(
erpBookApprovalMap
)
&&
erpBookApprovalMap
.
containsKey
(
key
)){
bookAndAdviser
.
setIsApproval
(
erpBookApprovalMap
.
get
(
key
).
getIsApproval
());
bookAndAdviser
.
setIsApproval
(
erpBookApprovalMap
.
get
(
key
).
getIsApproval
());
}
}
//权益
Long
adviserId
=
Long
.
valueOf
(
bookAndAdviser
.
getAdviserId
());
Long
bookId
=
Long
.
valueOf
(
bookAndAdviser
.
getBookId
());
Long
channelId
=
Long
.
valueOf
(
bookAndAdviser
.
getChannelId
());
Long
rightsSettingId
=
0L
;
if
(
adviserId
>
0
&&
bookId
>
0
&&
channelId
>
0
){
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getRightsSettingByBookId4AppletHome
(
bookId
,
adviserId
,
channelId
);
if
(
null
!=
rightsSettingDto
&&
null
!=
rightsSettingDto
.
getId
()){
rightsSettingId
=
rightsSettingDto
.
getId
();
}
}
bookAndAdviser
.
setRightsSettingId
(
rightsSettingId
);
}
}
}
}
...
@@ -402,13 +418,17 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
...
@@ -402,13 +418,17 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
.
filter
(
null
==
subLabelId
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termQuery
(
"subLabelId"
,
subLabelId
))
.
filter
(
null
==
subLabelId
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termQuery
(
"subLabelId"
,
subLabelId
))
.
filter
(
null
==
graLabelId
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termQuery
(
"graLabelId"
,
graLabelId
))
.
filter
(
null
==
graLabelId
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termQuery
(
"graLabelId"
,
graLabelId
))
.
filter
(
ListUtils
.
isEmpty
(
templetIds
)
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termsQuery
(
"templetId"
,
templetIds
));
.
filter
(
ListUtils
.
isEmpty
(
templetIds
)
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
termsQuery
(
"templetId"
,
templetIds
));
//关键词
for
(
String
keyword:
keywords
){
for
(
String
keyword:
keywords
){
BoolQueryBuilder
should
=
QueryBuilders
.
boolQuery
().
should
(
StringUtil
.
isEmpty
(
keyword
)
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
wildcardQuery
(
"bookName"
,
"*"
+
keyword
+
"*"
));
BoolQueryBuilder
should
=
QueryBuilders
.
boolQuery
().
should
(
StringUtil
.
isEmpty
(
keyword
)
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
wildcardQuery
(
"bookName"
,
"*"
+
keyword
+
"*"
));
boolQueryBuilder
.
must
(
should
);
boolQueryBuilder
.
must
(
should
);
}
}
BoolQueryBuilder
should1
=
QueryBuilders
.
boolQuery
()
//编辑书
.
should
(
QueryBuilders
.
termQuery
(
"isAdviserBook"
,
1
));
BoolQueryBuilder
should1
=
QueryBuilders
.
boolQuery
()
.
should
(
QueryBuilders
.
termQuery
(
"isAdviserBook"
,
1
));
boolQueryBuilder
.
must
(
should1
);
boolQueryBuilder
.
must
(
should1
);
//权益
BoolQueryBuilder
should2
=
QueryBuilders
.
boolQuery
().
mustNot
(
QueryBuilders
.
termQuery
(
"rightsSettingId"
,
0
));
boolQueryBuilder
.
must
(
should2
);
Sort
sort
=
new
Sort
(
Sort
.
Direction
.
DESC
,
"lastModifiedDate"
,
"bookId"
);
Sort
sort
=
new
Sort
(
Sort
.
Direction
.
DESC
,
"lastModifiedDate"
,
"bookId"
);
PageRequest
pageRequest
=
new
PageRequest
(
currentPage
,
numPerPage
,
sort
);
PageRequest
pageRequest
=
new
PageRequest
(
currentPage
,
numPerPage
,
sort
);
Page
<
ESBookAndAdviser
>
search
=
bookAndAdviserRepository
.
search
(
boolQueryBuilder
,
pageRequest
);
Page
<
ESBookAndAdviser
>
search
=
bookAndAdviserRepository
.
search
(
boolQueryBuilder
,
pageRequest
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/es/entity/ESBookAndAdviser.java
View file @
5bce4622
...
@@ -161,4 +161,9 @@ public class ESBookAndAdviser {
...
@@ -161,4 +161,9 @@ public class ESBookAndAdviser {
* 是否已立项
* 是否已立项
*/
*/
private
Integer
isApproval
;
private
Integer
isApproval
;
/**
* 权益id
*/
private
Long
rightsSettingId
;
}
}
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