sse实时开发 微修
This commit is contained in:
@@ -245,7 +245,7 @@ public class TriageQueueAppServiceImpl implements TriageQueueAppService {
|
||||
selected.setStatus(STATUS_CALLING).setUpdateTime(LocalDateTime.now());
|
||||
triageQueueItemService.updateById(selected);
|
||||
|
||||
// ✅ 叫号后推送 SSE 消息(实时通知显示屏刷新)
|
||||
// 叫号后推送 SSE 消息(实时通知显示屏刷新)
|
||||
pushDisplayUpdate(selected.getOrganizationId(), selected.getQueueDate(), selected.getTenantId());
|
||||
|
||||
return R.ok(true);
|
||||
@@ -332,7 +332,7 @@ public class TriageQueueAppServiceImpl implements TriageQueueAppService {
|
||||
|
||||
recalcOrders(actualOrgId, null);
|
||||
|
||||
// ✅ 完成后推送 SSE 消息(实时通知显示屏刷新)
|
||||
// 完成后推送 SSE 消息(实时通知显示屏刷新)
|
||||
pushDisplayUpdate(actualOrgId, calling.getQueueDate(), tenantId);
|
||||
|
||||
return R.ok(true);
|
||||
|
||||
@@ -16,7 +16,9 @@ import java.util.concurrent.CopyOnWriteArraySet;
|
||||
@Component
|
||||
public class CallNumberSseManager {
|
||||
|
||||
private static final long NO_TIMEOUT = 0L;
|
||||
private static final long NO_TIMEOUT = 0L; // 0 表示“永不超时”
|
||||
// 按科室分组保存连接(消化内科有3个屏、心内科有2个屏)
|
||||
// 很多屏幕同时连、同时断。故用 ConcurrentHashMap 存储,线程安全。内部分段锁,不阻塞其他科室的操作。
|
||||
private static final Map<Long, CopyOnWriteArraySet<SseEmitter>> emitterMap = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
|
||||
@@ -815,6 +815,8 @@ const loadDataFromApi = async () => {
|
||||
appointmentType: item.healthcareName ?? '普通',
|
||||
room: item.organizationName ? `${item.organizationName}` : '-',
|
||||
doctor: item.practitionerName ?? '-',
|
||||
// 当前接口返回的是 practitionerUserId,保存为 practitionerId 供入队使用
|
||||
practitionerId: item.practitionerUserId ?? null,
|
||||
matchingRule: '-' // 这里先不做智能规则匹配
|
||||
}))
|
||||
console.log('【心内科】候选池已加载', originalCandidatePoolList.value.length, '条今天的数据')
|
||||
@@ -1031,7 +1033,9 @@ const handleAddToQueue = async () => {
|
||||
patientId: c.patientId,
|
||||
patientName: c.patientName,
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1144,7 +1148,9 @@ const handleAddAllToQueue = async () => {
|
||||
patientId: c.patientId,
|
||||
patientName: c.patientName,
|
||||
healthcareName: c.appointmentType,
|
||||
practitionerName: c.doctor
|
||||
practitionerName: c.doctor,
|
||||
practitionerId: c.practitionerId ?? null,
|
||||
roomNo: c.roomNo ?? c.room ?? null
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user