Commit 5b59ce5261e27c96eaa9caef91f779e12d472efb
Committed by
Gitee
!1031 【代码优化】MALL-TRADE:订单结算信息返回积分相关信息
Merge pull request !1031 from puhui999/develop
Showing
4 changed files
with
16 additions
and
5 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementRespVO.java
| ... | ... | @@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.trade.controller.app.order.vo; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.trade.controller.app.base.property.AppProductPropertyValueDetailRespVO; |
| 4 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 5 | +import jakarta.validation.constraints.NotNull; | |
| 5 | 6 | import lombok.AllArgsConstructor; |
| 6 | 7 | import lombok.Data; |
| 7 | 8 | import lombok.NoArgsConstructor; |
| 8 | 9 | |
| 9 | -import jakarta.validation.constraints.NotNull; | |
| 10 | 10 | import java.util.List; |
| 11 | 11 | |
| 12 | 12 | @Schema(description = "用户 App - 交易订单结算信息 Response VO") |
| ... | ... | @@ -26,7 +26,7 @@ public class AppTradeOrderSettlementRespVO { |
| 26 | 26 | private Address address; |
| 27 | 27 | |
| 28 | 28 | @Schema(description = "已使用的积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| 29 | - private Integer usedPoint; | |
| 29 | + private Integer usePoint; | |
| 30 | 30 | |
| 31 | 31 | @Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10") |
| 32 | 32 | private Integer totalPoint; | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/bo/TradePriceCalculateRespBO.java
| ... | ... | @@ -49,12 +49,16 @@ public class TradePriceCalculateRespBO { |
| 49 | 49 | private Long couponId; |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | + * 会员剩余积分 | |
| 53 | + */ | |
| 54 | + private Integer totalPoint; | |
| 55 | + /** | |
| 52 | 56 | * 使用的积分 |
| 53 | 57 | */ |
| 54 | 58 | private Integer usePoint; |
| 55 | 59 | |
| 56 | 60 | /** |
| 57 | - * 使用的积分 | |
| 61 | + * 赠送的积分 | |
| 58 | 62 | */ |
| 59 | 63 | private Integer givePoint; |
| 60 | 64 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradePointUsePriceCalculator.java
| ... | ... | @@ -9,11 +9,11 @@ import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 9 | 9 | import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum; |
| 10 | 10 | import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateReqBO; |
| 11 | 11 | import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateRespBO; |
| 12 | +import jakarta.annotation.Resource; | |
| 12 | 13 | import lombok.extern.slf4j.Slf4j; |
| 13 | 14 | import org.springframework.core.annotation.Order; |
| 14 | 15 | import org.springframework.stereotype.Component; |
| 15 | 16 | |
| 16 | -import jakarta.annotation.Resource; | |
| 17 | 17 | import java.util.List; |
| 18 | 18 | |
| 19 | 19 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| ... | ... | @@ -39,6 +39,9 @@ public class TradePointUsePriceCalculator implements TradePriceCalculator { |
| 39 | 39 | public void calculate(TradePriceCalculateReqBO param, TradePriceCalculateRespBO result) { |
| 40 | 40 | // 默认使用积分为 0 |
| 41 | 41 | result.setUsePoint(0); |
| 42 | + MemberUserRespDTO user = memberUserApi.getUser(param.getUserId()); | |
| 43 | + result.setTotalPoint(user.getPoint()); // 设置会员总积分 | |
| 44 | + | |
| 42 | 45 | // 1.1 校验是否使用积分 |
| 43 | 46 | if (!BooleanUtil.isTrue(param.getPointStatus())) { |
| 44 | 47 | result.setUsePoint(0); |
| ... | ... | @@ -50,7 +53,6 @@ public class TradePointUsePriceCalculator implements TradePriceCalculator { |
| 50 | 53 | return; |
| 51 | 54 | } |
| 52 | 55 | // 1.3 校验用户积分余额 |
| 53 | - MemberUserRespDTO user = memberUserApi.getUser(param.getUserId()); | |
| 54 | 56 | if (user.getPoint() == null || user.getPoint() <= 0) { |
| 55 | 57 | return; |
| 56 | 58 | } | ... | ... |
yudao-module-system/yudao-module-system-biz/pom.xml
| ... | ... | @@ -111,6 +111,11 @@ |
| 111 | 111 | </dependency> |
| 112 | 112 | |
| 113 | 113 | <dependency> |
| 114 | + <groupId>com.tencentcloudapi</groupId> | |
| 115 | + <artifactId>tencentcloud-sdk-java-sms</artifactId> <!-- 短信(腾讯云) --> | |
| 116 | + </dependency> | |
| 117 | + | |
| 118 | + <dependency> | |
| 114 | 119 | <groupId>com.xingyuv</groupId> |
| 115 | 120 | <artifactId>spring-boot-starter-captcha-plus</artifactId> <!-- 验证码,一般用于登录使用 --> |
| 116 | 121 | </dependency> | ... | ... |