|
@@ -45,7 +45,7 @@ import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.util.Pair;
|
|
|
import org.springframework.http.*;
|
|
@@ -99,35 +99,39 @@ public class DataDashboardService {
|
|
|
|
|
|
public void export(String beginDate, String endDate) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(beginDate, endDate, 5);
|
|
|
+ // 滚动删除,仅保留最近14天内容
|
|
|
+ List<String> delDateStrList = DateUtils.getBeforeDays(null, null, 14);
|
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.QUNFA.getVal(), StatusEnum.ZERO.getCode(),
|
|
|
- sheetToken, "7d4e12");
|
|
|
+ sheetToken, "7d4e12", delDateStrList);
|
|
|
}
|
|
|
|
|
|
@XxlJob("scheduledExport")
|
|
|
public ReturnT<String> scheduledExport(String param) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(null, null, 5);
|
|
|
+ // 滚动删除,仅保留最近14天内容
|
|
|
+ List<String> delDateStrList = DateUtils.getBeforeDays(null, null, 14);
|
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.QUNFA.getVal(), StatusEnum.ZERO.getCode(),
|
|
|
- sheetToken, "7d4e12");
|
|
|
+ sheetToken, "7d4e12", delDateStrList);
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
public void exportWuXianLiu(String beginDate, String endDate) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(beginDate, endDate, 5);
|
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.WUXIANLIU.getVal(), StatusEnum.ONE.getCode(),
|
|
|
- sheetToken, "Ucycvw");
|
|
|
+ sheetToken, "Ucycvw", null);
|
|
|
}
|
|
|
|
|
|
@XxlJob("scheduledExportWuXianLiu")
|
|
|
public ReturnT<String> scheduledExportWuXianLiu(String param) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(null, null, 5);
|
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.WUXIANLIU.getVal(), StatusEnum.ONE.getCode(),
|
|
|
- sheetToken, "Ucycvw");
|
|
|
+ sheetToken, "Ucycvw", null);
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
|
|
|
private void exportFeishuNewSortStrategy(List<String> dateStrList, String articleType, Integer filter,
|
|
|
- String sheetToken, String sheetId) {
|
|
|
+ String sheetToken, String sheetId, List<String> delDateStrList) {
|
|
|
String minDate = dateStrList.stream().min(String::compareTo).orElse("");
|
|
|
String maxDate = dateStrList.stream().max(String::compareTo).orElse("");
|
|
|
List<NewSortStrategyExport> newContentsYesData = newSortStrategyData(minDate, maxDate, articleType, filter);
|
|
@@ -156,21 +160,17 @@ public class DataDashboardService {
|
|
|
|
|
|
List<Pair<String, String>> styles = Arrays
|
|
|
.asList(
|
|
|
- Pair.of("AA", "0.00%"),
|
|
|
- Pair.of("AB", "0.00%"),
|
|
|
- Pair.of("AC", "0.00%"),
|
|
|
- Pair.of("AD", "0.00%"),
|
|
|
- Pair.of("AE", "0.00%"),
|
|
|
- Pair.of("AF", "0.00%"),
|
|
|
- Pair.of("AG", "0.00%"),
|
|
|
- Pair.of("AH", "0.00%"),
|
|
|
- Pair.of("AI", "0.00%"),
|
|
|
- Pair.of("AO", "0.00%"),
|
|
|
- Pair.of("AP", "0.00%"),
|
|
|
- Pair.of("AQ", "0.00%")
|
|
|
+ Pair.of("J", "0.00%"),
|
|
|
+ Pair.of("K", "0.00%"),
|
|
|
+ Pair.of("L", "0.00%"),
|
|
|
+ Pair.of("M", "0.00%"),
|
|
|
+ Pair.of("N", "0.00%"),
|
|
|
+ Pair.of("O", "0.00%"),
|
|
|
+ Pair.of("P", "0.00%"),
|
|
|
+ Pair.of("Q", "0.00%"),
|
|
|
+ Pair.of("R", "0.00%")
|
|
|
);
|
|
|
-
|
|
|
- doSendFeishuSheet(dateStrList, sheetToken, sheetId, rowNum, rows, 2, styles);
|
|
|
+ doSendFeishuSheet(dateStrList, sheetToken, sheetId, rowNum, rows, 2, styles, delDateStrList);
|
|
|
}
|
|
|
|
|
|
private List<NewSortStrategyExport> newSortStrategyData(String beginDate, String endDate,
|
|
@@ -187,7 +187,6 @@ public class DataDashboardService {
|
|
|
Collectors.groupingBy(Article::getAppMsgId, Collectors.toMap(Article::getItemIndex, o -> o))));
|
|
|
log.info("newSortStrategyData articleList finish");
|
|
|
Set<String> snList = articleList.stream().map(Article::getWxSn).collect(Collectors.toSet());
|
|
|
- Map<String, Article> wxSnMap = articleList.stream().collect(Collectors.toMap(Article::getWxSn, Function.identity()));
|
|
|
List<ArticleDetailInfo> articleDetailInfoList = new ArrayList<>();
|
|
|
for (List<String> partitions : Lists.partition(new ArrayList<>(snList), 1000)) {
|
|
|
articleDetailInfoList.addAll(articleDetailInfoRepository.getAllByWxSnIn(partitions));
|
|
@@ -197,10 +196,10 @@ public class DataDashboardService {
|
|
|
.collect(Collectors.groupingBy(ArticleDetailInfo::getWxSn));
|
|
|
List<PublishSortLog> sortLogList = publishSortLogRepository.findByGhIdInAndDateStrBetween(ghIds, beginDate, endDate);
|
|
|
log.info("newSortStrategyData sortLogList finish");
|
|
|
- Map<String, Map<String, Map<String, String>>> sortStrategyMap = sortLogList.stream()
|
|
|
+ Map<String, Map<String, Map<String, PublishSortLog>>> sortStrategyMap = sortLogList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishSortLog::getGhId,
|
|
|
Collectors.groupingBy(PublishSortLog::getDateStr, Collectors.toMap(PublishSortLog::getTitle,
|
|
|
- PublishSortLog::getStrategy, (existing, replacement) -> existing))));
|
|
|
+ Function.identity(), (existing, replacement) -> existing))));
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap = accountAvgInfoList.stream()
|
|
|
.filter(o -> Objects.nonNull(o.getReadAvg()) && o.getReadAvg() > 0 && o.getFans() > 1000)
|
|
|
.collect(Collectors.groupingBy(AccountAvgInfo::getGhId, Collectors.groupingBy(AccountAvgInfo::getUpdateTime,
|
|
@@ -332,14 +331,16 @@ public class DataDashboardService {
|
|
|
.collect(Collectors.groupingBy(ArticleDetailInfo::getWxSn));
|
|
|
|
|
|
// result
|
|
|
- List<NewSortStrategyExport> result = new ArrayList<>();
|
|
|
+ List<DatastatSortStrategy> saveList = new ArrayList<>();
|
|
|
for (Article article : articleList) {
|
|
|
- NewSortStrategyExport obj = new NewSortStrategyExport();
|
|
|
+ DatastatSortStrategy obj = new DatastatSortStrategy();
|
|
|
+ obj.setType(articleType);
|
|
|
+ obj.setPublishTimestamp(article.getPublishTimestamp());
|
|
|
List<ArticleDetailInfo> articleDetailInfos = articleDetailInfoMap.get(article.getWxSn());
|
|
|
setObjArticleDetailInfo(article, obj, articleDetailInfos);
|
|
|
Article firstArticle = articleMap.get(article.getGhId()).get(article.getAppMsgId()).get(1);
|
|
|
- Map<String, Map<String, String>> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
- AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
+ Map<String, Map<String, PublishSortLog>> dateStrategy = sortStrategyMap.get(article.getGhId());
|
|
|
+ Map<String, AccountAvgInfo> indexAvgInfoMap = getDateAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
article.getPublishTimestamp(), article.getItemIndex());
|
|
|
AccountAvgInfo firstAvgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
article.getPublishTimestamp(), 1);
|
|
@@ -352,64 +353,58 @@ public class DataDashboardService {
|
|
|
obj.setFirstAvgViewCount(firstAvgInfo.getReadAvg());
|
|
|
}
|
|
|
if (Objects.nonNull(dateStrategy)) {
|
|
|
- Map<String, String> titleStrategyMap = dateStrategy.get(date);
|
|
|
+ Map<String, PublishSortLog> titleStrategyMap = dateStrategy.get(date);
|
|
|
if (Objects.nonNull(titleStrategyMap)) {
|
|
|
- String strategy = titleStrategyMap.get(article.getTitle());
|
|
|
- if (!StringUtils.hasText(strategy)) {
|
|
|
- if (Objects.equals(articleType, ArticleTypeEnum.WUXIANLIU.getVal())) {
|
|
|
- strategy = RankStrategyEnum.INFINITE_STRATEGY.getStrategy();
|
|
|
- } else {
|
|
|
- for (Map.Entry<String, String> entry : titleStrategyMap.entrySet()) {
|
|
|
- strategy = entry.getValue();
|
|
|
- break;
|
|
|
+ PublishSortLog sortLog = titleStrategyMap.get(article.getTitle());
|
|
|
+ if (Objects.nonNull(sortLog)) {
|
|
|
+ String strategy = sortLog.getStrategy();
|
|
|
+ if (!StringUtils.hasText(sortLog.getStrategy())) {
|
|
|
+ if (Objects.equals(articleType, ArticleTypeEnum.WUXIANLIU.getVal())) {
|
|
|
+ strategy = RankStrategyEnum.INFINITE_STRATEGY.getStrategy();
|
|
|
+ } else {
|
|
|
+ for (Map.Entry<String, PublishSortLog> entry : titleStrategyMap.entrySet()) {
|
|
|
+ strategy = entry.getValue().getStrategy();
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ obj.setSourceType(sortLog.getSourceType());
|
|
|
+ obj.setSourceId(sortLog.getSourceId());
|
|
|
+ obj.setStrategy(strategy);
|
|
|
}
|
|
|
- obj.setStrategy(strategy);
|
|
|
}
|
|
|
}
|
|
|
if (!StringUtils.hasText(obj.getStrategy()) &&
|
|
|
Objects.equals(articleType, ArticleTypeEnum.WUXIANLIU.getVal())) {
|
|
|
obj.setStrategy(RankStrategyEnum.INFINITE_STRATEGY.getStrategy());
|
|
|
}
|
|
|
- setObjAvgInfo(article, obj, avgInfo);
|
|
|
+ setObjAvgInfo(article, obj, indexAvgInfoMap);
|
|
|
setObjHisRateInfo(article, obj, hisArticleMap, accountAvgInfoIndexMap, hisArticleDetailInfoMap);
|
|
|
// aigc 数据
|
|
|
setObjAigcInfo(article, obj, date, publishAccountMap, publishContentMap, publishContentLayoutMap,
|
|
|
publishPlanMap, miniprogramTaskMap, planExeRecordMap, producePlanMap, inputSourceMap,
|
|
|
resultRelMap, crawlerPlanMap, sourceTitlePlanMap);
|
|
|
- result.add(obj);
|
|
|
+ saveList.add(obj);
|
|
|
}
|
|
|
log.info("newSortStrategyData buildData finish");
|
|
|
- if (CollectionUtil.isNotEmpty(result) && filter == StatusEnum.ONE.getCode()) {
|
|
|
- result = result.stream()
|
|
|
+ if (CollectionUtil.isNotEmpty(saveList) && filter == StatusEnum.ONE.getCode()) {
|
|
|
+ saveList = saveList.stream()
|
|
|
.filter(o -> Objects.nonNull(o.getPublishMiniProgramNum()) && o.getPublishMiniProgramNum() > 0)
|
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
|
- result.sort(Comparator.comparing(NewSortStrategyExport::getDateStr).reversed()
|
|
|
- .thenComparing(NewSortStrategyExport::getGhId).thenComparing(NewSortStrategyExport::getPosition));
|
|
|
- if (CollectionUtils.isNotEmpty(result)) {
|
|
|
+ saveList.sort(Comparator.comparing(DatastatSortStrategy::getDateStr).reversed()
|
|
|
+ .thenComparing(DatastatSortStrategy::getGhId).thenComparing(DatastatSortStrategy::getPosition));
|
|
|
+ if (CollectionUtils.isNotEmpty(saveList)) {
|
|
|
longArticleBaseMapper.deleteByDateStrBetween(beginDate, endDate, articleType);
|
|
|
- List<DatastatSortStrategy> saveList = new ArrayList<>();
|
|
|
- for (NewSortStrategyExport newSortStrategyExport : result) {
|
|
|
- DatastatSortStrategy item = new DatastatSortStrategy();
|
|
|
- BeanUtils.copyProperties(newSortStrategyExport, item);
|
|
|
- item.setType(articleType);
|
|
|
- PublishAccount publishAccount = publishAccountMap.get(item.getGhId());
|
|
|
- item.setAccountCreateTimestamp(publishAccount.getCreateTimestamp() / 1000);
|
|
|
- Article article = wxSnMap.get(item.getWxSn());
|
|
|
- item.setPublishTimestamp(article.getPublishTimestamp());
|
|
|
- saveList.add(item);
|
|
|
- }
|
|
|
for (List<DatastatSortStrategy> saveListPartition : Lists.partition(saveList, 1000)) {
|
|
|
longArticleBaseMapper.batchInsertDatastatSortStrategy(saveListPartition);
|
|
|
}
|
|
|
}
|
|
|
log.info("newSortStrategyData finish");
|
|
|
- return result;
|
|
|
+ return NewSortStrategyExport.dbObjToExportObj(saveList);
|
|
|
}
|
|
|
|
|
|
- private void setObjAigcInfo(Article article, NewSortStrategyExport obj, String date,
|
|
|
+ private void setObjAigcInfo(Article article, DatastatSortStrategy obj, String date,
|
|
|
Map<String, PublishAccount> publishAccountMap,
|
|
|
Map<String, Map<String, Map<Long, PublishContentDTO>>> publishContentMap,
|
|
|
Map<String, PublishContentLayout> publishContentLayoutMap,
|
|
@@ -422,6 +417,7 @@ public class DataDashboardService {
|
|
|
Map<String, CrawlerPlan> crawlerPlanMap,
|
|
|
Map<String, ProducePlan> sourceTitlePlanMap) {
|
|
|
PublishAccount publishAccount = publishAccountMap.get(article.getGhId());
|
|
|
+ obj.setAccountCreateTimestamp(publishAccount.getCreateTimestamp() / 1000);
|
|
|
Map<String, Map<Long, PublishContentDTO>> titleContentMap = publishContentMap.get(publishAccount.getId());
|
|
|
if (Objects.isNull(titleContentMap)) {
|
|
|
return;
|
|
@@ -494,7 +490,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void setObjHisRateInfo(Article article, NewSortStrategyExport obj,
|
|
|
+ private void setObjHisRateInfo(Article article, DatastatSortStrategy obj,
|
|
|
Map<String, List<Article>> hisArticleMap,
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
|
|
|
Map<String, List<ArticleDetailInfo>> hisArticleDetailInfoMap) {
|
|
@@ -539,7 +535,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void setObjBaseInfo(Article article, NewSortStrategyExport obj, String date) {
|
|
|
+ private void setObjBaseInfo(Article article, DatastatSortStrategy obj, String date) {
|
|
|
obj.setGhId(article.getGhId());
|
|
|
obj.setAccountName(article.getAccountName());
|
|
|
obj.setTitle(article.getTitle());
|
|
@@ -551,7 +547,7 @@ public class DataDashboardService {
|
|
|
obj.setWxSn(article.getWxSn());
|
|
|
}
|
|
|
|
|
|
- private void setObjArticleDetailInfo(Article article, NewSortStrategyExport obj, List<ArticleDetailInfo> articleDetailInfos) {
|
|
|
+ private void setObjArticleDetailInfo(Article article, DatastatSortStrategy obj, List<ArticleDetailInfo> articleDetailInfos) {
|
|
|
if (CollectionUtils.isNotEmpty(articleDetailInfos)) {
|
|
|
Date publishDate = DateUtils.getStartDateOfDay(article.getPublishTimestamp());
|
|
|
articleDetailInfos = articleDetailInfos.stream().filter(o -> !o.getRecallDt().before(publishDate))
|
|
@@ -606,14 +602,24 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void setObjAvgInfo(Article article, NewSortStrategyExport obj, AccountAvgInfo avgInfo) {
|
|
|
+ private void setObjAvgInfo(Article article, DatastatSortStrategy obj, Map<String, AccountAvgInfo> indexAvgInfoMap) {
|
|
|
+ if (MapUtils.isNotEmpty(indexAvgInfoMap)) {
|
|
|
+ AccountAvgInfo info = null;
|
|
|
+ for (String index : indexAvgInfoMap.keySet()) {
|
|
|
+ info = indexAvgInfoMap.get(index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(info)) {
|
|
|
+ obj.setAccountMode(info.getAccountMode());
|
|
|
+ obj.setAccountSource(info.getAccountSource());
|
|
|
+ obj.setAccountType(info.getAccountType());
|
|
|
+ obj.setAccountStatus(info.getAccountStatus());
|
|
|
+ obj.setBusinessType(AccountBusinessTypeEnum.from(info.getBusinessType()).getDescription());
|
|
|
+ obj.setFans(info.getFans());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AccountAvgInfo avgInfo = indexAvgInfoMap.get(article.getItemIndex().toString());
|
|
|
if (Objects.nonNull(avgInfo)) {
|
|
|
- obj.setAccountMode(avgInfo.getAccountMode());
|
|
|
- obj.setAccountSource(avgInfo.getAccountSource());
|
|
|
- obj.setAccountType(avgInfo.getAccountType());
|
|
|
- obj.setAccountStatus(avgInfo.getAccountStatus());
|
|
|
- obj.setBusinessType(AccountBusinessTypeEnum.from(avgInfo.getBusinessType()).getDescription());
|
|
|
- obj.setFans(avgInfo.getFans());
|
|
|
obj.setAvgViewCount(avgInfo.getReadAvg());
|
|
|
if (avgInfo.getReadAvg() > 0) {
|
|
|
obj.setReadRate((article.getShowViewCount() * 1.0) / avgInfo.getReadAvg());
|
|
@@ -671,12 +677,14 @@ public class DataDashboardService {
|
|
|
|
|
|
private static void doSendFeishuSheet(List<String> dateStrList, String sheetToken, String sheetId,
|
|
|
int rowNum, List<List<Object>> rows, Integer startRowIndex,
|
|
|
- List<Pair<String, String>> styles) {
|
|
|
+ List<Pair<String, String>> styles,
|
|
|
+ List<String> delDateStrList) {
|
|
|
Pair<String, Integer> token = FeiShu.requestAccessToken();
|
|
|
RestTemplate restTemplate = new RestTemplate();
|
|
|
HttpHeaders httpHeaders = new HttpHeaders();
|
|
|
httpHeaders.add("Authorization", "Bearer " + token.getFirst());
|
|
|
|
|
|
+ delFeishuSheet(httpHeaders, sheetId, startRowIndex, delDateStrList);
|
|
|
// 先删除掉已存在的dateStr数据
|
|
|
HttpEntity<Object> queryEntity = new HttpEntity<>(httpHeaders);
|
|
|
int deleteRowNum = rowNum < 20 ? startRowIndex + dateStrList.size() * rowNum : startRowIndex + (rowNum * 2);
|
|
@@ -795,6 +803,63 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void delFeishuSheet(HttpHeaders httpHeaders, String sheetId, Integer startRowIndex,
|
|
|
+ List<String> delDateStrList) {
|
|
|
+ if (CollectionUtil.isEmpty(delDateStrList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ RestTemplate restTemplate = new RestTemplate();
|
|
|
+ HttpEntity<Object> queryEntity = new HttpEntity<>(httpHeaders);
|
|
|
+ ResponseEntity<String> queryResponseEntity = restTemplate.exchange(
|
|
|
+ String.format("https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/%s/values/%s!A"
|
|
|
+ + startRowIndex + ":A", sheetToken, sheetId),
|
|
|
+ HttpMethod.GET, queryEntity, String.class);
|
|
|
+ JSONArray values = JSON.parseObject(queryResponseEntity.getBody())
|
|
|
+ .getJSONObject("data")
|
|
|
+ .getJSONObject("valueRange")
|
|
|
+ .getJSONArray("values");
|
|
|
+ int deleteStartRow = values.size();
|
|
|
+ if (!values.isEmpty() && Objects.nonNull(values.get(0)) && !((JSONArray) values.get(0)).isEmpty()
|
|
|
+ && Objects.nonNull(((JSONArray) values.get(0)).get(0))) {
|
|
|
+ for (int i = 0; i < values.size(); i++) {
|
|
|
+ JSONArray value = values.getJSONArray(i);
|
|
|
+ if (value.get(0) != null) {
|
|
|
+ List<String> dates = value.stream().map(Object::toString).collect(Collectors.toList());
|
|
|
+ if (!delDateStrList.contains(dates.get(0))) {
|
|
|
+ deleteStartRow = i + startRowIndex;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int count = values.size();
|
|
|
+ int delCount = values.size() - deleteStartRow;
|
|
|
+ if (delCount > 0) {
|
|
|
+ int delNum = 0;
|
|
|
+ do {
|
|
|
+ // 删除当前日期已存在的旧数据
|
|
|
+ httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
|
|
+ HttpEntity<Object> deleteEntity = new HttpEntity<>(
|
|
|
+ String.format("{\n" +
|
|
|
+ " \"dimension\": {\n" +
|
|
|
+ " \"sheetId\": \"%s\",\n" +
|
|
|
+ " \"majorDimension\": \"ROWS\",\n" +
|
|
|
+ " \"startIndex\": %s,\n" +
|
|
|
+ " \"endIndex\": %s\n" +
|
|
|
+ " }\n" +
|
|
|
+ "}", sheetId, deleteStartRow, Math.min(startRowIndex + 4000, count - delNum + startRowIndex) - 1),
|
|
|
+ httpHeaders);
|
|
|
+ ResponseEntity<String> response = restTemplate.exchange(String.format("https://open.feishu.cn/open-apis/sheets/v2/spreadsheets/%s/dimension_range", sheetToken),
|
|
|
+ HttpMethod.DELETE, deleteEntity, String.class);
|
|
|
+ JSONObject responseJSON = JSONObject.parseObject(response.getBody());
|
|
|
+ if (0 != responseJSON.getInteger("code")) {
|
|
|
+ log.error("doSendFeishuSheet write error :{}", responseJSON.getString("msg"));
|
|
|
+ }
|
|
|
+ delNum = Math.min(delNum + 4000, delCount);
|
|
|
+ } while (delNum < delCount);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@XxlJob("scheduleExportIntermediateIndicators")
|
|
|
public ReturnT<String> scheduleIntermediateIndicatorsExport(String param) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(null, null, 3);
|
|
@@ -876,7 +941,7 @@ public class DataDashboardService {
|
|
|
Pair.of("BP", "0.00%")
|
|
|
);
|
|
|
|
|
|
- doSendFeishuSheet(dateStrs, sheetToken, sheetId, rowNum, rows, 3, styles);
|
|
|
+ doSendFeishuSheet(dateStrs, sheetToken, sheetId, rowNum, rows, 3, styles, null);
|
|
|
}
|
|
|
|
|
|
public List<IntermediateIndicatorsExport> intermediateIndicatorsData(String dateStr) {
|
|
@@ -912,12 +977,10 @@ public class DataDashboardService {
|
|
|
.collect(Collectors.groupingBy(ArticleDetailInfo::getWxSn));
|
|
|
String lessDateStr = DateUtils.getBeforeDayStr(dateStr, "yyyyMMdd", 7);
|
|
|
List<PublishSortLog> publishSortLogList = publishSortLogRepository.findByDateStrGreaterThanEqual(lessDateStr);
|
|
|
- Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap = publishSortLogList.stream()
|
|
|
+ Map<String, Map<String, Map<Integer, List<PublishSortLog>>>> publishSortLogMap = publishSortLogList.stream()
|
|
|
.collect(Collectors.groupingBy(PublishSortLog::getGhId,
|
|
|
- Collectors.groupingBy(PublishSortLog::getDateStr, Collectors.toMap(
|
|
|
- PublishSortLog::getIndex, o -> o, (existing, replacement) -> replacement
|
|
|
- ))));
|
|
|
- List<NewSortStrategyExport> newSortStrategyExportList = getNewSortStrategyExportList(todayPublish,
|
|
|
+ Collectors.groupingBy(PublishSortLog::getDateStr, Collectors.groupingBy(PublishSortLog::getIndex))));
|
|
|
+ List<DatastatSortStrategy> newSortStrategyExportList = getNewSortStrategyExportList(todayPublish,
|
|
|
articleDetailInfoMap, accountAvgInfoIndexMap);
|
|
|
|
|
|
List<Article> futurePublishList = articleRepository.getByPublishTimestampGreaterThanAndTypeEquals(dateEnd, ArticleTypeEnum.QUNFA.getVal());
|
|
@@ -932,7 +995,7 @@ public class DataDashboardService {
|
|
|
Map<String, Map<Integer, List<String>>> titleTypePoolMap = new HashMap<>();
|
|
|
Map<String, Set<String>> wxsnHisDistinctSetMap = new HashMap<>();
|
|
|
Map<String, List<String>> fansAccountTypeMap = new HashMap<>();
|
|
|
- for (NewSortStrategyExport data : newSortStrategyExportList) {
|
|
|
+ for (DatastatSortStrategy data : newSortStrategyExportList) {
|
|
|
String type = getArticleType(data, small);
|
|
|
Article article = articleMap.get(data.getWxSn());
|
|
|
if (!checkIsAigcPublish(article, publishSortLogMap)) {
|
|
@@ -965,10 +1028,10 @@ public class DataDashboardService {
|
|
|
// 发布表现
|
|
|
setPublishPerformance(item, data, publishSortLogMap);
|
|
|
// 发布依赖表现
|
|
|
- setPublishSourcePerformance(item, accountAvgInfoIndexMap, articleDetailInfoMap, publishSortLogMap,
|
|
|
+ setPublishSourcePerformance(item, data, article, accountAvgInfoIndexMap, articleDetailInfoMap, publishSortLogMap,
|
|
|
type, scoreHisPublishTimeMap, wxsnHisDistinctSetMap, list, poolLevel, small, hisPublishMap);
|
|
|
// 发布未来表现
|
|
|
- setPublishFuturePerformance(item, data, poolLevel, promotionSourceMap, futurePublishMap, publishSortLogMap, small);
|
|
|
+ setPublishFuturePerformance(item, data, poolLevel, promotionSourceMap, futurePublishMap, small);
|
|
|
|
|
|
titles.add(data.getTitle());
|
|
|
poolTitles.add(data.getTitle());
|
|
@@ -978,15 +1041,19 @@ public class DataDashboardService {
|
|
|
}
|
|
|
|
|
|
private boolean checkIsAigcPublish(Article article,
|
|
|
- Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap) {
|
|
|
- Map<String, Map<Integer, PublishSortLog>> dateSortMap = publishSortLogMap.get(article.getGhId());
|
|
|
+ Map<String, Map<String, Map<Integer, List<PublishSortLog>>>> publishSortLogMap) {
|
|
|
+ Map<String, Map<Integer, List<PublishSortLog>>> dateSortMap = publishSortLogMap.get(article.getGhId());
|
|
|
if (Objects.nonNull(dateSortMap)) {
|
|
|
for (String dateStr : dateSortMap.keySet()) {
|
|
|
- Map<Integer, PublishSortLog> indexMap = dateSortMap.get(dateStr);
|
|
|
+ Map<Integer, List<PublishSortLog>> indexMap = dateSortMap.get(dateStr);
|
|
|
if (Objects.nonNull(indexMap)) {
|
|
|
- PublishSortLog log = indexMap.get(article.getItemIndex());
|
|
|
- if (Objects.nonNull(log) && log.getTitle().equals(article.getTitle())) {
|
|
|
- return true;
|
|
|
+ List<PublishSortLog> logs = indexMap.get(article.getItemIndex());
|
|
|
+ if (CollectionUtil.isNotEmpty(logs)) {
|
|
|
+ for (PublishSortLog log : logs) {
|
|
|
+ if (log.getTitle().equals(article.getTitle())) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1010,10 +1077,24 @@ public class DataDashboardService {
|
|
|
return avgInfo;
|
|
|
}
|
|
|
|
|
|
- private void setPublishFuturePerformance(IntermediateIndicatorsExport item, NewSortStrategyExport data, Integer poolLevel,
|
|
|
+ private Map<String, AccountAvgInfo> getDateAccountAvgInfo(Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
|
|
|
+ String ghId, Long updateTime, Integer itemIndex) {
|
|
|
+ Map<String, Map<String, AccountAvgInfo>> dateAvgMap = accountAvgInfoIndexMap.get(ghId);
|
|
|
+ String hisPublishDate = DateUtils.timestampToYMDStr(updateTime, "yyyy-MM-dd");
|
|
|
+ if (Objects.nonNull(dateAvgMap)) {
|
|
|
+ List<String> avgMapDateList = new ArrayList<>(dateAvgMap.keySet());
|
|
|
+ hisPublishDate = DateUtils.findNearestDate(avgMapDateList, hisPublishDate, "yyyy-MM-dd");
|
|
|
+ Map<String, AccountAvgInfo> accountAvgInfoMap = dateAvgMap.get(hisPublishDate);
|
|
|
+ if (Objects.nonNull(accountAvgInfoMap)) {
|
|
|
+ return accountAvgInfoMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setPublishFuturePerformance(IntermediateIndicatorsExport item, DatastatSortStrategy data, Integer poolLevel,
|
|
|
Map<String, ArticlePoolPromotionSource> promotionSourceMap,
|
|
|
Map<String, List<Article>> futurePublishMap,
|
|
|
- Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap,
|
|
|
List<String> small) {
|
|
|
int futurePoolLevel = getPromotionPoolLevel(data.getGhId(), data.getTitle(), promotionSourceMap, small);
|
|
|
if (futurePoolLevel > poolLevel) {
|
|
@@ -1142,28 +1223,30 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<NewSortStrategyExport> getNewSortStrategyExportList(List<Article> todayPublish,
|
|
|
+ private List<DatastatSortStrategy> getNewSortStrategyExportList(List<Article> todayPublish,
|
|
|
Map<String, List<ArticleDetailInfo>> articleDetailInfoMap,
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap) {
|
|
|
- List<NewSortStrategyExport> result = new ArrayList<>();
|
|
|
+ List<DatastatSortStrategy> result = new ArrayList<>();
|
|
|
for (Article article : todayPublish) {
|
|
|
- NewSortStrategyExport obj = new NewSortStrategyExport();
|
|
|
+ DatastatSortStrategy obj = new DatastatSortStrategy();
|
|
|
List<ArticleDetailInfo> articleDetailInfos = articleDetailInfoMap.get(article.getWxSn());
|
|
|
setObjArticleDetailInfo(article, obj, articleDetailInfos);
|
|
|
- AccountAvgInfo avgInfo = getAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
+ Map<String, AccountAvgInfo> indexAvgInfoMap = getDateAccountAvgInfo(accountAvgInfoIndexMap, article.getGhId(),
|
|
|
article.getPublishTimestamp(), article.getItemIndex());
|
|
|
String date = DateUtils.timestampToYMDStr(article.getPublishTimestamp(), "yyyyMMdd");
|
|
|
setObjBaseInfo(article, obj, date);
|
|
|
- setObjAvgInfo(article, obj, avgInfo);
|
|
|
+ setObjAvgInfo(article, obj, indexAvgInfoMap);
|
|
|
result.add(obj);
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private void setPublishSourcePerformance(IntermediateIndicatorsExport item,
|
|
|
+ DatastatSortStrategy data,
|
|
|
+ Article article,
|
|
|
Map<String, Map<String, Map<String, AccountAvgInfo>>> accountAvgInfoIndexMap,
|
|
|
Map<String, List<ArticleDetailInfo>> articleDetailInfoMap,
|
|
|
- Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap,
|
|
|
+ Map<String, Map<String, Map<Integer, List<PublishSortLog>>>> publishSortLogMap,
|
|
|
String type,
|
|
|
Map<String, Integer> scoreHisPublishTimeMap,
|
|
|
Map<String, Set<String>> wxsnHisDistinctSetMap,
|
|
@@ -1235,36 +1318,45 @@ public class DataDashboardService {
|
|
|
(item.getActualArticleReleaseCount() - 1) + firstLayerFissionToViewBaseRatio) / item.getActualArticleReleaseCount();
|
|
|
}
|
|
|
item.setAverageFirstLayerFissionToViewBaseRatio(averageFirstLayerFissionToViewBaseRatio);
|
|
|
- Map<String, Map<Integer, PublishSortLog>> dateSortMap = publishSortLogMap.get(publish.getGhId());
|
|
|
+ Map<String, Map<Integer, List<PublishSortLog>>> dateSortMap = publishSortLogMap.get(publish.getGhId());
|
|
|
if (Objects.nonNull(dateSortMap)) {
|
|
|
String publishDateStr = DateUtils.timestampToYMDStr(publish.getPublishTimestamp(), "yyyyMMdd");
|
|
|
- Map<Integer, PublishSortLog> indexMap = dateSortMap.get(publishDateStr);
|
|
|
+ Map<Integer, List<PublishSortLog>> indexMap = dateSortMap.get(publishDateStr);
|
|
|
if (Objects.nonNull(indexMap)) {
|
|
|
- PublishSortLog log = indexMap.get(publish.getItemIndex());
|
|
|
- double scoreAvg = item.getRedundantAccountArticleRelevanceAvg();
|
|
|
- double score = 0.0;
|
|
|
- if (Objects.nonNull(log) && Objects.nonNull(log.getScore())) {
|
|
|
- JSONObject scoreMap = JSONObject.parseObject(log.getScoreMap());
|
|
|
- if (scoreMap.containsKey("SimilarityStrategy")) {
|
|
|
- score = scoreMap.getDoubleValue("SimilarityStrategy");
|
|
|
+ List<PublishSortLog> logs = indexMap.get(publish.getItemIndex());
|
|
|
+ if (CollectionUtil.isNotEmpty(logs)) {
|
|
|
+ for (PublishSortLog log : logs) {
|
|
|
+ if (log.getTitle().equals(data.getTitle())) {
|
|
|
+ double scoreAvg = item.getRedundantAccountArticleRelevanceAvg();
|
|
|
+ double score = 0.0;
|
|
|
+ if (Objects.nonNull(log.getScore())) {
|
|
|
+ JSONObject scoreMap = JSONObject.parseObject(log.getScoreMap());
|
|
|
+ if (scoreMap.containsKey("SimilarityStrategy")) {
|
|
|
+ score = scoreMap.getDoubleValue("SimilarityStrategy");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ scorePublishTime++;
|
|
|
+ scoreAvg = (scoreAvg * (scorePublishTime - 1) + score) / scorePublishTime;
|
|
|
+ item.setRedundantAccountArticleRelevanceAvg(scoreAvg);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- scorePublishTime++;
|
|
|
- scoreAvg = (scoreAvg * (scorePublishTime - 1) + score) / scorePublishTime;
|
|
|
- item.setRedundantAccountArticleRelevanceAvg(scoreAvg);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+ if (hisMinDate > 0) {
|
|
|
double firstExplorationIntervalAvg = Double.isNaN(item.getFirstExplorationIntervalAvg()) ? 0.0 : item.getFirstExplorationIntervalAvg();
|
|
|
- double explorationInterval = (publish.getPublishTimestamp() - hisMinDate) / 86400.0;
|
|
|
- firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getTotalArticleReleaseCountNonInfinite() - 1)
|
|
|
- + explorationInterval) / item.getTotalArticleReleaseCountNonInfinite();
|
|
|
+ double explorationInterval = (article.getPublishTimestamp() - hisMinDate) / 86400.0;
|
|
|
+ firstExplorationIntervalAvg = (firstExplorationIntervalAvg * (item.getActualArticleReleaseCount() - 1)
|
|
|
+ + explorationInterval) / item.getActualArticleReleaseCount();
|
|
|
item.setFirstExplorationIntervalAvg(firstExplorationIntervalAvg);
|
|
|
}
|
|
|
scoreHisPublishTimeMap.put(type, scorePublishTime);
|
|
|
}
|
|
|
|
|
|
- private void setPublishPerformance(IntermediateIndicatorsExport item, NewSortStrategyExport data,
|
|
|
- Map<String, Map<String, Map<Integer, PublishSortLog>>> publishSortLogMap) {
|
|
|
+ private void setPublishPerformance(IntermediateIndicatorsExport item, DatastatSortStrategy data,
|
|
|
+ Map<String, Map<String, Map<Integer, List<PublishSortLog>>>> publishSortLogMap) {
|
|
|
if (Objects.isNull(data.getFirstLevel())) {
|
|
|
return;
|
|
|
}
|
|
@@ -1296,21 +1388,28 @@ public class DataDashboardService {
|
|
|
if (item.getT0FissionCount() + item.getT1FissionCount() + item.getT2FissionCount() > 0 && item.getViewBase() > 0) {
|
|
|
item.setT2CumulativeFissionRate((item.getT0FissionCount() + item.getT1FissionCount() + item.getT2FissionCount()) / (double) item.getFirstLayerUV());
|
|
|
}
|
|
|
- Map<String, Map<Integer, PublishSortLog>> dateSortMap = publishSortLogMap.get(data.getGhId());
|
|
|
+ Map<String, Map<Integer, List<PublishSortLog>>> dateSortMap = publishSortLogMap.get(data.getGhId());
|
|
|
if (Objects.nonNull(dateSortMap)) {
|
|
|
- Map<Integer, PublishSortLog> indexMap = dateSortMap.get(item.getDateStr());
|
|
|
+ Map<Integer, List<PublishSortLog>> indexMap = dateSortMap.get(item.getDateStr());
|
|
|
if (Objects.nonNull(indexMap)) {
|
|
|
- PublishSortLog log = indexMap.get(data.getPosition());
|
|
|
- double scoreAvg = item.getAccountArticleRelevanceAvg();
|
|
|
- double score = 0.0;
|
|
|
- if (Objects.nonNull(log) && Objects.nonNull(log.getScore())) {
|
|
|
- JSONObject scoreMap = JSONObject.parseObject(log.getScoreMap());
|
|
|
- if (scoreMap.containsKey("SimilarityStrategy")) {
|
|
|
- score = scoreMap.getDoubleValue("SimilarityStrategy");
|
|
|
+ List<PublishSortLog> logs = indexMap.get(data.getPosition());
|
|
|
+ if (CollectionUtil.isNotEmpty(logs)) {
|
|
|
+ for (PublishSortLog log : logs) {
|
|
|
+ if (log.getTitle().equals(data.getTitle())) {
|
|
|
+ double scoreAvg = item.getAccountArticleRelevanceAvg();
|
|
|
+ double score = 0.0;
|
|
|
+ if (Objects.nonNull(log.getScore())) {
|
|
|
+ JSONObject scoreMap = JSONObject.parseObject(log.getScoreMap());
|
|
|
+ if (scoreMap.containsKey("SimilarityStrategy")) {
|
|
|
+ score = scoreMap.getDoubleValue("SimilarityStrategy");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ scoreAvg = (scoreAvg * (item.getActualArticleReleaseCount() - 1) + score) / item.getActualArticleReleaseCount();
|
|
|
+ item.setAccountArticleRelevanceAvg(scoreAvg);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- scoreAvg = (scoreAvg * (item.getActualArticleReleaseCount() - 1) + score) / item.getActualArticleReleaseCount();
|
|
|
- item.setAccountArticleRelevanceAvg(scoreAvg);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1383,7 +1482,7 @@ public class DataDashboardService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private String getArticleType(NewSortStrategyExport data, List<String> small) {
|
|
|
+ private String getArticleType(DatastatSortStrategy data, List<String> small) {
|
|
|
if (data.getPosition() == 1) {
|
|
|
if (small.contains(data.getGhId())) {
|
|
|
return "L3";
|
|
@@ -1463,7 +1562,7 @@ public class DataDashboardService {
|
|
|
Pair.of("W", "#,##0.00")
|
|
|
);
|
|
|
|
|
|
- doSendFeishuSheet(dateStrList, sheetToken, sheetId, rowNum, rows, 2, styles);
|
|
|
+ doSendFeishuSheet(dateStrList, sheetToken, sheetId, rowNum, rows, 2, styles, null);
|
|
|
}
|
|
|
|
|
|
private List<FirstContentScoreExport> firstContentScoreData(List<String> dateStrList) {
|
|
@@ -1494,6 +1593,7 @@ public class DataDashboardService {
|
|
|
Collectors.toMap(AccountAvgInfo::getPosition, o -> o))));
|
|
|
|
|
|
String title = "";
|
|
|
+ List<DatastatScore> saveList = new ArrayList<>();
|
|
|
for (PublishSortLog publishSortLog : sortLogList) {
|
|
|
Map<String, Map<Integer, Article>> dateArticleMap = articleMap.get(publishSortLog.getGhId());
|
|
|
if (Objects.isNull(dateArticleMap)) {
|
|
@@ -1559,40 +1659,45 @@ public class DataDashboardService {
|
|
|
item.setFirstExplorationIntervalAvg(explorationInterval);
|
|
|
}
|
|
|
result.add(item);
|
|
|
+ saveList.add(buildDatastatScore(publishSortLog, item, article));
|
|
|
}
|
|
|
- saveDatastatScore(dateStrList, result);
|
|
|
+ saveDatastatScore(dateStrList, saveList);
|
|
|
result = result.stream().filter(o -> o.getIndex() == 1).collect(Collectors.toList());
|
|
|
result.sort(Comparator.comparing(FirstContentScoreExport::getDateStr).reversed()
|
|
|
.thenComparing(FirstContentScoreExport::getGhId));
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- private void saveDatastatScore(List<String> dateStrList, List<FirstContentScoreExport> result) {
|
|
|
- if (CollectionUtils.isNotEmpty(result)) {
|
|
|
+ private DatastatScore buildDatastatScore(PublishSortLog publishSortLog, FirstContentScoreExport value, Article article) {
|
|
|
+ DatastatScore item = new DatastatScore();
|
|
|
+ item.setDt(value.getDateStr());
|
|
|
+ item.setGhId(value.getGhId());
|
|
|
+ item.setAccountName(value.getAccountName());
|
|
|
+ item.setIndex(value.getIndex());
|
|
|
+ item.setTitle(value.getTitle());
|
|
|
+ item.setCategory(value.getCategory());
|
|
|
+ item.setStrategy(value.getStrategy());
|
|
|
+ item.setScore(value.getScore());
|
|
|
+ item.setHisFissionAvgReadRateRate(value.getHisFissionAvgReadRateRateStrategy());
|
|
|
+ item.setHisFissionAvgReadSumRate(value.getHisFissionAvgReadSumRateStrategy());
|
|
|
+ item.setSimilarity(value.getSimilarityStrategy());
|
|
|
+ item.setCategoryScore(value.getCategoryStrategy());
|
|
|
+ item.setViewCountRate(value.getViewCountRateStrategy());
|
|
|
+ item.setHisFissionDeWeightAvgReadSumRate(value.getHisFissionDeWeightAvgReadSumRateStrategy());
|
|
|
+ item.setReadCount(value.getReadCount());
|
|
|
+ item.setReadAvg(value.getReadAvg());
|
|
|
+ item.setReadAvgRate(value.getReadAvgRate());
|
|
|
+ item.setFirstPubInterval(value.getFirstExplorationIntervalAvg());
|
|
|
+ item.setPublishContentId(publishSortLog.getPublishContentId());
|
|
|
+ item.setCrawlerChannelContentId(publishSortLog.getCrawlerChannelContentId());
|
|
|
+ item.setSourceId(publishSortLog.getSourceId());
|
|
|
+ item.setPublishTimestamp(article.getPublishTimestamp());
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void saveDatastatScore(List<String> dateStrList, List<DatastatScore> saveList) {
|
|
|
+ if (CollectionUtils.isNotEmpty(saveList)) {
|
|
|
longArticleBaseMapper.deleteDatastatScoreByDtIn(dateStrList);
|
|
|
- List<DatastatScore> saveList = new ArrayList<>();
|
|
|
- for (FirstContentScoreExport value : result) {
|
|
|
- DatastatScore item = new DatastatScore();
|
|
|
- item.setDt(value.getDateStr());
|
|
|
- item.setGhId(value.getGhId());
|
|
|
- item.setAccountName(value.getAccountName());
|
|
|
- item.setIndex(value.getIndex());
|
|
|
- item.setTitle(value.getTitle());
|
|
|
- item.setCategory(value.getCategory());
|
|
|
- item.setStrategy(value.getStrategy());
|
|
|
- item.setScore(value.getScore());
|
|
|
- item.setHisFissionAvgReadRateRate(value.getHisFissionAvgReadRateRateStrategy());
|
|
|
- item.setHisFissionAvgReadSumRate(value.getHisFissionAvgReadSumRateStrategy());
|
|
|
- item.setSimilarity(value.getSimilarityStrategy());
|
|
|
- item.setCategoryScore(value.getCategoryStrategy());
|
|
|
- item.setViewCountRate(value.getViewCountRateStrategy());
|
|
|
- item.setHisFissionDeWeightAvgReadSumRate(value.getHisFissionDeWeightAvgReadSumRateStrategy());
|
|
|
- item.setReadCount(value.getReadCount());
|
|
|
- item.setReadAvg(value.getReadAvg());
|
|
|
- item.setReadAvgRate(value.getReadAvgRate());
|
|
|
- item.setFirstPubInterval(value.getFirstExplorationIntervalAvg());
|
|
|
- saveList.add(item);
|
|
|
- }
|
|
|
for (List<DatastatScore> saveListPartition : Lists.partition(saveList, 1000)) {
|
|
|
longArticleBaseMapper.batchInsertDatastatScore(saveListPartition);
|
|
|
}
|