diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCallQueue.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCallQueue.java index 7482973d..5e70f71c 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCallQueue.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/entity/TbCallQueue.java @@ -73,4 +73,7 @@ public class TbCallQueue { @Column(name = "call_num") private String callNum; + @Column(name = "create_day") + private String createDay; + } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/app/TbCallServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/app/TbCallServiceImpl.java index 69bb7cb9..b76b9f7a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/app/TbCallServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/app/TbCallServiceImpl.java @@ -145,6 +145,7 @@ public class TbCallServiceImpl implements TbCallService { .eq(TbCallQueue::getUserId, shopUser.getId()) .eq(TbCallQueue::getShopId, takeNumberDTO.getShopId()) .in(TbCallQueue::getState, 0, 1) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one(); if (callQueue != null) { throw new BadRequestException("当前用户已取号"); @@ -163,6 +164,7 @@ public class TbCallServiceImpl implements TbCallService { callQueue = callQueueService.lambdaQuery() .eq(TbCallQueue::getPhone, takeNumberDTO.getPhone()) .eq(TbCallQueue::getShopId, takeNumberDTO.getShopId()) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one(); if (callQueue != null) { throw new BadRequestException("当前用户已取号"); @@ -174,6 +176,7 @@ public class TbCallServiceImpl implements TbCallService { callQueue.setSubState(1); } + callQueue.setCreateDay(DateUtil.today()); callQueue.setCallNum(getCallNumber(takeNumberDTO.getShopId(), callTable)); callQueue.setCreateTime(DateUtil.date().toInstant()); callQueue.setShopId(shopInfo.getId()); @@ -186,6 +189,7 @@ public class TbCallServiceImpl implements TbCallService { public Object call(CallQueueDTO callQueueDTO) { TbCallQueue callQueue = callQueueService.lambdaQuery() .notIn(TbCallQueue::getState, -1, 2) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .eq(TbCallQueue::getShopId, callQueueDTO.getShopId()) .one(); @@ -210,6 +214,7 @@ public class TbCallServiceImpl implements TbCallService { List current = callQueueService.lambdaQuery() .eq(TbCallQueue::getCallTableId, callQueue.getCallTableId()) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .and(r -> { r.eq(TbCallQueue::getState, 1) .or() @@ -251,6 +256,7 @@ public class TbCallServiceImpl implements TbCallService { public Object updateInfo(UpdateCallQueueDTO updateCallQueueDTO) { TbCallQueue callQueue = callQueueService.lambdaQuery() .eq(TbCallQueue::getShopId, updateCallQueueDTO.getShopId()) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .eq(TbCallQueue::getId, updateCallQueueDTO.getCallQueueId()).one(); if (callQueue == null) { throw new BadRequestException("叫号用户不存在"); @@ -303,6 +309,7 @@ public class TbCallServiceImpl implements TbCallService { pageInfo.getRecords().forEach(item -> { Long count = callQueueService.lambdaQuery() .eq(TbCallQueue::getCallTableId, item.getId()) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .in(TbCallQueue::getState, 0, 1) .count(); @@ -353,6 +360,7 @@ public class TbCallServiceImpl implements TbCallService { LambdaQueryChainWrapper query = callQueueService.lambdaQuery() .eq(TbCallQueue::getShopId, shopId) + .eq(TbCallQueue::getCreateDay, DateUtil.today()) .in(TbCallQueue::getCallTableId, tableIds); if (state != null) { query.eq(TbCallQueue::getState, state);