1.排队取号 取消排号接口
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.chaozhanggui.system.cashierservice.service;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CancelCallQueueDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.TakeNumberDTO;
|
||||
|
||||
public interface TbCallService {
|
||||
@@ -8,4 +9,6 @@ public interface TbCallService {
|
||||
Object getList(Integer shopId, String openId);
|
||||
|
||||
Object getAllInfo(Integer shopId);
|
||||
|
||||
Object cancel(CancelCallQueueDTO cancelCallQueueDTO);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallQueue;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbCallTable;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.CancelCallQueueDTO;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.TakeNumberDTO;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.TbCallQueueMapper;
|
||||
@@ -77,6 +78,7 @@ public class TbCallServiceImpl implements TbCallService {
|
||||
TbCallQueue callQueue = callQueueService.lambdaQuery()
|
||||
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||
.in(TbCallQueue::getState, 0, 1)
|
||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||
if (callQueue != null) {
|
||||
throw new MsgException("您已取号,请勿重复取号");
|
||||
@@ -100,4 +102,13 @@ public class TbCallServiceImpl implements TbCallService {
|
||||
public Object getAllInfo(Integer shopId) {
|
||||
return callTableService.lambdaQuery().eq(TbCallTable::getShopId, shopId).eq(TbCallTable::getState, 1).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object cancel(CancelCallQueueDTO cancelCallQueueDTO) {
|
||||
return callQueueService.lambdaUpdate()
|
||||
.eq(TbCallQueue::getShopId, cancelCallQueueDTO.getShopId())
|
||||
.eq(TbCallQueue::getId, cancelCallQueueDTO.getQueueId())
|
||||
.set(TbCallQueue::getCallTime, DateUtil.date())
|
||||
.set(TbCallQueue::getState, -1).update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user