Ver Fonte

增加记录

xueyiming há 7 meses atrás
pai
commit
79b9c8afe7

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

@@ -19,6 +19,8 @@ public class PublishContent {
 
     private String pushId;
 
+    private String reason;
+
     private Date createTime;
 
     private Date updateTime;
@@ -87,6 +89,14 @@ public class PublishContent {
         this.pushId = pushId;
     }
 
+    public String getReason() {
+        return reason;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -117,6 +127,7 @@ public class PublishContent {
         sb.append(", contentPoolType=").append(contentPoolType);
         sb.append(", status=").append(status);
         sb.append(", pushId=").append(pushId);
+        sb.append(", reason=").append(reason);
         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/PublishContentExample.java

@@ -636,6 +636,76 @@ public class PublishContentExample {
             return (Criteria) this;
         }
 
+        public Criteria andReasonIsNull() {
+            addCriterion("reason is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonIsNotNull() {
+            addCriterion("reason is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonEqualTo(String value) {
+            addCriterion("reason =", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonNotEqualTo(String value) {
+            addCriterion("reason <>", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonGreaterThan(String value) {
+            addCriterion("reason >", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonGreaterThanOrEqualTo(String value) {
+            addCriterion("reason >=", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonLessThan(String value) {
+            addCriterion("reason <", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonLessThanOrEqualTo(String value) {
+            addCriterion("reason <=", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonLike(String value) {
+            addCriterion("reason like", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonNotLike(String value) {
+            addCriterion("reason not like", value, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonIn(List<String> values) {
+            addCriterion("reason in", values, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonNotIn(List<String> values) {
+            addCriterion("reason not in", values, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonBetween(String value1, String value2) {
+            addCriterion("reason between", value1, value2, "reason");
+            return (Criteria) this;
+        }
+
+        public Criteria andReasonNotBetween(String value1, String value2) {
+            addCriterion("reason not between", value1, value2, "reason");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimeIsNull() {
             addCriterion("create_time is null");
             return (Criteria) this;

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

@@ -33,6 +33,8 @@ public class PublishMiniprogram {
 
     private String productionPath;
 
+    private String rootSourceId;
+
     private String rootShareId;
 
     private Integer index;
@@ -165,6 +167,14 @@ public class PublishMiniprogram {
         this.productionPath = productionPath;
     }
 
+    public String getRootSourceId() {
+        return rootSourceId;
+    }
+
+    public void setRootSourceId(String rootSourceId) {
+        this.rootSourceId = rootSourceId;
+    }
+
     public String getRootShareId() {
         return rootShareId;
     }
@@ -234,6 +244,7 @@ public class PublishMiniprogram {
         sb.append(", videoCover=").append(videoCover);
         sb.append(", videoPath=").append(videoPath);
         sb.append(", productionPath=").append(productionPath);
+        sb.append(", rootSourceId=").append(rootSourceId);
         sb.append(", rootShareId=").append(rootShareId);
         sb.append(", index=").append(index);
         sb.append(", traceId=").append(traceId);

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

@@ -1106,6 +1106,76 @@ public class PublishMiniprogramExample {
             return (Criteria) this;
         }
 
+        public Criteria andRootSourceIdIsNull() {
+            addCriterion("root_source_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdIsNotNull() {
+            addCriterion("root_source_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdEqualTo(String value) {
+            addCriterion("root_source_id =", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotEqualTo(String value) {
+            addCriterion("root_source_id <>", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdGreaterThan(String value) {
+            addCriterion("root_source_id >", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdGreaterThanOrEqualTo(String value) {
+            addCriterion("root_source_id >=", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLessThan(String value) {
+            addCriterion("root_source_id <", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLessThanOrEqualTo(String value) {
+            addCriterion("root_source_id <=", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLike(String value) {
+            addCriterion("root_source_id like", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotLike(String value) {
+            addCriterion("root_source_id not like", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdIn(List<String> values) {
+            addCriterion("root_source_id in", values, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotIn(List<String> values) {
+            addCriterion("root_source_id not in", values, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdBetween(String value1, String value2) {
+            addCriterion("root_source_id between", value1, value2, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotBetween(String value1, String value2) {
+            addCriterion("root_source_id not between", value1, value2, "rootSourceId");
+            return (Criteria) this;
+        }
+
         public Criteria andRootShareIdIsNull() {
             addCriterion("root_share_id is null");
             return (Criteria) this;

+ 1 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CardServiceImpl.java

@@ -103,6 +103,7 @@ public class CardServiceImpl implements CardService {
         publishMiniprogram.setVideoCover(videoDetail.getVideoCover());
         publishMiniprogram.setVideoPath(videoDetail.getVideoPath());
         publishMiniprogram.setProductionPath(jsonObject.getString("productionPath"));
+        publishMiniprogram.setRootSourceId(jsonObject.getString("rootSourceId"));
         publishMiniprogram.setRootShareId(jsonObject.getString("rootShareId"));
         publishMiniprogram.setIndex(index);
         publishMiniprogram.setTraceId(videoDetail.getTraceId());

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

@@ -1,10 +1,12 @@
 package com.tzld.piaoquan.longarticle.service.impl;
 
 import com.alibaba.fastjson.JSON;
+import com.google.common.collect.Lists;
 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
 import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.RootSourceMapper;
 import com.tzld.piaoquan.longarticle.model.dto.*;
 import com.tzld.piaoquan.longarticle.model.bo.*;
 import com.tzld.piaoquan.longarticle.model.po.*;
@@ -61,6 +63,9 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     private PublishContentMapper publishContentMapper;
 
+    @Autowired
+    private RootSourceMapper rootSourceMapper;
+
     @Override
     public void initPlanAccount() {
         List<LongArticleSystemPlan> allLongArticleSystemPlans = planService.getAllLongArticleSystemPlan();
@@ -204,12 +209,13 @@ public class CoreServiceImpl implements CoreService {
     }
 
     private boolean checkPlanAccount(PlanAccount planAccount) {
-
+        boolean flag = true;
         // 固定日期
         if (planAccount.getPublishRate() == 1) {
             List<Integer> weeks = JSON.parseArray(planAccount.getPublishDate(), Integer.class);
             if (!weeks.contains(TimeZoneUtil.getTodayDayOfWeek(TimeZoneUtil.Timezone.china))) {
-                //TODO 更新状态
+                planAccount.setStatus(2);
+                planAccountMapper.updateByPrimaryKeySelective(planAccount);
                 return false;
             }
         }
@@ -227,38 +233,39 @@ public class CoreServiceImpl implements CoreService {
                 && StringUtils.isNotEmpty(planAccount.getPublishWindowEnd())) {
             if (!effectiveTime(planAccount.getPublishWindowStart(), planAccount.getPublishWindowEnd(),
                     TimeZoneUtil.Timezone.china)) {
-                log.info("当前时间不在发布时间窗口内,不需要发布,planId:{}", planAccount.getPlanId());
                 return false;
             }
-            // TODO 找到该账号最近发布的内容,判断时间间隔
-//            Long lastPushContentTimestamp = getAccountLatestPushTimestamp(plan.getId(), publishAccount.getId());
-//            if (Objects.nonNull(lastPushContentTimestamp) && Objects.nonNull(planSetting.getPublishTimeInterval())
-//                    && (System.currentTimeMillis() - lastPushContentTimestamp) < planSetting.getPublishTimeInterval() * 60 * 1000L) {
-//                log.info("距离上次发布的时间过短,planId:{},accountId:{},lastPushContentTimestamp:{}", plan.getId(),
-//                        publishAccount.getId(), lastPushContentTimestamp);
-//                return;
-//            }
+            if (planAccount.getPublishTimeInterval() != null) {
+                // 找到该账号最近发布的内容,判断时间间隔
+                PublishContentExample example = new PublishContentExample();
+                example.createCriteria().andStatusIn(Arrays.asList(1, 2)).andCreateTimeGreaterThan(DateUtil.getThatDayDate());
+                example.setOrderByClause("create_time desc");
+                List<PublishContent> publishContents = publishContentMapper.selectByExample(example);
+                if (!CollectionUtils.isEmpty(publishContents)) {
+                    long time = System.currentTimeMillis() - publishContents.get(0).getCreateTime().getTime();
+                    if (time < planAccount.getPublishTimeInterval() * 60 * 1000L) {
+                        return false;
+                    }
+                }
+            }
         }
+        PublishContentExample example = new PublishContentExample();
+        example.createCriteria().andStatusIn(Arrays.asList(1, 2)).andCreateTimeGreaterThan(DateUtil.getThatDayDate());
+        long sendCount = publishContentMapper.countByExample(example);
         Integer publishNum = planAccount.getPublishNum();
         if (publishNum == null || publishNum == 0) {
             return false;
         }
-        Integer sendCount = planAccount.getSendCount();
-        if (sendCount == null) {
-            sendCount = 0;
-        }
-        int needSentCount = sendCount - publishNum;
-
-
-        if (needSentCount >= 0) {
-            //TODO 修改状态
+        if (sendCount >= publishNum) {
             return false;
         }
-        if (planAccount.getRetryCount() > 3) {
+        if (planAccount.getRetryCount() >= 3) {
+            planAccount.setStatus(3);
+            planAccountMapper.updateByPrimaryKeySelective(planAccount);
             return false;
         }
 
-        return true;
+        return flag;
     }
 
 
@@ -279,35 +286,43 @@ public class CoreServiceImpl implements CoreService {
             articleSortRequest.setStrategy("ArticleRankRandom");
             //articleSortRequest.setStrategy(planAccount.getSortStrategy());
             if (Objects.equals(planAccount.getPushType(), PublishGzhPushTypeEnum.manual_push.getVal())) {
-                if (planAccount.getPublishPreNum() >= (planAccount.getPublishNum() - planAccount.getSendCount())) {
+                PublishContentExample publishContentExample = new PublishContentExample();
+                publishContentExample.createCriteria().andStatusIn(Arrays.asList(1, 2)).andCreateTimeGreaterThan(DateUtil.getThatDayDate());
+                long sendCount = publishContentMapper.countByExample(publishContentExample);
+                if (planAccount.getPublishPreNum() <= (planAccount.getPublishNum() - sendCount)) {
                     articleSortRequest.setPublishNum(planAccount.getPublishPreNum());
                 } else {
-                    articleSortRequest.setPublishNum(planAccount.getPublishNum() - planAccount.getSendCount());
+                    articleSortRequest.setPublishNum((int) (planAccount.getPublishNum() - sendCount));
                 }
             }
-            articleSortRequest.setPublishNum(planAccount.getPublishNum());
+            if (Objects.equals(PublishGzhPushTypeEnum.auto_group_publish.getVal(), planAccount.getPushType())) {
+                articleSortRequest.setPublishNum(planAccount.getPublishNum());
+            }
             articleSortRequest.setPlanId(planAccount.getPlanId());
             articleSortRequest.setPushType(planAccount.getPushType());
 
             ArticleSortResponse articleSortResponse = sortService.publishArticleSort(articleSortRequest);
-            if (articleSortResponse == null
-                    || articleSortResponse.getData() == null
-                    || CollectionUtils.isEmpty(articleSortResponse.getData().getRank_list())) {
+            if (articleSortResponse == null || articleSortResponse.getData() == null) {
+                continue;
+            }
+            if (CollectionUtils.isEmpty(articleSortResponse.getData().getRank_list())) {
+                planAccount.setRetryCount(planAccount.getRetryCount() + 1);
+                planAccountMapper.updateByPrimaryKeySelective(planAccount);
                 continue;
             }
             ArticleSortResponseData data = articleSortResponse.getData();
-//            if (!CollectionUtils.isEmpty(data.getFilter_list())) {
-//                List<FilterSortContentParam> list = new ArrayList<>();
-//                for (PublishArticleData publishArticleData : data.getFilter_list()) {
-//                    FilterSortContentParam param = new FilterSortContentParam();
-//                    param.setFilterReason(publishArticleData.getFilterReason());
-//                    param.setPublishContentId(publishArticleData.getId());
-//                    list.add(param);
-//                }
-//                FilterSortParam param = new FilterSortParam();
-//                param.setFilterSortContentList(list);
-//                planService.filterSortContents(param);
-//            }
+            if (!CollectionUtils.isEmpty(data.getFilter_list())) {
+                List<FilterSortContentParam> list = new ArrayList<>();
+                for (PublishArticleData publishArticleData : data.getFilter_list()) {
+                    FilterSortContentParam param = new FilterSortContentParam();
+                    param.setFilterReason(publishArticleData.getFilterReason());
+                    param.setPublishContentId(publishArticleData.getId());
+                    list.add(param);
+                }
+                FilterSortParam param = new FilterSortParam();
+                param.setFilterSortContentList(list);
+                planService.filterSortContents(param);
+            }
             List<LongArticleSystemPushContentParam> pushContentList = new ArrayList<>();
             //排序结束
             List<PublishArticleData> rankList = data.getRank_list();
@@ -321,8 +336,8 @@ public class CoreServiceImpl implements CoreService {
                 publishContent.setSourceId(publishArticleData.getSourceId());
                 publishContent.setScore(publishArticleData.getScore());
                 publishContent.setContentPoolType(publishArticleData.getContentPoolType());
-                long contentId = publishContentMapper.insertSelective(publishContent);
-                sendIds.add(contentId);
+                publishContentMapper.insertSelective(publishContent);
+                sendIds.add(publishContent.getId());
                 //获取小程序
                 List<CrawlerVideo> contentVideos =
                         contentService.getContentVideo(publishArticleData.getSourceId(), publishArticleData.getContentPoolType(), planAccount.getGhId());
@@ -352,6 +367,12 @@ public class CoreServiceImpl implements CoreService {
                     statusParam.setPublishContentId(publishContentId);
                     statusParam.setErrorMsg("小程序视频数量不足");
                     planService.updateMatchMiniprogramStatus(statusParam);
+
+                    PublishContent update = new PublishContent();
+                    update.setId(publishContent.getId());
+                    update.setStatus(3);
+                    update.setReason("小程序数量不足");
+                    publishContentMapper.updateByPrimaryKeySelective(update);
                     continue;
                 }
                 String ghId = planAccount.getGhId();
@@ -392,14 +413,31 @@ public class CoreServiceImpl implements CoreService {
                     }
                     param.setTraceId(publishMiniprogram.getTraceId());
                     publishCardList.add(param);
-                    publishMiniprogram.setContentId(contentId);
+                    publishMiniprogram.setContentId(publishContent.getId());
+                    RootSource rootSource = new RootSource();
+                    rootSource.setAccountName(planAccount.getAccountName());
+                    rootSource.setRootSourceId(publishMiniprogram.getRootSourceId());
+                    rootSource.setGhId(planAccount.getGhId());
+                    rootSource.setRequestTime(Integer.valueOf(String.valueOf(System.currentTimeMillis() / 1000)));
+                    rootSource.setTraceId(publishMiniprogram.getTraceId());
+                    rootSource.setPushType(planAccount.getPushType());
+                    rootSource.setVideoId(publishMiniprogram.getVideoId());
+                    rootSource.setContentId(publishArticleData.getSourceId());
+                    rootSourceMapper.insertSelective(rootSource);
                     publishMiniprogramMapper.insertSelective(publishMiniprogram);
                 }
 
                 if (publishCardList.size() < 2) {
+                    MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
+                    statusParam.setStatus(3);
+                    statusParam.setPublishContentId(publishContentId);
+                    statusParam.setErrorMsg("小程序视频数量不足");
+                    planService.updateMatchMiniprogramStatus(statusParam);
+
                     PublishContent update = new PublishContent();
-                    update.setId(contentId);
+                    update.setId(publishContent.getId());
                     update.setStatus(3);
+                    update.setReason("小程序数量不足");
                     publishContentMapper.updateByPrimaryKeySelective(update);
                     continue;
                 }
@@ -419,19 +457,24 @@ public class CoreServiceImpl implements CoreService {
                 gzhPushParam.setPushScheduleTimestamp(System.currentTimeMillis());
             }
             gzhPushParam.setPushContentList(pushContentList);
-            if (pushContentList.size() < planAccount.getPublishPreMinNum()) {
+            if (Objects.equals(planAccount.getPushType(), PublishGzhPushTypeEnum.auto_group_publish.getVal())
+                    && pushContentList.size() < planAccount.getPublishPreMinNum()) {
                 continue;
             }
             String pushId = planService.createPushTask(gzhPushParam);
+            System.out.println(pushId);
             if (StringUtils.isNotEmpty(pushId)) {
-                //更新状态  发布完成
-                PublishContent update = new PublishContent();
-                //发布成功
-                update.setStatus(1);
-                update.setPushId(pushId);
-                PublishContentExample updateExample = new PublishContentExample();
-                updateExample.createCriteria().andStatusEqualTo(0).andIdIn(sendIds);
-                publishContentMapper.updateByExample(update, updateExample);
+                for (Long id : sendIds) {
+                    PublishContent publishContent = publishContentMapper.selectByPrimaryKey(id);
+                    if (publishContent == null || publishContent.getStatus() != 0) {
+                        continue;
+                    }
+                    PublishContent update = new PublishContent();
+                    update.setId(id);
+                    update.setPushId(pushId);
+                    update.setStatus(1);
+                    publishContentMapper.updateByPrimaryKeySelective(update);
+                }
             }
         }
     }
@@ -467,11 +510,30 @@ public class CoreServiceImpl implements CoreService {
             }
             //更新状态  2成功  3失败
             if (updateStatus != 0) {
-                PublishContentExample updateExample = new PublishContentExample();
-                updateExample.createCriteria().andPushIdEqualTo(pushId);
+                PublishContentExample publishContentExample = new PublishContentExample();
+                publishContentExample.createCriteria().andPushIdEqualTo(pushId);
                 PublishContent update = new PublishContent();
                 update.setStatus(updateStatus);
-                publishContentMapper.updateByExample(update, updateExample);
+                publishContentMapper.updateByExampleSelective(update, publishContentExample);
+
+                List<PublishContent> publishContentList = publishContentMapper.selectByExample(publishContentExample);
+                if (!CollectionUtils.isEmpty(publishContentList)) {
+                    Long planAccountId = publishContentList.get(0).getPlanAccountId();
+                    if (planAccountId == null) {
+                        continue;
+                    }
+                    PlanAccount planAccount = planAccountMapper.selectByPrimaryKey(planAccountId);
+                    if (Objects.equals(planAccount.getPushType(), PublishGzhPushTypeEnum.auto_group_publish.getVal())) {
+                        if (updateStatus == 2) {
+                            planAccount.setStatus(2);
+                            planAccountMapper.updateByPrimaryKeySelective(planAccount);
+                        }
+                        if (updateStatus == 3) {
+                            planAccount.setRetryCount(planAccount.getRetryCount() + 1);
+                            planAccountMapper.updateByPrimaryKeySelective(planAccount);
+                        }
+                    }
+                }
             }
         }
     }

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

@@ -87,7 +87,7 @@ public class PlanServiceImpl {
             JSONObject jsonObject = JSON.parseObject(res);
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
-                return jsonObject.getString("data");
+                return jsonObject.getJSONObject("data").getString("pushId");
             }
         } catch (Exception e) {
             log.error("listWaitingMatchMiniprogramContents error", e);

+ 0 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/SortServiceImpl.java

@@ -26,9 +26,7 @@ public class SortServiceImpl {
         while (retryTimes > 0) {
             try {
                 retryTimes--;
-                log.info("publishArticleSort,request:{}", JSON.toJSONString(request));
                 String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
-                log.info("publishArticleSort recommend Api返回数据:{}", res);
 
                 response = JSON.parseObject(res, ArticleSortResponse.class);
                 if (Objects.nonNull(response) && Objects.nonNull(response.getData())) {

+ 85 - 70
long-article-server/src/main/resources/mapper/PublishContentMapper.xml

@@ -10,6 +10,7 @@
     <result column="content_pool_type" jdbcType="VARCHAR" property="contentPoolType" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="push_id" jdbcType="VARCHAR" property="pushId" />
+    <result column="reason" jdbcType="VARCHAR" property="reason" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
   </resultMap>
@@ -73,7 +74,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, plan_account_id, publish_content_id, source_id, score, content_pool_type, `status`, 
-    push_id, create_time, update_time
+    push_id, reason, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.PublishContentExample" resultMap="BaseResultMap">
     select
@@ -111,79 +112,85 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.PublishContent">
     insert into long_articles_publish_content (id, plan_account_id, publish_content_id, 
       source_id, score, content_pool_type, 
-      `status`, push_id, create_time, 
-      update_time)
+      `status`, push_id, reason, 
+      create_time, update_time)
     values (#{id,jdbcType=BIGINT}, #{planAccountId,jdbcType=BIGINT}, #{publishContentId,jdbcType=VARCHAR}, 
       #{sourceId,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, #{contentPoolType,jdbcType=VARCHAR}, 
-      #{status,jdbcType=INTEGER}, #{pushId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{status,jdbcType=INTEGER}, #{pushId,jdbcType=VARCHAR}, #{reason,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.PublishContent" useGeneratedKeys="true" keyProperty="id">
-      insert into long_articles_publish_content
-      <trim prefix="(" suffix=")" suffixOverrides=",">
-          <if test="id != null">
-              id,
-          </if>
-          <if test="planAccountId != null">
-              plan_account_id,
-          </if>
-          <if test="publishContentId != null">
-              publish_content_id,
-          </if>
-          <if test="sourceId != null">
-              source_id,
-          </if>
-          <if test="score != null">
-              score,
-          </if>
-          <if test="contentPoolType != null">
-              content_pool_type,
-          </if>
-          <if test="status != null">
-              `status`,
-          </if>
-          <if test="pushId != null">
-              push_id,
-          </if>
-          <if test="createTime != null">
-              create_time,
-          </if>
-          <if test="updateTime != null">
-              update_time,
-          </if>
-      </trim>
-      <trim prefix="values (" suffix=")" suffixOverrides=",">
-          <if test="id != null">
-              #{id,jdbcType=BIGINT},
-          </if>
-          <if test="planAccountId != null">
-              #{planAccountId,jdbcType=BIGINT},
-          </if>
-          <if test="publishContentId != null">
-              #{publishContentId,jdbcType=VARCHAR},
-          </if>
-          <if test="sourceId != null">
-              #{sourceId,jdbcType=VARCHAR},
-          </if>
-          <if test="score != null">
-              #{score,jdbcType=DOUBLE},
-          </if>
-          <if test="contentPoolType != null">
-              #{contentPoolType,jdbcType=VARCHAR},
-          </if>
-          <if test="status != null">
-              #{status,jdbcType=INTEGER},
-          </if>
-          <if test="pushId != null">
-              #{pushId,jdbcType=VARCHAR},
-          </if>
-          <if test="createTime != null">
-              #{createTime,jdbcType=TIMESTAMP},
-          </if>
-          <if test="updateTime != null">
-              #{updateTime,jdbcType=TIMESTAMP},
-          </if>
-      </trim>
+    insert into long_articles_publish_content
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="planAccountId != null">
+        plan_account_id,
+      </if>
+      <if test="publishContentId != null">
+        publish_content_id,
+      </if>
+      <if test="sourceId != null">
+        source_id,
+      </if>
+      <if test="score != null">
+        score,
+      </if>
+      <if test="contentPoolType != null">
+        content_pool_type,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="pushId != null">
+        push_id,
+      </if>
+      <if test="reason != null">
+        reason,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="planAccountId != null">
+        #{planAccountId,jdbcType=BIGINT},
+      </if>
+      <if test="publishContentId != null">
+        #{publishContentId,jdbcType=VARCHAR},
+      </if>
+      <if test="sourceId != null">
+        #{sourceId,jdbcType=VARCHAR},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="contentPoolType != null">
+        #{contentPoolType,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="pushId != null">
+        #{pushId,jdbcType=VARCHAR},
+      </if>
+      <if test="reason != null">
+        #{reason,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
       <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
           select LAST_INSERT_ID()
       </selectKey>
@@ -221,6 +228,9 @@
       <if test="record.pushId != null">
         push_id = #{record.pushId,jdbcType=VARCHAR},
       </if>
+      <if test="record.reason != null">
+        reason = #{record.reason,jdbcType=VARCHAR},
+      </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
@@ -242,6 +252,7 @@
       content_pool_type = #{record.contentPoolType,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       push_id = #{record.pushId,jdbcType=VARCHAR},
+      reason = #{record.reason,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
@@ -272,6 +283,9 @@
       <if test="pushId != null">
         push_id = #{pushId,jdbcType=VARCHAR},
       </if>
+      <if test="reason != null">
+        reason = #{reason,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -290,6 +304,7 @@
       content_pool_type = #{contentPoolType,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       push_id = #{pushId,jdbcType=VARCHAR},
+      reason = #{reason,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}

+ 22 - 7
long-article-server/src/main/resources/mapper/PublishMiniprogramMapper.xml

@@ -17,6 +17,7 @@
     <result column="video_cover" jdbcType="VARCHAR" property="videoCover" />
     <result column="video_path" jdbcType="VARCHAR" property="videoPath" />
     <result column="production_path" jdbcType="VARCHAR" property="productionPath" />
+    <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
     <result column="root_share_id" jdbcType="VARCHAR" property="rootShareId" />
     <result column="index" jdbcType="INTEGER" property="index" />
     <result column="trace_id" jdbcType="VARCHAR" property="traceId" />
@@ -85,7 +86,7 @@
   <sql id="Base_Column_List">
     id, content_id, plan_account_id, publish_content_id, app_id, app_name, avatar, mini_id, 
     mini_program_type, video_id, `source`, video_title, video_cover, video_path, production_path, 
-    root_share_id, `index`, trace_id, is_delete, create_time, update_time
+    root_source_id, root_share_id, `index`, trace_id, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.PublishMiniprogramExample" resultMap="BaseResultMap">
     select
@@ -126,17 +127,17 @@
       avatar, mini_id, mini_program_type, 
       video_id, `source`, video_title, 
       video_cover, video_path, production_path, 
-      root_share_id, `index`, trace_id, 
-      is_delete, create_time, update_time
-      )
+      root_source_id, root_share_id, `index`, 
+      trace_id, is_delete, create_time, 
+      update_time)
     values (#{id,jdbcType=BIGINT}, #{contentId,jdbcType=BIGINT}, #{planAccountId,jdbcType=BIGINT}, 
       #{publishContentId,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, 
       #{avatar,jdbcType=VARCHAR}, #{miniId,jdbcType=INTEGER}, #{miniProgramType,jdbcType=INTEGER}, 
       #{videoId,jdbcType=BIGINT}, #{source,jdbcType=VARCHAR}, #{videoTitle,jdbcType=VARCHAR}, 
       #{videoCover,jdbcType=VARCHAR}, #{videoPath,jdbcType=VARCHAR}, #{productionPath,jdbcType=VARCHAR}, 
-      #{rootShareId,jdbcType=VARCHAR}, #{index,jdbcType=INTEGER}, #{traceId,jdbcType=VARCHAR}, 
-      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
-      )
+      #{rootSourceId,jdbcType=VARCHAR}, #{rootShareId,jdbcType=VARCHAR}, #{index,jdbcType=INTEGER}, 
+      #{traceId,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.PublishMiniprogram">
     insert into long_articles_publish_miniprogram
@@ -186,6 +187,9 @@
       <if test="productionPath != null">
         production_path,
       </if>
+      <if test="rootSourceId != null">
+        root_source_id,
+      </if>
       <if test="rootShareId != null">
         root_share_id,
       </if>
@@ -251,6 +255,9 @@
       <if test="productionPath != null">
         #{productionPath,jdbcType=VARCHAR},
       </if>
+      <if test="rootSourceId != null">
+        #{rootSourceId,jdbcType=VARCHAR},
+      </if>
       <if test="rootShareId != null">
         #{rootShareId,jdbcType=VARCHAR},
       </if>
@@ -325,6 +332,9 @@
       <if test="record.productionPath != null">
         production_path = #{record.productionPath,jdbcType=VARCHAR},
       </if>
+      <if test="record.rootSourceId != null">
+        root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
+      </if>
       <if test="record.rootShareId != null">
         root_share_id = #{record.rootShareId,jdbcType=VARCHAR},
       </if>
@@ -365,6 +375,7 @@
       video_cover = #{record.videoCover,jdbcType=VARCHAR},
       video_path = #{record.videoPath,jdbcType=VARCHAR},
       production_path = #{record.productionPath,jdbcType=VARCHAR},
+      root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
       root_share_id = #{record.rootShareId,jdbcType=VARCHAR},
       `index` = #{record.index,jdbcType=INTEGER},
       trace_id = #{record.traceId,jdbcType=VARCHAR},
@@ -420,6 +431,9 @@
       <if test="productionPath != null">
         production_path = #{productionPath,jdbcType=VARCHAR},
       </if>
+      <if test="rootSourceId != null">
+        root_source_id = #{rootSourceId,jdbcType=VARCHAR},
+      </if>
       <if test="rootShareId != null">
         root_share_id = #{rootShareId,jdbcType=VARCHAR},
       </if>
@@ -457,6 +471,7 @@
       video_cover = #{videoCover,jdbcType=VARCHAR},
       video_path = #{videoPath,jdbcType=VARCHAR},
       production_path = #{productionPath,jdbcType=VARCHAR},
+      root_source_id = #{rootSourceId,jdbcType=VARCHAR},
       root_share_id = #{rootShareId,jdbcType=VARCHAR},
       `index` = #{index,jdbcType=INTEGER},
       trace_id = #{traceId,jdbcType=VARCHAR},

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

@@ -60,10 +60,10 @@
 <!--            <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_plan_account" domainObjectName="PlanAccount" alias=""/>
+<!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
 
 <!--                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
-<!--                <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>-->
+                <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>
 
     </context>