|
|
@@ -8,6 +8,7 @@ import com.tzld.piaoquan.api.component.VideoApiService;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComMsgMapper;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ThirdPartWeComRoomMapper;
|
|
|
+import com.tzld.piaoquan.api.dao.mapper.wecom.thirdpart.ext.ThirdPartWeComVideoMapperExt;
|
|
|
import com.tzld.piaoquan.api.model.param.wecom.thirdpart.*;
|
|
|
import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
|
|
|
import com.tzld.piaoquan.api.model.po.wecom.thirdpart.*;
|
|
|
@@ -57,6 +58,8 @@ public class WeComSendMsgJob {
|
|
|
@Autowired
|
|
|
ContentPlatformPlanMapperExt planMapperExt;
|
|
|
@Autowired
|
|
|
+ ThirdPartWeComVideoMapperExt videoMapperExt;
|
|
|
+ @Autowired
|
|
|
ThirdPartWeComRoomMapper roomMapper;
|
|
|
@Autowired
|
|
|
ThirdPartWeComMsgMapper msgMapper;
|
|
|
@@ -215,16 +218,10 @@ public class WeComSendMsgJob {
|
|
|
ThirdPartWeComStaff thirdPartWeComStaff,
|
|
|
ThirdPartWeComRoomConfig roomConfig,
|
|
|
ThirdPartWeComRoomConfigTaskContent configTaskContent) {
|
|
|
- String dt = planMapperExt.getVideoMaxDt();
|
|
|
- String datastatDt = planMapperExt.getVideoDatastatMaxDt();
|
|
|
// 排除最近发送过的视频
|
|
|
List<Long> sentVideoIds = getSentVideoIds(Long.valueOf(roomId));
|
|
|
- // 按行业获取视频
|
|
|
- String sort = "datastat.fission_rate desc, video.score desc";
|
|
|
- String type = "企微-社群";
|
|
|
- String channel = "sum";
|
|
|
- List<ContentPlatformVideo> videoList = getVideoByStrategy(thirdPartWeComStaff.getThirdStaffId(), roomId,
|
|
|
- dt, datastatDt, type, channel, videoMinScore, sentVideoIds, configTaskContent, 1, 100, sort);
|
|
|
+ List<ContentPlatformVideo> videoList = getVideoByStrategy(roomId, videoMinScore, sentVideoIds,
|
|
|
+ configTaskContent, 1, 100);
|
|
|
if (CollectionUtils.isEmpty(videoList)) {
|
|
|
LarkRobotUtil.sendWeComThirdPartMessage(
|
|
|
"【账号发送群消息,视频数量不足通知】\n" +
|
|
|
@@ -252,18 +249,12 @@ public class WeComSendMsgJob {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private List<ContentPlatformVideo> getVideoByStrategy(Long staffId,
|
|
|
- String roomId,
|
|
|
- String dt,
|
|
|
- String datastatDt,
|
|
|
- String type,
|
|
|
- String channel,
|
|
|
+ private List<ContentPlatformVideo> getVideoByStrategy(String roomId,
|
|
|
Double videoMinScore,
|
|
|
List<Long> sentVideoIds,
|
|
|
ThirdPartWeComRoomConfigTaskContent configTaskContent,
|
|
|
int pageNum,
|
|
|
- int pageSize,
|
|
|
- String sort) {
|
|
|
+ int pageSize) {
|
|
|
List<ContentPlatformVideo> result = new ArrayList<>();
|
|
|
List<ContentPlatformVideo> videoList;
|
|
|
// 0-热榜 1-标签 2-账号
|
|
|
@@ -287,11 +278,8 @@ public class WeComSendMsgJob {
|
|
|
result.addAll(videoList);
|
|
|
break;
|
|
|
default:
|
|
|
- result = planMapperExt.getVideoMinDatastatScoreList(dt, datastatDt,
|
|
|
- type, channel, "normal", videoMinScore, sentVideoIds, 0, 100, sort);
|
|
|
- // 行业数量不足,按平台推荐top选取视频
|
|
|
- sort = "video.score desc";
|
|
|
- result.addAll(planMapperExt.getVideoMinScoreList(dt, videoMinScore, roomId, 0, 100, sort));
|
|
|
+ // 按平台推荐top选取视频
|
|
|
+ result.addAll(videoMapperExt.getVideoMinScoreList(videoMinScore, roomId, 0, 100, "video.score desc"));
|
|
|
}
|
|
|
return result;
|
|
|
}
|