wangyunpeng 1 неделя назад
Родитель
Сommit
f5cfea904a

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformIllegalVideoJob.java

@@ -130,6 +130,13 @@ public class ContentPlatformIllegalVideoJob {
         illegalMsg.setVideoId(videoId);
         illegalMsg.setTitle(planList.get(0).getTitle());
         illegalMsg.setBusinessType(businessType);
+        String videoTitle = illegalMsg.getTitle();
+        if (videoTitle.length() >= 20) {
+            videoTitle = videoTitle.substring(0, 19) + "...";
+        }
+        illegalMsg.setIllegalTitle("视频“" + videoTitle + "”被封禁,请及时替换");
+        illegalMsg.setIllegalContent("您在" + illegalMsg.getBusinessType() + "栏目中使用的视频“" +
+                videoTitle + "”(视频ID:" + illegalMsg.getVideoId() + ")被微信封禁,请及时替换为其他视频。");
         illegalMsg.setStatus(0);
         illegalMsg.setCreateTimestamp(now);
         illegalMsg.setUpdateTimestamp(now);

+ 22 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsg.java

@@ -11,6 +11,10 @@ public class ContentPlatformIllegalMsg {
 
     private String businessType;
 
+    private String illegalTitle;
+
+    private String illegalContent;
+
     private Integer status;
 
     private Long createTimestamp;
@@ -57,6 +61,22 @@ public class ContentPlatformIllegalMsg {
         this.businessType = businessType;
     }
 
+    public String getIllegalTitle() {
+        return illegalTitle;
+    }
+
+    public void setIllegalTitle(String illegalTitle) {
+        this.illegalTitle = illegalTitle;
+    }
+
+    public String getIllegalContent() {
+        return illegalContent;
+    }
+
+    public void setIllegalContent(String illegalContent) {
+        this.illegalContent = illegalContent;
+    }
+
     public Integer getStatus() {
         return status;
     }
@@ -92,6 +112,8 @@ public class ContentPlatformIllegalMsg {
         sb.append(", videoId=").append(videoId);
         sb.append(", title=").append(title);
         sb.append(", businessType=").append(businessType);
+        sb.append(", illegalTitle=").append(illegalTitle);
+        sb.append(", illegalContent=").append(illegalContent);
         sb.append(", status=").append(status);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append(", updateTimestamp=").append(updateTimestamp);

+ 140 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformIllegalMsgExample.java

@@ -435,6 +435,146 @@ public class ContentPlatformIllegalMsgExample {
             return (Criteria) this;
         }
 
+        public Criteria andIllegalTitleIsNull() {
+            addCriterion("illegal_title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleIsNotNull() {
+            addCriterion("illegal_title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleEqualTo(String value) {
+            addCriterion("illegal_title =", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleNotEqualTo(String value) {
+            addCriterion("illegal_title <>", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleGreaterThan(String value) {
+            addCriterion("illegal_title >", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("illegal_title >=", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleLessThan(String value) {
+            addCriterion("illegal_title <", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleLessThanOrEqualTo(String value) {
+            addCriterion("illegal_title <=", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleLike(String value) {
+            addCriterion("illegal_title like", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleNotLike(String value) {
+            addCriterion("illegal_title not like", value, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleIn(List<String> values) {
+            addCriterion("illegal_title in", values, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleNotIn(List<String> values) {
+            addCriterion("illegal_title not in", values, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleBetween(String value1, String value2) {
+            addCriterion("illegal_title between", value1, value2, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalTitleNotBetween(String value1, String value2) {
+            addCriterion("illegal_title not between", value1, value2, "illegalTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentIsNull() {
+            addCriterion("illegal_content is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentIsNotNull() {
+            addCriterion("illegal_content is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentEqualTo(String value) {
+            addCriterion("illegal_content =", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentNotEqualTo(String value) {
+            addCriterion("illegal_content <>", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentGreaterThan(String value) {
+            addCriterion("illegal_content >", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentGreaterThanOrEqualTo(String value) {
+            addCriterion("illegal_content >=", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentLessThan(String value) {
+            addCriterion("illegal_content <", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentLessThanOrEqualTo(String value) {
+            addCriterion("illegal_content <=", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentLike(String value) {
+            addCriterion("illegal_content like", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentNotLike(String value) {
+            addCriterion("illegal_content not like", value, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentIn(List<String> values) {
+            addCriterion("illegal_content in", values, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentNotIn(List<String> values) {
+            addCriterion("illegal_content not in", values, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentBetween(String value1, String value2) {
+            addCriterion("illegal_content between", value1, value2, "illegalContent");
+            return (Criteria) this;
+        }
+
+        public Criteria andIllegalContentNotBetween(String value1, String value2) {
+            addCriterion("illegal_content not between", value1, value2, "illegalContent");
+            return (Criteria) this;
+        }
+
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             return (Criteria) this;

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -142,7 +142,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         List<CgiReplyBucketData> bucketDataList = cgiReplyService.getCgiReplyBucketDataListByGhIds(ghIds, "manual");
         Map<String, Map<Long, CgiReplyBucketData>> bucketDataMap = bucketDataList.stream()
                 .collect(Collectors.groupingBy(CgiReplyBucketData::getGhId,
-                        Collectors.toMap(CgiReplyBucketData::getMiniVideoId, Function.identity())));
+                        Collectors.toMap(CgiReplyBucketData::getMiniVideoId, Function.identity(), (a, b) -> b)));
         List<GzhPlanItemVO> result = new ArrayList<>();
         for (ContentPlatformGzhPlan gzhPlan : planList) {
             GzhPlanItemVO planItemVO = new GzhPlanItemVO();

+ 2 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/BuckStrategyV1.java

@@ -259,16 +259,13 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                 log.error("insertSmallData 算法排序数据异常,data:" + JSON.toJSONString(smallDataCgiReplyList));
                 continue;
             }
-            // 清上个版本的策略数据
             CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
             cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andMsgTypeEqualTo(1).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
             List<CgiReplyBucketData> cgiReplyBucketData1 = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
             Map<Long, CgiReplyBucketData> cgiReplyBucketDataMap = cgiReplyBucketData1.stream()
                     .collect(Collectors.toMap(CgiReplyBucketData::getMiniVideoId, x -> x, (a, b) -> b));
-            for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketData1) {
-                cgiReplyBucketData.setIsDelete(1);
-                cgiReplyBucketDataMapper.updateByPrimaryKeySelective(cgiReplyBucketData);
-            }
+            // 清上个版本的策略数据
+            cgiReplyBucketDataMapperExt.updateDeleteStatus(bucketDataParam.getGhId(), key, 1, 1);
             List<GhDetailExt> ghDetailExtList = ghDetailService.getGhDetailExtList(bucketDataParam.getGhId(), GhTypeEnum.GH.type);
             Map<Long, GhDetailExt> ghDetailExtMap = ghDetailExtList.stream()
                     .collect(Collectors.toMap(GhDetailExt::getVideoId, Function.identity(), (a, b) -> b));

+ 2 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java

@@ -165,16 +165,13 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
                         ",data:" + JSON.toJSONString(smallDataCgiReplyList) + ",ghId:" + bucketDataParam.getGhId());
                 continue;
             }
-            // 清上个版本的策略数据
             CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
             cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andMsgTypeEqualTo(1).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
             List<CgiReplyBucketData> cgiReplyBucketData1 = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
             Map<Long, CgiReplyBucketData> cgiReplyBucketDataMap = cgiReplyBucketData1.stream()
                     .collect(Collectors.toMap(CgiReplyBucketData::getMiniVideoId, x -> x, (a, b) -> b));
-            for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketData1) {
-                cgiReplyBucketData.setIsDelete(1);
-                cgiReplyBucketDataMapper.updateByPrimaryKeySelective(cgiReplyBucketData);
-            }
+            // 清上个版本的策略数据
+            cgiReplyBucketDataMapperExt.updateDeleteStatus(bucketDataParam.getGhId(), key, 1, 1);
             List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = contentPlatformPlanService.getGzhPlanVideoListByCooperateAccountId(bucketDataParam.getGhId());
             Map<Long, ContentPlatformGzhPlanVideo> gzhPlanVideoMap = gzhPlanVideoList.stream()
                     .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, x -> x, (a, b) -> b));

+ 2 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java

@@ -155,16 +155,13 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
                 log.error("ThirdPartyPushMessageStrategyV1 insertSmallData 算法排序数据异常,data:" + JSON.toJSONString(smallDataCgiReplyList));
                 continue;
             }
-            // 清上个版本的策略数据
             CgiReplyBucketDataExample cgiReplyBucketDataExample = new CgiReplyBucketDataExample();
             cgiReplyBucketDataExample.createCriteria().andIsDeleteEqualTo(0).andMsgTypeEqualTo(1).andStrategyEqualTo(key).andGhIdEqualTo(bucketDataParam.getGhId());
             List<CgiReplyBucketData> cgiReplyBucketData1 = cgiReplyBucketDataMapper.selectByExample(cgiReplyBucketDataExample);
             Map<Long, CgiReplyBucketData> cgiReplyBucketDataMap = cgiReplyBucketData1.stream()
                     .collect(Collectors.toMap(CgiReplyBucketData::getMiniVideoId, x -> x, (a, b) -> b));
-            for (CgiReplyBucketData cgiReplyBucketData : cgiReplyBucketData1) {
-                cgiReplyBucketData.setIsDelete(1);
-                cgiReplyBucketDataMapper.updateByPrimaryKeySelective(cgiReplyBucketData);
-            }
+            // 清上个版本的策略数据
+            cgiReplyBucketDataMapperExt.updateDeleteStatus(bucketDataParam.getGhId(), key, 1, 1);
             // 入库
             for (CgiReplyBucketData cgiReplyBucketData : collect) {
                 CgiReplyBucketData oldData = cgiReplyBucketDataMap.get(cgiReplyBucketData.getMiniVideoId());

+ 38 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformIllegalMsgMapper.xml

@@ -7,6 +7,8 @@
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="business_type" jdbcType="VARCHAR" property="businessType" />
+    <result column="illegal_title" jdbcType="VARCHAR" property="illegalTitle" />
+    <result column="illegal_content" jdbcType="VARCHAR" property="illegalContent" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
     <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
@@ -70,7 +72,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, account_id, video_id, title, business_type, `status`, create_timestamp, update_timestamp
+    id, account_id, video_id, title, business_type, illegal_title, illegal_content, `status`, 
+    create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsgExample" resultMap="BaseResultMap">
     select
@@ -107,11 +110,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
     insert into content_platform_illegal_msg (id, account_id, video_id, 
-      title, business_type, `status`, 
-      create_timestamp, update_timestamp)
+      title, business_type, illegal_title, 
+      illegal_content, `status`, create_timestamp, 
+      update_timestamp)
     values (#{id,jdbcType=BIGINT}, #{accountId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
-      #{title,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
+      #{title,jdbcType=VARCHAR}, #{businessType,jdbcType=VARCHAR}, #{illegalTitle,jdbcType=VARCHAR}, 
+      #{illegalContent,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}, 
+      #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformIllegalMsg">
     insert into content_platform_illegal_msg
@@ -131,6 +136,12 @@
       <if test="businessType != null">
         business_type,
       </if>
+      <if test="illegalTitle != null">
+        illegal_title,
+      </if>
+      <if test="illegalContent != null">
+        illegal_content,
+      </if>
       <if test="status != null">
         `status`,
       </if>
@@ -157,6 +168,12 @@
       <if test="businessType != null">
         #{businessType,jdbcType=VARCHAR},
       </if>
+      <if test="illegalTitle != null">
+        #{illegalTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="illegalContent != null">
+        #{illegalContent,jdbcType=VARCHAR},
+      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
@@ -192,6 +209,12 @@
       <if test="record.businessType != null">
         business_type = #{record.businessType,jdbcType=VARCHAR},
       </if>
+      <if test="record.illegalTitle != null">
+        illegal_title = #{record.illegalTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="record.illegalContent != null">
+        illegal_content = #{record.illegalContent,jdbcType=VARCHAR},
+      </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
@@ -213,6 +236,8 @@
       video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
       business_type = #{record.businessType,jdbcType=VARCHAR},
+      illegal_title = #{record.illegalTitle,jdbcType=VARCHAR},
+      illegal_content = #{record.illegalContent,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
@@ -235,6 +260,12 @@
       <if test="businessType != null">
         business_type = #{businessType,jdbcType=VARCHAR},
       </if>
+      <if test="illegalTitle != null">
+        illegal_title = #{illegalTitle,jdbcType=VARCHAR},
+      </if>
+      <if test="illegalContent != null">
+        illegal_content = #{illegalContent,jdbcType=VARCHAR},
+      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
@@ -253,6 +284,8 @@
       video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
       business_type = #{businessType,jdbcType=VARCHAR},
+      illegal_title = #{illegalTitle,jdbcType=VARCHAR},
+      illegal_content = #{illegalContent,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{updateTimestamp,jdbcType=BIGINT}

+ 5 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/ext/CgiReplyBucketDataMapperExt.java

@@ -15,4 +15,9 @@ public interface CgiReplyBucketDataMapperExt {
     void deleteBucketDataByGhId(@Param("ghId") String ghId);
 
     CgiReplyBucketData getOldCgiReplyData(@Param("videoId") Long miniVideoId);
+
+    void updateDeleteStatus(@Param("ghId") String ghId,
+                            @Param("strategy") String strategy,
+                            @Param("msgType") int msgType,
+                            @Param("isDelete") int isDelete);
 }

+ 8 - 0
common-module/src/main/resources/mapper/ext/CgiReplyBucketDataMapperExt.xml

@@ -25,4 +25,12 @@
         order by id desc limit 1
     </select>
 
+    <update id="updateDeleteStatus">
+        update cgi_reply_bucket_data
+        set is_delete = #{isDelete}
+        where gh_id = #{ghId}
+        and strategy = #{strategy}
+        and msg_type = #{msgType}
+    </update>
+
 </mapper>