xw 6 дней назад
Родитель
Сommit
93b9112b06

+ 4 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -979,6 +979,10 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
         if(qwExternalContact==null){
             return R.error(noRegisterMsg);
         }
+        Integer contactStatus = qwExternalContact.getStatus();
+        if (contactStatus == null || !Arrays.asList(0, 1, 2).contains(contactStatus)) {
+            return R.error("当前学习通道访问限流,暂时无法观看!");
+        }
         QwExternalContact finalQwExternalContact = qwExternalContact;
         if (qwGroupChatUsers.stream().noneMatch(e -> e.getUserId().equals(finalQwExternalContact.getExternalUserId()))) {
             log.error("客户不在群:{},里面:{}", qwGroupChat.getChatId(), qwExternalContact.getExternalUserId());

+ 10 - 3
fs-service/src/main/java/com/fs/sop/service/impl/QwSopLogsServiceImpl.java

@@ -79,6 +79,11 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
 
     private static final Logger logger = LoggerFactory.getLogger(QwSopLogsServiceImpl.class);
     public static final String FS_USER_BLACKLIST_REMARK = "该客户已经被管理员拉黑";
+
+    /** 发群/群公告:目标为群聊,不按单个客户拉黑拦截 */
+    private static boolean shouldSkipBlacklistCheck(Integer sendType) {
+        return sendType != null && (sendType == 6 || sendType == 21);
+    }
     @Autowired
     private RedisCache redisCache;
     @Autowired
@@ -1081,7 +1086,8 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
             for (QwSopLogsDoSendListTVO log : result) {
 
                 try {
-                    if (log.getFsUserId() != null && isFsUserBlacklisted(log.getFsUserId())) {
+                    if (!shouldSkipBlacklistCheck(log.getSendType())
+                            && log.getFsUserId() != null && isFsUserBlacklisted(log.getFsUserId())) {
                         qwSopLogsService.updateQwSopLogsByWatchLogType(log.getId(), FS_USER_BLACKLIST_REMARK);
                         continue;
                     }
@@ -1611,7 +1617,7 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
 
     @Override
     public void applyBlacklistCheck(QwSopLogs sopLogs) {
-        if (sopLogs == null || sopLogs.getFsUserId() == null) {
+        if (sopLogs == null || sopLogs.getFsUserId() == null || shouldSkipBlacklistCheck(sopLogs.getSendType())) {
             return;
         }
         if (isFsUserBlacklisted(sopLogs.getFsUserId())) {
@@ -1636,7 +1642,8 @@ public class QwSopLogsServiceImpl extends ServiceImpl<QwSopLogsMapper, QwSopLogs
             return;
         }
         for (QwSopLogs sopLog : sopLogs) {
-            if (sopLog.getFsUserId() != null && blacklistedUserIds.contains(sopLog.getFsUserId())) {
+            if (!shouldSkipBlacklistCheck(sopLog.getSendType())
+                    && sopLog.getFsUserId() != null && blacklistedUserIds.contains(sopLog.getFsUserId())) {
                 markSopLogAsBlacklisted(sopLog);
             }
         }

+ 1 - 0
fs-service/src/main/resources/mapper/sop/QwSopLogsMapper.xml

@@ -680,6 +680,7 @@
         real_send_time = NOW()
         WHERE fs_user_id = #{fsUserId}
         AND send_status = 3
+        AND send_type NOT IN (6, 21)
     </update>
 
     <update id="updateQwSopLogsByDeleted"  parameterType="com.fs.sop.params.GetQwSopLogsByJsApiParam"  useGeneratedKeys="false">