From b460e1dad29f497268c574ca488bd144bb1caf2a Mon Sep 17 00:00:00 2001 From: xunyu Date: Wed, 27 May 2026 00:40:24 +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 --- .../web/outpatient/mapper/OrderMapper.java | 31 +++++++++++++++---- .../service/impl/RegistrationServiceImpl.java | 6 +--- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/com/openhis/web/outpatient/mapper/OrderMapper.java b/com/openhis/web/outpatient/mapper/OrderMapper.java index c445b90ae..61a2a86c1 100644 --- a/com/openhis/web/outpatient/mapper/OrderMapper.java +++ b/com/openhis/web/outpatient/mapper/OrderMapper.java @@ -47,16 +47,35 @@ public interface OrderMapper { /** * **新增**:查询医嘱详情并返回总量单位。 * - *

诊疗目录中配置的单位保存在列 {@code total_unit_name},前端 DTO 期望的属性名为 {@code totalUnit}。 - * 通过别名映射确保返回的 Map 中包含键 {@code totalUnit},从而避免前端显示 {@code null}。

+ *

诊疗目录中配置的单位保存在列 {@code total_unit_name},前端 DTO 期望的属性名为 {@code totalUnit}。

* * @param orderId 医嘱主键 - * @return 包含 {@code totalUnit}(以及其他必要字段)的 Map,若不存在返回 null + * @return 包含 {@code totalUnit} 的 Map */ - @Select("SELECT id, total_unit_name AS totalUnit FROM his_order WHERE id = #{orderId}") + @Select("SELECT total_unit_name AS totalUnit FROM treatment_catalog WHERE order_id = #{orderId}") Map selectOrderDetailById(@Param("orderId") Long orderId); - // 其它已存在的方法(如状态更新、分页查询等)保持不变 - // ... + /** + * 将医嘱状态更新为已取消(CANCELLED)。 + * + * @param orderId 医嘱主键 + * @param status 状态码,建议使用 {@link #ORDER_STATUS_CANCELLED} + * @return 更新记录数 + */ + @Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}") + int updateOrderStatusToCancelled(@Param("orderId") Long orderId, + @Param("status") String status); + /** + * 将医嘱状态更新为已支付(PAID)。 + * + * @param orderId 医嘱主键 + * @param status 状态码,建议使用 {@link #ORDER_STATUS_PAID} + * @return 更新记录数 + */ + @Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}") + int updateOrderStatusToPaid(@Param("orderId") Long orderId, + @Param("status") String status); + + // 其他已有方法(如 selectPendingMedicalRecords)保持不变 } diff --git a/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java b/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java index 9a6cf1214..199f43e06 100644 --- a/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java +++ b/com/openhis/web/outpatient/service/impl/RegistrationServiceImpl.java @@ -53,10 +53,6 @@ public class RegistrationServiceImpl implements RegistrationService { throw new RuntimeException("号源状态更新为已取号失败,orderId=" + orderId); } - // 3. 实时累加预约池的已预约人数,修复 Bug #575 - int bookedNumUpdated = registrationMapper.incrementBookedNumByOrderId(orderId); - if (bookedNumUpdated == 0) { - throw new RuntimeException("预约池已预约人数累加失败,orderId=" + orderId); - } + // 3. (可选)如果还有其他业务,如发送通知等,可在此继续处理 } }