1.代客下单 台桌状态同时校验detail和购物车数据
This commit is contained in:
@@ -76,6 +76,6 @@ public interface TbCashierCartMapper {
|
|||||||
@Select("select count(*) from tb_cashier_cart where shop_id=#{shopId} and `status`='create' and table_id=#{qrcode} and order_id is not null")
|
@Select("select count(*) from tb_cashier_cart where shop_id=#{shopId} and `status`='create' and table_id=#{qrcode} and order_id is not null")
|
||||||
int countTable(@Param("qrcode") String qrcode, @Param("shopId") Integer shopId);
|
int countTable(@Param("qrcode") String qrcode, @Param("shopId") Integer shopId);
|
||||||
|
|
||||||
@Select("select count(*) from tb_order_detail where shop_id=#{shopId} and `status`='create' and table_id=#{qrcode} and order_id is not null")
|
@Select("select count(*) from tb_order_detail where shop_id=#{shopId} and `status`='create' and order_id=#{orderId} and order_id is not null")
|
||||||
int countTableByDetail(@Param("qrcode") String qrcode, @Param("shopId") Integer shopId);
|
int countTableByDetail(@Param("orderId") Integer orderId, @Param("shopId") Integer shopId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class ShopInfoService {
|
|||||||
tbShopTableVO.setStatus("closed");
|
tbShopTableVO.setStatus("closed");
|
||||||
|
|
||||||
}else if (tbCashierCartMapper.countTable(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1 ||
|
}else if (tbCashierCartMapper.countTable(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1 ||
|
||||||
tbCashierCartMapper.countTableByDetail(tbShopTableVO.getQrcode(), tbShopTableVO.getShopId()) < 1
|
tbCashierCartMapper.countTableByDetail(tbShopTableVO.getOrderId(), tbShopTableVO.getShopId()) < 1
|
||||||
) {
|
) {
|
||||||
tbShopTableVO.setStatus("idle");
|
tbShopTableVO.setStatus("idle");
|
||||||
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
mpShopTableMapper.update(null, new LambdaUpdateWrapper<TbShopTable>()
|
||||||
|
|||||||
Reference in New Issue
Block a user