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
1f97af23
Commit
1f97af23
authored
Mar 03, 2022
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug/10001234' into 'master'
bug : [none] rays和erp显示扫码量不一致 See merge request rays/pcloud-book!1511
parents
99c6be73
78820ab5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
9 deletions
+58
-9
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+31
-7
ErpConsr.java
.../src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
+27
-2
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
1f97af23
...
...
@@ -1028,25 +1028,36 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
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
);
//
Map<String, BookDataStatisticsDTO> stringBookDataStatisticsDTOMap = mapBookDataStatistics(adviserIds, bookIds, channelIds);
List
<
Long
>
xiaoRuiEducation
=
channelConsr
.
isXiaoRuiEducation
(
bookIds
);
List
<
BookScanCountDto
>
bookScanCounts
=
bookMapper
.
getBookScanCounts
(
bookIds
);
Map
<
Long
,
Integer
>
chMap
=
new
HashMap
<>();
// 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
<>();
...
...
@@ -1074,20 +1085,33 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
if
(
bookVO
.
getAdviserId
()!=
null
&&
bookVO
.
getChannelId
()!=
null
&&
bookVO
.
getBookId
()!=
null
)
{
String
key
=
bookVO
.
getBookId
()
+
"_"
+
bookVO
.
getChannelId
()
+
"_"
+
bookVO
.
getAdviserId
();
if
(
stringBookDataStatisticsDTOMap
.
containsKey
(
key
)){
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
());
/*
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
))
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/erp/ErpConsr.java
View file @
1f97af23
...
...
@@ -209,7 +209,7 @@ public class ErpConsr {
params
.
put
(
"startTime"
,
startTime
);
params
.
put
(
"endTime"
,
endTime
);
try
{
HttpResponse
response
=
HttpUtils
.
doPost
(
domain
,
"/erp/project4Third/searchBookInfo"
,
"
GE
T"
,
headers
,
new
HashMap
<>(),
JSONObject
.
toJSONString
(
params
));
HttpResponse
response
=
HttpUtils
.
doPost
(
domain
,
"/erp/project4Third/searchBookInfo"
,
"
POS
T"
,
headers
,
new
HashMap
<>(),
JSONObject
.
toJSONString
(
params
));
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
entityString
);
if
(
jsonObject
.
getInteger
(
"errCode"
)
!=
0
)
{
...
...
@@ -231,7 +231,7 @@ public class ErpConsr {
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/json"
);
try
{
HttpResponse
response
=
HttpUtils
.
doPost
(
domain
,
"/erp/project4Third/searchRaysBookId"
,
"
GE
T"
,
headers
,
new
HashMap
<>(),
JSONObject
.
toJSONString
(
erpBookInfoDTOS
));
HttpResponse
response
=
HttpUtils
.
doPost
(
domain
,
"/erp/project4Third/searchRaysBookId"
,
"
POS
T"
,
headers
,
new
HashMap
<>(),
JSONObject
.
toJSONString
(
erpBookInfoDTOS
));
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
entityString
);
if
(
jsonObject
.
getInteger
(
"errCode"
)
!=
0
)
{
...
...
@@ -402,4 +402,29 @@ public class ErpConsr {
return
null
;
}
/**
* 批量获取小睿书的扫码量
* @param
* @return
*/
public
Map
<
Long
,
Long
>
mapScan4Erp
(
List
<
Long
>
bookIds
)
{
if
(
CollUtil
.
isEmpty
(
bookIds
))
{
return
new
HashMap
<>();
}
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/json"
);
try
{
HttpResponse
response
=
HttpUtils
.
doPost
(
domain
,
"/erp/project4Third/mapScan4Erp"
,
"POST"
,
headers
,
new
HashMap
<>(),
JSONObject
.
toJSONString
(
bookIds
));
String
entityString
=
EntityUtils
.
toString
(
response
.
getEntity
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
entityString
);
if
(
jsonObject
.
getInteger
(
"errCode"
)
!=
0
)
{
throw
new
BizException
(
jsonObject
.
getString
(
"message"
));
}
return
JSONObject
.
parseObject
(
jsonObject
.
getString
(
"data"
),
new
TypeReference
<
Map
<
Long
,
Long
>>(){});
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"批量获取小睿书的扫码量 [projectService.mapScan4Erp]:"
+
e
.
getMessage
(),
e
);
throw
new
BookBizException
(
BookBizException
.
INVOKE_CONTENT_ERROR
,
"批量获取小睿书的扫码量失败!"
);
}
}
}
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