|
@@ -340,6 +340,12 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
}
|
|
|
}
|
|
|
for (GzhPlanVideoContentItemParam vo : param.getVideoList()) {
|
|
|
+ if (!StringUtils.hasText(vo.getCustomTitle())) {
|
|
|
+ vo.setCustomTitle(null);
|
|
|
+ }
|
|
|
+ if (!StringUtils.hasText(vo.getCustomCover())) {
|
|
|
+ vo.setCustomCover(null);
|
|
|
+ }
|
|
|
if (existsVideoIds.contains(vo.getVideoId())) {
|
|
|
ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
|
|
|
item.setTitle(vo.getTitle());
|
|
@@ -367,7 +373,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
}
|
|
|
item.setCreateAccountId(loginAccount.getId());
|
|
|
item.setCreateTimestamp(System.currentTimeMillis());
|
|
|
- gzhPlanVideoMapper.insertSelective(item);
|
|
|
+ gzhPlanVideoMapper.insert(item);
|
|
|
}
|
|
|
}
|
|
|
if (CollectionUtils.isNotEmpty(param.getVideoList())) {
|
|
@@ -463,7 +469,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
String type = getVideoContentListType(param.getType());
|
|
|
String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
|
|
|
List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, videoMinScore, offset, param.getPageSize(), sort);
|
|
|
- List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, user.getChannel(), datastatDt);
|
|
|
+ List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, channel, user.getChannel(), datastatDt);
|
|
|
result.setObjs(list);
|
|
|
return result;
|
|
|
}
|
|
@@ -504,7 +510,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
}
|
|
|
|
|
|
private List<VideoContentItemVO> buildVideoContentItemVOList(List<ContentPlatformVideo> videoList,
|
|
|
- String type, String channel, String datastatDt) {
|
|
|
+ String type, String channel, String userChannel, String datastatDt) {
|
|
|
if (CollectionUtils.isEmpty(videoList)) {
|
|
|
return null;
|
|
|
}
|
|
@@ -518,10 +524,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
Set<Long> ids = new HashSet<>(partition);
|
|
|
coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
|
|
|
}
|
|
|
- List<ContentPlatformVideoDataStatAgg> typeVideoDataStatAggList = getTypeVideoDataStatAggList(datastatDt, type, videoIds);
|
|
|
+ List<ContentPlatformVideoDataStatAgg> typeVideoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, channel, videoIds);
|
|
|
Map<Long, Double> typeVideoScoreMap = typeVideoDataStatAggList.stream().collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
- List<ContentPlatformVideoDataStatAgg> channelVideoDataStatAggList = getChannelVideoDataStatAggList(datastatDt, channel, videoIds);
|
|
|
+ List<ContentPlatformVideoDataStatAgg> channelVideoDataStatAggList = getTypeChannelVideoDataStatAggList(datastatDt, type, userChannel, videoIds);
|
|
|
Map<Long, Double> channelVideoScoreMap = channelVideoDataStatAggList.stream().collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
List<VideoContentItemVO> result = new ArrayList<>();
|
|
@@ -544,15 +550,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private List<ContentPlatformVideoDataStatAgg> getChannelVideoDataStatAggList(String datastatDt, String channel, List<Long> videoIds) {
|
|
|
- ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
|
|
|
- example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andChannelEqualTo(channel);
|
|
|
- return videoDataStatAggMapper.selectByExample(example);
|
|
|
- }
|
|
|
-
|
|
|
- private List<ContentPlatformVideoDataStatAgg> getTypeVideoDataStatAggList(String datastatDt, String type, List<Long> videoIds) {
|
|
|
+ private List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt, String type, String channel, List<Long> videoIds) {
|
|
|
ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
|
|
|
- example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type);
|
|
|
+ example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type).andChannelEqualTo(channel);
|
|
|
return videoDataStatAggMapper.selectByExample(example);
|
|
|
}
|
|
|
|