Procházet zdrojové kódy

Merge branch 'dev-xym-fix' of Server/long-article-manage into master

xueyiming před 1 měsícem
rodič
revize
1ec60f1498

+ 9 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java

@@ -230,6 +230,15 @@ public class MatchVideoServiceImpl {
     }
     }
 
 
     public void addCrawlerVideo(MatchVideo matchVideo) {
     public void addCrawlerVideo(MatchVideo matchVideo) {
+
+        //判断数据是否已经存在
+        CrawlerVideoExample crawlerVideoExample = new CrawlerVideoExample();
+        crawlerVideoExample.createCriteria().andContentIdEqualTo(matchVideo.getContentId());
+        long l = crawlerVideoMapper.countByExample(crawlerVideoExample);
+        if (l > 0) {
+            return;
+        }
+
         //数据准备
         //数据准备
         SingleVideoSourceExample example = new SingleVideoSourceExample();
         SingleVideoSourceExample example = new SingleVideoSourceExample();
         example.createCriteria().andContentTraceIdEqualTo(matchVideo.getVideoPoolTraceId());
         example.createCriteria().andContentTraceIdEqualTo(matchVideo.getVideoPoolTraceId());
@@ -246,7 +255,6 @@ public class MatchVideoServiceImpl {
         SingleVideoSource singleVideoSource = singleVideoSources.get(0);
         SingleVideoSource singleVideoSource = singleVideoSources.get(0);
         VideoContentUnderstanding videoContentUnderstanding = videoContentUnderstandings.get(0);
         VideoContentUnderstanding videoContentUnderstanding = videoContentUnderstandings.get(0);
 
 
-
         //视频抓取表插入
         //视频抓取表插入
         CrawlerVideo crawlerVideo = new CrawlerVideo();
         CrawlerVideo crawlerVideo = new CrawlerVideo();
         crawlerVideo.setDownloadStatus(2);
         crawlerVideo.setDownloadStatus(2);