Fix Bug #506: fallback修复
This commit is contained in:
@@ -15,9 +15,9 @@ import java.util.Map;
|
||||
* - 新增常量 {@link #ORDER_STATUS_CANCELLED},统一使用 PRD 中定义的 “CANCELLED” 状态码。
|
||||
* - 新增方法 {@link #updateOrderStatusToCancelled(Long,String)},用于在门诊诊前退号后将医嘱状态更新为
|
||||
* PRD 定义的 “CANCELLED”。原实现使用硬编码的 'RETURNED',导致状态不一致,触发 Bug #506。
|
||||
* - **新增方法 {@link #selectOrderDetailById(Long)}**,显式返回诊疗目录配置的总量单位字段,
|
||||
* - 新增方法 {@link #selectOrderDetailById(Long)},显式返回诊疗目录配置的总量单位字段,
|
||||
* 解决医嘱录入后总量单位显示为 “null” 的 Bug #561。
|
||||
* - **新增方法 {@link #updateOrderStatusToPaid(Long, String)}**,在支付成功后将订单状态更新为
|
||||
* - 新增方法 {@link #updateOrderStatusToPaid(Long,String)},在支付成功后将订单状态更新为
|
||||
* PRD 中定义的 “PAID”。该方法在 {@link com.openhis.web.outpatient.service.impl.RegistrationServiceImpl}
|
||||
* 中被调用,用以修复 Bug #574。
|
||||
*
|
||||
@@ -48,29 +48,20 @@ public interface OrderMapper {
|
||||
/**
|
||||
* **新增**:查询医嘱详情并返回总量单位。
|
||||
*
|
||||
* 该查询通过关联诊疗目录(treatment_catalog)获取配置的 total_unit,
|
||||
* 防止前端展示时出现 null。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @return 包含 id、itemName、totalQuantity、totalUnit 等字段的 Map
|
||||
* @return 包含医嘱详情的 Map,若不存在返回 null
|
||||
*/
|
||||
@Select(
|
||||
"SELECT " +
|
||||
" o.id AS id, " +
|
||||
" o.item_name AS itemName, " +
|
||||
" o.total_quantity AS totalQuantity, " +
|
||||
" COALESCE(c.total_unit, o.total_unit) AS totalUnit " + // 若目录无对应记录,回退到订单表字段
|
||||
"FROM his_order o " +
|
||||
"LEFT JOIN treatment_catalog c ON o.catalog_id = c.id " +
|
||||
"WHERE o.id = #{orderId}"
|
||||
)
|
||||
@Select("SELECT o.id, o.item_name, o.total_quantity, c.total_unit " +
|
||||
"FROM his_order o " +
|
||||
"LEFT JOIN treatment_catalog c ON o.catalog_id = c.id " +
|
||||
"WHERE o.id = #{orderId}")
|
||||
Map<String, Object> selectOrderDetailById(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为已支付。
|
||||
* 将医嘱状态更新为已支付(PAID)。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @param status 状态码,建议使用 {@link #ORDER_STATUS_PAID}
|
||||
* @param status 目标状态,建议使用 {@link #ORDER_STATUS_PAID}
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update("UPDATE his_order SET status = #{status} WHERE id = #{orderId}")
|
||||
@@ -78,15 +69,33 @@ public interface OrderMapper {
|
||||
@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 将医嘱状态更新为已取消(退号)。
|
||||
* 将医嘱状态更新为取消(CANCELLED),用于诊前退号。
|
||||
*
|
||||
* @param orderId 医嘱主键
|
||||
* @param status 状态码,建议使用 {@link #ORDER_STATUS_CANCELLED}
|
||||
* @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);
|
||||
@Param("status") String status);
|
||||
|
||||
// 其他已有方法(分页查询待写病历等)保持不变
|
||||
/**
|
||||
* 分页查询待写病历的医嘱(仅返回前端需要的字段),用于提升页面加载速度。
|
||||
*
|
||||
* @param doctorId 医生 ID
|
||||
* @param offset 分页起始位置
|
||||
* @param limit 每页记录数
|
||||
* @return 医嘱列表
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT o.id, o.item_name, o.status " +
|
||||
"FROM his_order o " +
|
||||
"WHERE o.doctor_id = #{doctorId} " +
|
||||
" AND o.status = 'COMPLETED' " +
|
||||
"ORDER BY o.created_time DESC " +
|
||||
"LIMIT #{limit} OFFSET #{offset}" +
|
||||
"</script>")
|
||||
List<Map<String, Object>> selectPendingMedicalRecords(@Param("doctorId") Long doctorId,
|
||||
@Param("offset") int offset,
|
||||
@Param("limit") int limit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user