|
@@ -22,6 +22,7 @@ import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyMapper;
|
|
|
import com.fs.company.mapper.CompanyMoneyLogsMapper;
|
|
|
import com.fs.company.mapper.CompanyUserMapper;
|
|
|
+import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.*;
|
|
|
import com.fs.course.dto.CoursePackageDTO;
|
|
@@ -107,7 +108,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
private static final String miniappRealLink = "/pages_course/video.html?course=";
|
|
|
private static final String REAL_LINK_PREFIX = "/courseH5/pages/course/learning?course=";
|
|
|
private static final String SHORT_LINK_PREFIX = "/courseH5/pages/course/learning?s=";
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ ICompanyService companyService;
|
|
|
@Autowired
|
|
|
private CompanyMoneyLogsMapper moneyLogsMapper;
|
|
|
@Autowired
|
|
@@ -1528,14 +1530,6 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
public ResponseResult<FsUser> isAddCompanyUser(FsUserCourseAddCompanyUserParam param) {
|
|
|
logger.info("\n 【进入个微-判断是否添加客服】,入参:{}",param);
|
|
|
|
|
|
- // 生成锁的key,使用用户ID和视频ID组合
|
|
|
- String lockKey = "submit:lock:" + param.getUserId() + ":" + param.getVideoId();
|
|
|
- // 尝试获取锁,3秒过期
|
|
|
- boolean locked = redisCache.setIfAbsent(lockKey, "1", 1, TimeUnit.SECONDS);
|
|
|
-
|
|
|
- if (!locked) {
|
|
|
- return ResponseResult.fail(504, "请勿重复提交,请等待3秒后重试");
|
|
|
- }
|
|
|
//查询用户
|
|
|
FsUser fsUser = fsUserMapper.selectFsUserById(param.getUserId());
|
|
|
if (fsUser == null){
|
|
@@ -1575,7 +1569,15 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
//3、以上都不是,则标识重粉,需要加入关系表,并打上重粉标签
|
|
|
FsUserCompanyUser userCompanyUser = userCompanyUserService.selectByUserIdAndProjectId(fsUser.getUserId(), param.getProjectId());
|
|
|
if(Objects.isNull(userCompanyUser)) {
|
|
|
- return ResponseResult.fail(BizResponseEnum.DATA_NOT_EXIST, getCompanyUserQRCode(companyUser));
|
|
|
+ Company company = companyService.selectCompanyById(param.getCompanyId());
|
|
|
+ if((companyUser.getIsAllowedAllRegister() !=null && companyUser.getIsAllowedAllRegister() != 1)){
|
|
|
+ return ResponseResult.fail(504,"当前销售禁止绑定会员,请联系销售!");
|
|
|
+ }
|
|
|
+ if (companyUser.getIsNeedRegisterMember() == null || companyUser.getIsNeedRegisterMember() == 1){
|
|
|
+ return ResponseResult.fail(504,"请联系销售发送邀请链接成为会员!");
|
|
|
+ }
|
|
|
+ int defaultStatus = (company != null ? company.getFsUserIsDefaultBlack() : 0) == 1 ? 0 : 1;
|
|
|
+ userCompanyUser = userCompanyUserService.bindRelationship(param.getUserId(), param.getProjectId(), companyUser.getCompanyId(), companyUser.getUserId(), defaultStatus);
|
|
|
}
|
|
|
|
|
|
// 逻辑调整:如果会员已经绑定了销售,直接提示,不添加重粉数据了-2025年6月16日14点53分
|