|
@@ -107,11 +107,13 @@ public class ArticleAuditService {
|
|
|
List<LongArticlesMatchVideoResponse> responseList = JSONArray.parseArray(longArticlesMatchVideo.getResponse()
|
|
|
, LongArticlesMatchVideoResponse.class);
|
|
|
for (LongArticlesMatchVideoResponse response : responseList) {
|
|
|
- String ossPath = getOssPath(response.getVideoPath());
|
|
|
- if (existsOssPath.contains(ossPath)) {
|
|
|
- continue;
|
|
|
+ String ossPath = response.getVideoOSS();
|
|
|
+ if (StringUtils.hasText(ossPath)) {
|
|
|
+ if (existsOssPath.contains(ossPath)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ existsOssPath.add(ossPath);
|
|
|
}
|
|
|
- existsOssPath.add(ossPath);
|
|
|
LongArticleVideoAudit videoAudit = new LongArticleVideoAudit();
|
|
|
videoAudit.setVideoId(response.getVideoID());
|
|
|
videoAudit.setTraceId(traceId);
|
|
@@ -209,10 +211,21 @@ public class ArticleAuditService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void saveDeleteRecord(String ossPath) {
|
|
|
- List<LongArticleCrawlerVideo> crawlerVideoList = longArticleCrawlerVideoRepository.getByVideoOssPath(ossPath);
|
|
|
+ public String saveDeleteRecord(Long videoId) {
|
|
|
+ GetOffVideoArticle getOffVideos = getOffVideoArticleRepository.getByVideoId(videoId);
|
|
|
+ String traceId = getOffVideos.getTraceId();
|
|
|
+ LongArticlesMatchVideo matchVideo = longArticlesMatchVideoRepository.getByTraceId(traceId);
|
|
|
+ List<LongArticlesMatchVideoResponse> responseList = JSONArray.parseArray(matchVideo.getResponse()
|
|
|
+ , LongArticlesMatchVideoResponse.class);
|
|
|
+ LongArticlesMatchVideoResponse response = responseList.stream()
|
|
|
+ .filter(o -> o.getVideoID() == videoId).findFirst().orElse(null);
|
|
|
+ if (Objects.isNull(response) || !StringUtils.hasText(response.getVideoOSS())) {
|
|
|
+ return "matchVideo response videoOss null videoId:" + videoId + " traceId:" + traceId;
|
|
|
+ }
|
|
|
+ List<LongArticleCrawlerVideo> crawlerVideoList = longArticleCrawlerVideoRepository.getByVideoOssPath(response.getVideoOSS());
|
|
|
if (CollectionUtils.isEmpty(crawlerVideoList)) {
|
|
|
- return;
|
|
|
+ return "matchVideo response videoOss findCrawlerVideo Null videoId:" + videoId +
|
|
|
+ " traceId:" + traceId + " videoOss:" + response.getVideoOSS();
|
|
|
}
|
|
|
for (LongArticleCrawlerVideo longArticleCrawlerVideo : crawlerVideoList) {
|
|
|
longArticleCrawlerVideo.setIsIllegal(1);
|
|
@@ -221,13 +234,13 @@ public class ArticleAuditService {
|
|
|
List<String> contentIds = crawlerVideoList.stream().map(LongArticleCrawlerVideo::getContentId).collect(Collectors.toList());
|
|
|
List<LongArticlesMatchVideo> matchVideoList = longArticlesMatchVideoRepository.getByContentIdIn(contentIds);
|
|
|
Map<String, LongArticlesMatchVideo> matchVideoMap = matchVideoList.stream()
|
|
|
- .collect(Collectors.toMap(LongArticlesMatchVideo::getTraceId, Function.identity()));
|
|
|
+ .collect(Collectors.toMap(LongArticlesMatchVideo::getTraceId, Function.identity()));
|
|
|
List<String> traceIds = matchVideoList.stream().map(LongArticlesMatchVideo::getTraceId).collect(Collectors.toList());
|
|
|
List<PublishContentMiniprogramDTO> publishContentMiniprogramList = aigcBaseMapper.getPublishContentByTraceIdIn(traceIds);
|
|
|
List<String> publishContentIds = publishContentMiniprogramList.stream()
|
|
|
.map(PublishContentMiniprogramDTO::getPublishContentId).collect(Collectors.toList());
|
|
|
Map<String, String> PublishTraceIdMap = publishContentMiniprogramList.stream()
|
|
|
- .collect(Collectors.toMap(PublishContentMiniprogramDTO::getPublishContentId, PublishContentMiniprogramDTO::getTraceId));
|
|
|
+ .collect(Collectors.toMap(PublishContentMiniprogramDTO::getPublishContentId, PublishContentMiniprogramDTO::getTraceId));
|
|
|
// 过滤状态非已发布内容
|
|
|
List<PublishContent> publishContentList = publishContentRepository.getByIdIn(publishContentIds);
|
|
|
List<String> publishedIds = publishContentList.stream()
|
|
@@ -237,9 +250,10 @@ public class ArticleAuditService {
|
|
|
List<String> deleteTraceIds = publishContentIds.stream().map(PublishTraceIdMap::get).collect(Collectors.toList());
|
|
|
// 重新匹配小程序
|
|
|
List<String> reMatchTraceIds = traceIds.stream().filter(o -> !deleteTraceIds.contains(o)).collect(Collectors.toList());
|
|
|
- buildReMatchRecord(reMatchTraceIds, ossPath, matchVideoMap);
|
|
|
+ buildReMatchRecord(reMatchTraceIds, response.getVideoOSS(), matchVideoMap);
|
|
|
// 文章删除
|
|
|
buildArticleAuditDelete(publishContentIds);
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
private void buildReMatchRecord(List<String> reMatchTraceIds, String ossPath,
|
|
@@ -430,8 +444,8 @@ public class ArticleAuditService {
|
|
|
}
|
|
|
// 处理视频内容池内容
|
|
|
List<PublishContentDTO> videoPoolContents = publishContents.stream()
|
|
|
- .filter(o -> Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .filter(o -> Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal()))
|
|
|
+ .collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(videoPoolContents)) {
|
|
|
for (PublishContentDTO videoPoolContent : videoPoolContents) {
|
|
|
longArticleBaseMapper.updateVideoPoolContentBad(videoPoolContent.getSourceId());
|