转台相关接口
This commit is contained in:
@@ -239,6 +239,11 @@ public class TbPlaceController {
|
|||||||
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
|
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PutMapping("/switch")
|
||||||
|
public ResponseEntity<?> switchTable(@Validated @RequestBody SwitchTableDTO switchTableDTO) {
|
||||||
|
return ResponseEntity.ok(tbShopTableService.switchTable(switchTableDTO));
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping("/updateVip")
|
@PutMapping("/updateVip")
|
||||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||||
public ResponseEntity<Object> updateVip(@Validated @RequestBody UpdateVipDTO updateVipDTO) {
|
public ResponseEntity<Object> updateVip(@Validated @RequestBody UpdateVipDTO updateVipDTO) {
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package cn.ysk.cashier.dto.shoptable;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SwitchTableDTO {
|
||||||
|
@NotNull
|
||||||
|
private Integer shopId;
|
||||||
|
@NotEmpty(message = "取餐码不为空")
|
||||||
|
private String masterId;
|
||||||
|
private Integer orderId;
|
||||||
|
private List<Integer> cartIds;
|
||||||
|
private boolean isFull;
|
||||||
|
@NotEmpty(message = "当前台桌id不为空")
|
||||||
|
private String currentTableId;
|
||||||
|
@NotEmpty(message = "目标台桌id不为空")
|
||||||
|
private String targetTableId;
|
||||||
|
}
|
||||||
@@ -69,7 +69,15 @@ public interface MpCashierCartService extends IService<TbCashierCart> {
|
|||||||
List<TbCashierCart> selectByShopEatType(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, TableConstant.OrderInfo.Status... statuses);
|
List<TbCashierCart> selectByShopEatType(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, TableConstant.OrderInfo.Status... statuses);
|
||||||
|
|
||||||
|
|
||||||
List<TbCashierCart> selectByShopEatTypeAndOrderId(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, Integer orderId, TableConstant.OrderInfo.Status... statuses);
|
/**
|
||||||
|
* 根据就餐模式查询购物车信息
|
||||||
|
* @param shopEatTypeInfoDTO 就餐模式
|
||||||
|
* @param masterId 取餐码
|
||||||
|
* @param orderId 订单id
|
||||||
|
* @param onlySearchPc 只查询pc
|
||||||
|
* @param statuses 状态
|
||||||
|
*/
|
||||||
|
List<TbCashierCart> selectByShopEatTypeAndOrderId(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, Integer orderId, boolean onlySearchPc, TableConstant.OrderInfo.Status... statuses);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单id和状态获取购物车数据
|
* 根据订单id和状态获取购物车数据
|
||||||
|
|||||||
@@ -139,7 +139,8 @@ public class MpCashierCartServiceImpl extends ServiceImpl<TbCashierCartMapper, T
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TbCashierCart> selectByShopEatTypeAndOrderId(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId, Integer orderId, TableConstant.OrderInfo.Status... statuses) {
|
public List<TbCashierCart> selectByShopEatTypeAndOrderId(ShopEatTypeInfoDTO shopEatTypeInfoDTO, String masterId,
|
||||||
|
Integer orderId, boolean onlySearchPc, TableConstant.OrderInfo.Status... statuses) {
|
||||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||||
.eq(TbCashierCart::getShopId, shopEatTypeInfoDTO.getShopId())
|
.eq(TbCashierCart::getShopId, shopEatTypeInfoDTO.getShopId())
|
||||||
.eq(TbCashierCart::getUseType, shopEatTypeInfoDTO.getUseType())
|
.eq(TbCashierCart::getUseType, shopEatTypeInfoDTO.getUseType())
|
||||||
@@ -157,6 +158,10 @@ public class MpCashierCartServiceImpl extends ServiceImpl<TbCashierCartMapper, T
|
|||||||
.or().isNull(TbCashierCart::getOrderId));
|
.or().isNull(TbCashierCart::getOrderId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (onlySearchPc) {
|
||||||
|
queryWrapper.ne(TbCashierCart::getPlatformType, "mimiapp");
|
||||||
|
}
|
||||||
|
|
||||||
// 非堂食校验台桌状态
|
// 非堂食校验台桌状态
|
||||||
if (shopEatTypeInfoDTO.isTakeout()) {
|
if (shopEatTypeInfoDTO.isTakeout()) {
|
||||||
queryWrapper.and(q -> q.isNull(TbCashierCart::getTableId).or().eq(TbCashierCart::getTableId, ""))
|
queryWrapper.and(q -> q.isNull(TbCashierCart::getTableId).or().eq(TbCashierCart::getTableId, ""))
|
||||||
|
|||||||
@@ -3318,7 +3318,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
public Object waitCall(WaitCallDTO waitCallDTO) {
|
public Object waitCall(WaitCallDTO waitCallDTO) {
|
||||||
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(waitCallDTO.getShopId(), waitCallDTO.getTableId(), waitCallDTO.getUseType());
|
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(waitCallDTO.getShopId(), waitCallDTO.getTableId(), waitCallDTO.getUseType());
|
||||||
List<TbCashierCart> cashierCarts = mpCashierCartService.selectByShopEatTypeAndOrderId(shopEatTypeInfoDTO,
|
List<TbCashierCart> cashierCarts = mpCashierCartService.selectByShopEatTypeAndOrderId(shopEatTypeInfoDTO,
|
||||||
waitCallDTO.getMasterId(), waitCallDTO.getOrderId(), TableConstant.OrderInfo.Status.CREATE, TableConstant.OrderInfo.Status.RETURN, TableConstant.OrderInfo.Status.CLOSED);
|
waitCallDTO.getMasterId(), waitCallDTO.getOrderId(), false, TableConstant.OrderInfo.Status.CREATE,
|
||||||
|
TableConstant.OrderInfo.Status.RETURN, TableConstant.OrderInfo.Status.CLOSED);
|
||||||
if (cashierCarts.isEmpty()) {
|
if (cashierCarts.isEmpty()) {
|
||||||
throw new BadRequestException("购物车为空");
|
throw new BadRequestException("购物车为空");
|
||||||
}
|
}
|
||||||
@@ -3336,4 +3337,11 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
mpCashierCartService.updateFieldValByIds(waitCallDTO.getShopId(), cartIds, TbCashierCart::getIsWaitCall, waitCallDTO.getIsWaitCall());
|
mpCashierCartService.updateFieldValByIds(waitCallDTO.getShopId(), cartIds, TbCashierCart::getIsWaitCall, waitCallDTO.getIsWaitCall());
|
||||||
return mpOrderDetailService.updateFieldByCartId(TbOrderDetail::getIsWaitCall, waitCallDTO.getIsWaitCall(), cartIds);
|
return mpOrderDetailService.updateFieldByCartId(TbOrderDetail::getIsWaitCall, waitCallDTO.getIsWaitCall(), cartIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object switchTable(SwitchTableDTO switchTableDTO) {
|
||||||
|
// 查询当前台桌信息
|
||||||
|
mpCashierCartService.selectByShopEatTypeAndOrderId()
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,4 +169,10 @@ public interface TbShopTableService {
|
|||||||
Object checkCoupon(ThirdCouponCheckDTO checkDTO);
|
Object checkCoupon(ThirdCouponCheckDTO checkDTO);
|
||||||
|
|
||||||
Object waitCall(WaitCallDTO waitCallDTO);
|
Object waitCall(WaitCallDTO waitCallDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 台桌转台
|
||||||
|
* @param switchTableDTO 转台参数
|
||||||
|
*/
|
||||||
|
Object switchTable(SwitchTableDTO switchTableDTO);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user