|
|
@@ -31,6 +31,7 @@ import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.GhDetail;
|
|
|
import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
|
|
|
+import com.tzld.piaoquan.growth.common.utils.DateUtils;
|
|
|
import com.tzld.piaoquan.growth.common.utils.MessageUtil;
|
|
|
import com.tzld.piaoquan.growth.common.utils.page.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -476,14 +477,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
ContentPlatformAccount user = LoginUserContext.getUser();
|
|
|
Page<VideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
|
|
|
int offset = (param.getPageNum() - 1) * param.getPageSize();
|
|
|
+ // get sql Filter param
|
|
|
String dt = planMapperExt.getVideoMaxDt();
|
|
|
String datastatDt = planMapperExt.getVideoDatastatMaxDt();
|
|
|
- int count = planMapperExt.getVideoCount(param, dt, videoMinScore);
|
|
|
- result.setTotalSize(count);
|
|
|
- if (count == 0) {
|
|
|
- result.setObjs(new ArrayList<>());
|
|
|
- return result;
|
|
|
- }
|
|
|
String sort = getVideoContentListSort(param.getSortType(), param.getSort());
|
|
|
String type = getVideoContentListType(param.getType());
|
|
|
String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
|
|
|
@@ -492,6 +488,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
String tagFilterSql = getVideoContentListTagFilterSql(param.getTags(), user.getId(), type, user.getChannel());
|
|
|
// 近期未使用
|
|
|
Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
|
|
|
+
|
|
|
+ int count = planMapperExt.getVideoCount(param, dt, datastatDt, type, channel, strategy,
|
|
|
+ videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql);
|
|
|
+ result.setTotalSize(count);
|
|
|
+ if (count == 0) {
|
|
|
+ result.setObjs(new ArrayList<>());
|
|
|
+ return result;
|
|
|
+ }
|
|
|
List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, strategy,
|
|
|
videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, offset, param.getPageSize(), sort);
|
|
|
List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), dt, datastatDt);
|
|
|
@@ -514,10 +518,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
item = "videoTag.account_id = " + accountId;
|
|
|
break;
|
|
|
case "你的用户爱看":
|
|
|
- item = "videoTag.type = " + type;
|
|
|
+ item = "videoTag.type = '" + type + "'";
|
|
|
break;
|
|
|
case "猜TA想看":
|
|
|
- item = "videoTag.channel = " + channel;
|
|
|
+ item = "videoTag.channel = '" + channel + "'";
|
|
|
break;
|
|
|
default:
|
|
|
item = null;
|
|
|
@@ -541,7 +545,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
if (videoRecentNotUsedEnum == VideoRecentNotUsedEnum.HISTORY) {
|
|
|
return 0L;
|
|
|
}
|
|
|
- return System.currentTimeMillis() - videoRecentNotUsedEnum.getDays() * 24 * 60 * 60 * 1000;
|
|
|
+ return DateUtils.todayBegin().getTime() - videoRecentNotUsedEnum.getDays() * 24 * 60 * 60 * 1000;
|
|
|
}
|
|
|
|
|
|
private String getVideoContentListType(Integer type) {
|
|
|
@@ -621,7 +625,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
.filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
|
|
|
ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
|
|
|
// tag
|
|
|
- List<ContentPlatformVideoTag> videoTagList = planMapperExt.getVideoTagList(dt, videoIds, user.getId(), type, channel);
|
|
|
+ List<ContentPlatformVideoTag> videoTagList = planMapperExt.getVideoTagList(dt, videoIds, user.getId(), type, userChannel);
|
|
|
Map<Long, List<ContentPlatformVideoTag>> videoTagMap = videoTagList.stream()
|
|
|
.collect(Collectors.groupingBy(ContentPlatformVideoTag::getVideoId));
|
|
|
List<VideoContentItemVO> result = new ArrayList<>();
|