|
@@ -64,9 +64,9 @@ public class WeComSendMsgJob {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
RedisUtils redisUtils;
|
|
RedisUtils redisUtils;
|
|
|
|
|
|
|
|
- @Value("${send.room.msg.video.min.score:3}")
|
|
|
|
|
|
|
+ @Value("${send.room.msg.video.min.score:1}")
|
|
|
private Double videoMinScore;
|
|
private Double videoMinScore;
|
|
|
- @Value("${send.room.msg.duplicate.days:7}")
|
|
|
|
|
|
|
+ @Value("${send.room.msg.duplicate.days:30}")
|
|
|
private Integer duplicateDays;
|
|
private Integer duplicateDays;
|
|
|
|
|
|
|
|
private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
|
|
private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
|
|
@@ -121,7 +121,7 @@ public class WeComSendMsgJob {
|
|
|
}
|
|
}
|
|
|
contentList = contentList.stream().sorted(Comparator.comparing(ThirdPartWeComRoomConfigTaskContent::getSeq)).collect(Collectors.toList());
|
|
contentList = contentList.stream().sorted(Comparator.comparing(ThirdPartWeComRoomConfigTaskContent::getSeq)).collect(Collectors.toList());
|
|
|
for (ThirdPartWeComRoomConfigTaskContent configTaskContent : contentList) {
|
|
for (ThirdPartWeComRoomConfigTaskContent configTaskContent : contentList) {
|
|
|
- if (ConfigTaskContentTypeEnum.TEXT.getVal() != configTaskContent.getType()) {
|
|
|
|
|
|
|
+ if (ConfigTaskContentTypeEnum.TEXT.getVal() == configTaskContent.getType()) {
|
|
|
// build发送体
|
|
// build发送体
|
|
|
SendTextMsgRequest request = buildSendTextMsgRequest(configTaskContent.getContent(), staff, room);
|
|
SendTextMsgRequest request = buildSendTextMsgRequest(configTaskContent.getContent(), staff, room);
|
|
|
// 发送消息
|
|
// 发送消息
|
|
@@ -291,7 +291,7 @@ public class WeComSendMsgJob {
|
|
|
type, channel, "normal", videoMinScore, sentVideoIds, 0, 100, sort);
|
|
type, channel, "normal", videoMinScore, sentVideoIds, 0, 100, sort);
|
|
|
// 行业数量不足,按平台推荐top选取视频
|
|
// 行业数量不足,按平台推荐top选取视频
|
|
|
sort = "video.score desc";
|
|
sort = "video.score desc";
|
|
|
- result.addAll(planMapperExt.getVideoMinScoreList(dt, videoMinScore, sentVideoIds, 0, 100, sort));
|
|
|
|
|
|
|
+ result.addAll(planMapperExt.getVideoMinScoreList(dt, videoMinScore, roomId, 0, 100, sort));
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -311,7 +311,8 @@ public class WeComSendMsgJob {
|
|
|
private List<Long> getSentVideoIds(Long roomId) {
|
|
private List<Long> getSentVideoIds(Long roomId) {
|
|
|
ThirdPartWeComMsgExample msgExample = new ThirdPartWeComMsgExample();
|
|
ThirdPartWeComMsgExample msgExample = new ThirdPartWeComMsgExample();
|
|
|
msgExample.createCriteria().andSendUseridEqualTo(roomId)
|
|
msgExample.createCriteria().andSendUseridEqualTo(roomId)
|
|
|
- .andCreateTimeGreaterThan(DateUtil.getDaysAgoDate(duplicateDays));
|
|
|
|
|
|
|
+ .andCreateTimeGreaterThan(DateUtil.getDaysAgoDate(duplicateDays))
|
|
|
|
|
+ .andVideoIdIsNotNull();
|
|
|
List<ThirdPartWeComMsg> msgList = msgMapper.selectByExample(msgExample);
|
|
List<ThirdPartWeComMsg> msgList = msgMapper.selectByExample(msgExample);
|
|
|
return msgList.stream().map(ThirdPartWeComMsg::getVideoId).collect(Collectors.toList());
|
|
return msgList.stream().map(ThirdPartWeComMsg::getVideoId).collect(Collectors.toList());
|
|
|
}
|
|
}
|