浏览代码

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

wangyunpeng 7 月之前
父节点
当前提交
1a0a5ecf13

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

@@ -1265,11 +1265,13 @@ public class DataDashboardService {
                 }
             }
         }
-        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);
+        if (hisMinDate > 0) {
+            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);
     }