From 3873009e63fc25e182c27da137fcf9a533ed2e49 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Mon, 23 Sep 2024 11:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AB=E5=8F=B7=E8=AE=B0=E5=BD=95=E9=99=8D?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/mybatis/mapper/TbCallQueueMapper.java | 2 +- .../cn/ysk/cashier/service/impl/app/TbCallServiceImpl.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCallQueueMapper.java b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCallQueueMapper.java index 5c08c936..849824af 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCallQueueMapper.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/mybatis/mapper/TbCallQueueMapper.java @@ -16,7 +16,7 @@ public interface TbCallQueueMapper extends BaseMapper { @Select("select a.*, b.note, TIMESTAMPDIFF(SECOND, a.create_time, NOW()) as since_at from tb_call_queue a " + "left join tb_call_table b on a.call_table_id=b.id " + - "where a.shop_id=#{shopId} and a.state in (3, 2, 1)") + "where a.shop_id=#{shopId} and a.state in (3, 2, 1) order by a.create_time desc") Page selectCallRecord(Integer shopId, Integer callTableId, Page objectPage); } 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 64cf148a..6f082c18 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 @@ -326,7 +326,7 @@ public class TbCallServiceImpl implements TbCallService { case 3: callQueue.setPassTime(DateUtil.date()); // 已经顺延 - callQueue.setIsPostpone(callQueue.getIsPostpone() == 0 ? 1 : 2); + callQueue.setIsPostpone(callQueue.getIsPostpone() == null ? 1 : callQueue.getIsPostpone() == 0 ? 1 : 2); TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null); if (shopInfo == null) { throw new BadRequestException("店铺信息不存在"); @@ -428,8 +428,10 @@ public class TbCallServiceImpl implements TbCallService { for (TbCallTable item : pageInfo.getRecords()) { LambdaQueryChainWrapper q = callQueueService.lambdaQuery() .eq(TbCallQueue::getCallTableId, item.getId()) + .eq(TbCallQueue::getShopId, shopId) + .ne(TbCallQueue::getIsPostpone, 2) .eq(TbCallQueue::getCreateDay, DateUtil.today()) - .in(TbCallQueue::getState, 0, 1); + .in(TbCallQueue::getState, 0, 1, 3); Long count = q.count(); totalCount += count;