1.排队取号 取消接口修改

This commit is contained in:
2024-09-14 17:26:21 +08:00
parent 0251def0b0
commit afe65d4a2f
5 changed files with 10 additions and 6 deletions

View File

@@ -48,9 +48,9 @@ public class TbCallTableController {
return Result.successWithData(tbCallService.getAllInfo(shopId)); return Result.successWithData(tbCallService.getAllInfo(shopId));
} }
@DeleteMapping("/cancel") @PostMapping("/cancel")
public Result cancel( public Result cancel(
@Validated @RequestParam CancelCallQueueDTO cancelCallQueueDTO @Validated @RequestBody CancelCallQueueDTO cancelCallQueueDTO
) { ) {
return Result.successWithData(tbCallService.cancel(cancelCallQueueDTO)); return Result.successWithData(tbCallService.cancel(cancelCallQueueDTO));
} }

View File

@@ -11,4 +11,7 @@ public class CallQueueInfoVO {
private Integer waitTime; private Integer waitTime;
private Integer state; private Integer state;
private String callNum; private String callNum;
private String shopState;
private String shopName;
private String logo;
} }

View File

@@ -3,7 +3,6 @@ package com.chaozhanggui.system.cashierservice.mapper;
import com.chaozhanggui.system.cashierservice.entity.TbCallQueue; import com.chaozhanggui.system.cashierservice.entity.TbCallQueue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chaozhanggui.system.cashierservice.entity.vo.CallQueueInfoVO; import com.chaozhanggui.system.cashierservice.entity.vo.CallQueueInfoVO;
import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
@@ -15,7 +14,7 @@ import java.util.List;
*/ */
public interface TbCallQueueMapper extends BaseMapper<TbCallQueue> { public interface TbCallQueueMapper extends BaseMapper<TbCallQueue> {
List<CallQueueInfoVO> selectInfoByOpenId(Integer shopId, String openId); List<CallQueueInfoVO> selectInfoByOpenId(Integer shopId, String openId, String today);
} }

View File

@@ -98,7 +98,7 @@ public class TbCallServiceImpl implements TbCallService {
@Override @Override
public Object getList(Integer shopId, String openId) { public Object getList(Integer shopId, String openId) {
return callQueueMapper.selectInfoByOpenId(shopId, openId); return callQueueMapper.selectInfoByOpenId(shopId, openId, DateUtil.today());
} }
@Override @Override

View File

@@ -35,6 +35,7 @@
<select id="selectInfoByOpenId" <select id="selectInfoByOpenId"
resultType="com.chaozhanggui.system.cashierservice.entity.vo.CallQueueInfoVO"> resultType="com.chaozhanggui.system.cashierservice.entity.vo.CallQueueInfoVO">
SELECT SELECT
d.shop_name, d.logo, d.status as shop_state,
a.call_num, a.call_num,
a.id, -- 用户的排队记录ID a.id, -- 用户的排队记录ID
a.state, a.state,
@@ -49,10 +50,11 @@
tb_call_table b ON a.call_table_id = b.id tb_call_table b ON a.call_table_id = b.id
LEFT JOIN LEFT JOIN
tb_call_queue c ON c.call_table_id = a.call_table_id tb_call_queue c ON c.call_table_id = a.call_table_id
left join tb_shop_info d on a.shop_id=d.id
AND c.create_time &lt; a.create_time AND c.create_time &lt; a.create_time
AND c.state IN (0, 1) -- 前面的人 AND c.state IN (0, 1) -- 前面的人
WHERE WHERE
a.open_id=#{openId} and a.shop_id=#{shopId} -- 替换为目标用户的user_id a.open_id=#{openId} and a.shop_id=#{shopId} and a.create_day=#{today} -- 替换为目标用户的user_id
GROUP BY GROUP BY
a.id, a.user_id, b.name, b.note, b.wait_time a.id, a.user_id, b.name, b.note, b.wait_time
ORDER BY ORDER BY