代客下单订单同步保存餐位费
This commit is contained in:
parent
3873009e63
commit
1babbfdefe
|
|
@ -231,6 +231,9 @@ public class TbOrderInfo implements Serializable {
|
|||
@Column(name = "`place_num`")
|
||||
@ApiModelProperty(value = "place_num")
|
||||
private Integer placeNum;
|
||||
|
||||
@Column(name = "`seat_amount`")
|
||||
private BigDecimal seatAmount;
|
||||
public void copy(TbOrderInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1003,7 +1003,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
int placeNum = StrUtil.isNotBlank(createOrderDTO.getTableId()) ? getCurrentPlaceNum(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString(), createOrderDTO.getUseType()) : 1;
|
||||
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
||||
|
||||
Integer mealNum = null;
|
||||
BigDecimal mealAmount = null;
|
||||
|
||||
boolean unAdd = cashierCarts.stream().noneMatch(item -> item.getPlaceNum() == null);
|
||||
if (ShopInfoTypeEnums.RESTAURANT.getValue().equals(shopInfo.getRegisterType()) && addMaterId && unAdd) {
|
||||
|
|
@ -1011,7 +1011,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
}
|
||||
for (TbCashierCart cashierCart : cashierCarts) {
|
||||
if ("-999".equals(cashierCart.getProductId())) {
|
||||
mealNum = cashierCart.getNumber();
|
||||
mealAmount = cashierCart.getTotalAmount();
|
||||
}
|
||||
if (!"return".equals(cashierCart.getStatus())) {
|
||||
totalAmount = totalAmount.add(cashierCart.getTotalAmount());
|
||||
|
|
@ -1051,7 +1051,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
|
||||
if (shopInfo.getIsTableFee() != null && shopInfo.getIsTableFee() == 0
|
||||
&& (OrderUseTypeEnum.DINE_IN_BEFORE.getValue().equals(createOrderDTO.getUseType()) || OrderUseTypeEnum.DINE_IN_AFTER.getValue().equals(createOrderDTO.getUseType()))
|
||||
&& mealNum == null) {
|
||||
&& mealAmount == null) {
|
||||
throw new BadRequestException("请选择用餐人数");
|
||||
}
|
||||
|
||||
|
|
@ -1074,6 +1074,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
orderInfo.setUseType(createOrderDTO.isPostPay() ? "postPay" : "afterPay");
|
||||
orderInfo.setUseType(createOrderDTO.getUseType());
|
||||
orderInfo.setCreatedAt(DateUtil.current());
|
||||
orderInfo.setSeatAmount(mealAmount);
|
||||
if (!unAdd) {
|
||||
orderInfo.setPlaceNum(placeNum);
|
||||
}
|
||||
|
|
@ -1104,6 +1105,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
orderInfo.setTableName(tbShopTable != null ? tbShopTable.getName() : null);
|
||||
orderInfo.setPlaceNum(placeNum);
|
||||
orderInfo.setUseType(createOrderDTO.getUseType());
|
||||
orderInfo.setSeatAmount(mealAmount);
|
||||
TbMerchantAccount merchantAccount = merchantAccountMapper.selectOne(new LambdaQueryWrapper<TbMerchantAccount>()
|
||||
.eq(TbMerchantAccount::getShopId, createOrderDTO.getShopId())
|
||||
.eq(TbMerchantAccount::getStatus, 1));
|
||||
|
|
|
|||
Loading…
Reference in New Issue