台桌增加绑定状态筛选
This commit is contained in:
parent
809109614e
commit
240e43daef
|
|
@ -36,7 +36,7 @@ public class ShopTableController {
|
|||
* 批量生成台桌码
|
||||
* 权限标识: shopTable:code
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:code")
|
||||
@SaAdminCheckPermission(value = "shopTable:code", name = "生成台桌码")
|
||||
@PostMapping("/code")
|
||||
public void createCode(@RequestParam Integer num, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
if (num > 100) {
|
||||
|
|
@ -53,10 +53,10 @@ public class ShopTableController {
|
|||
* @param status 台桌状态
|
||||
* @return 台桌列表
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:list")
|
||||
@SaAdminCheckPermission(value = "shopTable:list", name = "获取台桌列表")
|
||||
@GetMapping
|
||||
public CzgResult<Page<ShopTableVO>> list(Integer areaId, String tableCode, String status, String name) {
|
||||
return CzgResult.success(shopTableService.pageInfo(StpKit.USER.getShopId(), areaId, tableCode, status, name));
|
||||
public CzgResult<Page<ShopTableVO>> list(Integer areaId, String tableCode, String status, String name, Boolean isBind) {
|
||||
return CzgResult.success(shopTableService.pageInfo(StpKit.USER.getShopId(), areaId, tableCode, status, name, isBind));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,7 +65,7 @@ public class ShopTableController {
|
|||
* @param id 台桌id
|
||||
* @return 台桌列表
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:detail")
|
||||
@SaAdminCheckPermission(value = "shopTable:detail", name = "获取台桌详情")
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<ShopTable> detail(Long id, String tableCode) {
|
||||
if (id == null && StrUtil.isBlank(tableCode)) {
|
||||
|
|
@ -84,7 +84,7 @@ public class ShopTableController {
|
|||
* 权限标识: shopTable:edit
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:edit")
|
||||
@SaAdminCheckPermission(value = "shopTable:edit", name = "台桌信息修改")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated ShopTableDTO shopTableDTO) {
|
||||
return CzgResult.success(shopTableService.updateInfo(StpKit.USER.getLoginIdAsLong(), shopTableDTO));
|
||||
|
|
@ -95,7 +95,7 @@ public class ShopTableController {
|
|||
* 权限标识: shopTable:clear
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:clear")
|
||||
@SaAdminCheckPermission(value = "shopTable:clear", name = "台桌清台")
|
||||
@PutMapping("/clear")
|
||||
public CzgResult<Boolean> clear(@RequestBody @Validated ShopTableClearDTO shopTableClearDTO) {
|
||||
return CzgResult.success(shopTableService.clear(StpKit.USER.getLoginIdAsLong(), shopTableClearDTO));
|
||||
|
|
@ -106,7 +106,7 @@ public class ShopTableController {
|
|||
* 权限标识: shopTable:del
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:del")
|
||||
@SaAdminCheckPermission(value = "shopTable:del", name = "台桌信息删除")
|
||||
@DeleteMapping
|
||||
public CzgResult<Boolean> remove(@RequestBody @Validated ShopTableDTO shopTableDTO) {
|
||||
return CzgResult.success(shopTableService.remove(new QueryWrapper().eq(ShopTable::getShopId, StpKit.USER.getShopId()).eq(ShopTable::getId, shopTableDTO.getId())));
|
||||
|
|
@ -117,7 +117,7 @@ public class ShopTableController {
|
|||
* 权限标识: shopTable:add
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:add")
|
||||
@SaAdminCheckPermission(value = "shopTable:add", name = "台桌信息增加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated ShopTableAddDTO shopTableAddDTO) {
|
||||
if (shopTableAddDTO.getStart() >= shopTableAddDTO.getEnd()){
|
||||
|
|
@ -131,7 +131,7 @@ public class ShopTableController {
|
|||
* 权限标识: shopTable:bind
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission("shopTable:bind")
|
||||
@SaAdminCheckPermission(value = "shopTable:bind", name = "台桌绑定")
|
||||
@PostMapping("/bind")
|
||||
public CzgResult<Boolean> bind(@RequestBody @Validated ShopTableBindDTO shopTableBindDTO) {
|
||||
return CzgResult.success(shopTableService.bind(StpKit.USER.getShopId(), shopTableBindDTO));
|
||||
|
|
|
|||
|
|
@ -35,5 +35,5 @@ public interface ShopTableService extends IService<ShopTable> {
|
|||
|
||||
Boolean clear(long shopId, ShopTableClearDTO shopTableClearDTO);
|
||||
|
||||
Page<ShopTableVO> pageInfo(Long shopId, Integer areaId, String tableCode, String status, String name);
|
||||
Page<ShopTableVO> pageInfo(Long shopId, Integer areaId, String tableCode, String status, String name, Boolean isBind);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@ import java.util.List;
|
|||
public interface ShopTableMapper extends BaseMapper<ShopTable> {
|
||||
|
||||
List<ShopTableVO> pageInfo(@Param("shopId") Long shopId, @Param("areaId") Integer areaId,
|
||||
@Param("tableCode") String tableCode, @Param("status") String status, @Param("name") String name);
|
||||
@Param("tableCode") String tableCode, @Param("status") String status, @Param("name") String name,
|
||||
@Param("isBind") Boolean isBind);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,8 +270,8 @@ public class ShopTableServiceImpl extends ServiceImpl<ShopTableMapper, ShopTable
|
|||
}
|
||||
|
||||
@Override
|
||||
public Page<ShopTableVO> pageInfo(Long shopId, Integer areaId, String tableCode, String status, String name) {
|
||||
public Page<ShopTableVO> pageInfo(Long shopId, Integer areaId, String tableCode, String status, String name, Boolean isBind) {
|
||||
PageHelper.startPage(PageUtil.buildPageHelp());
|
||||
return PageUtil.convert(new PageInfo<>(mapper.pageInfo(shopId, areaId, tableCode, status, name)));
|
||||
return PageUtil.convert(new PageInfo<>(mapper.pageInfo(shopId, areaId, tableCode, status, name, isBind)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@
|
|||
<if test="name != null and name != ''">
|
||||
and a.name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
<if test="isBind != null">
|
||||
and a.table_code is not null
|
||||
</if>
|
||||
group by a.id
|
||||
ORDER BY a.create_time
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue