fix: 优惠券返回店铺id

This commit is contained in:
张松
2024-11-09 09:31:30 +08:00
parent 08348159f7
commit 9e95bde5da
3 changed files with 5 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ import java.util.Date;
@Data
public class TbUserCouponVo {
private Integer id;
private Integer shopId;
private BigDecimal fullAmount;
private BigDecimal discountAmount;
private Integer couponId;

View File

@@ -1261,7 +1261,8 @@ public class PayService {
log.info("更新购物车:{}", cartCount);
//更新子单状态
mpOrderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>().eq(TbOrderDetail::getOrderId, orderInfo.getId())
mpOrderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
.in(TbOrderDetail::getStatus, "unpaid")
.set(TbOrderDetail::getStatus, "closed"));

View File

@@ -38,6 +38,7 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
<select id="queryByVipIdAndShopId" resultType="com.chaozhanggui.system.cashierservice.entity.vo.TbUserCouponVo">
SELECT
inRecord.shop_id as shopId,
inRecord.id as id,
inRecord.full_amount as fullAmount,
inRecord.discount_amount as discountAmount,
@@ -72,6 +73,7 @@ id, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, nu
<select id="queryByVipIdAndShopIdExpire" resultType="com.chaozhanggui.system.cashierservice.entity.vo.TbUserCouponVo">
SELECT
inRecord.shop_id as shopId,
CASE
WHEN inRecord.type = 1 THEN inRecord.NAME
WHEN inRecord.type = 2 THEN pro.NAME