feat: 不传递桌码不修改人数

This commit is contained in:
SongZhang 2024-10-25 16:58:57 +08:00
parent 61b80c5a85
commit 96ecaa840e
2 changed files with 9 additions and 2 deletions

View File

@ -1,10 +1,12 @@
package cn.ysk.cashier.controller.product;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import cn.ysk.cashier.annotation.AnonymousAccess;
import cn.ysk.cashier.annotation.Log;
import cn.ysk.cashier.config.security.security.TokenProvider;
import cn.ysk.cashier.dto.shoptable.*;
import cn.ysk.cashier.exception.BadRequestException;
import cn.ysk.cashier.mybatis.mapper.TbMerchantAccountMapper;
import cn.ysk.cashier.pojo.TbToken;
import cn.ysk.cashier.pojo.order.TbCashierCart;
@ -199,6 +201,13 @@ public class TbPlaceController {
@ApiOperation("代客下单 选择用餐人数")
public ResponseEntity<Object> choseCount(@Validated @RequestBody ChoseCountDTO choseCountDTO) {
if (StrUtil.isBlank(choseCountDTO.getTableId())) {
return ResponseEntity.ok(null);
}
if (StrUtil.isNotBlank(choseCountDTO.getTableId()) && choseCountDTO.getNum() == null) {
throw new BadRequestException("人数不为空");
}
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
}

View File

@ -12,9 +12,7 @@ public class ChoseCountDTO {
private String masterId;
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
@NotNull
@Min(1)
private Integer num;
@NotEmpty