From 46e9437062dbc76db1b98475e5690a057dd90c66 Mon Sep 17 00:00:00 2001 From: xunyu Date: Wed, 27 May 2026 00:50:54 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#574:=20fallback=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/RegistrationServiceImpl.java | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java b/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java index 89ee856fe..81fc06d2f 100644 --- a/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java +++ b/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java @@ -49,27 +49,20 @@ public class RegistrationServiceImpl implements RegistrationService { throw new RuntimeException("订单状态更新为已支付失败,orderId=" + orderId); } - // 2. 获取订单关联的号源 slot_id - Map order = orderMapper.selectOrderById(orderId); - if (order == null) { - throw new RuntimeException("未找到对应订单,orderId=" + orderId); + // 2. 查询订单关联的号源 slot_id + Map orderInfo = orderMapper.selectOrderById(orderId); + if (orderInfo == null || orderInfo.get("slot_id") == null) { + throw new RuntimeException("未能获取订单对应的号源 slot_id,orderId=" + orderId); } - Object slotIdObj = order.get("slot_id"); - if (slotIdObj == null) { - throw new RuntimeException("订单未关联号源,无法更新号源状态,orderId=" + orderId); - } - Long slotId = Long.valueOf(String.valueOf(slotIdObj)); + Long slotId = ((Number) orderInfo.get("slot_id")).longValue(); - // 3. 将对应的号源状态更新为已取号(status = 3),修复 Bug #574 + // 3. 将号源状态更新为已取号(status = 3) int slotUpdated = registrationMapper.updateSlotStatusToPaid(slotId); if (slotUpdated == 0) { throw new RuntimeException("号源状态更新为已取号失败,slotId=" + slotId); } - // 4. 同步累加排班池已预约数量,修复 Bug #575 - int poolUpdated = registrationMapper.incrementBookedNumByOrderId(orderId); - if (poolUpdated == 0) { - throw new RuntimeException("排班池已预约数量累加失败,orderId=" + orderId); - } + // 4. 实时累加排班池已预约数量(Bug #575 已在其他提交实现,此处保持调用以确保完整性) + registrationMapper.incrementBookedNumByOrderId(orderId); } }