|
@@ -8,17 +8,16 @@ import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
|
|
import com.tzld.longarticle.recommend.server.common.CommonThreadPoolExecutor;
|
|
|
+import com.tzld.longarticle.recommend.server.common.enums.aigc.ProduceContentAuditStatusEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.AccountBusinessTypeEnum;
|
|
|
import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.growth.NewPushMessageCallbackMapper;
|
|
|
import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
|
|
|
-import com.tzld.longarticle.recommend.server.model.dto.AccountTypeFansDTO;
|
|
|
-import com.tzld.longarticle.recommend.server.model.dto.Content;
|
|
|
-import com.tzld.longarticle.recommend.server.model.dto.NotPublishPlan;
|
|
|
-import com.tzld.longarticle.recommend.server.model.dto.PublishPlanAccountNotifyDTO;
|
|
|
+import com.tzld.longarticle.recommend.server.model.dto.*;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan;
|
|
|
+import com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlan;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountAvgInfo;
|
|
|
import com.tzld.longarticle.recommend.server.model.entity.crawler.GetOffVideoCrawler;
|
|
@@ -27,6 +26,7 @@ import com.tzld.longarticle.recommend.server.model.entity.longArticle.*;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.ArticleFindSourceParam;
|
|
|
import com.tzld.longarticle.recommend.server.model.param.TitleHisCacheParam;
|
|
|
import com.tzld.longarticle.recommend.server.remote.ODPSManager;
|
|
|
+import com.tzld.longarticle.recommend.server.repository.aigc.ProducePlanRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.GetOffVideoCrawlerRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.crawler.LongArticlesVideoRepository;
|
|
|
import com.tzld.longarticle.recommend.server.repository.longArticle.*;
|
|
@@ -94,6 +94,8 @@ public class XxlJobService {
|
|
|
private ArticleTitleHisCacheRepository articleTitleHisCacheRepository;
|
|
|
@Autowired
|
|
|
private RecallService recallService;
|
|
|
+ @Autowired
|
|
|
+ private ProducePlanRepository producePlanRepository;
|
|
|
|
|
|
ExecutorService thread = new CommonThreadPoolExecutor(
|
|
|
5,
|
|
@@ -248,6 +250,50 @@ public class XxlJobService {
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+ @XxlJob("checkColdProducePlanAudit")
|
|
|
+ public ReturnT<String> checkColdProducePlanAudit(String param) {
|
|
|
+ long timeStamp = DateUtils.getBeforeDayStart(1);
|
|
|
+ if (StringUtils.hasText(param)) {
|
|
|
+ timeStamp = DateUtils.getStartOfDay(param, "yyyyMMdd");
|
|
|
+ }
|
|
|
+ timeStamp = timeStamp * 1000;
|
|
|
+ List<String> planIds = Arrays.asList("20241030070010871546586","20240802080355355308981","20240802021606053813696");
|
|
|
+ List<ProducePlan> producePlans = producePlanRepository.findByIdIn(planIds);
|
|
|
+ Map<String, String> producePlanMap = producePlans.stream().collect(Collectors.toMap(ProducePlan::getId, ProducePlan::getName));
|
|
|
+ List<ProducePlanAuditCheckDTO> producePlanList = aigcBaseMapper.getColdProducePlanAudit(
|
|
|
+ timeStamp, timeStamp + 86400000, planIds);
|
|
|
+ Map<String, List<ProducePlanAuditCheckDTO>> producePlanAuditMap = producePlanList.stream()
|
|
|
+ .collect(Collectors.groupingBy(ProducePlanAuditCheckDTO::getPlanId));
|
|
|
+ for (String planId : planIds) {
|
|
|
+ List<ProducePlanAuditCheckDTO> auditCheckDTOList = producePlanAuditMap.get(planId);
|
|
|
+ Integer yesterdayAuditNum = 0, yesterdayAuditPassNum = 0, waitingAuditNum = 0;
|
|
|
+ if (CollectionUtils.isNotEmpty(auditCheckDTOList)) {
|
|
|
+ for (ProducePlanAuditCheckDTO producePlanAuditCheckDTO : auditCheckDTOList) {
|
|
|
+ if (Objects.equals(producePlanAuditCheckDTO.getAuditStatus(), ProduceContentAuditStatusEnum.waiting.getVal())) {
|
|
|
+ waitingAuditNum = producePlanAuditCheckDTO.getNum();
|
|
|
+ } else if (Objects.equals(producePlanAuditCheckDTO.getAuditStatus(), ProduceContentAuditStatusEnum.pass.getVal())) {
|
|
|
+ yesterdayAuditPassNum = producePlanAuditCheckDTO.getNum();
|
|
|
+ yesterdayAuditNum += producePlanAuditCheckDTO.getNum();
|
|
|
+ } else if (Objects.equals(producePlanAuditCheckDTO.getAuditStatus(), ProduceContentAuditStatusEnum.reject.getVal())) {
|
|
|
+ yesterdayAuditNum += producePlanAuditCheckDTO.getNum();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ log.info("checkColdProducePlanAudit planId: {}, planName: {}, yesterdayAuditNum: {}, " +
|
|
|
+ "yesterdayAuditPassNum: {}, waitingAuditNum: {}",
|
|
|
+ planId, producePlanMap.get(planId), yesterdayAuditNum, yesterdayAuditPassNum, waitingAuditNum);
|
|
|
+ FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.DAILY.getRobotId(),
|
|
|
+ "【冷启生成计划审核数量】\n"
|
|
|
+ + "planId: " + planId + "\n"
|
|
|
+ + "planName: " + producePlanMap.get(planId) + "\n"
|
|
|
+ + "前一天审核数量: " + yesterdayAuditNum + "\n"
|
|
|
+ + "前一天审核通过数量: " + yesterdayAuditPassNum + "\n"
|
|
|
+ + "当前待审核数量: " + waitingAuditNum + "\n"
|
|
|
+ + "<at user_id=\"all\">所有人</at> ");
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
@XxlJob("migrateCrawlerRootSourceId")
|
|
|
public ReturnT<String> migrateCrawlerRootSourceId(String param) {
|
|
|
try {
|