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. (可选)如果还有其他业务,如发送通知等,可在此继续处理 } }