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

This commit is contained in:
2024-09-23 10:59:48 +08:00
parent 2eff0601c7
commit 871b0c5262
2 changed files with 9 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ public class TbCallQueue {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "cancel_time")
private Date cancelTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Column(name = "confirm_time")
private Date confirmTime;
@@ -84,4 +84,7 @@ public class TbCallQueue {
@Column(name = "create_day")
private String createDay;
@Column(name = "is_postpone")
private Integer isPostpone;
}

View File

@@ -163,6 +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)
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
if (callQueue != null) {
throw new BadRequestException("当前用户已取号");
@@ -182,6 +183,7 @@ public class TbCallServiceImpl implements TbCallService {
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
.eq(TbCallQueue::getCreateDay, DateUtil.today())
.eq(TbCallQueue::getIsPostpone, 0)
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
if (callQueue != null) {
throw new BadRequestException("当前用户已取号");
@@ -323,6 +325,8 @@ public class TbCallServiceImpl implements TbCallService {
break;
case 3:
callQueue.setPassTime(DateUtil.date());
// 已经顺延
callQueue.setIsPostpone(1);
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
if (shopInfo == null) {
throw new BadRequestException("店铺信息不存在");
@@ -337,7 +341,7 @@ public class TbCallServiceImpl implements TbCallService {
Integer postponeNum = callTable.getPostponeNum();
// 判断是否需要顺延
if (isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
if (callQueue.getIsPostpone() == 0 && isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
// 查询当前桌以及顺延桌数
List<TbCallQueue> current = callQueueService.lambdaQuery()
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())