|
@@ -51,6 +51,7 @@ import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.collections4.MapUtils;
|
|
import org.apache.commons.collections4.MapUtils;
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.util.Pair;
|
|
import org.springframework.data.util.Pair;
|
|
@@ -120,6 +121,8 @@ public class DataDashboardService {
|
|
|
private LongArticlesPublishMiniprogramRepository longArticlesPublishMiniprogramRepository;
|
|
private LongArticlesPublishMiniprogramRepository longArticlesPublishMiniprogramRepository;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private LongArticlesNewVideoCoverRepository longArticlesNewVideoCoverRepository;
|
|
private LongArticlesNewVideoCoverRepository longArticlesNewVideoCoverRepository;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PublishDailyReportRepository publishDailyReportRepository;
|
|
|
|
|
|
|
|
@ApolloJsonValue("${export.account.ghId:[]}")
|
|
@ApolloJsonValue("${export.account.ghId:[]}")
|
|
|
private static List<String> ghIdList;
|
|
private static List<String> ghIdList;
|
|
@@ -149,6 +152,28 @@ public class DataDashboardService {
|
|
|
return ReturnT.SUCCESS;
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @XxlJob("scheduledExportMysql")
|
|
|
|
|
+ public ReturnT<String> scheduledExportMysql(String param) {
|
|
|
|
|
+ if (!StringUtils.hasText(param)) {
|
|
|
|
|
+ return ReturnT.FAIL;
|
|
|
|
|
+ }
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(param);
|
|
|
|
|
+ String minDate = jsonObject.getString("minDate");
|
|
|
|
|
+ String maxDate = jsonObject.getString("maxDate");
|
|
|
|
|
+ List<NewSortStrategyExport> newContentsYesData = newSortStrategyData(minDate, maxDate,
|
|
|
|
|
+ ArticleTypeEnum.QUNFA.getVal(), StatusEnum.ZERO.getCode());
|
|
|
|
|
+ if (CollectionUtils.isNotEmpty(newContentsYesData)) {
|
|
|
|
|
+ List<PublishDailyReport> reports = new ArrayList<>();
|
|
|
|
|
+ for (NewSortStrategyExport newSortStrategyExport : newContentsYesData) {
|
|
|
|
|
+ PublishDailyReport publishDailyReport = new PublishDailyReport();
|
|
|
|
|
+ BeanUtils.copyProperties(newSortStrategyExport, publishDailyReport);
|
|
|
|
|
+ reports.add(publishDailyReport);
|
|
|
|
|
+ }
|
|
|
|
|
+ publishDailyReportRepository.saveAll(reports);
|
|
|
|
|
+ }
|
|
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void exportWuXianLiu(String beginDate, String endDate) {
|
|
public void exportWuXianLiu(String beginDate, String endDate) {
|
|
|
List<String> dateStrList = DateUtils.getBeforeDays(beginDate, endDate, 5);
|
|
List<String> dateStrList = DateUtils.getBeforeDays(beginDate, endDate, 5);
|
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.WUXIANLIU.getVal(), StatusEnum.ONE.getCode(),
|
|
exportFeishuNewSortStrategy(dateStrList, ArticleTypeEnum.WUXIANLIU.getVal(), StatusEnum.ONE.getCode(),
|