排队取号顺延之后支持重复取号

扫码取号实现
This commit is contained in:
SongZhang 2024-09-23 11:16:33 +08:00
parent 871b0c5262
commit 1ab55c2c46
1 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,7 @@ public class TbCallServiceImpl implements TbCallService {
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
.in(TbCallQueue::getState, 0, 1)
.eq(TbCallQueue::getCreateDay, DateUtil.today())
.eq(TbCallQueue::getIsPostpone, 0)
.ne(TbCallQueue::getIsPostpone, 2)
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
if (callQueue != null) {
throw new BadRequestException("当前用户已取号");
@ -326,7 +326,7 @@ public class TbCallServiceImpl implements TbCallService {
case 3:
callQueue.setPassTime(DateUtil.date());
// 已经顺延
callQueue.setIsPostpone(1);
callQueue.setIsPostpone(callQueue.getIsPostpone() == 0 ? 1 : 2);
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
if (shopInfo == null) {
throw new BadRequestException("店铺信息不存在");
@ -455,7 +455,7 @@ public class TbCallServiceImpl implements TbCallService {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
// 生成二维码图片输出到字节数组输出流
QrCodeUtil.generate("Your QR Code Content Here", config, "png", outputStream);
QrCodeUtil.generate(StrUtil.format(callPageUrl, shopId, ""), config, "png", outputStream);
// 将图片转换为 Base64 字符串
String base64 = Base64.getEncoder().encodeToString(outputStream.toByteArray());