挂账需求和电话机预约需求
This commit is contained in:
parent
60a5ccde5b
commit
e82ba91551
|
|
@ -95,7 +95,7 @@ public class TbShopTableBookingController {
|
||||||
return ResponseEntity.ok().body(list);
|
return ResponseEntity.ok().body(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("summary")
|
@PostMapping("summary")
|
||||||
@ApiOperation("根据电话号码统计历史预订信息")
|
@ApiOperation("根据电话号码统计历史预订信息")
|
||||||
public ResponseEntity summary(@RequestBody String[] phoneNos) {
|
public ResponseEntity summary(@RequestBody String[] phoneNos) {
|
||||||
Map<String, Object> data = tbShopTableBookingService.summary(phoneNos);
|
Map<String, Object> data = tbShopTableBookingService.summary(phoneNos);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.hutool.core.map.MapProxy;
|
import cn.hutool.core.map.MapProxy;
|
||||||
import cn.hutool.core.map.MapUtil;
|
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.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.dto.booking.ShopTableBookingDTO;
|
import cn.ysk.cashier.dto.booking.ShopTableBookingDTO;
|
||||||
import cn.ysk.cashier.exception.BadRequestException;
|
import cn.ysk.cashier.exception.BadRequestException;
|
||||||
|
|
@ -129,8 +129,9 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
|
||||||
if (existCount > 0) {
|
if (existCount > 0) {
|
||||||
throw new BadRequestException(StrUtil.format("该台桌{}档在{}已被预订", BOOKING_TYPE.get(entity.getBookingType()), DateUtil.formatDate(entity.getBookingDate())));
|
throw new BadRequestException(StrUtil.format("该台桌{}档在{}已被预订", BOOKING_TYPE.get(entity.getBookingType()), DateUtil.formatDate(entity.getBookingDate())));
|
||||||
}
|
}
|
||||||
String randomStr = RandomUtil.randomString(RandomUtil.BASE_CHAR_NUMBER, 4);
|
String nextId = IdUtil.getSnowflakeNextIdStr();
|
||||||
String orderNo = DateUtil.format(new Date(), "yyMMddHHmmss") + "-" + randomStr.toUpperCase();
|
String seq = StrUtil.sub(nextId, -5, nextId.length());
|
||||||
|
String orderNo = DateUtil.format(new Date(), "yyMMddHHmmss") + seq;
|
||||||
entity.setOrderNo("BK" + orderNo);
|
entity.setOrderNo("BK" + orderNo);
|
||||||
entity.setStatus(20);
|
entity.setStatus(20);
|
||||||
entity.setCreateTime(new Date());
|
entity.setCreateTime(new Date());
|
||||||
|
|
@ -277,4 +278,15 @@ public class TbShopTableBookingServiceImpl extends ServiceImpl<TbShopTableBookin
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String s = IdUtil.nanoId();
|
||||||
|
String s1 = IdUtil.objectId();
|
||||||
|
System.out.println(s);
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
|
String s2 = IdUtil.getSnowflakeNextIdStr();
|
||||||
|
System.out.println(s2);
|
||||||
|
System.out.println(StrUtil.sub(s2, -5, s2.length()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue