xw 1 semana atrás
pai
commit
35147f3980

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

@@ -607,53 +607,53 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
             }
         }
 
-        // ========== 【新增】企微自动发课(send_type=2)重粉判断逻辑 - 在所有场景处理之前判断 ==========
-        // 获取当前视频所属的课程和项目
-        if (param.getVideoId() != null && param.getCompanyId() != null) {
-            FsUserCourseVideo currentVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(param.getVideoId());
-            if (currentVideo != null && currentVideo.getCourseId() != null) {
-                FsUserCourse course = fsUserCourseMapper.selectFsUserCourseByCourseId(currentVideo.getCourseId());
-                Long projectId = course != null && course.getProject() != null ? course.getProject() : 0L;
-
-                // 只对有项目ID的课程进行重粉判断
-                if (projectId != 0L) {
-                        // 查询该用户在这个项目下是否已经绑定了其他销售
-                        FsUserCompanyQw existBind = fsUserCompanyQwMapper.selectByUserAndProject(
-                            param.getUserId(), projectId
-                        );
-
-                        // 如果存在绑定记录,且绑定的销售不是当前销售,说明是重粉
-                        if (existBind != null && param.getQwUserId() != null
-                            && !existBind.getQwUserId().equals(Long.parseLong(param.getQwUserId()))) {
-                            // 查询项目名称
-                            String projectName = "未知项目";
-                            List<SysDictData> courseProjects = sysDictDataMapper.selectDictDataByType("sys_course_project");
-                            for (SysDictData dictData : courseProjects) {
-                                if (dictData.getDictValue().equals(String.valueOf(projectId))) {
-                                    projectName = dictData.getDictLabel();
-                                    break;
-                                }
-                            }
-
-                            // 查询销售名称
-                            String salesName = "其他销售";
-                            QwUser existQwUser = qwUserMapper.selectById(existBind.getQwUserId());
-                            if (existQwUser != null && existQwUser.getCompanyUserId() != null) {
-                                CompanyUser companyUser = companyUserMapper.selectCompanyUserById(existQwUser.getCompanyUserId());
-                                if (companyUser != null && StringUtils.isNotEmpty(companyUser.getUserName())) {
-                                    salesName = companyUser.getUserName();
-                                }
-                            }
-
-                            // 返回重粉提示
-                            String errorMsg = String.format("您已在销售【%s】处观看过【%s】项目的课程", salesName, projectName);
-                            logger.info("【重粉检测-提前拦截】用户ID: {}, 项目ID: {}, 原销售: {}, 当前销售: {}",
-                                param.getUserId(), projectId, existBind.getQwUserId(), param.getQwUserId());
-                            return R.error(errorMsg);
-                        }
-                }
-            }
-        }
+//        // ========== 【新增】企微自动发课(send_type=2)重粉判断逻辑 - 在所有场景处理之前判断 ==========
+//        // 获取当前视频所属的课程和项目
+//        if (param.getVideoId() != null && param.getCompanyId() != null) {
+//            FsUserCourseVideo currentVideo = fsUserCourseVideoMapper.selectFsUserCourseVideoByVideoId(param.getVideoId());
+//            if (currentVideo != null && currentVideo.getCourseId() != null) {
+//                FsUserCourse course = fsUserCourseMapper.selectFsUserCourseByCourseId(currentVideo.getCourseId());
+//                Long projectId = course != null && course.getProject() != null ? course.getProject() : 0L;
+//
+//                // 只对有项目ID的课程进行重粉判断
+//                if (projectId != 0L) {
+//                        // 查询该用户在这个项目下是否已经绑定了其他销售
+//                        FsUserCompanyQw existBind = fsUserCompanyQwMapper.selectByUserAndProject(
+//                            param.getUserId(), projectId
+//                        );
+//
+//                        // 如果存在绑定记录,且绑定的销售不是当前销售,说明是重粉
+//                        if (existBind != null && param.getQwUserId() != null
+//                            && !existBind.getQwUserId().equals(Long.parseLong(param.getQwUserId()))) {
+//                            // 查询项目名称
+//                            String projectName = "未知项目";
+//                            List<SysDictData> courseProjects = sysDictDataMapper.selectDictDataByType("sys_course_project");
+//                            for (SysDictData dictData : courseProjects) {
+//                                if (dictData.getDictValue().equals(String.valueOf(projectId))) {
+//                                    projectName = dictData.getDictLabel();
+//                                    break;
+//                                }
+//                            }
+//
+//                            // 查询销售名称
+//                            String salesName = "其他销售";
+//                            QwUser existQwUser = qwUserMapper.selectById(existBind.getQwUserId());
+//                            if (existQwUser != null && existQwUser.getCompanyUserId() != null) {
+//                                CompanyUser companyUser = companyUserMapper.selectCompanyUserById(existQwUser.getCompanyUserId());
+//                                if (companyUser != null && StringUtils.isNotEmpty(companyUser.getUserName())) {
+//                                    salesName = companyUser.getUserName();
+//                                }
+//                            }
+//
+//                            // 返回重粉提示
+//                            String errorMsg = String.format("您已在销售【%s】处观看过【%s】项目的课程", salesName, projectName);
+//                            logger.info("【重粉检测-提前拦截】用户ID: {}, 项目ID: {}, 原销售: {}, 当前销售: {}",
+//                                param.getUserId(), projectId, existBind.getQwUserId(), param.getQwUserId());
+//                            return R.error(errorMsg);
+//                        }
+//                }
+//            }
+//        }
         // ========== 【重粉判断结束】 ==========
 
         Integer isRoom = param.getIsRoom();
@@ -767,8 +767,8 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
         //重粉逻辑
         fsUserCompanyBindService.bindFsUser(param.getUserId(), qwExternalId, log.getLogId());
 
-        // 记录用户-项目-销售绑定关系
-        recordUserProjectBind(param, qwExternalId, "handleQwRoom");
+//        // 记录用户-项目-销售绑定关系
+//        recordUserProjectBind(param, qwExternalId, "handleQwRoom");
 
         return R.error(567, "群聊通用链接").put("qwExternalId", qwExternalContact.getId());
     }
@@ -855,9 +855,9 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
         }
 
         // ========== 【handleRoom-记录用户-项目-销售绑定关系】 ==========
-        if (param.getQwExternalId() != null) {
-            recordUserProjectBind(param, param.getQwExternalId(), "handleRoom");
-        }
+//        if (param.getQwExternalId() != null) {
+//            recordUserProjectBind(param, param.getQwExternalId(), "handleRoom");
+//        }
         // ========== 【绑定关系记录结束】 ==========
 
 
@@ -973,7 +973,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
             fsUserCompanyBindService.bindFsUser(param.getUserId(), qwExternalId, log.getLogId());
 
             // 记录用户-项目-销售绑定关系
-            recordUserProjectBind(param, qwExternalId, "handleExt");
+//            recordUserProjectBind(param, qwExternalId, "handleExt");
 
 
             if (param.getLinkType() != null && param.getLinkType() == 5) {
@@ -1014,7 +1014,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
             fsUserCompanyBindService.bindFsUser(param.getUserId(), qwExternalId, log.getLogId());
 
             // 记录用户-项目-销售绑定关系
-            recordUserProjectBind(param, qwExternalId, "handleExt");
+//            recordUserProjectBind(param, qwExternalId, "handleExt");
 
 
             if (param.getLinkType() != null && param.getLinkType() == 5) {