|
@@ -1,5 +1,6 @@
|
|
|
package com.yonge.cooleshow.auth.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yonge.cooleshow.api.feign.AdminFeignService;
|
|
|
import com.yonge.cooleshow.api.feign.dto.UserFriendInfoVO;
|
|
@@ -17,11 +18,13 @@ import com.yonge.cooleshow.auth.service.SysRoleMenuService;
|
|
|
import com.yonge.cooleshow.auth.service.SysUserRoleService;
|
|
|
import com.yonge.cooleshow.auth.service.SysUserService;
|
|
|
import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
|
+import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
|
import com.yonge.cooleshow.common.entity.ImUserModel;
|
|
|
import com.yonge.cooleshow.common.enums.CacheNameEnum;
|
|
|
import com.yonge.cooleshow.common.enums.SysUserType;
|
|
|
import com.yonge.cooleshow.common.enums.UserFirstTimeTypeEnum;
|
|
|
import com.yonge.toolset.base.exception.BizException;
|
|
|
+import com.yonge.toolset.base.util.ThreadPool;
|
|
|
import com.yonge.toolset.mybatis.dal.BaseDAO;
|
|
|
import com.yonge.toolset.mybatis.service.impl.BaseServiceImpl;
|
|
|
import io.rong.models.user.UserModel;
|
|
@@ -208,22 +211,27 @@ public class SysUserServiceImpl extends BaseServiceImpl<Long, SysUser> implement
|
|
|
|
|
|
try {
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(customerService)) {
|
|
|
+ ThreadPool.getExecutor().submit(() -> {
|
|
|
|
|
|
- List<String> collect = Arrays.stream(customerService.split(",")).collect(Collectors.toList());
|
|
|
+ if (StringUtils.isNotEmpty(customerService)) {
|
|
|
|
|
|
- Random rand = new Random();
|
|
|
- String mobile = collect.get(rand.nextInt(collect.size()));
|
|
|
+ List<String> collect = Arrays.stream(customerService.split(",")).collect(Collectors.toList());
|
|
|
|
|
|
- // 系统客服好友
|
|
|
- SysUser friend = sysUserDao.queryByPhone(mobile);
|
|
|
+ Random rand = new Random();
|
|
|
+ String mobile = collect.get(rand.nextInt(collect.size()));
|
|
|
|
|
|
- // 发送添加系统客服好友消息
|
|
|
- adminFeignService.customerService(UserFriendInfoVO.builder()
|
|
|
- .userId(sysUser.getId())
|
|
|
- .friendIds(Lists.newArrayList(friend.getId()))
|
|
|
- .build());
|
|
|
- }
|
|
|
+ // 系统客服好友
|
|
|
+ SysUser friend = sysUserDao.queryByPhone(mobile);
|
|
|
+
|
|
|
+ // 发送添加系统客服好友消息
|
|
|
+ HttpResponseResult<Boolean> result = adminFeignService.customerService(UserFriendInfoVO.builder()
|
|
|
+ .userId(sysUser.getId())
|
|
|
+ .friendIds(Lists.newArrayList(friend.getId()))
|
|
|
+ .build());
|
|
|
+ log.info("sendSysCustomerServiceFriendMessage ret={}", JSON.toJSONString(result));
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
log.error("sendSysCustomerServiceFriendMessage userId={}", sysUser.getId(), e);
|