|
|
@@ -13,13 +13,15 @@ import com.goafanti.common.utils.LoggerUtils;
|
|
|
import com.goafanti.common.utils.StringUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.core.websocket.SystemWebSocketHandler;
|
|
|
import com.goafanti.customer.bo.InputCallNumber;
|
|
|
import com.goafanti.customer.bo.InputUserCallList;
|
|
|
+import com.goafanti.customer.bo.SseMap;
|
|
|
+import com.goafanti.customer.bo.SseResult;
|
|
|
import com.goafanti.customer.service.UserOutboundService;
|
|
|
import org.apache.shiro.crypto.hash.SimpleHash;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.socket.TextMessage;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.HashMap;
|
|
|
@@ -195,11 +197,17 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<CallLogMapper> imple
|
|
|
callLogMapper.insert(callLog);
|
|
|
pushCountUser(uid);
|
|
|
//需要关闭客户呼叫中
|
|
|
+ SseResult res = SseMap.sseEmitterMap.get(TokenManager.getAdminId());
|
|
|
+
|
|
|
try {
|
|
|
- LoggerUtils.debug(getClass(),String.format("websocket通信成功=》%s=%s",callResult,callResultMsg));
|
|
|
- systemWebSocketHandler.sendMessageToUser(admin.getId(), new TextMessage(callResult));
|
|
|
+ res.sseEmitter.send(callResult);
|
|
|
+// systemWebSocketHandler.sendMessageToUser(admin.getId(), new TextMessage(callResult));
|
|
|
+ LoggerUtils.debug(getClass(),String.format("通信成功=》%s=%s",callResult,callResultMsg));
|
|
|
}catch (Exception e ){
|
|
|
- LoggerUtils.error(getClass(),"websocket通信失败");
|
|
|
+ LoggerUtils.error(getClass(),"通信失败");
|
|
|
+ }finally {
|
|
|
+ res.sseEmitter.complete();
|
|
|
+ SseMap.sseEmitterMap.remove(TokenManager.getAdminId());
|
|
|
}
|
|
|
return 1;
|
|
|
}
|