Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -84,4 +84,7 @@ public class TbCallQueue {
|
|||||||
@Column(name = "create_day")
|
@Column(name = "create_day")
|
||||||
private String createDay;
|
private String createDay;
|
||||||
|
|
||||||
|
@Column(name = "is_postpone")
|
||||||
|
private Integer isPostpone;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||||
.in(TbCallQueue::getState, 0, 1)
|
.in(TbCallQueue::getState, 0, 1)
|
||||||
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
|
.eq(TbCallQueue::getIsPostpone, 0)
|
||||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||||
if (callQueue != null) {
|
if (callQueue != null) {
|
||||||
throw new BadRequestException("当前用户已取号");
|
throw new BadRequestException("当前用户已取号");
|
||||||
@@ -182,6 +183,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
.eq(TbCallQueue::getPhone, takeNumberDTO.getPhone())
|
||||||
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
.eq(TbCallQueue::getShopId, takeNumberDTO.getShopId())
|
||||||
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
.eq(TbCallQueue::getCreateDay, DateUtil.today())
|
||||||
|
.eq(TbCallQueue::getIsPostpone, 0)
|
||||||
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
.eq(TbCallQueue::getCallTableId, takeNumberDTO.getCallTableId()).one();
|
||||||
if (callQueue != null) {
|
if (callQueue != null) {
|
||||||
throw new BadRequestException("当前用户已取号");
|
throw new BadRequestException("当前用户已取号");
|
||||||
@@ -323,6 +325,8 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
callQueue.setPassTime(DateUtil.date());
|
callQueue.setPassTime(DateUtil.date());
|
||||||
|
// 已经顺延
|
||||||
|
callQueue.setIsPostpone(1);
|
||||||
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
|
TbShopInfo shopInfo = shopInfoRepository.findById(callQueue.getShopId()).orElse(null);
|
||||||
if (shopInfo == null) {
|
if (shopInfo == null) {
|
||||||
throw new BadRequestException("店铺信息不存在");
|
throw new BadRequestException("店铺信息不存在");
|
||||||
@@ -337,7 +341,7 @@ public class TbCallServiceImpl implements TbCallService {
|
|||||||
Integer postponeNum = callTable.getPostponeNum();
|
Integer postponeNum = callTable.getPostponeNum();
|
||||||
|
|
||||||
// 判断是否需要顺延
|
// 判断是否需要顺延
|
||||||
if (isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
|
if (callQueue.getIsPostpone() == 0 && isPostpone != null && isPostpone == 1 && postponeNum != null && postponeNum > 0) {
|
||||||
// 查询当前桌以及顺延桌数
|
// 查询当前桌以及顺延桌数
|
||||||
List<TbCallQueue> current = callQueueService.lambdaQuery()
|
List<TbCallQueue> current = callQueueService.lambdaQuery()
|
||||||
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())
|
.eq(TbCallQueue::getCallTableId, callQueue.getCallTableId())
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
throw new BadRequestException("购物车商品不存在");
|
throw new BadRequestException("购物车商品不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
int currentPlaceNum = getCurrentPlaceNum(tbCashierCart.getTableId().toString(), tbCashierCart.getShopId());
|
int currentPlaceNum = getCurrentPlaceNum(tbCashierCart.getTableId().toString(), tbCashierCart.getShopId(), tbCashierCart.getUseType());
|
||||||
|
|
||||||
if (tbCashierCart.getPlaceNum() != null && !tbCashierCart.getPlaceNum().equals(currentPlaceNum)) {
|
if (tbCashierCart.getPlaceNum() != null && !tbCashierCart.getPlaceNum().equals(currentPlaceNum)) {
|
||||||
throw new BadRequestException("已下单商品仅支持退单操作");
|
throw new BadRequestException("已下单商品仅支持退单操作");
|
||||||
@@ -330,7 +330,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
return shopTable;
|
return shopTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getCurrentPlaceNum(String tableId, String shopId) {
|
private int getCurrentPlaceNum(String tableId, String shopId, String useType) {
|
||||||
String currentOrderKey = RedisConstant.getCurrentOrderKey(tableId,
|
String currentOrderKey = RedisConstant.getCurrentOrderKey(tableId,
|
||||||
shopId);
|
shopId);
|
||||||
String orderId = redisTemplate.opsForValue().get(currentOrderKey);
|
String orderId = redisTemplate.opsForValue().get(currentOrderKey);
|
||||||
@@ -338,7 +338,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
||||||
.eq(TbOrderInfo::getUseType, "postPay")
|
.eq(TbOrderInfo::getUseType, useType)
|
||||||
.eq(TbOrderInfo::getId, orderId).select(TbOrderInfo::getPlaceNum));
|
.eq(TbOrderInfo::getId, orderId).select(TbOrderInfo::getPlaceNum));
|
||||||
return orderInfo == null ? 1 : orderInfo.getPlaceNum() + 1;
|
return orderInfo == null ? 1 : orderInfo.getPlaceNum() + 1;
|
||||||
}
|
}
|
||||||
@@ -349,7 +349,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
checkTableIsOpen(addCartDTO.getTableId());
|
checkTableIsOpen(addCartDTO.getTableId());
|
||||||
}
|
}
|
||||||
|
|
||||||
int currentPlaceNum = getCurrentPlaceNum(addCartDTO.getTableId(), addCartDTO.getShopId().toString());
|
int currentPlaceNum = getCurrentPlaceNum(addCartDTO.getTableId(), addCartDTO.getShopId().toString(), addCartDTO.getUseType());
|
||||||
|
|
||||||
TbProductSku productSku = productMapper.selectSkuByIdAndShopId(addCartDTO.getShopId(), addCartDTO.getSkuId());
|
TbProductSku productSku = productMapper.selectSkuByIdAndShopId(addCartDTO.getShopId(), addCartDTO.getSkuId());
|
||||||
TbProduct product = productMapper.selectByIdAndShopId(addCartDTO.getShopId(), addCartDTO.getProductId());
|
TbProduct product = productMapper.selectByIdAndShopId(addCartDTO.getShopId(), addCartDTO.getProductId());
|
||||||
@@ -485,7 +485,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeCart(RemoveCartDTO removeCartDTO) {
|
public void removeCart(RemoveCartDTO removeCartDTO) {
|
||||||
int currentPlaceNum = getCurrentPlaceNum(removeCartDTO.getTableId() == null ? "" : removeCartDTO.getTableId().toString(), removeCartDTO.getShopId().toString());
|
int currentPlaceNum = getCurrentPlaceNum(removeCartDTO.getTableId() == null ? "" : removeCartDTO.getTableId().toString(), removeCartDTO.getShopId().toString(), removeCartDTO.getUseType());
|
||||||
// 会员点单
|
// 会员点单
|
||||||
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
||||||
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
||||||
@@ -528,7 +528,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
public void returnCart(ReturnOrderDTO removeCartDTO) {
|
public void returnCart(ReturnOrderDTO removeCartDTO) {
|
||||||
rabbitMsgUtils.printDishesReturnTicket(4450, 9313);
|
rabbitMsgUtils.printDishesReturnTicket(4450, 9313);
|
||||||
|
|
||||||
int currentPlaceNum = getCurrentPlaceNum(removeCartDTO.getTableId().toString(), removeCartDTO.getShopId().toString());
|
|
||||||
// 会员点单
|
// 会员点单
|
||||||
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
||||||
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
||||||
@@ -1001,7 +1000,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
BigDecimal feeAmount = BigDecimal.ZERO;
|
BigDecimal feeAmount = BigDecimal.ZERO;
|
||||||
BigDecimal saleAmount = BigDecimal.ZERO;
|
BigDecimal saleAmount = BigDecimal.ZERO;
|
||||||
// 当前下单次数
|
// 当前下单次数
|
||||||
int placeNum = StrUtil.isNotBlank(createOrderDTO.getTableId()) ? getCurrentPlaceNum(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString()) : 1;
|
int placeNum = StrUtil.isNotBlank(createOrderDTO.getTableId()) ? getCurrentPlaceNum(createOrderDTO.getTableId(), createOrderDTO.getShopId().toString(), createOrderDTO.getUseType()) : 1;
|
||||||
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
||||||
|
|
||||||
Integer mealNum = null;
|
Integer mealNum = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user