Browse Source

Merge branch 'cooperation_video_candidate_pool_improved_lld_0509' into test

刘立冬 1 day ago
parent
commit
a7b6ae627b

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -292,7 +292,7 @@ public class ContentPlatformVideoJob {
         List<ContentPlatformVideoDataStatAgg> saveAggList = buildVideoDataStatAggList(aggDt, dtList);
         if (CollectionUtils.isNotEmpty(saveAggList)) {
             planMapperExt.deleteContentPlatformVideoDatastatAgg(aggDt, null);
-            String delDt = DateUtil.getBeforeDayDateString(31, "yyyyMMdd");
+            String delDt = DateUtil.getBeforeDayDateString(15, "yyyyMMdd");
             planMapperExt.deleteContentPlatformVideoDatastatAgg(delDt, null);
             planMapperExt.batchInsertContentPlatformVideoDatastatAgg(saveAggList);
         }

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/XcxPlanSaveVideoParam.java

@@ -21,4 +21,7 @@ public class XcxPlanSaveVideoParam {
     @ApiModelProperty(value = "匹配实验id")
     private String experimentId;
 
+    @ApiModelProperty(value = "该 video 生成份数 1-200,空/null/<=0 视为 1")
+    private Integer count;
+
 }

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

@@ -2260,26 +2260,33 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         Long now = System.currentTimeMillis();
         List<ContentPlatformXcxPlan> list = new ArrayList<>();
         for (XcxPlanSaveVideoParam videoParam : param.getVideoList()) {
-            ContentPlatformXcxPlan xcxPlan = new ContentPlatformXcxPlan();
-            xcxPlan.setAudiencePackage(param.getAudiencePackage());
-            xcxPlan.setRemark(param.getRemark());
-
-            Staff staff = new Staff();
-            staff.setCarrierId("wxf7261ed54f2e450e");
-            staff.setRemark(param.getRemark());
-            String pageUrl = messageAttachmentService.getPageNoCache("pages/category", "touliu", "tencent", staff,
-                    videoParam.getVideoId(), "小程序", null, null, videoParam.getExperimentId());
-            String rootSourceId = MessageUtil.getRootSourceId(pageUrl);
-            xcxPlan.setPageUrl(pageUrl);
-            xcxPlan.setRootSourceId(rootSourceId);
-            xcxPlan.setStatus(PlanStatusEnum.NORMAL.getVal());
-            xcxPlan.setCreateAccountId(loginUser.getId());
-            xcxPlan.setCreateTimestamp(now);
-            xcxPlan.setUpdateTimestamp(now);
-            planMapperExt.insertXcxPlanReturnId(xcxPlan);
-            list.add(xcxPlan);
-            // 保存视频内容
-            saveXcxPlanVideo(videoParam, xcxPlan.getId(), loginUser.getId());
+            int count = (videoParam.getCount() == null || videoParam.getCount() <= 0)
+                    ? 1 : videoParam.getCount();
+            if (count > 200) {
+                throw new CommonException(ExceptionEnum.PARAM_ERROR);
+            }
+            for (int i = 0; i < count; i++) {
+                ContentPlatformXcxPlan xcxPlan = new ContentPlatformXcxPlan();
+                xcxPlan.setAudiencePackage(param.getAudiencePackage());
+                xcxPlan.setRemark(param.getRemark());
+
+                Staff staff = new Staff();
+                staff.setCarrierId("wxf7261ed54f2e450e");
+                staff.setRemark(param.getRemark());
+                String pageUrl = messageAttachmentService.getPageNoCache("pages/category", "touliu", "tencent", staff,
+                        videoParam.getVideoId(), "小程序", null, null, videoParam.getExperimentId());
+                String rootSourceId = MessageUtil.getRootSourceId(pageUrl);
+                xcxPlan.setPageUrl(pageUrl);
+                xcxPlan.setRootSourceId(rootSourceId);
+                xcxPlan.setStatus(PlanStatusEnum.NORMAL.getVal());
+                xcxPlan.setCreateAccountId(loginUser.getId());
+                xcxPlan.setCreateTimestamp(now);
+                xcxPlan.setUpdateTimestamp(now);
+                planMapperExt.insertXcxPlanReturnId(xcxPlan);
+                list.add(xcxPlan);
+                // 保存视频内容
+                saveXcxPlanVideo(videoParam, xcxPlan.getId(), loginUser.getId());
+            }
         }
         return buildXcxPlanItemVOList(list);
     }