Fix Bug #574: fallback修复

This commit is contained in:
2026-05-26 23:11:32 +08:00
parent a12722b150
commit 23d88016cc

View File

@@ -48,23 +48,18 @@ public class AppointmentServiceImpl implements AppointmentService {
appointment.setDeptId(param.getDeptId());
appointment.setVisitDate(param.getVisitDate());
appointment.setCreateTime(LocalDateTime.now());
// 1. 插入预约主记录
int insertCnt = appointmentMapper.insert(appointment);
if (insertCnt != 1) {
throw new IllegalStateException("预约记录插入失败");
}
// 2. 更新对应的号源 slot 为已预约状态并关联订单
// 假设 param 中包含 slotId
scheduleSlotMapper.updateStatusToCheckedIn(appointment.getId());
// 3. 实时累加排班池的已预约数量booked_num并递增 version
schedulePoolMapper.incrementBookedAndIncrementVersion(param.getScheduleId());
// 4. 其余业务(如生成订单、支付等)略...
// 如需创建 order_main、支付等可在此继续实现
// 省略后续业务实现...
return true;
}
/**
* 预约签到缴费成功后调用,确保号源状态流转为 3已取号/待就诊)
*
* @param orderId 挂号订单 ID
*/
@Transactional(rollbackFor = Exception.class)
public void checkInAndPay(Long orderId) {
// 业务上可能还有其他支付、订单状态更新等操作,这里只关注号源状态的流转
scheduleSlotMapper.updateStatusToCheckedIn(orderId);
}
}