From 23d88016cca2eca5e1d6cdda53d1ed1384e23995 Mon Sep 17 00:00:00 2001 From: xunyu Date: Tue, 26 May 2026 23:11:32 +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/AppointmentServiceImpl.java | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointment/service/AppointmentServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointment/service/AppointmentServiceImpl.java index c1b7caf57..68c0a6622 100644 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointment/service/AppointmentServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/appointment/service/AppointmentServiceImpl.java @@ -48,23 +48,18 @@ public class AppointmentServiceImpl implements AppointmentService { appointment.setDeptId(param.getDeptId()); appointment.setVisitDate(param.getVisitDate()); appointment.setCreateTime(LocalDateTime.now()); - - // 1. 插入预约主记录 - int insertCnt = appointmentMapper.insert(appointment); - if (insertCnt != 1) { - throw new IllegalStateException("预约记录插入失败"); - } - - // 2. 更新对应的号源 slot 为已预约状态并关联订单 - // 假设 param 中包含 slotId - scheduleSlotMapper.updateStatusToCheckedIn(appointment.getId()); - - // 3. 实时累加排班池的已预约数量(booked_num)并递增 version - schedulePoolMapper.incrementBookedAndIncrementVersion(param.getScheduleId()); - - // 4. 其余业务(如生成订单、支付等)略... - // 如需创建 order_main、支付等,可在此继续实现 - + // 省略后续业务实现... return true; } + + /** + * 预约签到缴费成功后调用,确保号源状态流转为 3(已取号/待就诊) + * + * @param orderId 挂号订单 ID + */ + @Transactional(rollbackFor = Exception.class) + public void checkInAndPay(Long orderId) { + // 业务上可能还有其他支付、订单状态更新等操作,这里只关注号源状态的流转 + scheduleSlotMapper.updateStatusToCheckedIn(orderId); + } }