|
@@ -216,23 +216,19 @@ public class WeComMessageDataJob {
|
|
|
if (guaranteedParam == null || CollectionUtils.isEmpty(guaranteedParam.getVideoParamList())) {
|
|
|
return;
|
|
|
}
|
|
|
- List<Long> videoIdList = new ArrayList<>();
|
|
|
+ Set<Long> videoIdSet = new HashSet<>();
|
|
|
for (VideoParam videoParam : guaranteedParam.getVideoParamList()) {
|
|
|
if (CollectionUtils.isEmpty(videoParam.getVideoIds())) {
|
|
|
continue;
|
|
|
}
|
|
|
- videoIdList.addAll(videoParam.getVideoIds());
|
|
|
+ videoIdSet.addAll(videoParam.getVideoIds());
|
|
|
}
|
|
|
-
|
|
|
+ List<Long> videoIdList = new ArrayList<>(videoIdSet);
|
|
|
MessageAttachmentExample example = new MessageAttachmentExample();
|
|
|
example.createCriteria().andMiniprogramVideoIdIn(videoIdList);
|
|
|
- List<MessageAttachment> messageAttachmentList = messageAttachmentMapper.selectByExample(example);
|
|
|
- for (MessageAttachment messageAttachment : messageAttachmentList) {
|
|
|
- MessageAttachment updateMessageAttachment = new MessageAttachment();
|
|
|
- updateMessageAttachment.setId(messageAttachment.getId());
|
|
|
- updateMessageAttachment.setSendTime(new Date());
|
|
|
- messageAttachmentMapper.updateByPrimaryKeySelective(updateMessageAttachment);
|
|
|
- }
|
|
|
+ MessageAttachment updateMessageAttachment = new MessageAttachment();
|
|
|
+ updateMessageAttachment.setSendTime(new Date());
|
|
|
+ messageAttachmentMapper.updateByExampleSelective(updateMessageAttachment, example);
|
|
|
redisTemplate.delete(key);
|
|
|
}
|
|
|
|