From f96c47ecac5ef0ffe301d3ba8afd83f804dd39b4 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Wed, 9 Oct 2024 13:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95=E6=90=BA?= =?UTF-8?q?=E5=B8=A6=E5=B0=B1=E9=A4=90=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/cashierservice/entity/OrderVo.java | 4 +++- .../system/cashierservice/service/OrderService.java | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/OrderVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/OrderVo.java index b4b390e..de982e9 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/entity/OrderVo.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/OrderVo.java @@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.entity; import lombok.Data; +import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import java.util.List; @@ -19,6 +20,7 @@ public class OrderVo { private String sendType; - @NotBlank private String eatModel; + @Min(1) + private Integer seatNum; } diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java index 2eca1f0..aa08dbf 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java @@ -676,6 +676,7 @@ public class OrderService { throw new MsgException("店铺信息不存在"); } + orderVo.setEatModel(StrUtil.isBlank(orderVo.getTableId()) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue()); ShopEatTypeInfoDTO eatTypeInfoDTO = checkEatModel(orderVo.getShopId(), orderVo.getEatModel()); @@ -683,6 +684,17 @@ public class OrderService { throw new MsgException("店内就餐必须选择桌码"); } + + // 餐位费设置 + if (!eatTypeInfoDTO.isTakeout() && shopInfo.getIsTableFee() != null && shopInfo.getIsTableFee() == 0) { + ChoseCountDTO choseCountDTO = new ChoseCountDTO(); + choseCountDTO.setNum(orderVo.getSeatNum()); + choseCountDTO.setTableId(orderVo.getTableId()); + choseCountDTO.setShopId(orderVo.getShopId()); + choseCountDTO.setMasterId(orderVo.getMasterId()); + choseCount(choseCountDTO); + } + String day = DateUtils.getDay(); TbShopTable shopTable = null; int currentPlaceNum = getCurrentPlaceNum(orderVo.getTableId(), orderVo.getShopId().toString(), eatTypeInfoDTO);