1.代客下单 添加台桌就餐人数
This commit is contained in:
@@ -121,6 +121,8 @@ public class TbShopTable implements Serializable {
|
|||||||
private Integer totalAmount;
|
private Integer totalAmount;
|
||||||
@Column(name = "`real_amount`")
|
@Column(name = "`real_amount`")
|
||||||
private Integer realAmount;
|
private Integer realAmount;
|
||||||
|
@Column(name = "`use_num`")
|
||||||
|
private Integer useNum;
|
||||||
|
|
||||||
|
|
||||||
public void copy(TbShopTable source){
|
public void copy(TbShopTable source){
|
||||||
|
|||||||
@@ -1022,10 +1022,10 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
int placeNum = getCurrentPlaceNum(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString());
|
int placeNum = getCurrentPlaceNum(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString());
|
||||||
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
||||||
|
|
||||||
boolean mealCost = false;
|
Integer mealNum = null;
|
||||||
for (TbCashierCart cashierCart : cashierCarts) {
|
for (TbCashierCart cashierCart : cashierCarts) {
|
||||||
if ("-999".equals(cashierCart.getProductId())) {
|
if ("-999".equals(cashierCart.getProductId())) {
|
||||||
mealCost = true;
|
mealNum = cashierCart.getNumber();
|
||||||
}
|
}
|
||||||
if (!"return".equals(cashierCart.getStatus())) {
|
if (!"return".equals(cashierCart.getStatus())) {
|
||||||
totalAmount = totalAmount.add(cashierCart.getTotalAmount());
|
totalAmount = totalAmount.add(cashierCart.getTotalAmount());
|
||||||
@@ -1060,7 +1060,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
orderDetail.setPlaceNum(placeNum);
|
orderDetail.setPlaceNum(placeNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mealCost) {
|
if (mealNum == null) {
|
||||||
throw new BadRequestException("请选择用餐人数");
|
throw new BadRequestException("请选择用餐人数");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1184,6 +1184,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
.set(TbShopTable::getProductNum, cashierCarts.size())
|
.set(TbShopTable::getProductNum, cashierCarts.size())
|
||||||
.set(TbShopTable::getTotalAmount, orderInfo.getOrderAmount())
|
.set(TbShopTable::getTotalAmount, orderInfo.getOrderAmount())
|
||||||
.set(TbShopTable::getRealAmount, orderInfo.getOrderAmount())
|
.set(TbShopTable::getRealAmount, orderInfo.getOrderAmount())
|
||||||
|
.set(TbShopTable::getUseNum, mealNum)
|
||||||
.set(TbShopTable::getStatus, TableStateEnum.USING.getState());
|
.set(TbShopTable::getStatus, TableStateEnum.USING.getState());
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
wrapper.set(TbShopTable::getUseTime, DateUtil.date());
|
wrapper.set(TbShopTable::getUseTime, DateUtil.date());
|
||||||
|
|||||||
Reference in New Issue
Block a user