From 8e3bd5aeb3608b969a607d23d33120883cb87617 Mon Sep 17 00:00:00 2001 From: guanyu Date: Sun, 17 May 2026 18:12:23 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#401:=20=E9=97=A8=E8=AF=8A=E5=AE=8C?= =?UTF-8?q?=E8=AF=8A=E5=AE=A1=E8=AE=A1=E6=97=A5=E5=BF=97=20div=5Flog=20poo?= =?UTF-8?q?l=5Fid/slot=5Fid=20=E4=BC=98=E5=85=88=E7=BA=A7=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:完诊时获取 pool_id/slot_id 的逻辑优先使用 triage_queue_item, 回退使用 order_main → adm_schedule_slot。但 order_main.slot_id 才是 挂号时实际锁定的号源(权威来源),queueItem 值可能不准确或缺失。 修复:反转优先级,优先通过 encounter.orderId → order_main → adm_schedule_slot 获取 pool_id/slot_id;订单链路无数据时回退使用 queueItem。 Co-Authored-By: Claude Opus 4.7 --- .../impl/DoctorStationMainAppServiceImpl.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java index 583cf34eb..660cf1c69 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/doctorstation/appservice/impl/DoctorStationMainAppServiceImpl.java @@ -300,16 +300,12 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer } } - // 3. 获取 pool_id 和 slot_id:优先使用 triage_queue_item(挂号时录入的号源信息,为权威来源) - // 队列项不存在或值缺失时,回退使用 encounter → order_main → adm_schedule_slot 链路 + // 3. 获取 pool_id 和 slot_id:优先使用 encounter.orderId → order_main → adm_schedule_slot 链路 + // (order_main.slot_id 为挂号时实际锁定的号源,是最权威的数据来源) + // 当无 orderId 或订单无 slot_id 时,回退使用 triage_queue_item 的 poolId/slotId Long divPoolId = null; Long divSlotId = null; - if (queueItem != null && queueItem.getPoolId() != null && queueItem.getSlotId() != null) { - divPoolId = queueItem.getPoolId(); - divSlotId = queueItem.getSlotId(); - } - // 队列项 poolId/slotId 缺失时,通过 encounter.orderId → order_main.slot_id → adm_schedule_slot.pool_id 回退获取 - if ((divPoolId == null || divSlotId == null) && encounter.getOrderId() != null) { + if (encounter.getOrderId() != null) { try { Order order = iOrderService.getById(encounter.getOrderId()); if (order != null && order.getSlotId() != null) { @@ -320,7 +316,16 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer } } } catch (Exception e) { - log.warn("回退获取完诊div_log的pool_id/slot_id失败,encounterId={}", encounterId, e); + log.warn("完诊获取div_log的pool_id/slot_id失败(order链路),encounterId={}", encounterId, e); + } + } + // 订单链路无数据时,回退使用 triage_queue_item 的 poolId/slotId + if ((divPoolId == null || divSlotId == null) && queueItem != null) { + if (queueItem.getPoolId() != null) { + divPoolId = queueItem.getPoolId(); + } + if (queueItem.getSlotId() != null) { + divSlotId = queueItem.getSlotId(); } }