|
@@ -9,6 +9,7 @@ import com.google.common.collect.Lists;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.AccountBusinessTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
|
|
|
+import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.*;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
|
|
@@ -247,6 +248,9 @@ public class DataDashboardService {
|
|
|
}
|
|
|
Map<String, List<PublishPlanMiniprogramTask>> miniprogramTaskMap = miniprogramTaskList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishPlanMiniprogramTask::getPlanId));
|
|
|
+ // 源生成计划
|
|
|
+ List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
|
|
|
+ Map<String, ProducePlan> sourceTitlePlanMap = getTitleSourceProducePlanMap(titleList);
|
|
|
// result
|
|
|
List<NewSortStrategyExport> result = new ArrayList<>();
|
|
|
for (Article article : articleList) {
|
|
@@ -427,6 +431,10 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ ProducePlan sourceProducePlan = sourceTitlePlanMap.get(article.getTitle());
|
|
|
+ if (Objects.nonNull(sourceProducePlan)) {
|
|
|
+ obj.setSourceProducePlanName(sourceProducePlan.getName());
|
|
|
+ }
|
|
|
}
|
|
|
result.sort(Comparator.comparing(NewSortStrategyExport::getDateStr).reversed()
|
|
|
.thenComparing(NewSortStrategyExport::getGhId).thenComparing(NewSortStrategyExport::getPosition));
|
|
@@ -445,6 +453,35 @@ public class DataDashboardService {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ private Map<String, ProducePlan> getTitleSourceProducePlanMap(List<String> titleList) {
|
|
|
+ List<ProduceContentDTO> sourceProduceContentList = new ArrayList<>();
|
|
|
+ for (List<String> partitions : Lists.partition(titleList, 1000)) {
|
|
|
+ sourceProduceContentList.addAll(aigcBaseMapper.getSourceProduceContentByTitles(partitions));
|
|
|
+ }
|
|
|
+ Map<String, List<ProduceContentDTO>> sourceProduceContentMap = sourceProduceContentList.stream()
|
|
|
+ .collect(Collectors.groupingBy(ProduceContentDTO::getTitle));
|
|
|
+ Map<String, String> sourceTitlePlanIdMap = new HashMap<>();
|
|
|
+ List<String> sourceProducePlanIds = new ArrayList<>();
|
|
|
+ for (Map.Entry<String, List<ProduceContentDTO>> entry : sourceProduceContentMap.entrySet()) {
|
|
|
+ String title = entry.getKey();
|
|
|
+ List<ProduceContentDTO> contentList = entry.getValue();
|
|
|
+ contentList.sort(Comparator.comparing(ProduceContentDTO::getProduceTimestamp));
|
|
|
+ sourceTitlePlanIdMap.put(title, contentList.get(0).getProducePlanId());
|
|
|
+ sourceProducePlanIds.add(contentList.get(0).getProducePlanId());
|
|
|
+ }
|
|
|
+ List<ProducePlan> sourceProducePlanList = producePlanRepository.findByIdIn(sourceProducePlanIds);
|
|
|
+ Map<String, ProducePlan> sourceProducePlanMap = sourceProducePlanList.stream()
|
|
|
+ .collect(Collectors.toMap(ProducePlan::getId, o -> o));
|
|
|
+ Map<String, ProducePlan> sourceTitlePlanMap = new HashMap<>();
|
|
|
+ for (Map.Entry<String, String> entry : sourceTitlePlanIdMap.entrySet()) {
|
|
|
+ String title = entry.getKey();
|
|
|
+ String planId = entry.getValue();
|
|
|
+ ProducePlan plan = sourceProducePlanMap.get(planId);
|
|
|
+ sourceTitlePlanMap.put(title, plan);
|
|
|
+ }
|
|
|
+ return sourceTitlePlanMap;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
private static void doSendFeishuSheet(List<String> dateStrList, String sheetToken, String sheetId,
|
|
|
int rowNum, List<List<Object>> rows, Integer startRowIndex,
|