wangyunpeng 1 день назад
Родитель
Сommit
ddf27ffe2e

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/CgiReplyService.java

@@ -10,6 +10,8 @@ import java.util.List;
 public interface CgiReplyService {
     ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam);
 
+    List<CgiReplyBucketData> getCgiReplyBucketDataListByGhId(String ghId, String strategy);
+
     List<CgiReplyBucketData> getCgiReplyBucketDataListByGhIds(List<String> ghIds, String strategy);
 
     List<CgiReplyBucketData> getCgiReplyBucketDataListByVideoId(Long videoId);

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

@@ -38,6 +38,7 @@ import com.tzld.piaoquan.growth.common.utils.MessageUtil;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -164,6 +165,13 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 planItemVO.setTitle(titleList);
                 List<GzhPlanVideoContentItemVO> videoVOList = new ArrayList<>();
                 Map<Long, CgiReplyBucketData> bucketDataMapByGhId = bucketDataMap.get(gzhAccount.getGhId());
+                if (MapUtils.isEmpty(bucketDataMapByGhId)) {
+                    BucketDataParam bucketDataParam = new BucketDataParam();
+                    bucketDataParam.setGhId(gzhAccount.getGhId());
+                    cgiReplyService.getRgiReplyData(bucketDataParam);
+                    List<CgiReplyBucketData> bucketDatas = cgiReplyService.getCgiReplyBucketDataListByGhId(gzhAccount.getGhId(), "manual");
+                    bucketDataMapByGhId = bucketDatas.stream().collect(Collectors.toMap(CgiReplyBucketData::getMiniVideoId, Function.identity(), (a, b) -> b));
+                }
                 for (ContentPlatformGzhPlanVideo video : videoListByPlanId) {
                     GzhPlanVideoContentItemVO videoItemVO = new GzhPlanVideoContentItemVO();
                     videoItemVO.setVideoId(video.getVideoId());

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java

@@ -125,6 +125,13 @@ public class CgiReplyServiceImpl implements CgiReplyService {
         return null;
     }
 
+    @Override
+    public List<CgiReplyBucketData> getCgiReplyBucketDataListByGhId(String ghId, String strategy) {
+        CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
+        example.createCriteria().andGhIdEqualTo(ghId).andStrategyEqualTo(strategy).andIsDeleteEqualTo(0);
+        return cgiReplyBucketDataMapper.selectByExample(example);
+    }
+
     @Override
     public List<CgiReplyBucketData> getCgiReplyBucketDataListByGhIds(List<String> ghIds, String strategy) {
         CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();