|
|
@@ -2086,22 +2086,33 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
ContentPlatformAccount loginAccount = LoginUserContext.getUser();
|
|
|
List<ContentPlatformXcxPlan> planList = planMapperExt.getXcxPlanList(param,
|
|
|
loginAccount.getId(), 0, param.getPageSize());
|
|
|
- List<XcxPlanItemVO> list = buildXcxPlanItemVOList(planList);
|
|
|
- return generateXcxPlanExcelFile(list);
|
|
|
+ return generateXcxPlanExcelFile(planList);
|
|
|
}
|
|
|
|
|
|
- private String generateXcxPlanExcelFile(List<XcxPlanItemVO> dataList) {
|
|
|
+ private String generateXcxPlanExcelFile(List<ContentPlatformXcxPlan> planList) {
|
|
|
List<XcxPlanItemExportVO> list = new ArrayList<>();
|
|
|
- if (CollectionUtils.isNotEmpty(dataList)) {
|
|
|
- for (XcxPlanItemVO data : dataList) {
|
|
|
+ if (CollectionUtils.isNotEmpty(planList)) {
|
|
|
+ List<Long> planIds = planList.stream().map(ContentPlatformXcxPlan::getId).collect(Collectors.toList());
|
|
|
+ ContentPlatformXcxPlanVideoExample videoExample = new ContentPlatformXcxPlanVideoExample();
|
|
|
+ videoExample.createCriteria().andPlanIdIn(planIds);
|
|
|
+ List<ContentPlatformXcxPlanVideo> videoList = xcxPlanVideoMapper.selectByExample(videoExample);
|
|
|
+ Map<Long, ContentPlatformXcxPlanVideo> videoMap = videoList.stream()
|
|
|
+ .collect(Collectors.toMap(ContentPlatformXcxPlanVideo::getPlanId, Function.identity()));
|
|
|
+ for (ContentPlatformXcxPlan plan : planList) {
|
|
|
XcxPlanItemExportVO vo = new XcxPlanItemExportVO();
|
|
|
- vo.setAudiencePackage(data.getAudiencePackage());
|
|
|
- vo.setTitle(data.getTitle());
|
|
|
- vo.setCover(data.getShareCover() != null ? data.getShareCover() : data.getCover());
|
|
|
- vo.setPageUrl(data.getPageUrl());
|
|
|
- vo.setRemark(data.getRemark());
|
|
|
- if (Objects.nonNull(data.getCreateTimestamp())) {
|
|
|
- vo.setCreateTime(DateUtil.getDateString(data.getCreateTimestamp(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ vo.setAudiencePackage(plan.getAudiencePackage());
|
|
|
+ vo.setRootSourceId(plan.getRootSourceId());
|
|
|
+ vo.setPageUrl(plan.getPageUrl());
|
|
|
+ vo.setRemark(plan.getRemark());
|
|
|
+ if (Objects.nonNull(plan.getCreateTimestamp())) {
|
|
|
+ vo.setCreateTime(DateUtil.getDateString(plan.getCreateTimestamp(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ }
|
|
|
+ ContentPlatformXcxPlanVideo videoItem = videoMap.get(plan.getId());
|
|
|
+ if (Objects.nonNull(videoItem)) {
|
|
|
+ vo.setVideoId(videoItem.getVideoId());
|
|
|
+ vo.setTitle(videoItem.getTitle());
|
|
|
+ String shareCover = getShareCover(null, videoItem.getCover());
|
|
|
+ vo.setCover(StringUtils.hasText(shareCover) ? shareCover : videoItem.getCover());
|
|
|
}
|
|
|
list.add(vo);
|
|
|
}
|