xueyiming 7 місяців тому
батько
коміт
9ab19eb944
17 змінених файлів з 343 додано та 128 видалено
  1. 49 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/config/XxlJobConfig.java
  2. 42 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java
  3. 0 23
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/MiniprogramCard.java
  4. 0 27
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/MiniprogramCardQueryResultData.java
  5. 0 31
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/PlanAccount.java
  6. 11 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccount.java
  7. 70 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccountExample.java
  8. 1 3
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlan.java
  9. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlanAccount.java
  10. 11 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushStatusParam.java
  11. 22 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushStatusVO.java
  12. 82 30
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CoreServiceImpl.java
  13. 22 7
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/PlanServiceImpl.java
  14. 2 0
      long-article-server/src/main/resources/application-test.properties
  15. 9 0
      long-article-server/src/main/resources/application.properties
  16. 20 5
      long-article-server/src/main/resources/mapper/PlanAccountMapper.xml
  17. 1 1
      long-article-server/src/main/resources/mybatis-generator-config.xml

+ 49 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/config/XxlJobConfig.java

@@ -0,0 +1,49 @@
+package com.tzld.piaoquan.longarticle.config;
+
+import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class XxlJobConfig {
+
+
+    @Value("${xxl.job.admin.addresses}")
+    private String adminAddresses;
+
+    @Value("${xxl.job.accessToken}")
+    private String accessToken;
+
+    @Value("${xxl.job.executor.appname}")
+    private String appName;
+
+    @Value("${xxl.job.executor.address}")
+    private String address;
+
+    @Value("${xxl.job.executor.ip}")
+    private String ip;
+
+    @Value("${xxl.job.executor.port}")
+    private int port;
+
+    @Value("${xxl.job.executor.logpath}")
+    private String logPath;
+
+    @Value("${xxl.job.executor.logretentiondays}")
+    private int logRetentionDays;
+
+    @Bean
+    public XxlJobSpringExecutor xxlJobExecutor() {
+        XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
+        xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
+        xxlJobSpringExecutor.setAppname(appName);
+        xxlJobSpringExecutor.setAddress(address);
+        xxlJobSpringExecutor.setIp(ip);
+        xxlJobSpringExecutor.setPort(port);
+        xxlJobSpringExecutor.setAccessToken(accessToken);
+        xxlJobSpringExecutor.setLogPath(logPath);
+        xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
+        return xxlJobSpringExecutor;
+    }
+}

+ 42 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java

@@ -0,0 +1,42 @@
+package com.tzld.piaoquan.longarticle.job;
+
+import com.tzld.piaoquan.longarticle.service.impl.CoreServiceImpl;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Slf4j
+@Component
+public class PlanAccountJob {
+
+    @Autowired
+    private CoreServiceImpl coreService;
+
+
+    @XxlJob("initPlanAccountJob")
+    public ReturnT<String> initPlanAccount(String param) {
+        coreService.initPlanAccount();
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("matchPlanAccountJob")
+    public ReturnT<String> matchPlanAccount(String param) {
+        coreService.matchContent();
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("corePlanAccountJob")
+    public ReturnT<String> corePlanAccount(String param) {
+        coreService.core();
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("getPushStatusJob")
+    public ReturnT<String> getPushStatus(String param) {
+        coreService.getPushStatus();
+        return ReturnT.SUCCESS;
+    }
+
+}

+ 0 - 23
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/MiniprogramCard.java

@@ -1,23 +0,0 @@
-package com.tzld.piaoquan.longarticle.model.bo;
-
-import lombok.Data;
-
-import java.math.BigDecimal;
-
-@Data
-public class MiniprogramCard {
-
-    private String productionCover;
-    private String productionName;
-    private String productionPath;
-    private String programAvatar;
-    private String programId;
-    private String programName;
-    private String rootShareId;
-    private String source;
-    private String videoUrl;
-    private BigDecimal paragraphPosition;
-    private Integer mini_id;
-    private String traceId;
-    private Integer miniprogramUseType;
-}

+ 0 - 27
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/MiniprogramCardQueryResultData.java

@@ -1,27 +0,0 @@
-package com.tzld.piaoquan.longarticle.model.bo;
-
-import lombok.Getter;
-import lombok.Setter;
-import lombok.experimental.Accessors;
-
-import java.math.BigDecimal;
-
-@Getter
-@Setter
-@Accessors(chain = true)
-public class MiniprogramCardQueryResultData {
-    private String productionCover;
-    private String productionName;
-    private String productionPath;
-    private String programAvatar;
-    private String programId;
-    private String programName;
-    private String rootShareId;
-    private String source;
-    private String videoUrl;
-    private BigDecimal paragraphPosition;
-    private Integer mini_id;
-    private String traceId;
-    private Integer miniprogramUseType;
-
-}

+ 0 - 31
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/PlanAccount.java

@@ -1,31 +0,0 @@
-package com.tzld.piaoquan.longarticle.model.bo;
-
-import lombok.Data;
-
-@Data
-public class PlanAccount {
-    //计划id
-    private String planId;
-    //计划名称
-    private String planName;
-    //账号id
-    private String accountId;
-    //账号名称
-    private String accountName;
-    //公众号ID
-    private String gzhId;
-    //每次发布数量
-    private Integer publishNum;
-    //每次最少发布数量
-    private Integer publishPerMinNum;
-    //推送时间
-    private String publishPushTime;
-    //小程序插入策略
-    private String miniStrategy;
-    //小程序用途,1-自然流,2-投流
-    private Integer miniprogramUseType;
-    //排序策略
-    private String sortStrategy;
-    //推送策略
-    private Integer pushType;
-}

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccount.java

@@ -31,6 +31,8 @@ public class PlanAccount {
 
     private Integer status;
 
+    private String pushId;
+
     private Date createTime;
 
     private Date updateTime;
@@ -147,6 +149,14 @@ public class PlanAccount {
         this.status = status;
     }
 
+    public String getPushId() {
+        return pushId;
+    }
+
+    public void setPushId(String pushId) {
+        this.pushId = pushId;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -183,6 +193,7 @@ public class PlanAccount {
         sb.append(", sortStrategy=").append(sortStrategy);
         sb.append(", pushType=").append(pushType);
         sb.append(", status=").append(status);
+        sb.append(", pushId=").append(pushId);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);
         sb.append("]");

+ 70 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccountExample.java

@@ -1036,6 +1036,76 @@ public class PlanAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andPushIdIsNull() {
+            addCriterion("push_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdIsNotNull() {
+            addCriterion("push_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdEqualTo(String value) {
+            addCriterion("push_id =", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdNotEqualTo(String value) {
+            addCriterion("push_id <>", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdGreaterThan(String value) {
+            addCriterion("push_id >", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdGreaterThanOrEqualTo(String value) {
+            addCriterion("push_id >=", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdLessThan(String value) {
+            addCriterion("push_id <", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdLessThanOrEqualTo(String value) {
+            addCriterion("push_id <=", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdLike(String value) {
+            addCriterion("push_id like", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdNotLike(String value) {
+            addCriterion("push_id not like", value, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdIn(List<String> values) {
+            addCriterion("push_id in", values, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdNotIn(List<String> values) {
+            addCriterion("push_id not in", values, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdBetween(String value1, String value2) {
+            addCriterion("push_id between", value1, value2, "pushId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPushIdNotBetween(String value1, String value2) {
+            addCriterion("push_id not between", value1, value2, "pushId");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimeIsNull() {
             addCriterion("create_time is null");
             return (Criteria) this;

+ 1 - 3
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/LongArticleSystemPlan.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlan.java

@@ -1,7 +1,5 @@
-package com.tzld.piaoquan.longarticle.model.bo;
+package com.tzld.piaoquan.longarticle.model.vo;
 
-import com.tzld.piaoquan.longarticle.model.vo.GzhArticleSortTaskParam;
-import com.tzld.piaoquan.longarticle.model.vo.MiniprogramInsertTaskParam;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.experimental.Accessors;

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/LongArticleSystemPlanAccount.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlanAccount.java

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.longarticle.model.bo;
+package com.tzld.piaoquan.longarticle.model.vo;
 
 import lombok.Getter;
 import lombok.Setter;

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushStatusParam.java

@@ -0,0 +1,11 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class PushStatusParam {
+
+    private String pushId;
+}

+ 22 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/PushStatusVO.java

@@ -0,0 +1,22 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.experimental.Accessors;
+
+@Getter
+@Setter
+@Accessors(chain = true)
+public class PushStatusVO {
+
+    //"推送ID")
+    private String pushId;
+    //"推送到草稿箱状态(0-待推送,1-推送中,2-推送成功,3-推送失败)")
+    private Integer pushStatus;
+    //"发表状态(-1-未推送不能发表,0-待发表,1-发表中,2-发表成功,3-发表失败)")
+    private Integer publishStatus;
+    //"错误信息")
+    private String errorMsg;
+    //"推送完成时间戳")
+    private Long pushFinishTimestamp;
+}

+ 82 - 30
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CoreServiceImpl.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.longarticle.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
 import com.tzld.piaoquan.longarticle.model.dto.*;
@@ -16,10 +17,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Service
 public class CoreServiceImpl implements CoreService {
@@ -54,10 +52,15 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     private PublishMiniprogramMapper publishMiniprogramMapper;
 
-    public void init() {
+    public void initPlanAccount() {
         List<LongArticleSystemPlan> allLongArticleSystemPlans = planService.getAllLongArticleSystemPlan();
         for (LongArticleSystemPlan longArticleSystemPlan : allLongArticleSystemPlans) {
-            //TODO 判断计划当天是否需要发送  不发送不记录
+            if (longArticleSystemPlan.getPublishRate() == 1) {
+                List<Integer> weeks = JSON.parseArray(longArticleSystemPlan.getPublishDate(), Integer.class);
+                if (!weeks.contains(TimeZoneUtil.getTodayDayOfWeek(TimeZoneUtil.Timezone.china))) {
+                    continue;
+                }
+            }
             //获取排序策略
             Map<String, String> sortStgMap = new HashMap<>();
             List<GzhArticleSortTaskParam> gzhArticleSortTask = longArticleSystemPlan.getGzhArticleSortTask();
@@ -108,7 +111,7 @@ public class CoreServiceImpl implements CoreService {
         }
     }
 
-    public void match() {
+    public void matchContent() {
         //查询状态为0的请求匹配
         PlanAccountExample example = new PlanAccountExample();
         example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate()).andStatusEqualTo(0);
@@ -123,10 +126,7 @@ public class CoreServiceImpl implements CoreService {
             }
             //没有待匹配的文章  更新状态为1  待排序
             if (longArticleSystemContentVO.getTotalCount() == 0) {
-                PlanAccount updatePlanAccount = new PlanAccount();
-                updatePlanAccount.setId(planAccount.getId());
-                updatePlanAccount.setStatus(1);
-                planAccountMapper.updateByPrimaryKey(updatePlanAccount);
+                planAccountService.updateStatus(1, planAccount.getId());
             }
             for (ContentItemVO contentItemVO : longArticleSystemContentVO.getContentItemList()) {
                 MatchVideo content = contentService.getContent(planAccount.getGhId(), contentItemVO.getContent());
@@ -168,25 +168,27 @@ public class CoreServiceImpl implements CoreService {
     }
 
     public void core() {
-        List<PlanAccount> planAccounts = new ArrayList<>();
-
-        PlanAccount planAccount1 = new PlanAccount();
-        planAccount1.setAccountId("20231208111728193795195");
-        planAccount1.setAccountName("票圈大事件");
-        planAccount1.setGhId("gh_9e559b3b94ca");
-        planAccount1.setPlanId("20241012140830436890740");
-        planAccount1.setPublishNum(8);
-        planAccount1.setMiniStrategy("strategy_v1");
-        planAccount1.setSortStrategy("ArticleRankV5");
-        planAccount1.setPublishPreMinNum(4);
-        planAccount1.setMiniprogramUseType(1);
-        planAccount1.setPushType(2);
-        planAccounts.add(planAccount1);
+//        List<PlanAccount> planAccounts = new ArrayList<>();
+//
+//        PlanAccount planAccount1 = new PlanAccount();
+//        planAccount1.setAccountId("20231208111728193795195");
+//        planAccount1.setAccountName("票圈大事件");
+//        planAccount1.setGhId("gh_9e559b3b94ca");
+//        planAccount1.setPlanId("20241012140830436890740");
+//        planAccount1.setPublishNum(8);
+//        planAccount1.setMiniStrategy("strategy_v1");
+//        planAccount1.setSortStrategy("ArticleRankV5");
+//        planAccount1.setPublishPreMinNum(4);
+//        planAccount1.setMiniprogramUseType(1);
+//        planAccount1.setPushType(2);
+//        planAccounts.add(planAccount1);
 
         //查询状态为1的  开始排序  发布小程序视频  组装 发布文章
-//        PlanAccountExample example = new PlanAccountExample();
-//        example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate()).andStatusEqualTo(1);
-//        List<PlanAccount> planAccounts = planAccountMapper.selectByExample(example);
+        PlanAccountExample example = new PlanAccountExample();
+        //匹配完成和发布失败
+        List<Integer> status = Arrays.asList(1, 5);
+        example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate()).andStatusIn(status);
+        List<PlanAccount> planAccounts = planAccountMapper.selectByExample(example);
         for (PlanAccount planAccount : planAccounts) {
             ArticleSortRequest articleSortRequest = new ArticleSortRequest();
             articleSortRequest.setAccountId(planAccount.getAccountId());
@@ -317,11 +319,61 @@ public class CoreServiceImpl implements CoreService {
                 continue;
             }
             System.out.println(gzhPushParam);
-            boolean pushTask = planService.createPushTask(gzhPushParam);
-            if (pushTask) {
+            String pushId = planService.createPushTask(gzhPushParam);
+            if (StringUtils.isNotEmpty(pushId)) {
                 //更新状态  发布完成
+                PlanAccount updatePlanAccount = new PlanAccount();
+                updatePlanAccount.setId(planAccount.getId());
+                updatePlanAccount.setStatus(3);
+                updatePlanAccount.setPushId(pushId);
+                planAccountMapper.updateByPrimaryKey(updatePlanAccount);
                 planAccountService.updateStatus(3, planAccount.getId());
+            }
+        }
+    }
 
+    public void getPushStatus() {
+        PlanAccountExample example = new PlanAccountExample();
+        //匹配完成和发布失败
+        List<Integer> status = Arrays.asList(3);
+        example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate()).andStatusIn(status);
+        List<PlanAccount> planAccounts = planAccountMapper.selectByExample(example);
+        if (CollectionUtils.isEmpty(planAccounts)) {
+            return;
+        }
+        for (PlanAccount planAccount : planAccounts) {
+            if (StringUtils.isNotEmpty(planAccount.getPublishPushTime())) {
+                String dateTimeStr = TimeZoneUtil.todayYMD(TimeZoneUtil.Timezone.china) + " " + planAccount.getPublishPushTime();
+                long dateStrTimestamp = TimeZoneUtil.getDateStrTimestamp(dateTimeStr, "yyyy-MM-dd HH:mm:ss", TimeZoneUtil.Timezone.china);
+                if (dateStrTimestamp < new Date().getTime()) {
+                    continue;
+                }
+            }
+            if (StringUtils.isEmpty(planAccount.getPushId())) {
+                continue;
+            }
+            PushStatusParam param = new PushStatusParam();
+            param.setPushId(planAccount.getPushId());
+            PushStatusVO pushStatusVO = planService.queryPushStatus(param);
+            int updateStatus = 0;
+            //推送失败  重新推送
+            if (pushStatusVO.getPushStatus() == 3) {
+                updateStatus = 5;
+            }
+            //推送成功
+            if (pushStatusVO.getPushStatus() == 2) {
+                //发表失败
+                if (pushStatusVO.getPublishStatus() == 3) {
+                    updateStatus = 5;
+                }
+                //发表成功
+                if (pushStatusVO.getPublishStatus() == 2) {
+                    updateStatus = 4;
+                }
+            }
+            //更新状态  4成功  5失败
+            if (updateStatus != 0) {
+                planAccountService.updateStatus(updateStatus, planAccount.getId());
             }
         }
     }

+ 22 - 7
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/PlanServiceImpl.java

@@ -3,7 +3,7 @@ package com.tzld.piaoquan.longarticle.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.tzld.piaoquan.longarticle.model.bo.LongArticleSystemPlan;
+import com.tzld.piaoquan.longarticle.model.vo.LongArticleSystemPlan;
 import com.tzld.piaoquan.longarticle.model.vo.*;
 import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
 import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
@@ -77,22 +77,22 @@ public class PlanServiceImpl {
         return null;
     }
 
-    public boolean createPushTask(LongArticleSystemCreatePushTaskParam param) {
+    public String createPushTask(LongArticleSystemCreatePushTaskParam param) {
         String apiUrl = "http://aigc-testapi.cybertogether.net/publish/LongArticleSystem/uploadMiniprogramCover";
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
-                return true;
+                return jsonObject.getString("data");
             }
         } catch (Exception e) {
             log.error("listWaitingMatchMiniprogramContents error", e);
         }
-        return false;
+        return "";
     }
 
-    public boolean updateMatchMiniprogramStatus(MatchMiniprogramStatusParam param){
+    public boolean updateMatchMiniprogramStatus(MatchMiniprogramStatusParam param) {
         String apiUrl = "http://aigc-testapi.cybertogether.net/publish/LongArticleSystem/updateMatchMiniprogramStatus";
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
@@ -118,10 +118,25 @@ public class PlanServiceImpl {
                 return true;
             }
         } catch (Exception e) {
-            log.error("listWaitingMatchMiniprogramContents error", e);
+            log.error("filterSortContents error", e);
         }
         return false;
     }
 
-
+    public PushStatusVO queryPushStatus(PushStatusParam param) {
+        String apiUrl = "http://aigc-testapi.cybertogether.net/publish/LongArticleSystem/queryPushStatus";
+        List<ContentItemVO> contentItemList = new ArrayList<>();
+        try {
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                PushStatusVO data = jsonObject.getJSONObject("data").toJavaObject(PushStatusVO.class);
+                return data;
+            }
+        } catch (Exception e) {
+            log.error("queryPushStatus error", e);
+        }
+        return null;
+    }
 }

+ 2 - 0
long-article-server/src/main/resources/application-test.properties

@@ -6,3 +6,5 @@ spring.datasource.url=jdbc:mysql://rm-bp14529nwwcw75yr1ko.mysql.rds.aliyuncs.com
 
 
 apollo.meta: https://apolloconfig-internal.piaoquantv.com
+
+xxl.job.admin.addresses=http://xxl-job-internal.piaoquantv.com/xxl-job-admin

+ 9 - 0
long-article-server/src/main/resources/application.properties

@@ -21,6 +21,15 @@ apollo.bootstrap.namespaces=application
 apollo.cacheDir=/datalog/apollo-cache-dir
 
 
+xxl.job.accessToken=
+xxl.job.executor.appname=${spring.application.name}
+xxl.job.executor.address=
+xxl.job.executor.ip=
+xxl.job.executor.port=9999
+xxl.job.executor.logpath=${datalog}/xxl-job/
+xxl.job.executor.logretentiondays=30
+
+
 
 
 

+ 20 - 5
long-article-server/src/main/resources/mapper/PlanAccountMapper.xml

@@ -16,6 +16,7 @@
     <result column="sort_strategy" jdbcType="VARCHAR" property="sortStrategy" />
     <result column="push_type" jdbcType="INTEGER" property="pushType" />
     <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="push_id" jdbcType="VARCHAR" property="pushId" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
@@ -80,7 +81,7 @@
   <sql id="Base_Column_List">
     id, plan_id, plan_name, account_id, account_name, gh_id, publish_num, publish_pre_min_num, 
     publish_push_time, mini_strategy, miniprogram_use_type, sort_strategy, push_type, 
-    `status`, create_time, update_time
+    `status`, push_id, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.PlanAccountExample" resultMap="BaseResultMap">
     select
@@ -120,14 +121,14 @@
       account_id, account_name, gh_id, 
       publish_num, publish_pre_min_num, publish_push_time, 
       mini_strategy, miniprogram_use_type, sort_strategy, 
-      push_type, `status`, create_time, 
-      update_time)
+      push_type, `status`, push_id, 
+      create_time, update_time)
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=VARCHAR}, #{planName,jdbcType=VARCHAR}, 
       #{accountId,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
       #{publishNum,jdbcType=INTEGER}, #{publishPreMinNum,jdbcType=INTEGER}, #{publishPushTime,jdbcType=VARCHAR}, 
       #{miniStrategy,jdbcType=VARCHAR}, #{miniprogramUseType,jdbcType=INTEGER}, #{sortStrategy,jdbcType=VARCHAR}, 
-      #{pushType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{pushType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{pushId,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.PlanAccount">
     insert into long_articles_plan_account
@@ -174,6 +175,9 @@
       <if test="status != null">
         `status`,
       </if>
+      <if test="pushId != null">
+        push_id,
+      </if>
       <if test="createTime != null">
         create_time,
       </if>
@@ -224,6 +228,9 @@
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
+      <if test="pushId != null">
+        #{pushId,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -283,6 +290,9 @@
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
+      <if test="record.pushId != null">
+        push_id = #{record.pushId,jdbcType=VARCHAR},
+      </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
@@ -310,6 +320,7 @@
       sort_strategy = #{record.sortStrategy,jdbcType=VARCHAR},
       push_type = #{record.pushType,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
+      push_id = #{record.pushId,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
@@ -358,6 +369,9 @@
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
+      <if test="pushId != null">
+        push_id = #{pushId,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -382,6 +396,7 @@
       sort_strategy = #{sortStrategy,jdbcType=VARCHAR},
       push_type = #{pushType,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
+      push_id = #{pushId,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}

+ 1 - 1
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -60,7 +60,7 @@
 <!--            <columnOverride column="cover_url" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
-        <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>
+        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>
 
     </context>