Fix Bug #401: 门诊完诊审计日志 div_log pool_id/slot_id 优先级修复
根因:完诊时获取 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 <noreply@anthropic.com>
This commit is contained in:
@@ -300,16 +300,12 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 获取 pool_id 和 slot_id:优先使用 triage_queue_item(挂号时录入的号源信息,为权威来源)
|
// 3. 获取 pool_id 和 slot_id:优先使用 encounter.orderId → order_main → adm_schedule_slot 链路
|
||||||
// 队列项不存在或值缺失时,回退使用 encounter → order_main → adm_schedule_slot 链路
|
// (order_main.slot_id 为挂号时实际锁定的号源,是最权威的数据来源)
|
||||||
|
// 当无 orderId 或订单无 slot_id 时,回退使用 triage_queue_item 的 poolId/slotId
|
||||||
Long divPoolId = null;
|
Long divPoolId = null;
|
||||||
Long divSlotId = null;
|
Long divSlotId = null;
|
||||||
if (queueItem != null && queueItem.getPoolId() != null && queueItem.getSlotId() != null) {
|
if (encounter.getOrderId() != 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) {
|
|
||||||
try {
|
try {
|
||||||
Order order = iOrderService.getById(encounter.getOrderId());
|
Order order = iOrderService.getById(encounter.getOrderId());
|
||||||
if (order != null && order.getSlotId() != null) {
|
if (order != null && order.getSlotId() != null) {
|
||||||
@@ -320,7 +316,16 @@ public class DoctorStationMainAppServiceImpl implements IDoctorStationMainAppSer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} 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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user