台桌详情支持桌码查询
This commit is contained in:
parent
726ba8c389
commit
3aba49cdd1
|
|
@ -84,8 +84,15 @@ public class ShopTableController {
|
||||||
*/
|
*/
|
||||||
@SaAdminCheckPermission("shopTable:detail")
|
@SaAdminCheckPermission("shopTable:detail")
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public CzgResult<ShopTable> detail(@RequestParam Long id) {
|
public CzgResult<ShopTable> detail(Long id, String tableCode) {
|
||||||
return CzgResult.success(shopTableService.getOne(new QueryWrapper().eq(ShopTable::getId, id).eq(ShopTable::getShopId, StpKit.USER.getShopId())));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue