|
@@ -8,6 +8,7 @@ import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.AccountBusinessTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeEnum;
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
|
|
|
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;
|
|
@@ -16,6 +17,7 @@ import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.ArticleDetailInfo;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.PublishSortLog;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.ArticlePoolPromotionSource;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatScore;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.MiniprogramTaskParam;
|
|
@@ -30,6 +32,7 @@ import com.tzld.longarticle.recommend.server.repository.crawler.ArticleDetailInf
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.ArticleRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.PublishSortLogRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.ArticleCategoryRepository;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.longArticle.ArticlePoolPromotionSourceRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.DatastatScoreRepository;
|
|
|
import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreStrategy;
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
@@ -84,6 +87,8 @@ public class DataDashboardService {
|
|
|
private DatastatScoreRepository datastatScoreRepository;
|
|
|
@Autowired
|
|
|
private ArticleCategoryRepository articleCategoryRepository;
|
|
|
+ @Autowired
|
|
|
+ private ArticlePoolPromotionSourceRepository articlePoolPromotionSourceRepository;
|
|
|
|
|
|
@ApolloJsonValue("${export.account.ghId:[]}")
|
|
|
private static List<String> ghIdList;
|
|
@@ -872,6 +877,10 @@ public class DataDashboardService {
|
|
|
List<Article> futurePublishList = articleRepository.getByPublishTimestampGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
|
Map<String, List<Article>> futurePublishMap = futurePublishList.stream().collect(Collectors.groupingBy(Article::getTitle));
|
|
|
|
|
|
+ List<ArticlePoolPromotionSource> promotionSourceList = articlePoolPromotionSourceRepository.getByStatusAndDeleted(0, 0);
|
|
|
+ Map<String, ArticlePoolPromotionSource> promotionSourceMap = promotionSourceList.stream()
|
|
|
+ .collect(Collectors.toMap(ArticlePoolPromotionSource::getTitle, Function.identity(), (a, b) -> a));
|
|
|
+
|
|
|
Map<String, List<String>> titleTypeMap = new HashMap<>();
|
|
|
Map<String, Integer> scoreHisPublishTimeMap = new HashMap<>();
|
|
|
Map<String, Map<Integer, List<String>>> titleTypePoolMap = new HashMap<>();
|
|
@@ -913,7 +922,7 @@ public class DataDashboardService {
|
|
|
setPublishSourcePerformance(item, accountAvgInfoIndexMap, articleDetailInfoMap, publishSortLogMap,
|
|
|
type, scoreHisPublishTimeMap, wxsnHisDistinctSetMap, list, poolLevel, small, hisPublishMap);
|
|
|
// 发布未来表现
|
|
|
- setPublishFuturePerformance(item, data, poolLevel, futurePublishMap, publishSortLogMap, small);
|
|
|
+ setPublishFuturePerformance(item, data, poolLevel, promotionSourceMap, futurePublishMap, publishSortLogMap, small);
|
|
|
|
|
|
titles.add(data.getTitle());
|
|
|
poolTitles.add(data.getTitle());
|
|
@@ -956,14 +965,11 @@ public class DataDashboardService {
|
|
|
}
|
|
|
|
|
|
private void setPublishFuturePerformance(IntermediateIndicatorsExport item, NewSortStrategyExport data, Integer poolLevel,
|
|
|
+ Map<String, ArticlePoolPromotionSource> promotionSourceMap,
|
|
|
Map<String, List<Article>> futurePublishMap,
|
|
|
Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap,
|
|
|
List<String> small) {
|
|
|
- List<Article> futurePublishList = futurePublishMap.get(data.getTitle());
|
|
|
- if (CollectionUtils.isEmpty(futurePublishList)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- int futurePoolLevel = getArticlePoolLevel(data.getGhId(), futurePublishList, small);
|
|
|
+ int futurePoolLevel = getPromotionPoolLevel(data.getGhId(), data.getTitle(), promotionSourceMap, small);
|
|
|
if (futurePoolLevel > poolLevel) {
|
|
|
if (futurePoolLevel == 2) {
|
|
|
item.setPromotionCountL2(item.getPromotionCountL2() + 1);
|
|
@@ -976,6 +982,10 @@ public class DataDashboardService {
|
|
|
item.setPromotionRateL4((item.getPromotionCountL4() * 1.0) / item.getActualArticleReleaseCount());
|
|
|
}
|
|
|
}
|
|
|
+ List<Article> futurePublishList = futurePublishMap.get(data.getTitle());
|
|
|
+ if (CollectionUtils.isEmpty(futurePublishList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (Objects.isNull(data.getSecondFirstLevel())) {
|
|
|
return;
|
|
|
}
|
|
@@ -1066,6 +1076,26 @@ public class DataDashboardService {
|
|
|
item.setT3PlusDayViewBase(item.getT3PlusDayViewBase());
|
|
|
}
|
|
|
|
|
|
+ private int getPromotionPoolLevel(String ghId, String title,
|
|
|
+ Map<String, ArticlePoolPromotionSource> promotionSourceMap,
|
|
|
+ List<String> small) {
|
|
|
+ ArticlePoolPromotionSource promotionSource = promotionSourceMap.get(title);
|
|
|
+ if (Objects.isNull(promotionSource)) {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ if (promotionSource.getLevel().equals(ContentPoolEnum.autoArticlePoolLevel1.getContentPool())) {
|
|
|
+ if (small.contains(ghId)) {
|
|
|
+ return 3;
|
|
|
+ } else {
|
|
|
+ return 4;
|
|
|
+ }
|
|
|
+ } else if (promotionSource.getLevel().equals(ContentPoolEnum.autoArticlePoolLevel3.getContentPool())) {
|
|
|
+ return 2;
|
|
|
+ } else {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<NewSortStrategyExport> getNewSortStrategyExportList(List<Article> todayPublish,
|
|
|
Map<String, List<ArticleDetailInfo>> articleDetailInfoMap,
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap) {
|