|
@@ -116,7 +116,9 @@ public class ContentPlatformDatastatJob {
|
|
|
if (CollectionUtils.isNotEmpty(videoList)) {
|
|
|
List<Long> itemVideoIds = videoList.stream().map(ContentPlatformGzhPlanVideo::getVideoId).collect(Collectors.toList());
|
|
|
for (Long videoId : itemVideoIds) {
|
|
|
- score += videoMap.get(videoId).getScore();
|
|
|
+ if (Objects.nonNull(videoMap.get(videoId))) {
|
|
|
+ score += videoMap.get(videoId).getScore();
|
|
|
+ }
|
|
|
}
|
|
|
size += videoList.size();
|
|
|
}
|
|
@@ -191,9 +193,11 @@ public class ContentPlatformDatastatJob {
|
|
|
Long planId = rootSourceIdMap.get(rootSourceId);
|
|
|
Long videoId = planVideoMap.get(planId);
|
|
|
Double score = videoScoreMap.get(videoId);
|
|
|
- BigDecimal num = BigDecimal.valueOf(score);
|
|
|
- BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
|
|
|
- item.setScore(rounded.doubleValue());
|
|
|
+ if (Objects.nonNull(score)) {
|
|
|
+ BigDecimal num = BigDecimal.valueOf(score);
|
|
|
+ BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ item.setScore(rounded.doubleValue());
|
|
|
+ }
|
|
|
item.setRootSourceId(rootSourceId);
|
|
|
item.setFirstLevelCount(firstLevelCount);
|
|
|
item.setCreateTimestamp(now);
|