Commit 4c51b2f9 by zhangjw

1:修复已知bug

parent feb57d06
......@@ -27,8 +27,7 @@ public class HeartBeatServerHandler extends BaseHandler<HeartBeat> {
IdleStateEvent event = (IdleStateEvent) evt;
if (event.state() == IdleState.READER_IDLE) {
ctx.channel().close();
final Long userId = ctx.channel().attr(ChannelAttributeKey.ROLE_ID).get();
log.info("用户: " + userId + " 无心跳 ");
log.info("用户: " + ctx.channel().attr(ChannelAttributeKey.ROLE_ID).get() + " 无心跳 ");
}
} else {
super.userEventTriggered(ctx, evt);
......
......@@ -10,7 +10,10 @@ import com.ym.im.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import static java.util.Map.Entry.comparingByValue;
import static java.util.stream.Collectors.toMap;
......@@ -72,7 +75,10 @@ public class StaffServiceImpl implements StaffService {
return new MsgBody<>().setCode(MsgBody.BINDINGFAILURE).setMessage(ResultStatus.FORWARD_FAILURE.getMessage());
}
//移除原客服绑定
channelGroup.getMerchantStaff(userSocketInfo.getStaffId(merchantId)).getUserIds().remove(userId);
final StaffSocketInfo merchantStaff = channelGroup.getMerchantStaff(userSocketInfo.getStaffId(merchantId));
if (merchantStaff != null) {
merchantStaff.getUserIds().remove(userId);
}
//设置新的客服
staffSocketInfo.getUserIds().add(userId);
userSocketInfo.setStaff(merchantId, staffId);
......
......@@ -16,9 +16,9 @@ spring:
max-wait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位毫秒
time-between-eviction-runs-millis: 60000
url: jdbc:mysql://127.0.0.1/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
url: jdbc:mysql://47.99.47.225/customer_service?useUnicode=true&useSSL=false&serverTimezone=Asia/Shanghai&characterEncoding=utf8
username: root
password: 101020
password: temple123456
driver-class-name: com.mysql.cj.jdbc.Driver
connectionInitSqls: set names utf8mb4
jackson:
......@@ -28,9 +28,9 @@ spring:
port: 5672
username: root
password: root
staff-offline-Queue-Name: staff.offline.dev
order-queue-name: push.order.dev
exchange-name: delay.exchange.dev
staff-offline-Queue-Name: staff.offline
order-queue-name: push.order
exchange-name: delay.exchange
listener:
simple:
default-requeue-rejected: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment