supeng 5 дней назад
Родитель
Сommit
5229074340

+ 2 - 0
core/src/main/java/com/tzld/supply/dao/mapper/supply/spider/ext/SpiderMapperExt.java

@@ -13,6 +13,8 @@ public interface SpiderMapperExt {
 
     List<SpiderContent> getRoughScreenSpiderContentHasContent();
 
+    List<SpiderContent> getRoughScreenSpiderContentHasContentLatest(Long beginTime);
+
     List<SpiderContent> getRoughScreenSpiderContentNoContent();
 
     List<SpiderContent> getExportContentList(List<Integer> statusList, Integer aiRoughStatus, Long startTime, Long endTime);

+ 3 - 4
core/src/main/java/com/tzld/supply/job/ContentScreenJob.java

@@ -420,7 +420,7 @@ public class ContentScreenJob {
                     jsonObject.put(strategyName, result);
                 }
             }
-            log.info("titleAnalyseStrategy jsonObject is {}" ,jsonObject.toJSONString());
+            log.info("titleAnalyseStrategy jsonObject is {}", jsonObject.toJSONString());
             if (jsonObject.isEmpty()) {
                 SpiderContent updateContent = new SpiderContent();
                 updateContent.setId(content.getId());
@@ -463,13 +463,13 @@ public class ContentScreenJob {
         Long lastTime = LocalDateTime.now().minusDays(lastDays).atZone(ZoneId.systemDefault())
                 .toInstant()
                 .toEpochMilli();
-        XxlJobLogger.log("articleAnalyseConfigDTO config is " + articleAnalyseConfigDTO);
+        XxlJobLogger.log("articleAnalyseConfigDTO config is {}, lastTime:{}", articleAnalyseConfigDTO, lastTime);
         List<ArticleAnalyseConfigDTO.StrategyConfig> strategies = articleAnalyseConfigDTO.getStrategies();
         if (Objects.isNull(strategies) || strategies.isEmpty()) {
             XxlJobLogger.log("strategies is null or empty");
             return ReturnT.SUCCESS;
         }
-        List<SpiderContent> contentList = spiderMapperExt.getRoughScreenSpiderContentHasContent();
+        List<SpiderContent> contentList = spiderMapperExt.getRoughScreenSpiderContentHasContentLatest(lastTime);
         if (contentList.isEmpty()) {
             return ReturnT.SUCCESS;
         }
@@ -529,7 +529,6 @@ public class ContentScreenJob {
         }
 
 
-
         for (SpiderContent content : contentList) {
             Long filterTime = DateUtils.getBeforeDayStart(2);
             if (content.getCreateTime() < filterTime) {

+ 8 - 0
core/src/main/resources/mapper/supply/spider/ext/SpiderMapperExt.xml

@@ -27,6 +27,14 @@
         where `status` = 1 and ai_rough_status = 1 and ai_precision_status = 0 and content is not null
     </select>
 
+    <select id="getRoughScreenSpiderContentHasContentLatest" resultType="com.tzld.supply.model.po.supply.spider.SpiderContent">
+        select *
+        from spider_content
+        where `status` = 1 and ai_rough_status = 1 and ai_precision_status = 0
+          and create_time>#{beginTime}
+          and content is not null
+    </select>
+
     <select id="getRoughScreenSpiderContentNoContent" resultType="com.tzld.supply.model.po.supply.spider.SpiderContent">
         select *
         from spider_content