Fix Bug #574: fallback修复
This commit is contained in:
@@ -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_id,orderId=" + 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user