Fix Bug #574: fallback修复

This commit is contained in:
2026-05-27 00:40:24 +08:00
parent e9dbc59953
commit b460e1dad2
2 changed files with 26 additions and 11 deletions

View File

@@ -47,16 +47,35 @@ public interface OrderMapper {
/**
* **新增**:查询医嘱详情并返回总量单位。
*
* <p>诊疗目录中配置的单位保存在列 {@code total_unit_name},前端 DTO 期望的属性名为 {@code totalUnit}。
* 通过别名映射确保返回的 Map 中包含键 {@code totalUnit},从而避免前端显示 {@code null}。</p>
* <p>诊疗目录中配置的单位保存在列 {@code total_unit_name},前端 DTO 期望的属性名为 {@code totalUnit}。</p>
*
* @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<String, Object> 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保持不变
}

View File

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