...
This commit is contained in:
parent
2b6165be0f
commit
6fae1071ff
|
@ -238,7 +238,7 @@ public class TAbilityApplicationController {
|
||||||
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
|
put("instanceId", tAbilityApplicationDTOList.get(0).getInstanceId()); // 流程id
|
||||||
put("resourceOwnerDept", tAbilityApplicationDTOList.get(0).getResourceOwnerDept()); // 资源所属部门信息
|
put("resourceOwnerDept", tAbilityApplicationDTOList.get(0).getResourceOwnerDept()); // 资源所属部门信息
|
||||||
put("resources", resourceDTOS);//申请的该部门的能力资源
|
put("resources", resourceDTOS);//申请的该部门的能力资源
|
||||||
if (tAbilityApplicationDTOList.get(0).getApplyFlag().equals("通过")) {
|
if (tAbilityApplicationDTOList.get(0).getApproveStatus().equals("通过")) {
|
||||||
put("ended", true);
|
put("ended", true);
|
||||||
} else {
|
} else {
|
||||||
put("ended", false);
|
put("ended", false);
|
||||||
|
|
|
@ -16,8 +16,6 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ExecutorService;
|
|
||||||
import java.util.concurrent.Executors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket服务
|
* WebSocket服务
|
||||||
|
@ -26,7 +24,6 @@ import java.util.concurrent.Executors;
|
||||||
@Component
|
@Component
|
||||||
@ServerEndpoint(value = "/websocket", configurator = WebSocketConfig.class)
|
@ServerEndpoint(value = "/websocket", configurator = WebSocketConfig.class)
|
||||||
public class WebSocketServer {
|
public class WebSocketServer {
|
||||||
private static final ExecutorService executor = Executors.newWorkStealingPool();
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
private static final Logger logger = LoggerFactory.getLogger(WebSocketServer.class);
|
||||||
|
|
||||||
public WebSocketServer() {
|
public WebSocketServer() {
|
||||||
|
@ -81,9 +78,7 @@ public class WebSocketServer {
|
||||||
public void sendMessage(Long userId, MessageData<?> message) {
|
public void sendMessage(Long userId, MessageData<?> message) {
|
||||||
servers.values().forEach(info -> {
|
servers.values().forEach(info -> {
|
||||||
if (userId.equals(info.getUserId())) {
|
if (userId.equals(info.getUserId())) {
|
||||||
executor.execute(() -> {
|
sendMessage(info.getSession(), message);
|
||||||
sendMessage(info.getSession(), message);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -94,9 +89,9 @@ public class WebSocketServer {
|
||||||
* @param message 消息内容
|
* @param message 消息内容
|
||||||
*/
|
*/
|
||||||
public void sendMessageAll(MessageData<?> message) {
|
public void sendMessageAll(MessageData<?> message) {
|
||||||
servers.values().forEach(info -> executor.execute(() -> {
|
servers.values().forEach(info ->
|
||||||
sendMessage(info.getSession(), message);
|
sendMessage(info.getSession(), message)
|
||||||
}));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(Session session, MessageData<?> message) {
|
public void sendMessage(Session session, MessageData<?> message) {
|
||||||
|
|
Loading…
Reference in New Issue