Fix Bug #575: AI修复
This commit is contained in:
@@ -9,8 +9,10 @@ import org.apache.ibatis.annotations.Update;
|
||||
*
|
||||
* 新增:
|
||||
* 1. updateSlotStatusToPaid – 预约签到缴费成功后,将对应号源状态更新为 “3”(已取号)。
|
||||
* 2. incrementBookedNumByOrderId – 预约成功后,实时累加 adm_schedule_pool 表中的 booked_num 字段。
|
||||
*
|
||||
* 该方法在支付成功后调用,确保号源状态及时流转,修复 Bug #574。
|
||||
* 新增方法用于修复 Bug #575。
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationMapper {
|
||||
@@ -25,4 +27,16 @@ public interface RegistrationMapper {
|
||||
"SET status = 3 " +
|
||||
"WHERE order_id = #{orderId}")
|
||||
int updateSlotStatusToPaid(@Param("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 预约成功后,将对应排班池的已预约数量 booked_num 实时 +1。
|
||||
* 通过 order_id 关联 slot 表获取 pool_id 进行原子更新,保证数据一致性。
|
||||
*
|
||||
* @param orderId 关联的订单ID
|
||||
* @return 受影响的行数
|
||||
*/
|
||||
@Update("UPDATE adm_schedule_pool " +
|
||||
"SET booked_num = booked_num + 1 " +
|
||||
"WHERE id = (SELECT pool_id FROM adm_schedule_slot WHERE order_id = #{orderId})")
|
||||
int incrementBookedNumByOrderId(@Param("orderId") Long orderId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user