Commit 7922f2e2 authored by 王明生's avatar 王明生

Merge branch 'v13.17.0' into uat

parents c7b3103e 3f343171
......@@ -4,10 +4,10 @@ import java.util.Arrays;
import java.util.Optional;
public enum PrincipalEnum {
BYD_WC("1270917477950984192", "比亚迪-王朝"),
BYD_HY("1270917477950984192", "比亚迪-海洋"),
BYD_TS("1270917477950984192", "比亚迪-腾势"),
BYD_FCB("1270917477950984192", "比亚迪-方程豹"),
BYD_WC("869753006697992192", "比亚迪-王朝"),
BYD_HY("1181731554985156608", "比亚迪-海洋"),
BYD_TS("1059328720988442624", "比亚迪-腾势"),
BYD_FCB("xxxxx", "比亚迪-方程豹"),
SQDZ("869753088184930304", "SWM斯威汽车");
// TODO: 修改ID
......
......@@ -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,9 +83,9 @@ 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();
MemberInfo info = memberInfos.get(id);
if (Objects.nonNull(info)) {
infoVo.setMemberId(info.getMatrixMemberId());
infoVo.setMemberCode(info.getMatrixMemberCode());
infoVo.setMemberName(info.getMatrixMemberName());
......@@ -91,11 +94,11 @@ public class BydOpenService {
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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment