台桌详情支持桌码查询

This commit is contained in:
张松 2025-03-04 17:53:04 +08:00
parent 726ba8c389
commit 3aba49cdd1
1 changed files with 9 additions and 2 deletions

View File

@ -84,8 +84,15 @@ public class ShopTableController {
*/
@SaAdminCheckPermission("shopTable:detail")
@GetMapping("/detail")
public CzgResult<ShopTable> detail(@RequestParam Long id) {
return CzgResult.success(shopTableService.getOne(new QueryWrapper().eq(ShopTable::getId, id).eq(ShopTable::getShopId, StpKit.USER.getShopId())));
public CzgResult<ShopTable> detail(Long id, String tableCode) {
if (id == null && StrUtil.isBlank(tableCode)) {
return CzgResult.failure("id和桌码不能同时为空");
}
QueryWrapper queryWrapper = new QueryWrapper().eq(ShopTable::getId, id).eq(ShopTable::getShopId, StpKit.USER.getShopId()).eq(ShopTable::getId, id);
if (StrUtil.isNotBlank(tableCode)) {
queryWrapper.eq(ShopTable::getTableCode, tableCode);
}
return CzgResult.success(shopTableService.getOne(queryWrapper));
}