zx 1 هفته پیش
والد
کامیت
2e6c268bff

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

@@ -517,9 +517,34 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
                     createWatchLog(param);
                 }
                 return R.error(567,"群聊通用链接").put("qwExternalId", matchedContact.getId());
+            }else {
+                QwExternalContact contact = contacts.get(0);
+                log.info("匹配到的第一个企微用户:"+contact.getUserId());
+                log.info("企微id:"+contact.getId());
+                log.info("用户:"+param.getVideoId());
+                log.info("企微用户:"+param.getQwUserId());
+                param.setQwExternalId(contact.getId());
+                FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByExt(contact.getId(), param.getVideoId(),param.getQwUserId());
+                if (log==null){
+                    createWatchLog(param);
+                }
+                return R.error(567,"群聊通用链接").put("qwExternalId", matchedContact.getId());
             }
         }
-
+        //一个都找不到
+        QwExternalContact UnionEXt = qwExternalContactMapper.selectQwExternalByUnionID(user.getUnionId());
+        if (UnionEXt!=null){
+            log.info("匹配到的第一个企微用户:"+UnionEXt.getUserId());
+            log.info("企微id:"+UnionEXt.getId());
+            log.info("用户:"+param.getVideoId());
+            log.info("企微用户:"+param.getQwUserId());
+            param.setQwExternalId(UnionEXt.getId());
+            FsCourseWatchLog log = courseWatchLogMapper.getWatchCourseVideoByExt(UnionEXt.getId(), param.getVideoId(),param.getQwUserId());
+            if (log==null){
+                createWatchLog(param);
+            }
+            return R.error(567,"群聊通用链接").put("qwExternalId", UnionEXt.getId());
+        }
         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>";
 

+ 2 - 0
fs-service/src/main/java/com/fs/qw/mapper/QwExternalContactMapper.java

@@ -505,4 +505,6 @@ public interface QwExternalContactMapper extends BaseMapper<QwExternalContact> {
     List<QwExternalContact> selectQwExternalContactByFsUserIdAndCompany(@Param("userId")Long userId,@Param("companyUserId") Long companyUserId);
 
     void updateQwExternalContactIsRePlyById(@Param("id")Long id);
+    @Select("select * from qw_external_contact where unionid = #{unionID} ")
+    QwExternalContact selectQwExternalByUnionID(@Param("unionID")String unionID);
 }

+ 1 - 0
fs-user-app/src/main/java/com/fs/app/controller/store/UserScrmController.java

@@ -81,6 +81,7 @@ public class UserScrmController extends AppBaseController {
     @GetMapping("/getUserInfo")
     public R getUserInfo(HttpServletRequest request){
         try {
+
             FsUserScrm user=userService.selectFsUserById(Long.parseLong(getUserId()));
             if (user.getIsShow() !=null && user.getIsShow() == 0){
                 FsStoreOrderScrm order = orderService.selectOrderByUserIdLimit1(user.getUserId());