代客下单调整
This commit is contained in:
@@ -144,9 +144,18 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
return orderInfo;
|
return orderInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验就餐模式是否存在并返回就餐类型信息
|
||||||
|
* @param tableId 台桌id
|
||||||
|
* @param shopId 店铺id
|
||||||
|
* @return 就餐类型信息
|
||||||
|
*/
|
||||||
|
public ShopEatTypeInfoDTO checkEatModel(Object tableId, Object shopId) {
|
||||||
|
String eatModel = StrUtil.isBlank(tableId.toString()) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
||||||
|
return getShopEatTypeInfoDTO(shopId, eatModel);
|
||||||
|
}
|
||||||
|
|
||||||
private ShopEatTypeInfoDTO checkEatModel(Integer shopId, String useType) {
|
private ShopEatTypeInfoDTO getShopEatTypeInfoDTO(Object shopId, String eatModel) {
|
||||||
String eatModel = OrderUseTypeEnum.TAKEOUT.getValue().equals(useType) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
|
||||||
TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper<TbShopInfo>()
|
TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper<TbShopInfo>()
|
||||||
.eq(TbShopInfo::getId, shopId)
|
.eq(TbShopInfo::getId, shopId)
|
||||||
.eq(TbShopInfo::getStatus, 1));
|
.eq(TbShopInfo::getStatus, 1));
|
||||||
@@ -170,6 +179,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private ShopEatTypeInfoDTO checkEatModel(Integer shopId, String useType) {
|
||||||
|
String eatModel = OrderUseTypeEnum.TAKEOUT.getValue().equals(useType) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
|
||||||
|
return getShopEatTypeInfoDTO(shopId, eatModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(TbShopTableQueryCriteria criteria, Pageable pageable) {
|
public Map<String, Object> queryAll(TbShopTableQueryCriteria criteria, Pageable pageable) {
|
||||||
if (criteria.getAreaId() == 0) {
|
if (criteria.getAreaId() == 0) {
|
||||||
@@ -327,7 +342,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
throw new BadRequestException("购物车商品不存在");
|
throw new BadRequestException("购物车商品不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
int currentPlaceNum = getCurrentPlaceNum(tbCashierCart.getTableId().toString(), tbCashierCart.getShopId(), tbCashierCart.getUseType());
|
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(updateCartDTO.getShopId(), tbCashierCart.getUseType());
|
||||||
|
int currentPlaceNum = getCurrentPlaceNum(tbCashierCart.getTableId().toString(), tbCashierCart.getShopId(), shopEatTypeInfoDTO);
|
||||||
|
|
||||||
if (tbCashierCart.getPlaceNum() != null && !tbCashierCart.getPlaceNum().equals(currentPlaceNum)) {
|
if (tbCashierCart.getPlaceNum() != null && !tbCashierCart.getPlaceNum().equals(currentPlaceNum)) {
|
||||||
throw new BadRequestException("已下单商品仅支持退单操作");
|
throw new BadRequestException("已下单商品仅支持退单操作");
|
||||||
@@ -543,7 +559,9 @@ 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(), removeCartDTO.getUseType());
|
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(removeCartDTO.getTableId(), removeCartDTO.getShopId());
|
||||||
|
|
||||||
|
int currentPlaceNum = getCurrentPlaceNum(removeCartDTO.getTableId() == null ? "" : removeCartDTO.getTableId().toString(), removeCartDTO.getShopId().toString(), shopEatTypeInfoDTO);
|
||||||
// 会员点单
|
// 会员点单
|
||||||
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
TbCashierCart cashierCart = cashierCartMapper.selectOne(new LambdaQueryWrapper<TbCashierCart>()
|
||||||
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
.eq(TbCashierCart::getShopId, removeCartDTO.getShopId())
|
||||||
@@ -1095,7 +1113,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
BigDecimal feeAmount = BigDecimal.ZERO;
|
BigDecimal feeAmount = BigDecimal.ZERO;
|
||||||
BigDecimal saleAmount = BigDecimal.ZERO;
|
BigDecimal saleAmount = BigDecimal.ZERO;
|
||||||
// 当前下单次数
|
// 当前下单次数
|
||||||
int placeNum = getCurrentPlaceNum(createOrderDTO.getTableId(), String.valueOf(createOrderDTO.getShopId()), createOrderDTO.getUseType());
|
int placeNum = getCurrentPlaceNum(createOrderDTO.getTableId(), String.valueOf(createOrderDTO.getShopId()), shopEatTypeInfoDTO);
|
||||||
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
List<TbOrderDetail> orderDetails = new ArrayList<>();
|
||||||
|
|
||||||
BigDecimal mealAmount = null;
|
BigDecimal mealAmount = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user