wangyunpeng hai 1 mes
pai
achega
4fc4d52f13

+ 19 - 18
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -313,24 +313,25 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     }
 
     private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemParam> videoList) {
-        for (GzhPlanVideoContentItemParam video : videoList) {
-            if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
-                continue;
-            }
-            List<CgiReplyBucketData> dataList = cgiReplyService.getCgiReplyBucketDataListByVideoId(video.getVideoId());
-            if (CollectionUtils.isEmpty(dataList)) {
-                continue;
-            }
-            String existsCover = dataList.get(0).getCoverUrl();
-            if (!existsCover.contains("?")) {
-                continue;
-            }
-            String coverSuffix = existsCover.substring(existsCover.indexOf("?"));
-            String cover = video.getCover().substring(0, existsCover.indexOf("?"));
-            cgiReplyBucketDataMapperExt.updateBucketDataTitleCoverByGhId(ghId, video.getVideoId(),
-                    StringUtils.hasText(video.getCustomTitle()) ? video.getCustomTitle() : video.getTitle(),
-                    StringUtils.hasText(video.getCustomCover()) ? video.getCustomCover() : cover + coverSuffix);
-        }
+        cgiReplyBucketDataMapperExt.deleteBucketDataByGhId(ghId);
+//        for (GzhPlanVideoContentItemParam video : videoList) {
+//            if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
+//                continue;
+//            }
+//            List<CgiReplyBucketData> dataList = cgiReplyService.getCgiReplyBucketDataListByVideoId(video.getVideoId());
+//            if (CollectionUtils.isEmpty(dataList)) {
+//                continue;
+//            }
+//            String existsCover = dataList.get(0).getCoverUrl();
+//            if (!existsCover.contains("?")) {
+//                continue;
+//            }
+//            String coverSuffix = existsCover.substring(existsCover.indexOf("?"));
+//            String cover = video.getCover().substring(0, existsCover.indexOf("?"));
+//            cgiReplyBucketDataMapperExt.updateBucketDataTitleCoverByGhId(ghId, video.getVideoId(),
+//                    StringUtils.hasText(video.getCustomTitle()) ? video.getCustomTitle() : video.getTitle(),
+//                    StringUtils.hasText(video.getCustomCover()) ? video.getCustomCover() : cover + coverSuffix);
+//        }
     }
 
     private void saveGzhPlanVideo(GzhPlanSaveParam param, List<Long> videoIds, Long planId,

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/ext/CgiReplyBucketDataMapperExt.java

@@ -10,4 +10,6 @@ public interface CgiReplyBucketDataMapperExt {
                                           @Param("videoId") Long videoId,
                                           @Param("title") String title,
                                           @Param("cover") String cover);
+
+    void deleteBucketDataByGhId(@Param("ghId") String ghId);
 }

+ 7 - 0
common-module/src/main/resources/mapper/ext/CgiReplyBucketDataMapperExt.xml

@@ -11,4 +11,11 @@
         and is_delete = 0
   </update>
 
+  <update id="deleteBucketDataByGhId">
+      update cgi_reply_bucket_data
+      set is_delete = 1
+      where gh_id = #{ghId}
+        and is_delete = 0
+  </update>
+
 </mapper>