Fix Bug #574: AI修复
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.openhis.web.appointment.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 排班号源数据库操作 Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScheduleSlotMapper {
|
||||
|
||||
/**
|
||||
* Bug #574 Fix: 预约签到缴费成功后,将号源状态流转为 3(已取号/待就诊)
|
||||
* 根因:原签到缴费流程未触发 adm_schedule_slot 状态更新,或错误更新为 1(已预约)
|
||||
* 修复:显式执行状态流转 SQL,确保事务内同步更新
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.openhis.web.appointment.service;
|
||||
|
||||
import com.openhis.web.appointment.entity.Appointment;
|
||||
import com.openhis.web.appointment.mapper.AppointmentMapper;
|
||||
import com.openhis.web.appointment.mapper.ScheduleSlotMapper;
|
||||
import com.openhis.web.appointment.dto.AppointmentParam;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 门诊预约挂号服务实现
|
||||
@@ -15,9 +17,11 @@ import java.time.LocalDateTime;
|
||||
public class AppointmentServiceImpl implements AppointmentService {
|
||||
|
||||
private final AppointmentMapper appointmentMapper;
|
||||
private final ScheduleSlotMapper scheduleSlotMapper;
|
||||
|
||||
public AppointmentServiceImpl(AppointmentMapper appointmentMapper) {
|
||||
public AppointmentServiceImpl(AppointmentMapper appointmentMapper, ScheduleSlotMapper scheduleSlotMapper) {
|
||||
this.appointmentMapper = appointmentMapper;
|
||||
this.scheduleSlotMapper = scheduleSlotMapper;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -53,4 +57,18 @@ public class AppointmentServiceImpl implements AppointmentService {
|
||||
public List<Appointment> listAppointmentsByStatus(Integer status) {
|
||||
return appointmentMapper.selectByStatus(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bug #574 Fix: 预约签到缴费成功后,更新号源状态为 3(已取号)
|
||||
* 该方法应在支付回调或门诊挂号签到接口中调用,确保状态及时流转
|
||||
*
|
||||
* @param orderId 挂号订单ID
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean completeCheckInAndPayment(Long orderId) {
|
||||
int rows = scheduleSlotMapper.updateStatusToCheckedIn(orderId);
|
||||
return rows > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user