fix: 会员修改接口修改

This commit is contained in:
2024-11-04 14:27:41 +08:00
parent 9b1f802867
commit 5406aedb76

View File

@@ -1834,7 +1834,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
TbActivateOutRecord tbActivateOutRecord = null; TbActivateOutRecord tbActivateOutRecord = null;
if (!couponInfo.getFullReductionCouponMap().isEmpty()) { if (!couponInfo.getFullReductionCouponMap().isEmpty()) {
TbUserCouponVo couponVo = couponInfo.getFullReductionCouponMap().values().stream().findFirst().orElse(null); TbUserCouponVo couponVo = couponInfo.getFullReductionCouponMap().values().stream().findFirst().orElse(null);
finalAmount =finalAmount.subtract(couponVo.getDiscountAmount()); finalAmount = finalAmount.subtract(couponVo.getDiscountAmount());
orderInfo.setFullCouponDiscountAmount(couponVo.getDiscountAmount()); orderInfo.setFullCouponDiscountAmount(couponVo.getDiscountAmount());
tbActivateOutRecord = new TbActivateOutRecord(); tbActivateOutRecord = new TbActivateOutRecord();
@@ -2109,6 +2109,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
@Override @Override
public Object updateVip(UpdateVipDTO updateVipDTO) { public Object updateVip(UpdateVipDTO updateVipDTO) {
Integer orderId = updateVipDTO.getOrderId();
if (orderId == null) {
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(updateVipDTO.getShopId(), updateVipDTO.getTableId()); ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(updateVipDTO.getShopId(), updateVipDTO.getTableId());
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>() LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
.in(TbCashierCart::getStatus, "create", "return") .in(TbCashierCart::getStatus, "create", "return")
@@ -2124,15 +2126,13 @@ public class TbShopTableServiceImpl implements TbShopTableService {
} }
List<TbCashierCart> tbCashierCarts = cashierCartMapper.selectList(queryWrapper.isNotNull(TbCashierCart::getOrderId)); List<TbCashierCart> tbCashierCarts = cashierCartMapper.selectList(queryWrapper.isNotNull(TbCashierCart::getOrderId));
if (!tbCashierCarts.isEmpty()) {
Integer orderId = updateVipDTO.getOrderId();
if (orderId == null) {
for (TbCashierCart item : tbCashierCarts) { for (TbCashierCart item : tbCashierCarts) {
if (item.getOrderId() != null) { if (item.getOrderId() != null) {
orderId = item.getOrderId(); orderId = item.getOrderId();
} }
} }
} }
if (updateVipDTO.getType() == 0) { if (updateVipDTO.getType() == 0) {
TbShopUser shopUser = tbShopUserMapper.selectById(updateVipDTO.getVipUserId()); TbShopUser shopUser = tbShopUserMapper.selectById(updateVipDTO.getVipUserId());
if (shopUser == null) { if (shopUser == null) {
@@ -2149,8 +2149,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
.set(TbOrderInfo::getMemberId, null)); .set(TbOrderInfo::getMemberId, null));
} }
} }
return true;
}
private void setCurrentOrderId(String tableId, Object shopId, String orderId) { private void setCurrentOrderId(String tableId, Object shopId, String orderId) {