ソースを参照

ipad状态判定bug修复 & 群判定匹配人新增

lmx 5 日 前
コミット
582824815d

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

@@ -604,17 +604,31 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         if(qwGroupChatUsers == null || qwGroupChatUsers.isEmpty()){
             return R.error("群参数异常");
         }
-        //修改成通过昵称匹配
         QwExternalContact qwExternalContact =
                 qwExternalContactMapper.selectOne(new QueryWrapper<QwExternalContact>()
                         .eq("user_id", qwGroupChat.getOwner())
-                        .eq("name", user.getNickName())
+                        .eq("fs_user_id", param.getUserId())
                         .eq("corp_id", param.getCorpId())
                         .eq("status",0));
+        if(null == qwExternalContact){
+            try{
+                //修改成通过昵称匹配
+                qwExternalContact =
+                        qwExternalContactMapper.selectOne(new QueryWrapper<QwExternalContact>()
+                                .eq("user_id", qwGroupChat.getOwner())
+                                .eq("name", user.getNickName())
+                                .eq("corp_id", param.getCorpId())
+                                .eq("status",0));
+            } catch(Exception e){
+                log.error("群聊用户昵称匹配异常,参数user_id:{},name:{},corp_id:{}",qwGroupChat.getOwner(),user.getNickName(),param.getCorpId(),e);
+            }
+
+        }
         if(qwExternalContact==null){
             return addCustomerService(param.getQwUserId(),msg);
         }
-        if(qwGroupChatUsers.stream().noneMatch(e -> e.getUserId().equals(qwExternalContact.getExternalUserId()))){
+        QwExternalContact finalQwExternalContact = qwExternalContact;
+        if(qwGroupChatUsers.stream().noneMatch(e -> e.getUserId().equals(finalQwExternalContact.getExternalUserId()))){
             log.error("客户不在群:{},里面:{}", qwGroupChat.getChatId(), qwExternalContact.getExternalUserId());
             return addCustomerService(param.getQwUserId(),msg);
         }

+ 1 - 1
fs-service/src/main/java/com/fs/qw/mapper/QwUserMapper.java

@@ -152,7 +152,7 @@ public interface QwUserMapper extends BaseMapper<QwUser>
             "left join fastgpt_role fr on fr.role_id=qu.fastGpt_role_id " +
             "where qu.company_user_id is not null "+
             "            <if test=\"qwUserId != null  and qwUserId != ''\"> and qu.qw_user_id = #{qwUserId}</if>\n" +
-            "            <if test=\"loginStatus != null  and loginStatus != ''\"> and qu.ipad_status = #{loginStatus}</if>\n" +
+            "            <if test=\"loginStatus != null \"> and qu.ipad_status = #{loginStatus}</if>\n" +
             "            <if test=\"appKey != null  and appKey != ''\"> and qu.app_key = #{appKey}</if>\n" +
             "            <if test=\"nickName != null  and nickName != ''\"> and cu.nick_name like concat( #{nickName}, '%') </if>\n" +
             "            <if test=\"qwUserName != null  and qwUserName != ''\"> and qu.qw_user_name like concat('%', #{qwUserName}, '%') </if> " +