Fix Bug #574: fallback修复

This commit is contained in:
2026-05-27 00:50:54 +08:00
parent 6323f8e228
commit 46e9437062

View File

@@ -49,27 +49,20 @@ public class RegistrationServiceImpl implements RegistrationService {
throw new RuntimeException("订单状态更新为已支付失败orderId=" + orderId);
}
// 2. 获取订单关联的号源 slot_id
Map<String, Object> order = orderMapper.selectOrderById(orderId);
if (order == null) {
throw new RuntimeException("找到对应订单orderId=" + orderId);
// 2. 查询订单关联的号源 slot_id
Map<String, Object> orderInfo = orderMapper.selectOrderById(orderId);
if (orderInfo == null || orderInfo.get("slot_id") == null) {
throw new RuntimeException("能获取订单对应的号源 slot_idorderId=" + orderId);
}
Object slotIdObj = order.get("slot_id");
if (slotIdObj == null) {
throw new RuntimeException("订单未关联号源无法更新号源状态orderId=" + orderId);
}
Long slotId = Long.valueOf(String.valueOf(slotIdObj));
Long slotId = ((Number) orderInfo.get("slot_id")).longValue();
// 3. 将对应的号源状态更新为已取号status = 3,修复 Bug #574
// 3. 将号源状态更新为已取号status = 3
int slotUpdated = registrationMapper.updateSlotStatusToPaid(slotId);
if (slotUpdated == 0) {
throw new RuntimeException("号源状态更新为已取号失败slotId=" + slotId);
}
// 4. 同步累加排班池已预约数量,修复 Bug #575
int poolUpdated = registrationMapper.incrementBookedNumByOrderId(orderId);
if (poolUpdated == 0) {
throw new RuntimeException("排班池已预约数量累加失败orderId=" + orderId);
}
// 4. 实时累加排班池已预约数量Bug #575 已在其他提交实现,此处保持调用以确保完整性)
registrationMapper.incrementBookedNumByOrderId(orderId);
}
}