小程序叫号相关

This commit is contained in:
张松
2025-03-20 14:53:08 +08:00
parent 8f46ce129e
commit baabf01e51
8 changed files with 220 additions and 8 deletions

View File

@@ -136,8 +136,8 @@ public class CallTableController {
*/
@SaAdminCheckPermission(value = "callTable:queue:list", name = "获取叫号队列")
@GetMapping("queue")
public CzgResult<Page<CallQueue>> getQueue(Long callTableId, Integer state) {
return CzgResult.success(callTableService.getQueue(StpKit.USER.getShopId(), callTableId, state));
public CzgResult<Page<CallQueue>> getQueue(Long callTableId, Integer state, String openId) {
return CzgResult.success(callTableService.getQueue(StpKit.USER.getShopId(), openId, callTableId, state));
}

View File

@@ -0,0 +1,77 @@
package com.czg.controller.user;
import com.czg.account.dto.calltable.CallSubMsgDTO;
import com.czg.account.dto.calltable.CallTableNumDTO;
import com.czg.account.dto.calltable.CallTablePage;
import com.czg.account.dto.calltable.TakeNumberDTO;
import com.czg.account.entity.CallQueue;
import com.czg.account.service.CallTableService;
import com.czg.annotation.SaAdminCheckPermission;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import com.mybatisflex.core.paginate.Page;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
* 小程序叫号管理
* @author Administrator
*/
@RestController
@RequestMapping("/user/callTable")
public class UCallTableController {
@Resource
private CallTableService callTableService;
/**
* 获取叫号号码
*/
@PostMapping("takeNumber")
public CzgResult<CallTableNumDTO> takeNumber(@Validated @RequestBody TakeNumberDTO takeNumberDTO) {
return CzgResult.success(callTableService.takeNumber(StpKit.USER.getShopId(), takeNumberDTO));
}
/**
* 获取叫号队列
*
* @param callTableId 桌型id
* @param state 状态 -1已取消 0排队中 1叫号中 2已入座 3 已过号
* @return 分页数据
*/
// @GetMapping("queue")
public CzgResult<Page<CallQueue>> getQueue(@RequestParam String openId, Long callTableId, Integer state) {
return CzgResult.success(callTableService.getQueue(StpKit.USER.getShopId(), openId, callTableId, state));
}
/**
* 叫号桌型获取
*
* @param callTableId 叫号桌型id
* @param state 0禁用 1使用
* @return 分页数据
*/
@GetMapping
public CzgResult<CallTablePage> get(Long callTableId, Integer state) {
return CzgResult.success(callTableService.get(StpKit.USER.getShopId(), callTableId, state));
}
/**
* 根据店铺id和openId获取当前叫号号码
* @param queueId 队列id
* @return 状态
*/
@GetMapping("status")
public CzgResult<?> getStatus(@RequestParam String openId, @RequestParam(required = false) Long queueId) {
return CzgResult.success(callTableService.getStatus(StpKit.USER.getShopId(), openId, queueId));
}
@PostMapping("subMsg")
public CzgResult<Boolean> subMsg(
@Validated @RequestBody CallSubMsgDTO subMsgDTO
) {
return CzgResult.success(callTableService.subMsg(subMsgDTO));
}
}