Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
afanti-open-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-ms
afanti-open-api
Commits
3f343171
Commit
3f343171
authored
Dec 18, 2024
by
王明生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed: 修改主体编码以及数据为空的情况
parent
a28cbd2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
PrincipalEnum.java
...a/com/afanticar/afantiopenapi/constant/PrincipalEnum.java
+4
-4
BydOpenService.java
...a/com/afanticar/afantiopenapi/service/BydOpenService.java
+21
-18
No files found.
src/main/java/com/afanticar/afantiopenapi/constant/PrincipalEnum.java
View file @
3f343171
...
...
@@ -4,10 +4,10 @@ import java.util.Arrays;
import
java.util.Optional
;
public
enum
PrincipalEnum
{
BYD_WC
(
"
1270917477950984
192"
,
"比亚迪-王朝"
),
BYD_HY
(
"1
270917477950984192
"
,
"比亚迪-海洋"
),
BYD_TS
(
"1
270917477950984192
"
,
"比亚迪-腾势"
),
BYD_FCB
(
"
1270917477950984192
"
,
"比亚迪-方程豹"
),
BYD_WC
(
"
869753006697992
192"
,
"比亚迪-王朝"
),
BYD_HY
(
"1
181731554985156608
"
,
"比亚迪-海洋"
),
BYD_TS
(
"1
059328720988442624
"
,
"比亚迪-腾势"
),
BYD_FCB
(
"
xxxxx
"
,
"比亚迪-方程豹"
),
SQDZ
(
"869753088184930304"
,
"SWM斯威汽车"
);
// TODO: 修改ID
...
...
src/main/java/com/afanticar/afantiopenapi/service/BydOpenService.java
View file @
3f343171
...
...
@@ -57,16 +57,19 @@ public class BydOpenService {
Page
<
XiaoHongShuAuthorDay
>
data
=
authorDayMapper
.
queryAuthorDayByPrincipalId
(
page
,
principal
.
id
,
startDate
,
endDate
);
List
<
String
>
authorIds
=
data
.
getRecords
().
stream
().
map
(
XiaoHongShuAuthorDay:
:
getAuthorId
).
distinct
().
collect
(
Collectors
.
toList
());
// QueryWrapper<XiaoHongShuAuthorInfo> wrapper = new QueryWrapper<>();
// wrapper.in("author_id", authorIds);
Map
<
String
,
XiaoHongShuAuthorInfo
>
authorInfos
=
authorInfoMapper
.
queryAuthorInfoListByAuthorIds
(
authorIds
).
stream
().
distinct
()
Map
<
String
,
XiaoHongShuAuthorInfo
>
authorInfos
=
authorInfoMapper
.
queryAuthorInfoListByAuthorIds
(
authorIds
.
isEmpty
()
?
Collections
.
singletonList
(
"XXX"
)
:
authorIds
)
.
stream
().
distinct
()
.
collect
(
Collectors
.
toMap
(
XiaoHongShuAuthorInfo:
:
getAuthorId
,
Function
.
identity
()));
List
<
String
>
memberIds
=
authorInfos
.
values
().
stream
()
.
flatMap
(
o
->
o
.
getMemberIds
().
stream
())
.
collect
(
Collectors
.
toList
());
Map
<
String
,
MemberInfo
>
memberInfos
=
memberInfoMapper
.
queryMemberInfoListByMemberIds
(
memberIds
).
stream
().
distinct
()
Map
<
String
,
MemberInfo
>
memberInfos
=
memberInfoMapper
.
queryMemberInfoListByMemberIds
(
memberIds
.
isEmpty
()
?
Collections
.
singletonList
(
"XXX"
):
memberIds
)
.
stream
().
distinct
()
.
collect
(
Collectors
.
toMap
(
MemberInfo:
:
getMatrixMemberId
,
Function
.
identity
()));
List
<
BydXiaoHongShuAuthorDayVO
>
voList
=
data
.
getRecords
().
stream
().
map
(
x
->{
...
...
@@ -80,22 +83,22 @@ public class BydOpenService {
vo
.
setIncludeTime
(
authorInfo
.
getIncludedTime
());
if
(
Optional
.
ofNullable
(
authorInfo
.
getMemberIds
()).
isPresent
())
{
vo
.
setMemberInfos
(
authorInfo
.
getMemberIds
().
stream
().
map
(
id
->{
System
.
out
.
println
(
"memberId: "
+
id
);
MemberInfo
info
=
memberInfos
.
get
(
id
);
BydXiaoHongShuAuthorDayVO
.
MemberInfo
infoVo
=
new
BydXiaoHongShuAuthorDayVO
.
MemberInfo
();
infoVo
.
setMemberId
(
info
.
getMatrixMemberId
());
infoVo
.
setMemberCode
(
info
.
getMatrixMemberCode
());
infoVo
.
setMemberName
(
info
.
getMatrixMemberName
());
infoVo
.
setAreaName
(
info
.
getAreaName
());
infoVo
.
setVillageName
(
info
.
getVillageName
());
infoVo
.
setPrincipalName
(
info
.
getPrincipalName
());
infoVo
.
setCityName
(
info
.
getCityName
());
infoVo
.
setProvinceName
(
info
.
getProvinceName
());
MemberInfo
info
=
memberInfos
.
get
(
id
);
if
(
Objects
.
nonNull
(
info
))
{
infoVo
.
setMemberId
(
info
.
getMatrixMemberId
());
infoVo
.
setMemberCode
(
info
.
getMatrixMemberCode
());
infoVo
.
setMemberName
(
info
.
getMatrixMemberName
());
infoVo
.
setAreaName
(
info
.
getAreaName
());
infoVo
.
setVillageName
(
info
.
getVillageName
());
infoVo
.
setPrincipalName
(
info
.
getPrincipalName
());
infoVo
.
setCityName
(
info
.
getCityName
());
infoVo
.
setProvinceName
(
info
.
getProvinceName
());
}
return
infoVo
;
}).
collect
(
Collectors
.
toList
()));
}
else
{
vo
.
setMemberInfos
(
new
ArrayList
<>());
System
.
out
.
println
(
authorInfo
.
getAuthorId
());
}
vo
.
setStatsDate
(
x
.
getStatisticsDay
());
vo
.
setFansCntTotal
(
x
.
getFansCountTotal
());
...
...
@@ -122,7 +125,9 @@ public class BydOpenService {
List
<
String
>
noteIds
=
data
.
getRecords
().
stream
().
map
(
XiaoHongShuNoteDay:
:
getNoteId
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
XiaoHongShuNoteInfo
>
noteInfos
=
noteInfoMapper
.
queryNoteInfoListByNoteIds
(
noteIds
).
stream
().
distinct
()
Map
<
String
,
XiaoHongShuNoteInfo
>
noteInfos
=
noteInfoMapper
.
queryNoteInfoListByNoteIds
(
noteIds
.
isEmpty
()
?
Collections
.
singletonList
(
"XXX"
)
:
noteIds
)
.
stream
().
distinct
()
.
collect
(
Collectors
.
toMap
(
XiaoHongShuNoteInfo:
:
getNoteId
,
Function
.
identity
()));
EsBaseQuery
esQuery
=
new
EsBaseQuery
();
...
...
@@ -145,8 +150,6 @@ public class BydOpenService {
vo
.
setShareUrl
(
noteInfo
.
getShareUrl
());
vo
.
setCoverUrl
(
noteInfo
.
getCoverUrl
());
vo
.
setTopicNames
(
noteInfo
.
getTopicNames
());
}
else
{
System
.
out
.
println
(
x
.
getNoteId
());
}
vo
.
setAuthorId
(
x
.
getAuthorId
());
vo
.
setLikeCnt
(
x
.
getDiggCount
());
...
...
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