Ver Fonte

Merge branch '20251106-wyp-roomPutScene' of Server/growth-manager into master

wangyunpeng há 1 semana atrás
pai
commit
75cf08581e

+ 1 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java

@@ -60,6 +60,7 @@ public enum ExceptionEnum {
     VIDEO_INFO_FAILED(6005, "视频信息获取失败"),
     PQ_ACCOUNT_NOT_BINDING(6006, "票圈账号未绑定"),
     VIDEO_CITED(6007, "视频已被引用,不能删除"),
+    VIDEO_GET_FAILED(6008, "视频获取失败"),
 
     // 自动回复
     CGI_REPLY_BUCKET_DATA_NOT_FOUND(10000, "自动回复数据不存在"),

+ 6 - 6
api-module/src/main/java/com/tzld/piaoquan/api/component/VideoApiService.java

@@ -198,13 +198,13 @@ public class VideoApiService {
                     uid, excludeVideoIds, pageNum, pageSize, e);
         }
         if (Objects.isNull(res)) {
-            throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED);
+            throw new CommonException(ExceptionEnum.VIDEO_GET_FAILED);
         }
         if (res.getInteger("code") != 0) {
             log.error("VideoApiService getUserVideoList error, uid={} excludeVideoIds={} pageNum={} pageSize={} res={}",
                     uid, excludeVideoIds, pageNum, pageSize, res);
-            throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED.getCode(),
-                    ExceptionEnum.VIDEO_DELETE_FAILED.getMsg() + "," + res.getString("msg"));
+            throw new CommonException(ExceptionEnum.VIDEO_GET_FAILED.getCode(),
+                    ExceptionEnum.VIDEO_GET_FAILED.getMsg() + "," + res.getString("msg"));
         }
         return res.getJSONArray("data").toJavaList(WxVideoV2VO.class);
     }
@@ -226,13 +226,13 @@ public class VideoApiService {
                     tagName, excludeVideoIds, pageNum, pageSize, e);
         }
         if (Objects.isNull(res)) {
-            throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED);
+            throw new CommonException(ExceptionEnum.VIDEO_GET_FAILED);
         }
         if (res.getInteger("code") != 0) {
             log.error("VideoApiService getTagVideoList error, tagName={} excludeVideoIds={} pageNum={} pageSize={} res={}",
                     tagName, excludeVideoIds, pageNum, pageSize, res);
-            throw new CommonException(ExceptionEnum.VIDEO_DELETE_FAILED.getCode(),
-                    ExceptionEnum.VIDEO_DELETE_FAILED.getMsg() + "," + res.getString("msg"));
+            throw new CommonException(ExceptionEnum.VIDEO_GET_FAILED.getCode(),
+                    ExceptionEnum.VIDEO_GET_FAILED.getMsg() + "," + res.getString("msg"));
         }
         return res.getJSONArray("data").toJavaList(WxVideoV2VO.class);
     }

+ 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);