创建订单携带就餐人数

This commit is contained in:
2024-10-09 13:29:13 +08:00
parent 4615e0fae1
commit f96c47ecac
2 changed files with 15 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -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);