mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 23:31:52 +08:00
【代码优化】MALL-TRADE:订单结算信息返回积分相关信息
This commit is contained in:
parent
b678da810e
commit
24b1594976
@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO;
|
import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "用户 App - 交易订单结算信息 Response VO")
|
@Schema(description = "用户 App - 交易订单结算信息 Response VO")
|
||||||
@ -26,7 +26,7 @@ public class AppTradeOrderSettlementRespVO {
|
|||||||
private Address address;
|
private Address address;
|
||||||
|
|
||||||
@Schema(description = "已使用的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
@Schema(description = "已使用的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
private Integer usedPoint;
|
private Integer usePoint;
|
||||||
|
|
||||||
@Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
@Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
private Integer totalPoint;
|
private Integer totalPoint;
|
||||||
|
@ -48,13 +48,17 @@ public class TradePriceCalculateRespBO {
|
|||||||
*/
|
*/
|
||||||
private Long couponId;
|
private Long couponId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会员剩余积分
|
||||||
|
*/
|
||||||
|
private Integer totalPoint;
|
||||||
/**
|
/**
|
||||||
* 使用的积分
|
* 使用的积分
|
||||||
*/
|
*/
|
||||||
private Integer usePoint;
|
private Integer usePoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 使用的积分
|
* 赠送的积分
|
||||||
*/
|
*/
|
||||||
private Integer givePoint;
|
private Integer givePoint;
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@ import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
|||||||
import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum;
|
import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum;
|
||||||
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateReqBO;
|
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateReqBO;
|
||||||
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateRespBO;
|
import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateRespBO;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.core.annotation.Order;
|
import org.springframework.core.annotation.Order;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
@ -39,6 +39,9 @@ public class TradePointUsePriceCalculator implements TradePriceCalculator {
|
|||||||
public void calculate(TradePriceCalculateReqBO param, TradePriceCalculateRespBO result) {
|
public void calculate(TradePriceCalculateReqBO param, TradePriceCalculateRespBO result) {
|
||||||
// 默认使用积分为 0
|
// 默认使用积分为 0
|
||||||
result.setUsePoint(0);
|
result.setUsePoint(0);
|
||||||
|
MemberUserRespDTO user = memberUserApi.getUser(param.getUserId());
|
||||||
|
result.setTotalPoint(user.getPoint()); // 设置会员总积分
|
||||||
|
|
||||||
// 1.1 校验是否使用积分
|
// 1.1 校验是否使用积分
|
||||||
if (!BooleanUtil.isTrue(param.getPointStatus())) {
|
if (!BooleanUtil.isTrue(param.getPointStatus())) {
|
||||||
result.setUsePoint(0);
|
result.setUsePoint(0);
|
||||||
@ -50,7 +53,6 @@ public class TradePointUsePriceCalculator implements TradePriceCalculator {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 1.3 校验用户积分余额
|
// 1.3 校验用户积分余额
|
||||||
MemberUserRespDTO user = memberUserApi.getUser(param.getUserId());
|
|
||||||
if (user.getPoint() == null || user.getPoint() <= 0) {
|
if (user.getPoint() == null || user.getPoint() <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user