会员余额支付缺陷修复

This commit is contained in:
谭凯凯
2024-10-29 15:47:09 +08:00
committed by Tankaikai
parent 17cbff4228
commit d5b0813c46

View File

@@ -661,7 +661,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
}
if (cashierCart.getOrderId() == null) {
throw new BadRequestException("此商品还未下单,无需退单");
}
@@ -1381,7 +1380,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
}
if (shopEatTypeInfoDTO.isIncrMaterId() && "pending".equals(orderInfo.getStatus())) {
String key = RedisConstant.getMasterIdKey(createOrderDTO.getShopId(), cn.ysk.cashier.utils.DateUtils.getDay(), orderInfo.getTableId());;
String key = RedisConstant.getMasterIdKey(createOrderDTO.getShopId(), cn.ysk.cashier.utils.DateUtils.getDay(), orderInfo.getTableId());
;
redisTemplate.delete(key);
}
}
@@ -1636,7 +1636,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
orderInfo.setDiscountAmount(orderInfo.getAmount().subtract(finalAmount));
}
orderInfo.setMemberId(Convert.toStr(payDTO.getVipUserId()));
if (StrUtil.isEmpty(orderInfo.getMemberId())) {
orderInfo.setMemberId(Convert.toStr(payDTO.getVipUserId()));
}
orderInfoMapper.updateById(orderInfo);
//更新购物车状态
@@ -1653,7 +1655,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
.eq(TbOrderDetail::getStatus, "unpaid")
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount() == null ? 1: payDTO.getDiscount()))
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount() == null ? 1 : payDTO.getDiscount()))
.set(TbOrderDetail::getStatus, "closed"));
JSONObject jsonObject = new JSONObject();