|
@@ -2257,29 +2257,38 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
&& !Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.AGENT.getVal())) {
|
|
&& !Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.AGENT.getVal())) {
|
|
|
throw new CommonException(ExceptionEnum.XCX_PLAN_INTERNAL_ONLY);
|
|
throw new CommonException(ExceptionEnum.XCX_PLAN_INTERNAL_ONLY);
|
|
|
}
|
|
}
|
|
|
- Long now = System.currentTimeMillis();
|
|
|
|
|
|
|
+ long baseNow = System.currentTimeMillis();
|
|
|
|
|
+ long offset = 0L;
|
|
|
List<ContentPlatformXcxPlan> list = new ArrayList<>();
|
|
List<ContentPlatformXcxPlan> list = new ArrayList<>();
|
|
|
for (XcxPlanSaveVideoParam videoParam : param.getVideoList()) {
|
|
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++) {
|
|
|
|
|
+ long ts = baseNow + offset++;
|
|
|
|
|
+ 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(ts);
|
|
|
|
|
+ xcxPlan.setUpdateTimestamp(ts);
|
|
|
|
|
+ planMapperExt.insertXcxPlanReturnId(xcxPlan);
|
|
|
|
|
+ list.add(xcxPlan);
|
|
|
|
|
+ // 保存视频内容
|
|
|
|
|
+ saveXcxPlanVideo(videoParam, xcxPlan.getId(), loginUser.getId());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return buildXcxPlanItemVOList(list);
|
|
return buildXcxPlanItemVOList(list);
|
|
|
}
|
|
}
|
|
@@ -2324,10 +2333,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
}
|
|
}
|
|
|
ContentPlatformXcxPlanVideo srcVideo = srcVideoList.get(0);
|
|
ContentPlatformXcxPlanVideo srcVideo = srcVideoList.get(0);
|
|
|
|
|
|
|
|
- Long now = System.currentTimeMillis();
|
|
|
|
|
|
|
+ long baseNow = System.currentTimeMillis();
|
|
|
List<ContentPlatformXcxPlan> created = new ArrayList<>();
|
|
List<ContentPlatformXcxPlan> created = new ArrayList<>();
|
|
|
try {
|
|
try {
|
|
|
for (int i = 0; i < param.getCount(); i++) {
|
|
for (int i = 0; i < param.getCount(); i++) {
|
|
|
|
|
+ long ts = baseNow + i;
|
|
|
ContentPlatformXcxPlan xcxPlan = new ContentPlatformXcxPlan();
|
|
ContentPlatformXcxPlan xcxPlan = new ContentPlatformXcxPlan();
|
|
|
xcxPlan.setAudiencePackage(src.getAudiencePackage());
|
|
xcxPlan.setAudiencePackage(src.getAudiencePackage());
|
|
|
xcxPlan.setRemark(src.getRemark());
|
|
xcxPlan.setRemark(src.getRemark());
|
|
@@ -2341,8 +2351,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
|
|
|
xcxPlan.setRootSourceId(rootSourceId);
|
|
xcxPlan.setRootSourceId(rootSourceId);
|
|
|
xcxPlan.setStatus(PlanStatusEnum.NORMAL.getVal());
|
|
xcxPlan.setStatus(PlanStatusEnum.NORMAL.getVal());
|
|
|
xcxPlan.setCreateAccountId(loginUser.getId());
|
|
xcxPlan.setCreateAccountId(loginUser.getId());
|
|
|
- xcxPlan.setCreateTimestamp(now);
|
|
|
|
|
- xcxPlan.setUpdateTimestamp(now);
|
|
|
|
|
|
|
+ xcxPlan.setCreateTimestamp(ts);
|
|
|
|
|
+ xcxPlan.setUpdateTimestamp(ts);
|
|
|
planMapperExt.insertXcxPlanReturnId(xcxPlan);
|
|
planMapperExt.insertXcxPlanReturnId(xcxPlan);
|
|
|
created.add(xcxPlan);
|
|
created.add(xcxPlan);
|
|
|
|
|
|