Просмотр исходного кода

Merge branch 'wyp/1102-exportFix' of Server/long-article-recommend into master

wangyunpeng 7 месяцев назад
Родитель
Сommit
dc64ca59d6

+ 7 - 6
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/DataDashboardService.java

@@ -963,7 +963,7 @@ public class DataDashboardService {
             // 发布表现
             setPublishPerformance(item, data, publishSortLogMap);
             // 发布依赖表现
-            setPublishSourcePerformance(item, data, accountAvgInfoIndexMap, articleDetailInfoMap, publishSortLogMap,
+            setPublishSourcePerformance(item, data, article, accountAvgInfoIndexMap, articleDetailInfoMap, publishSortLogMap,
                     type, scoreHisPublishTimeMap, wxsnHisDistinctSetMap, list, poolLevel, small, hisPublishMap);
             // 发布未来表现
             setPublishFuturePerformance(item, data, poolLevel, promotionSourceMap, futurePublishMap, small);
@@ -1163,6 +1163,7 @@ public class DataDashboardService {
 
     private void setPublishSourcePerformance(IntermediateIndicatorsExport item,
                                              NewSortStrategyExport data,
+                                             Article article,
                                              Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
                                              Map<String, List<ArticleDetailInfo>> articleDetailInfoMap,
                                              Map<String, Map<String, Map<Integer, List<PublishSortLog>>>> publishSortLogMap,
@@ -1263,12 +1264,12 @@ public class DataDashboardService {
                     }
                 }
             }
-            double firstExplorationIntervalAvg = Double.isNaN(item.getFirstExplorationIntervalAvg()) ? 0.0 : item.getFirstExplorationIntervalAvg();
-            double explorationInterval = (publish.getPublishTimestamp() - hisMinDate) / 86400.0;
-            firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getTotalArticleReleaseCountNonInfinite() - 1)
-                    + explorationInterval) / item.getTotalArticleReleaseCountNonInfinite();
-            item.setFirstExplorationIntervalAvg(firstExplorationIntervalAvg);
         }
+        double firstExplorationIntervalAvg = Double.isNaN(item.getFirstExplorationIntervalAvg()) ? 0.0 : item.getFirstExplorationIntervalAvg();
+        double explorationInterval = (article.getPublishTimestamp() - hisMinDate) / 86400.0;
+        firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getTotalArticleReleaseCountNonInfinite() - 1)
+                + explorationInterval) / item.getTotalArticleReleaseCountNonInfinite();
+        item.setFirstExplorationIntervalAvg(firstExplorationIntervalAvg);
         scoreHisPublishTimeMap.put(type, scorePublishTime);
     }
 

+ 1 - 1
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/DataDashboardTest.java

@@ -19,7 +19,7 @@ public class DataDashboardTest {
 
     @Test
     public void test() {
-        List<IntermediateIndicatorsExport> result = dataDashboardService.intermediateIndicatorsData("20241122");
+        List<IntermediateIndicatorsExport> result = dataDashboardService.intermediateIndicatorsData("20241129");
         log.info(JSONObject.toJSONString(result));
     }
 }