diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java index 24f7f493..d4f05012 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/booking/TbShopTableBookingController.java @@ -95,7 +95,7 @@ public class TbShopTableBookingController { return ResponseEntity.ok().body(list); } - @GetMapping("summary") + @PostMapping("summary") @ApiOperation("根据电话号码统计历史预订信息") public ResponseEntity summary(@RequestBody String[] phoneNos) { Map data = tbShopTableBookingService.summary(phoneNos); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java index 63a08eb9..84ef70f9 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/service/impl/TbShopTableBookingServiceImpl.java @@ -8,7 +8,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.lang.Assert; import cn.hutool.core.map.MapProxy; import cn.hutool.core.map.MapUtil; -import cn.hutool.core.util.RandomUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import cn.ysk.cashier.dto.booking.ShopTableBookingDTO; import cn.ysk.cashier.exception.BadRequestException; @@ -129,8 +129,9 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl 0) { throw new BadRequestException(StrUtil.format("该台桌{}档在{}已被预订", BOOKING_TYPE.get(entity.getBookingType()), DateUtil.formatDate(entity.getBookingDate()))); } - String randomStr = RandomUtil.randomString(RandomUtil.BASE_CHAR_NUMBER, 4); - String orderNo = DateUtil.format(new Date(), "yyMMddHHmmss") + "-" + randomStr.toUpperCase(); + String nextId = IdUtil.getSnowflakeNextIdStr(); + String seq = StrUtil.sub(nextId, -5, nextId.length()); + String orderNo = DateUtil.format(new Date(), "yyMMddHHmmss") + seq; entity.setOrderNo("BK" + orderNo); entity.setStatus(20); entity.setCreateTime(new Date()); @@ -277,4 +278,15 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl