fix: 餐位费退菜修复
This commit is contained in:
parent
ce94bd7e4e
commit
f75aae14a8
|
|
@ -169,7 +169,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
* @param eatModel 就餐模式
|
* @param eatModel 就餐模式
|
||||||
* @param tableId 台桌id
|
* @param tableId 台桌id
|
||||||
* @return just餐类型信息
|
* @return just餐类型信息
|
||||||
* */
|
*/
|
||||||
private ShopEatTypeInfoDTO getShopEatTypeInfoDTO(Object shopId, String eatModel, String tableId) {
|
private ShopEatTypeInfoDTO getShopEatTypeInfoDTO(Object shopId, String eatModel, String tableId) {
|
||||||
TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper<TbShopInfo>()
|
TbShopInfo shopInfo = mpShopInfoMapper.selectOne(new LambdaQueryWrapper<TbShopInfo>()
|
||||||
.eq(TbShopInfo::getId, shopId)
|
.eq(TbShopInfo::getId, shopId)
|
||||||
|
|
@ -673,18 +673,15 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
TbOrderDetail orderDetail = orderDetailMapper.selectOne(new LambdaQueryWrapper<TbOrderDetail>()
|
TbOrderDetail orderDetail = orderDetailMapper.selectOne(new LambdaQueryWrapper<TbOrderDetail>()
|
||||||
.eq(TbOrderDetail::getCartId, cashierCart.getId()));
|
.eq(TbOrderDetail::getCartId, cashierCart.getId()));
|
||||||
|
|
||||||
if (cashierCart.getId() == -999) {
|
if (cashierCart.getProductId().equals("-999")) {
|
||||||
cashierCartMapper.deleteById(cashierCart.getId());
|
cashierCartMapper.deleteById(cashierCart.getId());
|
||||||
if (cashierCart.getOrderId() != null) {
|
cashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
|
||||||
orderDetailMapper.delete(new LambdaQueryWrapper<TbOrderDetail>()
|
.eq(TbCashierCart::getId, cashierCart.getId())
|
||||||
.eq(TbOrderDetail::getCartId, cashierCart.getId()));
|
.set(TbCashierCart::getStatus, "return"));
|
||||||
|
orderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
|
||||||
orderInfoMapper.update(null, new LambdaUpdateWrapper<TbOrderInfo>()
|
.eq(TbOrderDetail::getId, tbOrderDetail.getId())
|
||||||
.eq(TbOrderInfo::getId, cashierCart.getOrderId())
|
.set(TbOrderDetail::getUpdateTime, DateUtil.date())
|
||||||
.eq(TbOrderInfo::getShopId, removeCartDTO.getShopId())
|
.set(TbOrderDetail::getStatus, "return"));
|
||||||
.set(TbOrderInfo::getSeatCount, null)
|
|
||||||
.set(TbOrderInfo::getSeatAmount, null));
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -1155,7 +1152,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(createOrderDTO.getTableId()) && (allCashierCarts.isEmpty() || (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart != null && allCashierCarts.size() < 2)
|
if (StrUtil.isNotBlank(createOrderDTO.getTableId())
|
||||||
|
&& (cashierCarts.isEmpty() ||
|
||||||
|
(shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart != null && cashierCarts.size() < 2)
|
||||||
|| (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart == null))) {
|
|| (shopEatTypeInfoDTO.isNeedSeatFee() && !shopEatTypeInfoDTO.isTakeout() && seatCart == null))) {
|
||||||
throw new BadRequestException("购物车为空或未选择餐位费,请先添加商品或选择餐位费");
|
throw new BadRequestException("购物车为空或未选择餐位费,请先添加商品或选择餐位费");
|
||||||
}
|
}
|
||||||
|
|
@ -1196,7 +1195,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
||||||
List<TbOrderDetail> addOrderDetails = new ArrayList<>();
|
List<TbOrderDetail> addOrderDetails = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boolean hasNewInfo = false;
|
boolean hasNewInfo = false;
|
||||||
for (TbCashierCart cashierCart : cashierCarts) {
|
for (TbCashierCart cashierCart : cashierCarts) {
|
||||||
if (!"return".equals(cashierCart.getStatus())) {
|
if (!"return".equals(cashierCart.getStatus())) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue