浏览代码

发布计划校验增加信息

wangyunpeng 9 月之前
父节点
当前提交
864ab10ccf

+ 6 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/NotPublishPlan.java

@@ -11,5 +11,11 @@ public class NotPublishPlan {
 
     private String planName;
 
+    private String errorMsg;
+
+    private Integer expectCount;
+
+    private Integer publishCount;
+
     private String publishPushTime;
 }

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java

@@ -48,6 +48,9 @@ public class XxlJobService {
                 "发布计划超1H未发送完成\n"
                         + "发布计划ID: " + publishPlan.getPlanId() + "\n"
                         + "发布计划名称: " + publishPlan.getPlanName() + "\n"
+                        + "预计数量: " + publishPlan.getExpectCount() + "\n"
+                        + "实际数量: " + publishPlan.getPublishCount() + "\n"
+                        + "发布计划失败原因: " + publishPlan.getErrorMsg() + "\n"
                         + "发布时间: " + publishPlan.getPublishPushTime() + "\n"
                         + "<at user_id=\"all\">所有人</at> ");
     }

+ 21 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/XxlJobController.java

@@ -0,0 +1,21 @@
+package com.tzld.longarticle.recommend.server.web;
+
+import com.tzld.longarticle.recommend.server.service.XxlJobService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/xxlJob")
+@Slf4j
+public class XxlJobController {
+    @Autowired
+    private XxlJobService service;
+
+    @GetMapping("/checkPublishPlan")
+    public void checkPublishPlan() {
+        service.checkPublishPlan(null);
+    }
+}

+ 6 - 3
long-article-recommend-service/src/main/resources/mapper/aigc/AigcBaseMapper.xml

@@ -68,11 +68,14 @@
         SELECT
             plan.id as planId,
             plan.NAME as planName,
-            setting.publish_push_time
+            plan.error_msg as errorMsg,
+            stat.today_expect_publish_count as expectCount,
+            stat.today_publish_count as publishCount,
+            setting.publish_push_time as publishPushTime
         FROM
             publish_plan plan
-                JOIN publish_plan_stat stat ON plan.id = stat.plan_id
-                JOIN publish_plan_setting setting ON plan.id = setting.plan_id
+        JOIN publish_plan_stat stat ON plan.id = stat.plan_id
+        JOIN publish_plan_setting setting ON plan.id = setting.plan_id
         WHERE
             stat.today_expect_publish_count > stat.today_publish_count
           AND plan.plan_status = 1