From c3ecadcfe02874dbb17558fdec9d78b609a3162c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Tue, 2 Jun 2026 09:59:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(#575):=20=E9=80=80=E5=8F=B7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=85=BC=E5=AE=B9=20CHECKED=5FIN(3)=20=E7=8A=B6?= =?UTF-8?q?=E6=80=81=20+=20=E6=9F=A5=E8=AF=A2=E8=BF=87=E6=BB=A4=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug #574 将签到状态从 BOOKED(1) 改为 CHECKED_IN(3) 后, 退号流程只检查 BOOKED(1) 导致已签到患者无法退号。 修复: - OutpatientRegistrationAppServiceImpl: 退号检查兼容 BOOKED(1) 和 CHECKED_IN(3) - OutpatientRegistrationAppServiceImpl: 退号统计改用 refreshPoolStats 统一刷新 - ScheduleSlotMapper.xml: 'checked' 查询过滤兼容 status=1 和 status=3 --- .../OutpatientRegistrationAppServiceImpl.java | 15 +++++++-------- .../mapper/administration/ScheduleSlotMapper.xml | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java index ef6f7bd16..c92887ae4 100755 --- a/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java +++ b/openhis-server-new/openhis-application/src/main/java/com/openhis/web/chargemanage/appservice/impl/OutpatientRegistrationAppServiceImpl.java @@ -660,10 +660,12 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra return appointmentOrder.getId(); } - // 只有已预约(1)的号源才能退号,对应签到后的 BOOKED 状态 + // 已预约(1)或已签到(3)的号源都能退号 ScheduleSlot slot = scheduleSlotMapper.selectById(slotId); - if (slot == null || !SlotStatus.BOOKED.getValue().equals(slot.getStatus())) { - log.warn("退号跳过:槽位非已预约状态, slotId={}, status={}", slotId, + if (slot == null || + (!SlotStatus.BOOKED.getValue().equals(slot.getStatus()) && + !SlotStatus.CHECKED_IN.getValue().equals(slot.getStatus()))) { + log.warn("退号跳过:槽位状态不允许退号, slotId={}, status={}", slotId, slot != null ? slot.getStatus() : null); return appointmentOrder.getId(); } @@ -676,11 +678,8 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra Long poolId = scheduleSlotMapper.selectPoolIdBySlotId(slotId); if (poolId != null) { - schedulePoolMapper.update(null, - new LambdaUpdateWrapper() - .setSql("booked_num = booked_num - 1, version = version + 1") - .set(SchedulePool::getUpdateTime, new Date()) - .eq(SchedulePool::getId, poolId)); + // 退号时刷新池统计(兼容 BOOKED 和 CHECKED_IN 状态) + schedulePoolMapper.refreshPoolStats(poolId, SlotStatus.BOOKED.getValue(), SlotStatus.LOCKED.getValue()); } return appointmentOrder.getId(); } catch (Exception e) { diff --git a/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml b/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml index fd0ca01fb..8deea84ab 100755 --- a/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml +++ b/openhis-server-new/openhis-domain/src/main/resources/mapper/administration/ScheduleSlotMapper.xml @@ -340,8 +340,8 @@ OR d.is_stopped = FALSE ) - - AND = 1 + + AND ( = 1 OR = 3) AND ( d.is_stopped IS NULL OR d.is_stopped = FALSE