|
@@ -498,7 +498,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
// 设置 Redis 记录的过期时间(例如 5 分钟)
|
|
// 设置 Redis 记录的过期时间(例如 5 分钟)
|
|
|
redisCache.expire(redisKey, 300, TimeUnit.SECONDS);
|
|
redisCache.expire(redisKey, 300, TimeUnit.SECONDS);
|
|
|
}
|
|
}
|
|
|
- @Override
|
|
|
|
|
|
|
+ /*@Override
|
|
|
public R isAddKf(FsUserCourseVideoAddKfUParam param) {
|
|
public R isAddKf(FsUserCourseVideoAddKfUParam param) {
|
|
|
|
|
|
|
|
logger.info("zyp \n【判断添加客服】:{}",param);
|
|
logger.info("zyp \n【判断添加客服】:{}",param);
|
|
@@ -724,8 +724,8 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
return R.ok();
|
|
return R.ok();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- /* @Override
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+ @Override
|
|
|
public R isAddKf(FsUserCourseVideoAddKfUParam param) {
|
|
public R isAddKf(FsUserCourseVideoAddKfUParam param) {
|
|
|
logger.info("【判断添加客服】:{}",param);
|
|
logger.info("【判断添加客服】:{}",param);
|
|
|
//查询用户
|
|
//查询用户
|
|
@@ -753,12 +753,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
// }
|
|
// }
|
|
|
// return R.ok();
|
|
// return R.ok();
|
|
|
// }
|
|
// }
|
|
|
- String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为会员独享<br>请长按二维码</div>\n" +
|
|
|
|
|
- "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";
|
|
|
|
|
- //济南联志隐藏二维码
|
|
|
|
|
- if ("济南联志健康".equals(signProjectName)) {
|
|
|
|
|
- msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为会员独享<br></div>";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //未注册提示
|
|
|
|
|
+ String noRegisterMsg = "由于您还未完成注册,请联系伴学助手完成注册即可观看!";
|
|
|
|
|
+ //非独属链接提示
|
|
|
|
|
+ String noMemberMsg = "此链接已被绑定,请联系伴学助手领取您的专属链接,专属链接请勿分享哦!";
|
|
|
// try {
|
|
// try {
|
|
|
// new Thread(() -> {
|
|
// new Thread(() -> {
|
|
|
// try {
|
|
// try {
|
|
@@ -804,25 +802,25 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
|
|
// 处理逻辑
|
|
// 处理逻辑
|
|
|
if(StringUtils.isNotEmpty(param.getChatId())){
|
|
if(StringUtils.isNotEmpty(param.getChatId())){
|
|
|
- return handleQwRoom(param, fsUser);
|
|
|
|
|
|
|
+ return handleQwRoom(param, fsUser,noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
if (isRoom == null || isRoom == 0) {
|
|
if (isRoom == null || isRoom == 0) {
|
|
|
// 当 isRoom 为 null 或 0 时走 handleExt
|
|
// 当 isRoom 为 null 或 0 时走 handleExt
|
|
|
- return handleExt(param,msg, oneCompanyCourse);
|
|
|
|
|
|
|
+ return handleExt(param,noRegisterMsg, oneCompanyCourse);
|
|
|
} else if (isRoom == 1) {
|
|
} else if (isRoom == 1) {
|
|
|
// 当 isRoom 为 1 时走 handleRoom
|
|
// 当 isRoom 为 1 时走 handleRoom
|
|
|
- return handleRoom(param,fsUser);
|
|
|
|
|
|
|
+ return handleRoom(param,fsUser,noRegisterMsg);
|
|
|
} else {
|
|
} else {
|
|
|
// 非法参数
|
|
// 非法参数
|
|
|
logger.warn("非法参数 isRoom: {}", isRoom);
|
|
logger.warn("非法参数 isRoom: {}", isRoom);
|
|
|
return R.error("参数错误!");
|
|
return R.error("参数错误!");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }*/
|
|
|
|
|
- private R handleQwRoom(FsUserCourseVideoAddKfUParam param,FsUser user) {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ private R handleQwRoom(FsUserCourseVideoAddKfUParam param,FsUser user,String noRegisterMsg) {
|
|
|
FsCourseLink courseLink = courseLinkMapper.selectFsCourseLinkByLink(param.getLink());
|
|
FsCourseLink courseLink = courseLinkMapper.selectFsCourseLinkByLink(param.getLink());
|
|
|
- String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为群会员独享<br>请长按二维码</div>\n" +
|
|
|
|
|
- "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";
|
|
|
|
|
|
|
+// String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为群会员独享<br>请长按二维码</div>\n" +
|
|
|
|
|
+// "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";
|
|
|
QwGroupChat qwGroupChat = qwGroupChatMapper.selectQwGroupChatByChatId(courseLink.getChatId());
|
|
QwGroupChat qwGroupChat = qwGroupChatMapper.selectQwGroupChatByChatId(courseLink.getChatId());
|
|
|
if(qwGroupChat == null){
|
|
if(qwGroupChat == null){
|
|
|
return R.error("群参数异常");
|
|
return R.error("群参数异常");
|
|
@@ -898,29 +896,29 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
if(qwExternalContact==null){
|
|
if(qwExternalContact==null){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
QwExternalContact finalQwExternalContact = qwExternalContact;
|
|
QwExternalContact finalQwExternalContact = qwExternalContact;
|
|
|
if(qwGroupChatUsers.stream().noneMatch(e -> e.getUserId().equals(finalQwExternalContact.getExternalUserId()))){
|
|
if(qwGroupChatUsers.stream().noneMatch(e -> e.getUserId().equals(finalQwExternalContact.getExternalUserId()))){
|
|
|
log.error("客户不在群:{},里面:{}", qwGroupChat.getChatId(), qwExternalContact.getExternalUserId());
|
|
log.error("客户不在群:{},里面:{}", qwGroupChat.getChatId(), qwExternalContact.getExternalUserId());
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
Long qwExternalId = qwExternalContact.getId();
|
|
Long qwExternalId = qwExternalContact.getId();
|
|
|
// addCompanyCompanyFsUser(param);
|
|
// addCompanyCompanyFsUser(param);
|
|
|
FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByExt(qwExternalId, param.getVideoId(),param.getQwUserId());
|
|
FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByExt(qwExternalId, param.getVideoId(),param.getQwUserId());
|
|
|
if (log==null ){
|
|
if (log==null ){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
//判断外部联系人有没有绑定userId
|
|
//判断外部联系人有没有绑定userId
|
|
|
if (qwExternalContact.getFsUserId()!=null){
|
|
if (qwExternalContact.getFsUserId()!=null){
|
|
|
//有客户有小程序id 但 登录的小程序id和根据外部联系人id查出来的小程序id不一致
|
|
//有客户有小程序id 但 登录的小程序id和根据外部联系人id查出来的小程序id不一致
|
|
|
if (!qwExternalContact.getFsUserId().equals(param.getUserId())) {
|
|
if (!qwExternalContact.getFsUserId().equals(param.getUserId())) {
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectQwExternalContactByMiniUserId(param.getUserId());
|
|
List<QwExternalContact> qwExternalContacts = qwExternalContactMapper.selectQwExternalContactByMiniUserId(param.getUserId());
|
|
|
//匹配客户公司id
|
|
//匹配客户公司id
|
|
|
if (qwExternalContacts.stream().noneMatch(contact -> contact.getCorpId().equals(param.getCorpId()))){
|
|
if (qwExternalContacts.stream().noneMatch(contact -> contact.getCorpId().equals(param.getCorpId()))){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//看课记录中userId为0绑定userId
|
|
//看课记录中userId为0绑定userId
|
|
@@ -957,7 +955,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
fsUserCompanyBindService.bindFsUser(param.getUserId(), qwExternalId, log.getLogId());
|
|
fsUserCompanyBindService.bindFsUser(param.getUserId(), qwExternalId, log.getLogId());
|
|
|
return R.error(567,"群聊通用链接").put("qwExternalId", qwExternalContact.getId());
|
|
return R.error(567,"群聊通用链接").put("qwExternalId", qwExternalContact.getId());
|
|
|
}
|
|
}
|
|
|
- private R handleRoom(FsUserCourseVideoAddKfUParam param,FsUser user) {
|
|
|
|
|
|
|
+ private R handleRoom(FsUserCourseVideoAddKfUParam param,FsUser user,String noRegisterMsg) {
|
|
|
//查询客户列表
|
|
//查询客户列表
|
|
|
List<QwExternalContact> contacts = qwExternalContactMapper.selectQwExternalContactListVOByfsUserId(user.getUserId());
|
|
List<QwExternalContact> contacts = qwExternalContactMapper.selectQwExternalContactListVOByfsUserId(user.getUserId());
|
|
|
List<QwExternalContact> nonNullContacts = contacts.stream()
|
|
List<QwExternalContact> nonNullContacts = contacts.stream()
|
|
@@ -1020,10 +1018,10 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为群会员独享<br>请长按二维码</div>\n" +
|
|
|
|
|
- "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";
|
|
|
|
|
|
|
+ /* String msg = "<div style=\"color: red;margin-bottom: 15px;font-weight: bold;\">本课程为群会员独享<br>请长按二维码</div>\n" +
|
|
|
|
|
+ "\t\t\t\t\t<div style=\"color: #999;font-size: 14px;font-weight: bold;\">添加伴学助手免费领取会员权限</div>";*/
|
|
|
|
|
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(noRegisterMsg);
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -1075,7 +1073,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
if (param.getLinkType()!=null&¶m.getLinkType()==5) {
|
|
if (param.getLinkType()!=null&¶m.getLinkType()==5) {
|
|
|
log = courseWatchLogMapper.selectFsCourseWatchLogByCourseSopIdAndVideoId(param.getUserId(), param.getVideoId(), param.getQwUserId());
|
|
log = courseWatchLogMapper.selectFsCourseWatchLogByCourseSopIdAndVideoId(param.getUserId(), param.getVideoId(), param.getQwUserId());
|
|
|
if (log == null) {
|
|
if (log == null) {
|
|
|
- return addCustomerService(param.getQwUserId(), msg);
|
|
|
|
|
|
|
+ return R.error(msg);
|
|
|
}else {
|
|
}else {
|
|
|
qwExternalId=log.getQwExternalContactId();
|
|
qwExternalId=log.getQwExternalContactId();
|
|
|
}
|
|
}
|
|
@@ -1083,7 +1081,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
}else {
|
|
}else {
|
|
|
log = courseWatchLogMapper.getWatchCourseVideoByExt(qwExternalId, param.getVideoId(),param.getQwUserId());
|
|
log = courseWatchLogMapper.getWatchCourseVideoByExt(qwExternalId, param.getVideoId(),param.getQwUserId());
|
|
|
if (log==null ){
|
|
if (log==null ){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(msg);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1101,18 +1099,18 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
|
|
|
|
|
//如果查不出来客户信息,加好友
|
|
//如果查不出来客户信息,加好友
|
|
|
if(externalContact==null){
|
|
if(externalContact==null){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(msg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//判断外部联系人有没有绑定userId
|
|
//判断外部联系人有没有绑定userId
|
|
|
if (externalContact.getFsUserId()!=null){
|
|
if (externalContact.getFsUserId()!=null){
|
|
|
//有客户有小程序id 但 登录的小程序id和根据外部联系人id查出来的小程序id不一致
|
|
//有客户有小程序id 但 登录的小程序id和根据外部联系人id查出来的小程序id不一致
|
|
|
if (!externalContact.getFsUserId().equals(param.getUserId())) {
|
|
if (!externalContact.getFsUserId().equals(param.getUserId())) {
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(msg);
|
|
|
}
|
|
}
|
|
|
//匹配客户公司id
|
|
//匹配客户公司id
|
|
|
if (qwExternalContacts.stream().noneMatch(contact -> contact.getCorpId().equals(param.getCorpId()))){
|
|
if (qwExternalContacts.stream().noneMatch(contact -> contact.getCorpId().equals(param.getCorpId()))){
|
|
|
- return addCustomerService(param.getQwUserId(),msg);
|
|
|
|
|
|
|
+ return R.error(msg);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//看课记录中userId为0绑定userId
|
|
//看课记录中userId为0绑定userId
|
|
@@ -1177,7 +1175,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private R addCustomerService(String qwUserById,String msg){
|
|
|
|
|
|
|
+ /* private R addCustomerService(String qwUserById,String msg){
|
|
|
if ("济南联志健康".equals(signProjectName)){
|
|
if ("济南联志健康".equals(signProjectName)){
|
|
|
return R.error(400,msg).put("qrcode", "");
|
|
return R.error(400,msg).put("qrcode", "");
|
|
|
}
|
|
}
|
|
@@ -1215,7 +1213,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
|
|
|
return R.error(400,msg).put("qrcode",contactWay);
|
|
return R.error(400,msg).put("qrcode",contactWay);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+*/
|
|
|
@Override
|
|
@Override
|
|
|
public List<FsUserCourseVideoVO> selectFsUserCourseVideoListByCourseIdAndCompany(FsUserCourseVideoParam fsUserCourseVideo) {
|
|
public List<FsUserCourseVideoVO> selectFsUserCourseVideoListByCourseIdAndCompany(FsUserCourseVideoParam fsUserCourseVideo) {
|
|
|
return fsUserCourseVideoMapper.selectFsUserCourseVideoListByCourseIdAndCompany(fsUserCourseVideo);
|
|
return fsUserCourseVideoMapper.selectFsUserCourseVideoListByCourseIdAndCompany(fsUserCourseVideo);
|