提交 46355c4e 作者: 洪东保

绑定企业微信和腾讯会议失败记录-避免重复

父级 224e70d1
...@@ -27,4 +27,8 @@ public class WeComUser implements Serializable { ...@@ -27,4 +27,8 @@ public class WeComUser implements Serializable {
private String isrepeatName; private String isrepeatName;
private String email; private String email;
private Boolean emailPushAccess; private Boolean emailPushAccess;
/**
* 是否绑定失败:创建会议时企业微信接口返回 -1
*/
private Boolean tryBind = false;
} }
...@@ -29,4 +29,6 @@ public interface WeComService extends IService<WeComUser> { ...@@ -29,4 +29,6 @@ public interface WeComService extends IService<WeComUser> {
Object updateEmailPushAccess(Boolean emailPushAccess); Object updateEmailPushAccess(Boolean emailPushAccess);
Object findEmailPushAccess(); Object findEmailPushAccess();
boolean bindError(String wid);
} }
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cmeeting.ad.entity.RobotSecurityUser; import com.cmeeting.ad.entity.RobotSecurityUser;
import com.cmeeting.ad.util.SecurityUtil; import com.cmeeting.ad.util.SecurityUtil;
...@@ -54,6 +55,8 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i ...@@ -54,6 +55,8 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i
private TencentMeetingService tencentMeetingService; private TencentMeetingService tencentMeetingService;
@Autowired @Autowired
private UserIdMapper userIdMapper; private UserIdMapper userIdMapper;
@Autowired
private WeComService iweConService;
@Resource @Resource
private SysUserSysMapper sysUserSyncMapper; private SysUserSysMapper sysUserSyncMapper;
@Value(value = "${permission.tenantId}") @Value(value = "${permission.tenantId}")
...@@ -158,6 +161,9 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i ...@@ -158,6 +161,9 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i
MeetingInfo meetingInfo = new MeetingInfo(); MeetingInfo meetingInfo = new MeetingInfo();
if (json.getInt("errcode") != 0) { if (json.getInt("errcode") != 0) {
log.error(string); log.error(string);
if (json.getInt("errcode") == -1) {
iweConService.bindError(wid);
}
return meetingInfo; // 或者抛出异常 return meetingInfo; // 或者抛出异常
} }
meetingInfo.setMeetingId(json.getString("meetingid")); meetingInfo.setMeetingId(json.getString("meetingid"));
...@@ -271,6 +277,11 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i ...@@ -271,6 +277,11 @@ public class WeComServiceImpl extends ServiceImpl<WeComUserMapper, WeComUser> i
return weComUser.getEmailPushAccess(); return weComUser.getEmailPushAccess();
} }
@Override
public boolean bindError(String wid) {
return baseMapper.update(null, new LambdaUpdateWrapper<WeComUser>().eq(WeComUser::getUserId, wid).set(WeComUser::getTryBind, true)) != 0;
}
/** /**
* 获取企微部门列表 * 获取企微部门列表
* *
......
...@@ -29,6 +29,6 @@ ...@@ -29,6 +29,6 @@
SELECT t1.* SELECT t1.*
FROM user_wecom t1 FROM user_wecom t1
left join userid t2 on t1.user_id = t2.Wid left join userid t2 on t1.user_id = t2.Wid
WHERE t2.id is null WHERE t1.try_bind = 0 and t2.id is null
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论