Browse Source

三方平台群消息发送 putType

wangyunpeng 1 week ago
parent
commit
96e93783ee

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

@@ -142,7 +142,7 @@ public class WeComSendMsgJob {
             Staff staff = new Staff();
             staff.setCarrierId(String.valueOf(thirdPartWeComStaff.getThirdStaffId()));
             staff.setRemark(thirdPartWeComStaff.getName());
-            String page = messageAttachmentService.getPage(staff, video.getVideoId());
+            String page = messageAttachmentService.getPage(staff, video.getVideoId(), "企微", "社群");
 
             CgiReplyBucketData cgiReplyBucketData = new CgiReplyBucketData();
             cgiReplyBucketData.setMiniVideoId(video.getVideoId());

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

@@ -3,7 +3,6 @@ package com.tzld.piaoquan.growth.common.service.Impl;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
-import com.tzld.piaoquan.growth.common.common.constant.MessageConstant;
 import com.tzld.piaoquan.growth.common.common.enums.ExceptionCodeEnum;
 import com.tzld.piaoquan.growth.common.common.enums.MessageAttachmentTypeEnum;
 import com.tzld.piaoquan.growth.common.common.exception.CustomizeException;
@@ -16,12 +15,14 @@ import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.model.bo.VideoParam;
 import com.tzld.piaoquan.growth.common.model.po.*;
 import com.tzld.piaoquan.growth.common.model.vo.GuaranteedParam;
-import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
+import com.tzld.piaoquan.growth.common.service.WeComAccessTokenService;
 import com.tzld.piaoquan.growth.common.service.WeComSendService;
-import com.tzld.piaoquan.growth.common.utils.*;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.FileUtils;
+import com.tzld.piaoquan.growth.common.utils.ImageUrlValidator;
+import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
 import lombok.extern.slf4j.Slf4j;
-import lombok.val;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +37,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.*;
@@ -388,31 +388,31 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
 
 
     @Override
-    public String getPage(Staff staff, Long videoId) {
+    public String getPage(Staff staff, Long videoId, String typeOne, String typeTwo) {
         try {
             if (staff == null || staff.getCarrierId() == null) {
                 return "";
             }
-            String page = selectPage(videoId, staff.getCarrierId(), "企微", "日常推送");
+            String page = selectPage(videoId, staff.getCarrierId(), typeOne, typeTwo);
             if (StringUtils.isNotEmpty(page)) {
                 return page;
             }
-            return insertPage(staff.getCarrierId(), videoId, staff.getRemark());
+            return insertPage(staff.getCarrierId(), videoId, staff.getRemark(), typeOne, typeTwo);
         } catch (IOException e) {
             log.error("MessageAttachmentService getPage error", e);
         }
         return null;
     }
 
-    private String insertPage(String carrierId, Long videoId, String remark) throws IOException {
+    private String insertPage(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.setPutStartDate(DateUtil.getDayDateString("yyyy-MM-dd"));
-        param.setPutTypeOne("企微");
-        param.setPutTypeTwo("日常推送");
+        param.setPutTypeOne(typeOne);
+        param.setPutTypeTwo(typeTwo);
         param.setPutTypeThree("位置X");
         param.setRemark(remark);
         param.setVideoId(videoId);

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

@@ -25,7 +25,7 @@ public interface MessageAttachmentService {
 
     String getPicMediaId(String cover, Long corpId, Long miniprogramVideoId);
 
-    String getPage(Staff staff, Long videoId);
+    String getPage(Staff staff, Long videoId, String typeOne, String typeTwo);
 
     String getPage(String channel, String carrierId, String scene, String putTypeOne, String putTypeTwo, String putTypeThree, Long videoId);
 

+ 1 - 1
offline-module/src/main/java/com/tzld/piaoquan/offline/job/WeComMessageDataJob.java

@@ -546,7 +546,7 @@ public class WeComMessageDataJob {
             if (pageMap.containsKey(key)) {
                 page = pageMap.get(key);
             } else {
-                page = messageAttachmentService.getPage(staff, videoId);
+                page = messageAttachmentService.getPage(staff, videoId, "企微", "日常推送");
                 pageMap.put(key, page);
             }
             if (StringUtils.isEmpty(page)) {