|
@@ -22,6 +22,7 @@ import com.tzld.longarticle.recommend.server.util.CommonCollectionUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.DateUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.JSONUtils;
|
|
|
import com.tzld.longarticle.recommend.server.util.Md5Util;
|
|
|
+import com.tzld.longarticle.recommend.server.util.feishu.FeishuMessageSender;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -78,11 +79,15 @@ public class RecallService implements ApplicationContextAware {
|
|
|
}
|
|
|
|
|
|
public RecallResult recall(RecallParam param) {
|
|
|
+ List<RecallResult.RecallData> results = new ArrayList<>();
|
|
|
log.info("RecallParam {}", JSONUtils.toJson(param));
|
|
|
List<RecallStrategy> strategies = getRecallStrategy(param);
|
|
|
log.info("RecallStrategy {}", JSONUtils.toJson(CommonCollectionUtils.toList(strategies,
|
|
|
s -> s.getClass().getSimpleName())));
|
|
|
List<Content> content = getAllContent(param);
|
|
|
+ if (CollectionUtils.isEmpty(content)) {
|
|
|
+ return new RecallResult(results);
|
|
|
+ }
|
|
|
param.setContent(content);
|
|
|
CountDownLatch cdl = new CountDownLatch(strategies.size());
|
|
|
List<Future<RecallResult.RecallData>> recallResultFutures = new ArrayList<>();
|
|
@@ -103,7 +108,6 @@ public class RecallService implements ApplicationContextAware {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- List<RecallResult.RecallData> results = new ArrayList<>();
|
|
|
for (Future<RecallResult.RecallData> f : recallResultFutures) {
|
|
|
try {
|
|
|
RecallResult.RecallData data = f.get();
|
|
@@ -130,6 +134,9 @@ public class RecallService implements ApplicationContextAware {
|
|
|
private List<Content> getAllContent(RecallParam param) {
|
|
|
List<Content> content = aigcRemoteService.getAllContent(param);
|
|
|
if (CollectionUtils.isEmpty(content)) {
|
|
|
+ FeishuMessageSender.sendWebHookMessage("07026a9f-43f5-448b-ba40-a8d71bd6e634", "内容召回失败\n"
|
|
|
+ + "ghId: " + param.getGhId() + "\n"
|
|
|
+ + "账号名称: " + param.getAccountName());
|
|
|
return content;
|
|
|
}
|
|
|
// 标题历史均值
|
|
@@ -266,6 +273,7 @@ public class RecallService implements ApplicationContextAware {
|
|
|
ContentHisPublishArticle article = new ContentHisPublishArticle();
|
|
|
BeanUtils.copyProperties(hisArticle, article);
|
|
|
article.setViewCount(hisArticle.getShowViewCount());
|
|
|
+ article.setWxSn(hisArticle.getWxSn());
|
|
|
article.setArticleDetailInfoList(articleDetailInfoMap.get(hisArticle.getWxSn()));
|
|
|
// 设置账号位置阅读均值
|
|
|
int avgViewCount = 0;
|
|
@@ -279,6 +287,11 @@ public class RecallService implements ApplicationContextAware {
|
|
|
article.setInnerAccount(true);
|
|
|
avgViewCount = Optional.ofNullable(indexMap.get(hisArticle.getItemIndex().toString()).getReadAvg())
|
|
|
.orElse(0.0).intValue();
|
|
|
+ } else {
|
|
|
+ FeishuMessageSender.sendWebHookMessage("07026a9f-43f5-448b-ba40-a8d71bd6e634", "历史表现阅读均值获取失败\n"
|
|
|
+ + "ghId: " + hisArticle.getGhId() + "\n"
|
|
|
+ + "账号名称: " + hisArticle.getAccountName() + "\n"
|
|
|
+ + "位置: " + hisArticle.getItemIndex());
|
|
|
}
|
|
|
}
|
|
|
article.setAvgViewCount(avgViewCount);
|
|
@@ -325,8 +338,16 @@ public class RecallService implements ApplicationContextAware {
|
|
|
Double t0FissionByReadAvgSum = 0.0;
|
|
|
Double t0FissionByReadAvgCorrelationSum = 0.0;
|
|
|
for (ContentHisPublishArticle article : content.getHisPublishArticleList()) {
|
|
|
- if (article.getItemIndex() != 1 || !article.isInnerAccount()
|
|
|
- || CollectionUtils.isEmpty(article.getArticleDetailInfoList())) {
|
|
|
+ if (article.getItemIndex() != 1 || !article.isInnerAccount()) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isEmpty(article.getArticleDetailInfoList())) {
|
|
|
+ FeishuMessageSender.sendWebHookMessage("07026a9f-43f5-448b-ba40-a8d71bd6e634", "历史表现裂变特征获取失败\n"
|
|
|
+ + "ghId: " + article.getGhId() + "\n"
|
|
|
+ + "账号名称: " + article.getAccountName() + "\n"
|
|
|
+ + "位置: " + article.getItemIndex() + "\n"
|
|
|
+ + "标题: " + article.getTitle() + "\n"
|
|
|
+ + "wxsn: " + article.getWxSn());
|
|
|
continue;
|
|
|
}
|
|
|
int sumFission0 = 0;
|