|
@@ -13,6 +13,7 @@ import com.tzld.piaoquan.api.component.VlogApiService;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
|
|
|
import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
|
|
|
import com.tzld.piaoquan.api.model.bo.AdPutFlowRecordTencent;
|
|
|
+import com.tzld.piaoquan.api.model.bo.BucketDataParam;
|
|
|
import com.tzld.piaoquan.api.model.config.LoginUserContext;
|
|
|
import com.tzld.piaoquan.api.model.param.contentplatform.*;
|
|
|
import com.tzld.piaoquan.api.model.po.contentplatform.*;
|
|
@@ -21,17 +22,16 @@ import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanVideoContentItemVO;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
|
|
|
import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
|
|
|
+import com.tzld.piaoquan.api.service.CgiReplyService;
|
|
|
import com.tzld.piaoquan.api.service.GhDetailService;
|
|
|
import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformAccountService;
|
|
|
import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
|
|
|
import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
|
|
|
import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
|
|
|
-import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
|
|
|
import com.tzld.piaoquan.growth.common.dao.mapper.ext.CgiReplyBucketDataMapperExt;
|
|
|
import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
|
|
|
-import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
|
|
|
import com.tzld.piaoquan.growth.common.model.po.GhDetail;
|
|
|
import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
|
|
|
import com.tzld.piaoquan.growth.common.utils.MessageUtil;
|
|
@@ -63,8 +63,6 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
@Autowired
|
|
|
private ContentPlatformQwPlanVideoMapper qwPlanVideoMapper;
|
|
|
@Autowired
|
|
|
- private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
|
|
|
- @Autowired
|
|
|
private CgiReplyBucketDataMapperExt cgiReplyBucketDataMapperExt;
|
|
|
@Autowired
|
|
|
private ContentPlatformVideoMapper contentPlatformVideoMapper;
|
|
@@ -84,6 +82,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
private ContentPlatformAccountService accountService;
|
|
|
@Autowired
|
|
|
private AdApiService adApiService;
|
|
|
+ @Autowired
|
|
|
+ private CgiReplyService cgiReplyService;
|
|
|
+
|
|
|
|
|
|
@Value("${vlog.share.appType:11}")
|
|
|
private String shareAppType;
|
|
@@ -114,18 +115,26 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
}
|
|
|
List<Long> accountIds = planList.stream().map(ContentPlatformGzhPlan::getAccountId).collect(Collectors.toList());
|
|
|
List<ContentPlatformGzhAccount> accountList = cooperateAccountService.getAccountListByIds(accountIds);
|
|
|
- Map<Long, String> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId,
|
|
|
- ContentPlatformGzhAccount::getName));
|
|
|
+ Map<Long, ContentPlatformGzhAccount> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId,
|
|
|
+ Function.identity()));
|
|
|
List<Long> planIds = planList.stream().map(ContentPlatformGzhPlan::getId).collect(Collectors.toList());
|
|
|
List<ContentPlatformGzhPlanVideo> videoList = getGzhPlanVideoList(planIds);
|
|
|
Map<Long, List<ContentPlatformGzhPlanVideo>> videoMap = videoList.stream()
|
|
|
.collect(Collectors.groupingBy(ContentPlatformGzhPlanVideo::getPlanId));
|
|
|
+ List<String> ghIds = accountList.stream().map(ContentPlatformGzhAccount::getGhId).collect(Collectors.toList());
|
|
|
+ List<CgiReplyBucketData> bucketDataList = cgiReplyService.getCgiReplyBucketDataListByGhIds(ghIds, "manual");
|
|
|
+ Map<String, Map<Long, CgiReplyBucketData>> bucketDataMap = bucketDataList.stream()
|
|
|
+ .collect(Collectors.groupingBy(CgiReplyBucketData::getGhId,
|
|
|
+ Collectors.toMap(CgiReplyBucketData::getMiniVideoId, Function.identity())));
|
|
|
List<GzhPlanItemVO> result = new ArrayList<>();
|
|
|
for (ContentPlatformGzhPlan gzhPlan : planList) {
|
|
|
GzhPlanItemVO planItemVO = new GzhPlanItemVO();
|
|
|
planItemVO.setId(gzhPlan.getId());
|
|
|
planItemVO.setAccountId(gzhPlan.getAccountId());
|
|
|
- planItemVO.setAccountName(accountMap.get(gzhPlan.getAccountId()));
|
|
|
+ ContentPlatformGzhAccount gzhAccount = accountMap.get(gzhPlan.getAccountId());
|
|
|
+ if (Objects.nonNull(gzhAccount)) {
|
|
|
+ planItemVO.setAccountName(gzhAccount.getName());
|
|
|
+ }
|
|
|
planItemVO.setType(gzhPlan.getType());
|
|
|
planItemVO.setScene(gzhPlan.getScene());
|
|
|
planItemVO.setPublishStage(gzhPlan.getPublishStage());
|
|
@@ -137,6 +146,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
.collect(Collectors.toList());
|
|
|
planItemVO.setTitle(titleList);
|
|
|
List<GzhPlanVideoContentItemVO> videoVOList = new ArrayList<>();
|
|
|
+ Map<Long, CgiReplyBucketData> bucketDataMapByGhId = bucketDataMap.get(gzhAccount.getGhId());
|
|
|
for (ContentPlatformGzhPlanVideo video : videoListByPlanId) {
|
|
|
GzhPlanVideoContentItemVO videoItemVO = new GzhPlanVideoContentItemVO();
|
|
|
videoItemVO.setVideoId(video.getVideoId());
|
|
@@ -146,7 +156,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
videoItemVO.setCustomCover(video.getCustomCover());
|
|
|
videoItemVO.setCustomCoverType(video.getCustomCoverType());
|
|
|
videoItemVO.setVideo(video.getVideo());
|
|
|
- videoItemVO.setPageUrl(null);
|
|
|
+ CgiReplyBucketData bucketData = bucketDataMapByGhId.get(video.getVideoId());
|
|
|
+ if (Objects.nonNull(bucketData)) {
|
|
|
+ videoItemVO.setPageUrl(bucketData.getMiniPagePath());
|
|
|
+ }
|
|
|
videoVOList.add(videoItemVO);
|
|
|
}
|
|
|
planItemVO.setVideoList(videoVOList);
|
|
@@ -259,7 +272,13 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
// 保存视频内容
|
|
|
saveGzhPlanVideo(param, videoIds, gzhPlan.getId(), loginAccount);
|
|
|
// 调用aigc重新拉取视频
|
|
|
- aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
|
|
|
+ if (PublishStageEnum.PLATFORM.getVal() == param.getPublishStage()) {
|
|
|
+ aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
|
|
|
+ } else {
|
|
|
+ BucketDataParam bucketDataParam = new BucketDataParam();
|
|
|
+ bucketDataParam.setGhId(account.getGhId());
|
|
|
+ cgiReplyService.getRgiReplyData(bucketDataParam);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemParam> videoList) {
|
|
@@ -267,10 +286,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
|
|
|
continue;
|
|
|
}
|
|
|
- CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
|
|
|
- example.createCriteria().andGhIdEqualTo(ghId).andMiniVideoIdEqualTo(video.getVideoId())
|
|
|
- .andIsDeleteEqualTo(0);
|
|
|
- List<CgiReplyBucketData> dataList = cgiReplyBucketDataMapper.selectByExample(example);
|
|
|
+ List<CgiReplyBucketData> dataList = cgiReplyService.getCgiReplyBucketDataListByVideoId(video.getVideoId());
|
|
|
if (CollectionUtils.isEmpty(dataList)) {
|
|
|
continue;
|
|
|
}
|