Fix Bug #574: fallback修复
This commit is contained in:
@@ -48,23 +48,18 @@ public class AppointmentServiceImpl implements AppointmentService {
|
|||||||
appointment.setDeptId(param.getDeptId());
|
appointment.setDeptId(param.getDeptId());
|
||||||
appointment.setVisitDate(param.getVisitDate());
|
appointment.setVisitDate(param.getVisitDate());
|
||||||
appointment.setCreateTime(LocalDateTime.now());
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约签到缴费成功后调用,确保号源状态流转为 3(已取号/待就诊)
|
||||||
|
*
|
||||||
|
* @param orderId 挂号订单 ID
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void checkInAndPay(Long orderId) {
|
||||||
|
// 业务上可能还有其他支付、订单状态更新等操作,这里只关注号源状态的流转
|
||||||
|
scheduleSlotMapper.updateStatusToCheckedIn(orderId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user