feat: 不传递桌码不修改人数
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
package cn.ysk.cashier.controller.product;
|
package cn.ysk.cashier.controller.product;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||||
import cn.ysk.cashier.annotation.Log;
|
import cn.ysk.cashier.annotation.Log;
|
||||||
import cn.ysk.cashier.config.security.security.TokenProvider;
|
import cn.ysk.cashier.config.security.security.TokenProvider;
|
||||||
import cn.ysk.cashier.dto.shoptable.*;
|
import cn.ysk.cashier.dto.shoptable.*;
|
||||||
|
import cn.ysk.cashier.exception.BadRequestException;
|
||||||
import cn.ysk.cashier.mybatis.mapper.TbMerchantAccountMapper;
|
import cn.ysk.cashier.mybatis.mapper.TbMerchantAccountMapper;
|
||||||
import cn.ysk.cashier.pojo.TbToken;
|
import cn.ysk.cashier.pojo.TbToken;
|
||||||
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
||||||
@@ -199,6 +201,13 @@ public class TbPlaceController {
|
|||||||
@ApiOperation("代客下单 选择用餐人数")
|
@ApiOperation("代客下单 选择用餐人数")
|
||||||
public ResponseEntity<Object> choseCount(@Validated @RequestBody ChoseCountDTO choseCountDTO) {
|
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));
|
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ public class ChoseCountDTO {
|
|||||||
private String masterId;
|
private String masterId;
|
||||||
@NotNull
|
@NotNull
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
@NotEmpty
|
|
||||||
private String tableId;
|
private String tableId;
|
||||||
@NotNull
|
|
||||||
@Min(1)
|
@Min(1)
|
||||||
private Integer num;
|
private Integer num;
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
|
|||||||
Reference in New Issue
Block a user