Просмотр исходного кода

Merge branch 'cooperation_video_candidate_pool_improved_lld_0509' of https://git.yishihui.com/Server/growth-manager into cooperation_video_candidate_pool_improved_lld_0509

刘立冬 14 часов назад
Родитель
Сommit
6c02c4c1db

+ 29 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/ContentPlatformAccountTypeEnum.java

@@ -0,0 +1,29 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum ContentPlatformAccountTypeEnum {
+    PARTNER(1, "合作方"),
+    INTERNAL(2, "内部账号"),
+    AGENT(3, "代理商"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    ContentPlatformAccountTypeEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static ContentPlatformAccountTypeEnum from(int val) {
+        for (ContentPlatformAccountTypeEnum typeEnum : ContentPlatformAccountTypeEnum.values()) {
+            if (typeEnum.getVal() == val) {
+                return typeEnum;
+            }
+        }
+        return other;
+    }
+}

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComSendMsgJob.java

@@ -305,7 +305,7 @@ public class WeComSendMsgJob {
         staff.setRemark(thirdPartWeComStaff.getName());
         String putScene = StringUtils.isNotBlank(roomConfig.getPutScene()) ? roomConfig.getPutScene() : "touliu";
         String pageChannel = StringUtils.isNotBlank(roomConfig.getChannel()) ? roomConfig.getChannel() : "tencentqw";
-        String page = messageAttachmentService.getPageNoCache(putScene, pageChannel, staff, video.getVideoId(), "企微", "社群", "位置X", null);
+        String page = messageAttachmentService.getPageNoCache("pages/category.html", putScene, pageChannel, staff, video.getVideoId(), "企微", "社群", "位置X", null);
         page = videoMultiService.setVideoMultiTitleCoverPagePath(video.getVideoId(), page, video.getTitle(), video.getCover());
 
         CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();

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

@@ -577,8 +577,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private void updateGhDetail(ContentPlatformGzhAccount account, Integer selectVideoType, List<Long> videoIds,
                                 Map<Long, String> videoIdTestIdMap) {
         ContentPlatformAccount loginUser = LoginUserContext.getUser();
-        // 根据 content_platform_account 的 type 判断公众号类型:type=2 内部账号 -> 内部公众号,否则 -> 外部公众号
-        Integer ghType = Objects.equals(loginUser.getType(), 2) ? GhTypeEnum.GH.type : GhTypeEnum.THIRD_PARTY_GH.type;
+        // 根据 content_platform_account 的 type 判断公众号类型:内部账号 -> 内部公众号,否则 -> 外部公众号
+        Integer ghType = Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.INTERNAL.getVal()) ? GhTypeEnum.GH.type : GhTypeEnum.THIRD_PARTY_GH.type;
         GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), ghType);
         GhDetailVo detailVo = new GhDetailVo();
         Integer strategyStatus = selectVideoType == 0 ? StrategyStatusEnum.DEFAULT.status : StrategyStatusEnum.STRATEGY.status;
@@ -2119,7 +2119,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<XcxPlanItemVO> xcxPlanSave(XcxPlanSaveParam param) {
         ContentPlatformAccount loginUser = LoginUserContext.getUser();
-        if (!Objects.equals(loginUser.getType(), 2) && !Objects.equals(loginUser.getType(), 3)) {
+        if (!Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.INTERNAL.getVal())
+                && !Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.AGENT.getVal())) {
             throw new CommonException(ExceptionEnum.XCX_PLAN_INTERNAL_ONLY);
         }
         Long now = System.currentTimeMillis();
@@ -2132,7 +2133,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             Staff staff = new Staff();
             staff.setCarrierId("wxf7261ed54f2e450e");
             staff.setRemark(param.getRemark());
-            String pageUrl = messageAttachmentService.getPageNoCache("touliu", "tencent", staff,
+            String pageUrl = messageAttachmentService.getPageNoCache("pages/category", "touliu", "tencent", staff,
                     videoParam.getVideoId(), "小程序", null, null, videoParam.getExperimentId());
             String rootSourceId = MessageUtil.getRootSourceId(pageUrl);
             xcxPlan.setPageUrl(pageUrl);
@@ -2152,7 +2153,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public void xcxPlanDelete(Long id) {
         ContentPlatformAccount loginUser = LoginUserContext.getUser();
-        if (!Objects.equals(loginUser.getType(), 2) && !Objects.equals(loginUser.getType(), 3)) {
+        if (!Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.INTERNAL.getVal())
+                && !Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.AGENT.getVal())) {
             throw new CommonException(ExceptionEnum.XCX_PLAN_INTERNAL_ONLY);
         }
         ContentPlatformXcxPlan plan = xcxPlanMapper.selectByPrimaryKey(id);
@@ -2167,7 +2169,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<XcxPlanItemVO> xcxPlanMultiLink(XcxPlanMultiLinkParam param) {
         ContentPlatformAccount loginUser = LoginUserContext.getUser();
-        if (!Objects.equals(loginUser.getType(), 2) && !Objects.equals(loginUser.getType(), 3)) {
+        if (!Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.INTERNAL.getVal())
+                && !Objects.equals(loginUser.getType(), ContentPlatformAccountTypeEnum.AGENT.getVal())) {
             throw new CommonException(ExceptionEnum.XCX_PLAN_INTERNAL_ONLY);
         }
         if (Objects.isNull(param.getPlanId()) || Objects.isNull(param.getCount())
@@ -2197,7 +2200,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 Staff staff = new Staff();
                 staff.setCarrierId("wxf7261ed54f2e450e");
                 staff.setRemark(src.getRemark());
-                String pageUrl = messageAttachmentService.getPageNoCache("touliu", "tencent", staff,
+                String pageUrl = messageAttachmentService.getPageNoCache("pages/category", "touliu", "tencent", staff,
                         srcVideo.getVideoId(), "小程序", null, null, srcVideo.getExperimentId());
                 String rootSourceId = MessageUtil.getRootSourceId(pageUrl);
                 xcxPlan.setPageUrl(pageUrl);

+ 5 - 5
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java

@@ -400,7 +400,7 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
             if (StringUtils.isNotEmpty(page)) {
                 return page;
             }
-            return insertPage(putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo, typeThree, experimentId);
+            return insertPage("pages/category.html", putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo, typeThree, experimentId);
         } catch (IOException e) {
             log.error("MessageAttachmentService getPage error", e);
         }
@@ -408,24 +408,24 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
     }
 
     @Override
-    public String getPageNoCache(String putScene, String channel, Staff staff, Long videoId,
+    public String getPageNoCache(String path, String putScene, String channel, Staff staff, Long videoId,
                                  String typeOne, String typeTwo, String typeThree, String experimentId) {
         try {
             if (staff == null || staff.getCarrierId() == null) {
                 return "";
             }
-            return insertPage(putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo, typeThree, experimentId);
+            return insertPage(path, putScene, channel, staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo, typeThree, experimentId);
         } catch (IOException e) {
             log.error("MessageAttachmentService getPageNoCache error", e);
         }
         return null;
     }
 
-    private String insertPage(String putScene, String channel, String carrierId, Long videoId, String remark,
+    private String insertPage(String path, String putScene, String channel, String carrierId, Long videoId, String remark,
                               String typeOne, String typeTwo, String typeThree, String experimentId) throws IOException {
         AdPutFlowParam param = new AdPutFlowParam();
         param.setChannel(channel);
-        param.setPath("pages/category.html");
+        param.setPath(path);
         param.setPutCarrierId(carrierId);
         param.setPutScene(putScene);
         param.setPutStartDate(DateUtil.getDayDateString("yyyy-MM-dd"));

+ 1 - 1
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/MessageAttachmentService.java

@@ -27,7 +27,7 @@ public interface MessageAttachmentService {
 
     String getPage(String putScene, String channel, Staff staff, Long videoId, String typeOne, String typeTwo, String typeThree, String experimentId);
 
-    String getPageNoCache(String putScene, String channel, Staff staff, Long videoId, String typeOne, String typeTwo, String typeThree, String experimentId);
+    String getPageNoCache(String path, String putScene, String channel, Staff staff, Long videoId, String typeOne, String typeTwo, String typeThree, String experimentId);
 
     String getPage(String channel, String carrierId, String scene, String putTypeOne, String putTypeTwo, String putTypeThree, Long videoId, String experimentId);