Przeglądaj źródła

群发投放场景实验

wangyunpeng 1 tydzień temu
rodzic
commit
4950b20bfd

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

@@ -66,6 +66,8 @@ public class WeComSendMsgJob {
     private List<String> testRoomList;
     @ApolloJsonValue("${send.room.msg.video.source.staff.config:{}}")
     private Map<Long, JSONObject> videoSourceStaffConfig;
+    @ApolloJsonValue("${send.room.msg.staff.put.scene.config:{}}")
+    private Map<Long, String> staffPutSceneConfig;
 
     private final static ExecutorService pool = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS,
             new LinkedBlockingQueue<>(1000),
@@ -171,7 +173,8 @@ public class WeComSendMsgJob {
             Staff staff = new Staff();
             staff.setCarrierId(String.valueOf(thirdPartWeComStaff.getThirdStaffId()));
             staff.setRemark(thirdPartWeComStaff.getName());
-            String page = messageAttachmentService.getPageNoCache(staff, video.getVideoId(), "企微", "社群");
+            String putScene = staffPutSceneConfig.getOrDefault(thirdPartWeComStaff.getThirdStaffId(), "touliu");
+            String page = messageAttachmentService.getPageNoCache(putScene, staff, video.getVideoId(), "企微", "社群");
 
             CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
             cgiReplyBucketData.setMiniVideoId(video.getVideoId());

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

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

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

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