|
@@ -223,7 +223,7 @@ public class UserTicketOrderController extends BaseApiController {
|
|
|
if (null == orderSettleVO) {
|
|
|
return AjaxResult.error("订单已过期,请重新下单");
|
|
|
}
|
|
|
-
|
|
|
+ String repeatSubmitKey = RedisKey.build(RedisKey.LIMIT_USER_REPEAT_SUBMIT, userId, orderSettleVO.getBoxId());
|
|
|
TicketBox ticketBox = ticketBoxService.getById(orderSettleVO.getBoxId());
|
|
|
if (TicketBoxStatusEnum.STOP.getValue().equals(ticketBox.getStatus().getValue())) {
|
|
|
return AjaxResult.error("盲票已停售!");
|
|
@@ -236,6 +236,13 @@ public class UserTicketOrderController extends BaseApiController {
|
|
|
return AjaxResult.error("您已领取过盲票!");
|
|
|
}
|
|
|
}
|
|
|
+ //限制前端重复提交请求
|
|
|
+ String repeatSubmitRecord = redisCache.getCacheObject(repeatSubmitKey);
|
|
|
+ if (StringUtils.isNotBlank(repeatSubmitRecord)) {
|
|
|
+ return AjaxResult.error("请稍候点击!");
|
|
|
+ }else {
|
|
|
+ redisCache.setCacheObject(repeatSubmitKey, "用户userId:"+userId+"已请求", 3, TimeUnit.SECONDS);
|
|
|
+ }
|
|
|
|
|
|
String orderId = userTicketOrderService.submitOrder(userId, orderSettleVO, userShareVO);
|
|
|
JSONObject jsonObject = new JSONObject();
|