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
768ab440
Commit
768ab440
authored
Dec 22, 2020
by
朱亚洁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:[1004039]系列书切换,增加出版社和序号限定
parent
484c2c74
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
19 deletions
+56
-19
BookBizImpl.java
.../main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
+17
-4
SeriesBook.java
...src/main/java/com/pcloud/book/book/entity/SeriesBook.java
+2
-0
ESBookAndAdviserBiz.java
...main/java/com/pcloud/book/es/biz/ESBookAndAdviserBiz.java
+1
-1
ESBookAndAdviserBizImpl.java
.../com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
+22
-8
ESBookAndAdviser.java
...main/java/com/pcloud/book/es/entity/ESBookAndAdviser.java
+4
-1
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+4
-2
SeriesBook.xml
...ervice-book/src/main/resources/mapper/book/SeriesBook.xml
+6
-3
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookBizImpl.java
View file @
768ab440
...
...
@@ -3567,7 +3567,7 @@ public class BookBizImpl implements BookBiz {
List
<
Long
>
adviserIds
=
adviserConsr
.
getByAgentId
(
seriesBook
.
getAgentId
());
Integer
currentPage
=
0
;
Integer
numPerPage
=
50
;
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
currentPage
,
numPerPage
,
adviserIds
,
seriesBook
.
getAgentId
(),
null
,
graLabelId
);
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
currentPage
,
numPerPage
,
adviserIds
,
seriesBook
.
getAgentId
(),
null
,
graLabelId
,
seriesBook
.
getSerialNumber
()
);
List
<
ESBookAndAdviser
>
esBookAndAdvisers
=
esPage
.
getContent
();
if
(
ListUtils
.
isEmpty
(
esBookAndAdvisers
))
{
return
new
ArrayList
<>();
...
...
@@ -3600,28 +3600,41 @@ public class BookBizImpl implements BookBiz {
}
List
<
String
>
keywordList
=
new
ArrayList
<>();
Long
seriesBookId
=
null
;
String
serialNumber
=
null
;
for
(
SeriesBook
seriesBook:
seriesBooks
){
String
[]
keywords
=
seriesBook
.
getSeriesBookKeyword
().
split
(
" "
);
Boolean
hasKeyword
=
true
;
//关键词匹配
for
(
String
keyword:
keywords
){
if
(!
book
.
getBookName
().
contains
(
keyword
)){
hasKeyword
=
false
;
break
;
}
}
//书刊序号匹配
if
(!
StringUtil
.
isEmpty
(
seriesBook
.
getSerialNumber
()))
{
if
(
StringUtil
.
isEmpty
(
book
.
getSerialNumber
())
||
!
book
.
getSerialNumber
().
trim
().
equals
(
seriesBook
.
getSerialNumber
()))
{
hasKeyword
=
false
;
}
}
if
(
hasKeyword
){
isSeriesBook
=
true
;
seriesBookId
=
seriesBook
.
getId
();
keywordList
=
Arrays
.
asList
(
keywords
);
serialNumber
=
seriesBook
.
getSerialNumber
();
break
;
}
}
if
(
isSeriesBook
){
List
<
Long
>
adviserIds
=
adviserConsr
.
getByAgentId
(
agentId
);
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
0
,
50
,
adviserIds
,
agentId
,
null
,
bookAdviserDto
.
getGraLabelId
());
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
0
,
50
,
adviserIds
,
agentId
,
null
,
bookAdviserDto
.
getGraLabelId
()
,
serialNumber
);
List
<
ESBookAndAdviser
>
esBookAndAdvisers
=
esPage
.
getContent
();
List
<
Long
>
subjectLabels
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
esBookAndAdvisers
))
{
subjectLabels
=
esBookAndAdvisers
.
stream
().
filter
(
s
->
s
.
getSubLabelId
()>
0
).
map
(
ESBookAndAdviser:
:
getSubLabelId
).
distinct
().
collect
(
Collectors
.
toList
());
}
//无系列书或只有一本,不展示切换
if
(
ListUtils
.
isEmpty
(
esBookAndAdvisers
)
||
esBookAndAdvisers
.
size
()==
1
)
{
if
(
ListUtils
.
isEmpty
(
esBookAndAdvisers
)
||
esBookAndAdvisers
.
size
()==
1
||
ListUtils
.
isEmpty
(
subjectLabels
)
)
{
isSeriesBook
=
false
;
}
else
{
map
.
put
(
"seriesBookId"
,
seriesBookId
);
...
...
@@ -3646,7 +3659,7 @@ public class BookBizImpl implements BookBiz {
List
<
Long
>
adviserIds
=
adviserConsr
.
getByAgentId
(
seriesBook
.
getAgentId
());
Integer
currentPage
=
0
;
Integer
numPerPage
=
50
;
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
currentPage
,
numPerPage
,
adviserIds
,
seriesBook
.
getAgentId
(),
subLabelId
,
graLabelId
);
Page
<
ESBookAndAdviser
>
esPage
=
esBookAndAdviserBiz
.
getAdviserBooks4SeriesBook
(
keywordList
,
currentPage
,
numPerPage
,
adviserIds
,
seriesBook
.
getAgentId
(),
subLabelId
,
graLabelId
,
seriesBook
.
getSerialNumber
()
);
List
<
ESBookAndAdviser
>
esBookAndAdvisers
=
esPage
.
getContent
();
if
(
ListUtils
.
isEmpty
(
esBookAndAdvisers
))
{
return
new
ArrayList
<>();
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/entity/SeriesBook.java
View file @
768ab440
...
...
@@ -17,6 +17,8 @@ public class SeriesBook extends BaseEntity {
@ApiModelProperty
(
"系列书关键词"
)
private
String
seriesBookKeyword
;
@ApiModelProperty
(
"书刊序号"
)
private
String
serialNumber
;
}
pcloud-service-book/src/main/java/com/pcloud/book/es/biz/ESBookAndAdviserBiz.java
View file @
768ab440
...
...
@@ -37,5 +37,5 @@ public interface ESBookAndAdviserBiz {
* @date:2020/11/23 17:26
* * @param null
*/
Page
<
ESBookAndAdviser
>
getAdviserBooks4SeriesBook
(
List
<
String
>
keywords
,
Integer
currentPage
,
Integer
numPerPage
,
List
<
Long
>
adviserIds
,
Long
agentId
,
Long
subLabelId
,
Long
graLabelId
);
Page
<
ESBookAndAdviser
>
getAdviserBooks4SeriesBook
(
List
<
String
>
keywords
,
Integer
currentPage
,
Integer
numPerPage
,
List
<
Long
>
adviserIds
,
Long
agentId
,
Long
subLabelId
,
Long
graLabelId
,
String
serialNumber
);
}
pcloud-service-book/src/main/java/com/pcloud/book/es/biz/impl/ESBookAndAdviserBizImpl.java
View file @
768ab440
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.es.biz.impl;
import
com.pcloud.analysisengine.browse.dto.BrowseCacheRecordDto
;
import
com.pcloud.book.applet.biz.AppletUserBookcaseBiz
;
import
com.pcloud.book.book.biz.BookBiz
;
import
com.pcloud.book.book.constant.BookConstant
;
import
com.pcloud.book.book.dao.BookDao
;
import
com.pcloud.book.book.dto.ErpBookApprovalDTO
;
...
...
@@ -13,6 +14,7 @@ import com.pcloud.book.es.biz.ESBookAndAdviserBiz;
import
com.pcloud.book.es.entity.ESBookAndAdviser
;
import
com.pcloud.book.es.repository.BookAndAdviserRepository
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.enums.JoinGroupTypeEnum
;
import
com.pcloud.book.rightsSetting.biz.RightsSettingBiz
;
import
com.pcloud.book.rightsSetting.constants.RightsSettingConstant
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
...
...
@@ -79,6 +81,8 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
private
ErpConsr
erpConsr
;
@Autowired
private
RightsSettingBiz
rightsSettingBiz
;
@Autowired
private
BookBiz
bookBiz
;
@ParamLog
(
"导入全部book和bookAdviser"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -179,14 +183,19 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
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
();
Integer
joinGroupType
=
bookAndAdviser
.
getJoinGroupType
();
if
(
null
!=
joinGroupType
&&
JoinGroupTypeEnum
.
XIAORUI
.
getCode
().
equals
(
joinGroupType
)){
Long
adviserId
=
Long
.
valueOf
(
bookAndAdviser
.
getAdviserId
());
Long
bookId
=
Long
.
valueOf
(
bookAndAdviser
.
getBookId
());
Long
channelId
=
Long
.
valueOf
(
bookAndAdviser
.
getChannelId
());
if
(
adviserId
>
0
&&
bookId
>
0
&&
channelId
>
0
){
RightsSettingDto
rightsSettingDto
=
rightsSettingBiz
.
getRightsSettingByBookId4AppletHome
(
bookId
,
adviserId
,
channelId
);
if
(
null
!=
rightsSettingDto
&&
null
!=
rightsSettingDto
.
getId
()){
rightsSettingId
=
rightsSettingDto
.
getId
();
}
else
{
rightsSettingId
=
bookBiz
.
getDefaultRightsSettingId
();
}
}
}
bookAndAdviser
.
setRightsSettingId
(
rightsSettingId
);
...
...
@@ -408,7 +417,7 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
@Override
public
Page
<
ESBookAndAdviser
>
getAdviserBooks4SeriesBook
(
List
<
String
>
keywords
,
Integer
currentPage
,
Integer
numPerPage
,
List
<
Long
>
adviserIds
,
Long
agentId
,
Long
subLabelId
,
Long
graLabelId
)
{
Long
agentId
,
Long
subLabelId
,
Long
graLabelId
,
String
serialNumber
)
{
//k12教育分类校验
List
<
Long
>
templetIds
=
Arrays
.
asList
(
RightsSettingConstant
.
K12_VERSION_ID
);
BoolQueryBuilder
boolQueryBuilder
=
QueryBuilders
.
boolQuery
()
...
...
@@ -423,6 +432,11 @@ public class ESBookAndAdviserBizImpl implements ESBookAndAdviserBiz {
BoolQueryBuilder
should
=
QueryBuilders
.
boolQuery
().
should
(
StringUtil
.
isEmpty
(
keyword
)
?
QueryBuilders
.
boolQuery
()
:
QueryBuilders
.
wildcardQuery
(
"bookName"
,
"*"
+
keyword
+
"*"
));
boolQueryBuilder
.
must
(
should
);
}
//书刊序号
if
(!
StringUtil
.
isEmpty
(
serialNumber
)){
BoolQueryBuilder
should
=
QueryBuilders
.
boolQuery
().
should
(
QueryBuilders
.
termQuery
(
"serialNumber"
,
serialNumber
.
trim
()));
boolQueryBuilder
.
must
(
should
);
}
//编辑书
BoolQueryBuilder
should1
=
QueryBuilders
.
boolQuery
().
should
(
QueryBuilders
.
termQuery
(
"isAdviserBook"
,
1
));
boolQueryBuilder
.
must
(
should1
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/es/entity/ESBookAndAdviser.java
View file @
768ab440
...
...
@@ -165,5 +165,8 @@ public class ESBookAndAdviser {
* 权益id
*/
private
Long
rightsSettingId
;
/**
* 书刊序号
*/
private
String
serialNumber
;
}
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
768ab440
...
...
@@ -2337,7 +2337,8 @@
IF(A.vol_label_id is NULL, 0, A.vol_label_id) volLabelId,
G.id bookGroupId,
G.join_group_type joinGroupType,
IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport
IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport,
b.SERIAL_NUMBER serialNumber
FROM
BOOK B
LEFT JOIN BOOK_ADVISER A ON A.BOOK_ID = B.BOOK_ID and A.IS_MAIN_EDITOR=1
...
...
@@ -2374,7 +2375,8 @@
IF(A.vol_label_id is NULL, 0, A.vol_label_id) volLabelId,
G.id bookGroupId,
G.join_group_type joinGroupType,
IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport
IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport,
b.SERIAL_NUMBER serialNumber
FROM
BOOK B
LEFT JOIN BOOK_ADVISER A ON A.BOOK_ID = B.BOOK_ID and A.IS_MAIN_EDITOR=1
...
...
pcloud-service-book/src/main/resources/mapper/book/SeriesBook.xml
View file @
768ab440
...
...
@@ -7,10 +7,11 @@
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"series_book_keyword"
property=
"seriesBookKeyword"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"serial_number"
property=
"serialNumber"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,agent_id,series_book_keyword,
create_time
id,agent_id,series_book_keyword,
create_time, serial_number
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.book.entity.HotBook"
useGeneratedKeys=
"true"
...
...
@@ -19,12 +20,14 @@
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
agent_id,
series_book_keyword,
create_time
create_time,
serial_number
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{agentId,jdbcType=BIGINT},
#{seriesBookKeyword,jdbcType=INTEGER},
NOW()
NOW(),
#{serialNumber}
</trim>
</insert>
...
...
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