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
7e0f5444
Commit
7e0f5444
authored
May 23, 2022
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotfix: [1007236] erpBook慢sql优化
parent
48c3accd
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
228 additions
and
22 deletions
+228
-22
BookAdviserBiz.java
...rc/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
+12
-0
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+201
-21
BookAdviserFacadeImpl.java
...m/pcloud/book/book/facade/impl/BookAdviserFacadeImpl.java
+1
-1
BookElasticSearchConsr.java
...k/consumer/book/elasticsearch/BookElasticSearchConsr.java
+14
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
View file @
7e0f5444
...
@@ -509,4 +509,16 @@ public interface BookAdviserBiz {
...
@@ -509,4 +509,16 @@ public interface BookAdviserBiz {
Integer
getBookIsOpenCatalog
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
Integer
getBookIsOpenCatalog
(
Long
bookId
,
Long
channelId
,
Long
adviserId
);
void
updateOpenRaysCode
(
BookAdviser
bookAdviser
);
void
updateOpenRaysCode
(
BookAdviser
bookAdviser
);
/**
* 从es中查询rays书刊信息
* @param isbn
* @param uniqueNumber
* @param adviserName
* @param agentId
* @param currentPage
* @param numPerPage
* @return
*/
PageBeanNew
<
ErpAdviserBookVO
>
listAdviserBook4Erp4ES
(
String
isbn
,
String
uniqueNumber
,
String
adviserName
,
Long
agentId
,
Integer
currentPage
,
Integer
numPerPage
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
7e0f5444
...
@@ -29,6 +29,7 @@ import com.pcloud.book.book.vo.request.RelateRaysBookApprovalVO;
...
@@ -29,6 +29,7 @@ import com.pcloud.book.book.vo.request.RelateRaysBookApprovalVO;
import
com.pcloud.book.book.vo.request.UpdateBookRobotProcessDto
;
import
com.pcloud.book.book.vo.request.UpdateBookRobotProcessDto
;
import
com.pcloud.book.consumer.analysisengine.BrowseRecordConsr
;
import
com.pcloud.book.consumer.analysisengine.BrowseRecordConsr
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.app.AppConsr
;
import
com.pcloud.book.consumer.book.elasticsearch.BookElasticSearchConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.channel.QrcodeSceneConsr
;
import
com.pcloud.book.consumer.common.ExportConsr
;
import
com.pcloud.book.consumer.common.ExportConsr
;
import
com.pcloud.book.consumer.data.DataConsr
;
import
com.pcloud.book.consumer.data.DataConsr
;
...
@@ -47,6 +48,9 @@ import com.pcloud.book.consumer.user.BookcaseConsr;
...
@@ -47,6 +48,9 @@ import com.pcloud.book.consumer.user.BookcaseConsr;
import
com.pcloud.book.consumer.user.ChannelConsr
;
import
com.pcloud.book.consumer.user.ChannelConsr
;
import
com.pcloud.book.consumer.user.OperationConsr
;
import
com.pcloud.book.consumer.user.OperationConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.BookSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.PlatformSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.entity.Es7Book
;
import
com.pcloud.book.es.biz.ESBookAndAdviserBiz
;
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.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
...
@@ -70,6 +74,7 @@ import com.pcloud.book.rightsSetting.dto.RightsSettingQueryDTO;
...
@@ -70,6 +74,7 @@ import com.pcloud.book.rightsSetting.dto.RightsSettingQueryDTO;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSetting
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingNow
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingNow
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingTitle
;
import
com.pcloud.book.rightsSetting.entity.RightsSettingTitle
;
import
com.pcloud.book.util.common.Converter
;
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.channelcenter.base.constants.MessageFromTypeEnum
;
import
com.pcloud.channelcenter.base.constants.MessageFromTypeEnum
;
...
@@ -106,10 +111,12 @@ import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
...
@@ -106,10 +111,12 @@ import com.pcloud.readercenter.userlabel.dto.UserGradeLabelIdDTO;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductLabelDto
;
import
com.pcloud.resourcecenter.product.dto.ProductLabelDto
;
import
com.pcloud.resourcecenter.product.dto.ProductTypeDto
;
import
com.pcloud.resourcecenter.product.dto.ProductTypeDto
;
import
com.pcloud.universe.commons.paging.Pagination
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.pcloud.usercenter.user.entity.UserLogin
;
import
com.pcloud.usercenter.user.entity.UserLogin
;
import
com.pcloud.wechatgroup.group.dto.GroupScanUserStatsDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupScanUserStatsDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserCountDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserCountDTO
;
import
com.sun.org.apache.bcel.internal.generic.NEW
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -232,6 +239,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -232,6 +239,8 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
private
DataConsr
dataConsr
;
private
DataConsr
dataConsr
;
@Autowired
@Autowired
private
OperationConsr
operationConsr
;
private
OperationConsr
operationConsr
;
@Autowired
private
BookElasticSearchConsr
bookElasticSearchConsr
;
@Override
@Override
public
List
<
BookDto
>
listByAdviserId
(
Long
adviserId
)
{
public
List
<
BookDto
>
listByAdviserId
(
Long
adviserId
)
{
...
@@ -2585,29 +2594,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -2585,29 +2594,11 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if
(
StringUtils
.
isBlank
(
isbn
)
&&
StringUtils
.
isBlank
(
uniqueNumber
)
&&
StringUtils
.
isBlank
(
adviserName
)
&&
!
NumberUtil
.
isNumber
(
agentId
)){
if
(
StringUtils
.
isBlank
(
isbn
)
&&
StringUtils
.
isBlank
(
uniqueNumber
)
&&
StringUtils
.
isBlank
(
adviserName
)
&&
!
NumberUtil
.
isNumber
(
agentId
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请筛选后再下载!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"请筛选后再下载!"
);
}
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
PageBeanNew
<
ErpAdviserBookVO
>
pageBeanNew
=
this
.
listAdviserBook4Erp4ES
(
isbn
,
uniqueNumber
,
adviserName
,
agentId
,
0
,
10000
);
paramMap
.
put
(
"isbn"
,
isbn
);
if
(
null
==
pageBeanNew
||
CollUtil
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
paramMap
.
put
(
"uniqueNumber"
,
uniqueNumber
);
if
(!
StringUtil
.
isEmpty
(
adviserName
))
{
List
<
Long
>
adviserIds
=
adviserConsr
.
getAdviserIdsByName
(
adviserName
);
if
(
CollectionUtils
.
isEmpty
(
adviserIds
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前列表为空,请重新筛选再下载!"
);
}
paramMap
.
put
(
"adviserIds"
,
adviserIds
);
}
if
(
agentId
!=
null
&&
agentId
>
0
){
List
<
Long
>
allAdvisers4Agent
=
adviserConsr
.
getByAgentId
(
agentId
);
if
(
CollectionUtils
.
isEmpty
(
allAdvisers4Agent
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前列表为空,请重新筛选再下载!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前列表为空,请重新筛选再下载!"
);
}
}
if
(
paramMap
.
containsKey
(
"adviserIds"
)){
List
<
ErpAdviserBookVO
>
bookVOS
=
pageBeanNew
.
getRecordList
();
List
<
Long
>
adviserIds
=
(
List
<
Long
>)
paramMap
.
get
(
"adviserIds"
);
adviserIds
.
retainAll
(
allAdvisers4Agent
);
}
else
{
paramMap
.
put
(
"adviserIds"
,
allAdvisers4Agent
);
}
}
List
<
ErpAdviserBookVO
>
bookVOS
=
bookAdviserDao
.
listAdviserBook4Erp
(
paramMap
);
if
(
ListUtils
.
isEmpty
(
bookVOS
)){
if
(
ListUtils
.
isEmpty
(
bookVOS
)){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前列表为空,请重新筛选再下载!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"当前列表为空,请重新筛选再下载!"
);
}
}
...
@@ -3576,4 +3567,193 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
...
@@ -3576,4 +3567,193 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
model
.
setOpenRaysCode
(
bookAdviser
.
getOpenRaysCode
());
model
.
setOpenRaysCode
(
bookAdviser
.
getOpenRaysCode
());
bookAdviserDao
.
update
(
model
);
bookAdviserDao
.
update
(
model
);
}
}
@Override
public
PageBeanNew
<
ErpAdviserBookVO
>
listAdviserBook4Erp4ES
(
String
isbn
,
String
uniqueNumber
,
String
adviserName
,
Long
agentId
,
Integer
currentPage
,
Integer
numPerPage
)
{
BookSearchDto
bookSearchDto
=
new
BookSearchDto
();
if
(!
StringUtil
.
isEmpty
(
isbn
))
{
String
[]
nameList
=
isbn
.
trim
().
split
(
"[\u00A0|\u3000|\u0020]"
);
if
(
nameList
.
length
>
1
)
{
bookSearchDto
.
setBookNames
(
Lists
.
newArrayList
(
nameList
));
}
}
bookSearchDto
.
setKeyword
(
isbn
);
if
(
StrUtil
.
isNotBlank
(
uniqueNumber
)
&&
uniqueNumber
.
contains
(
"BK"
))
{
String
bk
=
uniqueNumber
.
replace
(
"BK"
,
""
);
if
(
NumberUtil
.
isNumber
(
bk
))
{
bookSearchDto
.
setBookIdList
(
Lists
.
newArrayList
(
Long
.
valueOf
(
bk
)));
}
}
bookSearchDto
.
setIsAdviserBook
(
Boolean
.
TRUE
);
List
<
Long
>
adviserIds4ES
=
new
ArrayList
<>();
if
(!
StringUtil
.
isEmpty
(
adviserName
))
{
adviserIds4ES
=
adviserConsr
.
getAdviserIdsByName
(
adviserName
);
if
(
CollectionUtils
.
isEmpty
(
adviserIds4ES
))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
new
ArrayList
<>());
}
}
if
(
agentId
!=
null
&&
agentId
>
0
)
{
List
<
Long
>
allAdvisers4Agent
=
adviserConsr
.
getByAgentId
(
agentId
);
if
(
CollectionUtils
.
isEmpty
(
allAdvisers4Agent
))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
new
ArrayList
<>());
}
if
(
CollUtil
.
isNotEmpty
(
adviserIds4ES
))
{
adviserIds4ES
.
retainAll
(
allAdvisers4Agent
);
}
else
{
adviserIds4ES
=
allAdvisers4Agent
;
}
}
if
(
CollUtil
.
isNotEmpty
(
adviserIds4ES
))
{
bookSearchDto
.
setAdviserIds
(
adviserIds4ES
);
}
bookSearchDto
.
setCurrentPage
(
Optional
.
ofNullable
(
currentPage
).
orElse
(
0
)
+
1
);
bookSearchDto
.
setPageSize
(
numPerPage
);
Pagination
<
Es7Book
>
data
=
bookElasticSearchConsr
.
getAdviserBooks4Erp
(
bookSearchDto
);
LOGGER
.
info
(
data
.
toString
());
PageBeanNew
<
ErpAdviserBookVO
>
pageBeanNew
=
convertData
(
data
);
if
(
null
==
pageBeanNew
||
CollUtil
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
null
==
pageBeanNew
?
0
:
pageBeanNew
.
getTotalCount
(),
new
ArrayList
<>());
}
List
<
ErpAdviserBookVO
>
bookVOS
=
pageBeanNew
.
getRecordList
();
List
<
BookScanCountParamDTO
>
param
=
new
ArrayList
<>();
BookScanCountParamDTO
bookScanCountParamDTO
=
null
;
if
(!
CollectionUtils
.
isEmpty
(
bookVOS
))
{
Set
<
Long
>
setAdviserIds
=
new
HashSet
<>();
Set
<
Long
>
setChannelIds
=
new
HashSet
<>();
Set
<
Long
>
setBookIds
=
new
HashSet
<>();
for
(
ErpAdviserBookVO
bookVO
:
bookVOS
)
{
bookScanCountParamDTO
=
new
BookScanCountParamDTO
();
addIfNonNull
(
setAdviserIds
,
bookVO
.
getAdviserId
());
addIfNonNull
(
setChannelIds
,
bookVO
.
getChannelId
());
addIfNonNull
(
setBookIds
,
bookVO
.
getBookId
());
bookScanCountParamDTO
.
setBookId
(
bookVO
.
getBookId
());
bookScanCountParamDTO
.
setAdviserId
(
bookVO
.
getAdviserId
());
bookScanCountParamDTO
.
setChannelId
(
bookVO
.
getChannelId
());
param
.
add
(
bookScanCountParamDTO
);
}
List
<
Long
>
adviserIds
=
Lists
.
newArrayList
(
setAdviserIds
);
List
<
Long
>
channelIds
=
Lists
.
newArrayList
(
setChannelIds
);
List
<
Long
>
bookIds
=
Lists
.
newArrayList
(
setBookIds
);
// Map<String, BookDataStatisticsDTO> stringBookDataStatisticsDTOMap = mapBookDataStatistics(adviserIds, bookIds, channelIds);
List
<
Long
>
xiaoRuiEducation
=
channelConsr
.
isXiaoRuiEducation
(
bookIds
);
// List<BookScanCountDto> bookScanCounts = bookMapper.getBookScanCounts(bookIds);
//小睿书的扫码量
Map
<
Long
,
Long
>
xiaoRuiScanMap
=
erpConsr
.
mapScan4Erp
(
xiaoRuiEducation
);
//从data服务拿书刊扫码量(bookId,adviserId,channelId)
Map
<
String
,
BookScanCountVO
>
bookScanCountVOMap
=
dataConsr
.
multiGetBookScanCount
(
param
);
/* Map<Long,Integer> chMap = new HashMap<>();
for (BookScanCountDto bookScanCount : bookScanCounts) {
chMap.put(bookScanCount.getBookId(),bookScanCount.getScanCount().intValue());
}*/
Map
<
Long
,
UserLogin
>
userLoginInfoMap
=
new
HashMap
<>();
Map
<
Long
,
AdviserBaseInfoDto
>
adviserAgentMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
channelNameMap
=
new
HashMap
<>();
CompletableFuture
<
Map
<
Long
,
UserLogin
>>
userLoginInfoMapFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
adviserConsr
.
getUserLoginInfoList
(
adviserIds
);
},
ThreadPoolUtils
.
OTHER_THREAD_POOL
);
CompletableFuture
<
Map
<
Long
,
AdviserBaseInfoDto
>>
adviserAgentMapFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
adviserConsr
.
getAdviserId2AdviserInfoDtoMap
(
adviserIds
);
},
ThreadPoolUtils
.
OTHER_THREAD_POOL
);
CompletableFuture
<
Map
<
Long
,
String
>>
channelNameMapFuture
=
CompletableFuture
.
supplyAsync
(()
->
{
return
channelConsr
.
getNamesByIdList
(
channelIds
);
},
ThreadPoolUtils
.
OTHER_THREAD_POOL
);
CompletableFuture
.
allOf
(
userLoginInfoMapFuture
,
adviserAgentMapFuture
,
channelNameMapFuture
);
try
{
userLoginInfoMap
=
userLoginInfoMapFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
adviserAgentMap
=
adviserAgentMapFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
channelNameMap
=
channelNameMapFuture
.
get
(
10
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
TimeoutException
|
ExecutionException
e
)
{
LOGGER
.
error
(
"[exportMonthReport] 并行导出word失败! err:{}"
,
e
.
getMessage
(),
e
);
}
List
<
Long
>
list
=
bookFundBiz
.
listHaveFundBooks
(
bookIds
);
for
(
ErpAdviserBookVO
bookVO
:
bookVOS
)
{
if
(
bookVO
.
getAdviserId
()
!=
null
&&
bookVO
.
getChannelId
()
!=
null
&&
bookVO
.
getBookId
()
!=
null
)
{
String
key
=
bookVO
.
getBookId
()
+
"_"
+
bookVO
.
getChannelId
()
+
"_"
+
bookVO
.
getAdviserId
();
String
scanKey
=
bookVO
.
getBookId
()
+
"_"
+
bookVO
.
getAdviserId
()
+
"_"
+
bookVO
.
getChannelId
();
/*if(stringBookDataStatisticsDTOMap.containsKey(key)){
BookDataStatisticsDTO bookDataStatisticsDTO = stringBookDataStatisticsDTOMap.get(key);
bookVO.setScanCount(bookDataStatisticsDTO.getScanCount().intValue());
bookVO.setUserCount(bookDataStatisticsDTO.getUserCount().intValue());
}*/
if
(
CollUtil
.
isNotEmpty
(
bookScanCountVOMap
)
&&
bookScanCountVOMap
.
containsKey
(
scanKey
))
{
BookScanCountVO
bookScanCountVO
=
bookScanCountVOMap
.
get
(
scanKey
);
if
(
null
!=
bookScanCountVO
)
{
bookVO
.
setScanCount
(
Optional
.
ofNullable
(
bookScanCountVO
.
getScanCnt
()).
map
(
Long:
:
intValue
).
orElse
(
0
));
bookVO
.
setUserCount
(
Optional
.
ofNullable
(
bookScanCountVO
.
getScanUserCnt
()).
map
(
Long:
:
intValue
).
orElse
(
0
));
bookVO
.
setChScanCount
(
Optional
.
ofNullable
(
bookScanCountVO
.
getScanCnt
()).
map
(
Long:
:
intValue
).
orElse
(
0
));
}
}
}
if
(
bookVO
.
getBookId
()
!=
null
)
{
if
(
xiaoRuiEducation
.
contains
(
bookVO
.
getBookId
()))
{
bookVO
.
setXiaoRuiEducation
(
1
);
if
(
CollUtil
.
isNotEmpty
(
xiaoRuiScanMap
)
&&
xiaoRuiScanMap
.
containsKey
(
bookVO
.
getBookId
()))
{
Long
scanCount
=
xiaoRuiScanMap
.
get
(
bookVO
.
getBookId
());
bookVO
.
setChScanCount
(
Optional
.
ofNullable
(
scanCount
).
map
(
Long:
:
intValue
).
orElse
(
0
));
}
}
/*Integer chScan = chMap.get(bookVO.getBookId());
if(chScan!=null) {
bookVO.setChScanCount(chScan);
}*/
}
Long
adviserId
=
bookVO
.
getAdviserId
();
if
(
adviserId
!=
null
&&
MapUtils
.
isNotEmpty
(
userLoginInfoMap
)
&&
userLoginInfoMap
.
containsKey
(
adviserId
))
{
UserLogin
userLogin
=
userLoginInfoMap
.
get
(
adviserId
);
bookVO
.
setAdviserAccount
(
userLogin
!=
null
?
userLogin
.
getUserName
()
:
null
);
bookVO
.
setEncryptInfo
(
userLogin
!=
null
?
userLogin
.
getEncryptInfo
()
:
null
);
}
if
(
adviserId
!=
null
&&
MapUtils
.
isNotEmpty
(
adviserAgentMap
)
&&
adviserAgentMap
.
containsKey
(
adviserId
))
{
AdviserBaseInfoDto
adviserBaseInfoDto
=
adviserAgentMap
.
get
(
adviserId
);
bookVO
.
setAgentName
(
null
!=
adviserBaseInfoDto
?
adviserBaseInfoDto
.
getAgentName
()
:
"--"
);
bookVO
.
setAdviserName
(
null
!=
adviserBaseInfoDto
?
adviserBaseInfoDto
.
getPartyName
()
:
"--"
);
bookVO
.
setPhoneNum
(
null
!=
adviserBaseInfoDto
?
adviserBaseInfoDto
.
getPhoneNum
()
:
"--"
);
}
if
(
bookVO
.
getChannelId
()
!=
null
&&
MapUtils
.
isNotEmpty
(
channelNameMap
)
&&
channelNameMap
.
containsKey
(
bookVO
.
getChannelId
()))
{
bookVO
.
setChannelName
(
channelNameMap
.
get
(
bookVO
.
getChannelId
()));
}
bookVO
.
setIsFundSupport
(
false
);
if
(!
ListUtils
.
isEmpty
(
list
)
&&
list
.
contains
(
bookVO
.
getBookId
()))
{
bookVO
.
setIsFundSupport
(
true
);
}
}
}
return
new
PageBeanNew
<>(
currentPage
,
numPerPage
,
pageBeanNew
.
getTotalCount
(),
bookVOS
);
}
private
PageBeanNew
<
ErpAdviserBookVO
>
convertData
(
Pagination
<
Es7Book
>
esResult
)
{
PageBeanNew
<
ErpAdviserBookVO
>
pageBeanNew
=
new
PageBeanNew
<>();
pageBeanNew
.
setCurrentPage
(
esResult
.
getCurrentPage
()
-
1
);
pageBeanNew
.
setNumPerPage
(
esResult
.
getPageSize
());
pageBeanNew
.
setTotalCount
((
int
)
esResult
.
getTotalCount
());
if
(
CollUtil
.
isEmpty
(
esResult
.
getList
()))
{
pageBeanNew
.
setRecordList
(
new
ArrayList
<>());
}
else
{
List
<
ErpAdviserBookVO
>
erpAdviserBookVOS
=
new
ArrayList
<>();
esResult
.
getList
().
stream
().
forEach
(
es7Book
->
{
ErpAdviserBookVO
erpAdviserBookVO
=
new
ErpAdviserBookVO
();
erpAdviserBookVO
.
setBookId
(
es7Book
.
getBookId
());
erpAdviserBookVO
.
setAdviserId
(
es7Book
.
getAdviserId
());
erpAdviserBookVO
.
setChannelId
(
es7Book
.
getAdviserChannelId
());
erpAdviserBookVO
.
setBookName
(
es7Book
.
getBookName
());
erpAdviserBookVO
.
setCoverImg
(
es7Book
.
getCoverImg
());
erpAdviserBookVO
.
setIsbn
(
es7Book
.
getIsbn
());
erpAdviserBookVO
.
setUniqueNumber
(
"BK"
+
es7Book
.
getBookId
());
erpAdviserBookVO
.
setBookAdviserId
(
es7Book
.
getBookAdviserId
());
erpAdviserBookVO
.
setSerialNumber
(
es7Book
.
getSerialNumber
());
erpAdviserBookVOS
.
add
(
erpAdviserBookVO
);
});
pageBeanNew
.
setRecordList
(
erpAdviserBookVOS
);
}
return
pageBeanNew
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookAdviserFacadeImpl.java
View file @
7e0f5444
...
@@ -218,7 +218,7 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
...
@@ -218,7 +218,7 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
@RequestParam
(
value
=
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
value
=
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
)
Integer
numPerPage
)
@RequestParam
(
value
=
"numPerPage"
)
Integer
numPerPage
)
throws
PermissionException
,
JsonParseException
,
BizException
{
throws
PermissionException
,
JsonParseException
,
BizException
{
return
new
ResponseDto
<>(
bookAdviserBiz
.
listAdviserBook4Erp
(
isbn
,
uniqueNumber
,
adviserName
,
agentId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
bookAdviserBiz
.
listAdviserBook4Erp
4ES
(
isbn
,
uniqueNumber
,
adviserName
,
agentId
,
currentPage
,
numPerPage
));
}
}
/**
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/book/elasticsearch/BookElasticSearchConsr.java
View file @
7e0f5444
package
com
.
pcloud
.
book
.
consumer
.
book
.
elasticsearch
;
package
com
.
pcloud
.
book
.
consumer
.
book
.
elasticsearch
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.BookExtendImgSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.BookExtendImgSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.BookSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.PlatformSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.dto.param.PlatformSearchDto
;
import
com.pcloud.book.elasticsearch7.domain.entity.Es7Book
;
import
com.pcloud.book.elasticsearch7.domain.entity.Es7Book
;
import
com.pcloud.book.elasticsearch7.service.Es7BookExtendImgService
;
import
com.pcloud.book.elasticsearch7.service.Es7BookExtendImgService
;
import
com.pcloud.book.elasticsearch7.service.Es7BookSearchService
;
import
com.pcloud.book.elasticsearch7.service.PlatformBookSearchService
;
import
com.pcloud.book.elasticsearch7.service.PlatformBookSearchService
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.universe.commons.paging.Pagination
;
import
com.pcloud.universe.commons.paging.Pagination
;
...
@@ -30,6 +32,8 @@ public class BookElasticSearchConsr {
...
@@ -30,6 +32,8 @@ public class BookElasticSearchConsr {
private
PlatformBookSearchService
platformBookSearchService
;
private
PlatformBookSearchService
platformBookSearchService
;
@Autowired
@Autowired
private
Es7BookExtendImgService
es7BookExtendImgService
;
private
Es7BookExtendImgService
es7BookExtendImgService
;
@Autowired
private
Es7BookSearchService
es7BookSearchService
;
public
Pagination
<
Es7Book
>
search
(
PlatformSearchDto
dto
)
{
public
Pagination
<
Es7Book
>
search
(
PlatformSearchDto
dto
)
{
try
{
try
{
...
@@ -50,4 +54,14 @@ public class BookElasticSearchConsr {
...
@@ -50,4 +54,14 @@ public class BookElasticSearchConsr {
}
}
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
public
Pagination
<
Es7Book
>
getAdviserBooks4Erp
(
BookSearchDto
param
)
{
try
{
Pagination
<
Es7Book
>
r
=
es7BookSearchService
.
getAdviserBooks4Erp
(
param
);
return
r
;
}
catch
(
Exception
e
)
{
logger
.
error
(
"platform book es search exception."
,
e
);
}
return
new
Pagination
<>();
}
}
}
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