Fix Bug #574: AI修复
This commit is contained in:
@@ -2,33 +2,29 @@ package com.openhis.web.appointment.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 排班号源数据库操作 Mapper
|
||||
* 排班号源明细数据库操作 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScheduleSlotMapper {
|
||||
|
||||
/**
|
||||
* Bug #574 Fix: 预约签到缴费成功后,将号源状态流转为 3(已取号/待就诊)
|
||||
* 根因:原签到缴费流程未触发 adm_schedule_slot 状态更新,或错误更新为 1(已预约)
|
||||
* 修复:显式执行状态流转 SQL,确保事务内同步更新
|
||||
* 根据订单ID查询号源状态
|
||||
*/
|
||||
@Select("SELECT status FROM adm_schedule_slot WHERE order_id = #{orderId}")
|
||||
Integer selectStatusByOrderId(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* Bug #574 Fix: 预约签到缴费成功后,更新号源状态为 3(已取号/待就诊)
|
||||
* 根因:原业务在签到缴费流程中遗漏了对 adm_schedule_slot.status 的状态流转更新
|
||||
* 修复:补充状态更新 SQL,确保事务内同步落库
|
||||
*
|
||||
* @param orderId 挂号订单ID
|
||||
* @param orderId 挂号订单 ID
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot SET status = 3, update_time = NOW() WHERE order_id = #{orderId}")
|
||||
int updateStatusToCheckedIn(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* Bug #506 Fix: 门诊诊前退号后,回滚号源状态至待约(0)并清空关联订单
|
||||
* 根因:原退号逻辑未正确回滚号源状态,导致 status=5 且 order_id 残留,号源无法再次预约
|
||||
* 修复:显式更新 status=0, order_id=NULL
|
||||
*
|
||||
* @param orderId 挂号订单ID
|
||||
* @return 受影响行数
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_slot SET status = 0, order_id = NULL, update_time = NOW() WHERE order_id = #{orderId}")
|
||||
int rollbackSlotStatus(@Param("orderId") Long orderId);
|
||||
}
|
||||
|
||||
@@ -57,9 +57,12 @@ public class AppointmentServiceImpl implements AppointmentService {
|
||||
*
|
||||
* @param orderId 挂号订单 ID
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void checkInAndPay(Long orderId) {
|
||||
// 业务上可能还有其他支付、订单状态更新等操作,这里只关注号源状态的流转
|
||||
scheduleSlotMapper.updateStatusToCheckedIn(orderId);
|
||||
public void updateSlotStatusAfterCheckIn(Long orderId) {
|
||||
int rows = scheduleSlotMapper.updateStatusToCheckedIn(orderId);
|
||||
if (rows == 0) {
|
||||
throw new RuntimeException("号源状态更新失败,未找到对应订单记录: " + orderId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user