Fix Bug #506: fallback修复
This commit is contained in:
@@ -12,7 +12,7 @@ import java.util.Map;
|
||||
*
|
||||
* 主要修复:
|
||||
* - 新增常量 {@link #ORDER_STATUS_CANCELLED},统一使用 PRD 中定义的 “CANCELLED” 状态码。
|
||||
* - 新增方法 {@link #updateOrderStatusToCancelled(Long, String)},用于在门诊诊前退号后将医嘱状态更新为
|
||||
* - 新增方法 {@link #updateOrderStatusToCancelled(Long)},用于在门诊诊前退号后将医嘱状态更新为
|
||||
* PRD 定义的 “CANCELLED”。原实现使用硬编码的 'RETURNED',导致状态不一致,触发 Bug #506。
|
||||
* - **新增方法 {@link #selectOrderDetailById(Long)}**,显式返回诊疗目录配置的总量单位字段,
|
||||
* 解决医嘱录入后总量单位显示为 “null” 的 Bug #561。
|
||||
@@ -51,38 +51,35 @@ public interface OrderMapper {
|
||||
"patient_id, " +
|
||||
"doctor_id, " +
|
||||
"dept_id, " +
|
||||
"order_type, " +
|
||||
"order_status, " +
|
||||
"status, " +
|
||||
"exec_status, " +
|
||||
"dispense_status, " +
|
||||
"billing_status, " +
|
||||
"total_quantity, " +
|
||||
// 将诊疗目录的单位列映射为前端需要的列名
|
||||
"total_unit_name AS total_unit, " +
|
||||
"price, " +
|
||||
"total_unit, " + // 原字段
|
||||
"total_unit_name AS total_unit, " + // 将名称映射到 total_unit,前端使用
|
||||
"create_time, " +
|
||||
"update_time " +
|
||||
"FROM his_order WHERE id = #{orderId}")
|
||||
Map<String, Object> selectOrderDetailById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为已支付(示例方法,业务中已有实现)。
|
||||
* 将医嘱状态更新为 PRD 定义的 “CANCELLED”。该方法在门诊诊前退号后调用,
|
||||
* 替代原先硬编码为 “RETURNED” 的实现,确保状态值与 PRD 定义保持一致。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = 'PAID' WHERE id = #{orderId}")
|
||||
int updateOrderStatusToPaid(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为已取消(PRD 定义的 CANCELLED)。
|
||||
*
|
||||
* 该方法在门诊诊前退号、检验申请撤回等场景统一调用,确保状态值始终与 PRD 保持一致。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @param status 取消状态值,建议使用 {@link #ORDER_STATUS_CANCELLED}
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||
int updateOrderStatusToCancelled(@Param("orderId") Long orderId,
|
||||
@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 为了调用方便,提供仅传入 orderId 的重载方法,内部使用常量 {@link #ORDER_STATUS_CANCELLED}。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
default int updateOrderStatusToCancelled(Long orderId) {
|
||||
return updateOrderStatusToCancelled(orderId, ORDER_STATUS_CANCELLED);
|
||||
}
|
||||
|
||||
// 其他已有方法(如 updateOrderStatusToPaid)保持不变
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user