Commit a9a6bff15fe1ee368e32edcce3f96c44c728e265
1 parent
072b3d6f
【依赖升级】Phase 1:安全依赖版本升级
升级内容: - spring-boot 3.5.9 → 3.5.14 - springdoc 2.8.14 → 2.8.17 - druid 1.2.27 → 1.2.28 - mybatis-plus 3.5.15 → 3.5.16 - mybatis-plus-join 1.5.5 → 1.5.7 - netty 4.2.9.Final → 4.2.12.Final - lombok 1.18.42 → 1.18.46 - hutool 5.8.42 → 5.8.44 - guava 33.5.0-jre → 33.6.0-jre - jsoup 1.21.2 → 1.22.2 - jsch 2.27.7 → 2.28.2 - commons-net 3.12.0 → 3.13.0 - tika-core 3.2.3 → 3.3.0 - skywalking 9.5.0 → 9.6.0 - spring-boot-admin 3.5.6 → 3.5.8 - vertx 4.5.22 → 4.5.26 - californium 3.12.0 → 3.14.0 - j2mod 3.2.1 → 3.3.0 - taos 3.7.9 → 3.8.3 - awssdk 2.40.15 → 2.44.0 - alipay-sdk-java 4.40.607.ALL → 4.40.771.ALL - opengauss-jdbc 5.1.0 → 7.0.0-RC3-og - kingbase8 8.6.0 → 9.0.1.jre7 - jimureport 2.1.3 → 2.3.2(artifactId 从 jimureport-spring-boot3-starter-fastjson2 改为 jimureport-spring-boot3-starter) - jimubi 2.3.0 → 2.3.2
Showing
3 changed files
with
131 additions
and
27 deletions
yudao-dependencies/pom.xml
| ... | ... | @@ -17,29 +17,29 @@ |
| 17 | 17 | <revision>2026.03-SNAPSHOT</revision> |
| 18 | 18 | <flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version> |
| 19 | 19 | <!-- 统一依赖管理 --> |
| 20 | - <spring.boot.version>3.5.9</spring.boot.version> | |
| 20 | + <spring.boot.version>3.5.14</spring.boot.version> | |
| 21 | 21 | <!-- Web 相关 --> |
| 22 | - <springdoc.version>2.8.14</springdoc.version> | |
| 22 | + <springdoc.version>2.8.17</springdoc.version> | |
| 23 | 23 | <knife4j.version>4.5.0</knife4j.version> |
| 24 | 24 | <!-- DB 相关 --> |
| 25 | - <druid.version>1.2.27</druid.version> | |
| 25 | + <druid.version>1.2.28</druid.version> | |
| 26 | 26 | <mybatis.version>3.5.19</mybatis.version> |
| 27 | - <mybatis-plus.version>3.5.15</mybatis-plus.version> | |
| 28 | - <mybatis-plus-join.version>1.5.5</mybatis-plus-join.version> | |
| 27 | + <mybatis-plus.version>3.5.16</mybatis-plus.version> | |
| 28 | + <mybatis-plus-join.version>1.5.7</mybatis-plus-join.version> | |
| 29 | 29 | <dynamic-datasource.version>4.5.0</dynamic-datasource.version> |
| 30 | 30 | <easy-trans.version>3.0.6</easy-trans.version> |
| 31 | 31 | <redisson.version>3.52.0</redisson.version> |
| 32 | 32 | <dm8.jdbc.version>8.1.3.140</dm8.jdbc.version> |
| 33 | - <kingbase.jdbc.version>8.6.0</kingbase.jdbc.version> | |
| 34 | - <opengauss.jdbc.version>5.1.0</opengauss.jdbc.version> | |
| 35 | - <taos.version>3.7.9</taos.version> | |
| 33 | + <kingbase.jdbc.version>9.0.1.jre7</kingbase.jdbc.version> | |
| 34 | + <opengauss.jdbc.version>7.0.0-RC3-og</opengauss.jdbc.version> | |
| 35 | + <taos.version>3.8.3</taos.version> | |
| 36 | 36 | <!-- 消息队列 --> |
| 37 | 37 | <rocketmq-spring.version>2.3.5</rocketmq-spring.version> |
| 38 | 38 | <!-- 服务保障相关 --> |
| 39 | 39 | <lock4j.version>2.2.7</lock4j.version> |
| 40 | 40 | <!-- 监控相关 --> |
| 41 | - <skywalking.version>9.5.0</skywalking.version> | |
| 42 | - <spring-boot-admin.version>3.5.6</spring-boot-admin.version> | |
| 41 | + <skywalking.version>9.6.0</skywalking.version> | |
| 42 | + <spring-boot-admin.version>3.5.8</spring-boot-admin.version> | |
| 43 | 43 | <opentracing.version>0.33.0</opentracing.version> |
| 44 | 44 | <!-- Test 测试相关 --> |
| 45 | 45 | <podam.version>8.0.2.RELEASE</podam.version> |
| ... | ... | @@ -49,36 +49,36 @@ |
| 49 | 49 | <flowable.version>7.2.0</flowable.version> |
| 50 | 50 | <!-- 工具类相关 --> |
| 51 | 51 | <anji-plus-captcha.version>1.4.0</anji-plus-captcha.version> |
| 52 | - <jsoup.version>1.21.2</jsoup.version> | |
| 53 | - <lombok.version>1.18.42</lombok.version> | |
| 52 | + <jsoup.version>1.22.2</jsoup.version> | |
| 53 | + <lombok.version>1.18.46</lombok.version> | |
| 54 | 54 | <mapstruct.version>1.6.3</mapstruct.version> |
| 55 | - <hutool-5.version>5.8.42</hutool-5.version> | |
| 55 | + <hutool-5.version>5.8.44</hutool-5.version> | |
| 56 | 56 | <hutool-6.version>6.0.0-M22</hutool-6.version> |
| 57 | 57 | <fastexcel.version>1.3.0</fastexcel.version> |
| 58 | 58 | <velocity.version>2.4.1</velocity.version> |
| 59 | 59 | <fastjson.version>1.2.83</fastjson.version> |
| 60 | - <guava.version>33.5.0-jre</guava.version> | |
| 60 | + <guava.version>33.6.0-jre</guava.version> | |
| 61 | 61 | <transmittable-thread-local.version>2.14.5</transmittable-thread-local.version> |
| 62 | - <commons-net.version>3.12.0</commons-net.version> | |
| 62 | + <commons-net.version>3.13.0</commons-net.version> | |
| 63 | 63 | <commons-lang3.version>3.20.0</commons-lang3.version> |
| 64 | - <jsch.version>2.27.7</jsch.version> | |
| 65 | - <tika-core.version>3.2.3</tika-core.version> | |
| 64 | + <jsch.version>2.28.2</jsch.version> | |
| 65 | + <tika-core.version>3.3.0</tika-core.version> | |
| 66 | 66 | <ip2region.version>2.7.0</ip2region.version> |
| 67 | 67 | <bizlog-sdk.version>3.0.6</bizlog-sdk.version> |
| 68 | - <netty.version>4.2.9.Final</netty.version> | |
| 68 | + <netty.version>4.2.12.Final</netty.version> | |
| 69 | 69 | <mqtt.version>1.2.5</mqtt.version> |
| 70 | - <vertx.version>4.5.22</vertx.version> | |
| 70 | + <vertx.version>4.5.26</vertx.version> | |
| 71 | 71 | <okhttp.version>4.12.0</okhttp.version> |
| 72 | - <californium.version>3.12.0</californium.version> | |
| 73 | - <j2mod.version>3.2.1</j2mod.version> | |
| 72 | + <californium.version>3.14.0</californium.version> | |
| 73 | + <j2mod.version>3.3.0</j2mod.version> | |
| 74 | 74 | <!-- 三方云服务相关 --> |
| 75 | - <awssdk.version>2.40.15</awssdk.version> | |
| 75 | + <awssdk.version>2.44.0</awssdk.version> | |
| 76 | 76 | <justauth.version>1.16.7</justauth.version> |
| 77 | 77 | <justauth-starter.version>1.4.0</justauth-starter.version> |
| 78 | - <jimureport.version>2.1.3</jimureport.version> | |
| 79 | - <jimubi.version>2.3.0</jimubi.version> | |
| 78 | + <jimureport.version>2.3.2</jimureport.version> | |
| 79 | + <jimubi.version>2.3.2</jimubi.version> | |
| 80 | 80 | <weixin-java.version>4.7.9-20251224.161447</weixin-java.version> |
| 81 | - <alipay-sdk-java.version>4.40.607.ALL</alipay-sdk-java.version> | |
| 81 | + <alipay-sdk-java.version>4.40.771.ALL</alipay-sdk-java.version> | |
| 82 | 82 | </properties> |
| 83 | 83 | |
| 84 | 84 | <dependencyManagement> |
| ... | ... | @@ -665,7 +665,7 @@ |
| 665 | 665 | <!-- 积木报表--> |
| 666 | 666 | <dependency> |
| 667 | 667 | <groupId>org.jeecgframework.jimureport</groupId> |
| 668 | - <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> | |
| 668 | + <artifactId>jimureport-spring-boot3-starter</artifactId> | |
| 669 | 669 | <version>${jimureport.version}</version> |
| 670 | 670 | </dependency> |
| 671 | 671 | <dependency> | ... | ... |
yudao-module-mall/yudao-module-trade/src/test/java/cn/iocoder/yudao/module/trade/service/price/calculator/TradeBargainActivityPriceCalculatorTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.trade.service.price.calculator; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; | |
| 4 | +import cn.iocoder.yudao.module.promotion.api.bargain.BargainRecordApi; | |
| 5 | +import cn.iocoder.yudao.module.promotion.api.bargain.dto.BargainValidateJoinRespDTO; | |
| 6 | +import cn.iocoder.yudao.module.promotion.enums.common.PromotionTypeEnum; | |
| 7 | +import cn.iocoder.yudao.module.trade.enums.order.TradeOrderTypeEnum; | |
| 8 | +import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateReqBO; | |
| 9 | +import cn.iocoder.yudao.module.trade.service.price.bo.TradePriceCalculateRespBO; | |
| 10 | +import org.junit.jupiter.api.Test; | |
| 11 | +import org.mockito.InjectMocks; | |
| 12 | +import org.mockito.Mock; | |
| 13 | + | |
| 14 | +import java.util.ArrayList; | |
| 15 | + | |
| 16 | +import static java.util.Collections.singletonList; | |
| 17 | +import static org.junit.jupiter.api.Assertions.assertEquals; | |
| 18 | +import static org.junit.jupiter.api.Assertions.assertTrue; | |
| 19 | +import static org.mockito.ArgumentMatchers.eq; | |
| 20 | +import static org.mockito.Mockito.when; | |
| 21 | + | |
| 22 | +/** | |
| 23 | + * {@link TradeBargainActivityPriceCalculator} 的单元测试 | |
| 24 | + * | |
| 25 | + * @author 芋道源码 | |
| 26 | + */ | |
| 27 | +public class TradeBargainActivityPriceCalculatorTest extends BaseMockitoUnitTest { | |
| 28 | + | |
| 29 | + @InjectMocks | |
| 30 | + private TradeBargainActivityPriceCalculator tradeBargainActivityPriceCalculator; | |
| 31 | + | |
| 32 | + @Mock | |
| 33 | + private BargainRecordApi bargainRecordApi; | |
| 34 | + | |
| 35 | + @Test | |
| 36 | + public void testCalculate_match() { | |
| 37 | + // 准备参数:砍价订单,单 SKU、数量 1 | |
| 38 | + TradePriceCalculateReqBO param = new TradePriceCalculateReqBO() | |
| 39 | + .setUserId(1L).setBargainRecordId(2L) | |
| 40 | + .setItems(singletonList( | |
| 41 | + new TradePriceCalculateReqBO.Item().setSkuId(10L).setCount(1).setSelected(true) | |
| 42 | + )); | |
| 43 | + TradePriceCalculateRespBO result = new TradePriceCalculateRespBO() | |
| 44 | + .setType(TradeOrderTypeEnum.BARGAIN.getType()) | |
| 45 | + .setPrice(new TradePriceCalculateRespBO.Price()) | |
| 46 | + .setPromotions(new ArrayList<>()) | |
| 47 | + .setItems(singletonList( | |
| 48 | + new TradePriceCalculateRespBO.OrderItem().setSkuId(10L).setCount(1).setSelected(true) | |
| 49 | + .setPrice(100).setSpuId(1L).setGivePoint(0) | |
| 50 | + )); | |
| 51 | + TradePriceCalculatorHelper.recountPayPrice(result.getItems()); | |
| 52 | + TradePriceCalculatorHelper.recountAllPrice(result); | |
| 53 | + | |
| 54 | + // mock 方法:砍价后单价 30 分 | |
| 55 | + when(bargainRecordApi.validateJoinBargain(eq(1L), eq(2L), eq(10L))).thenReturn( | |
| 56 | + new BargainValidateJoinRespDTO().setActivityId(1000L).setName("砍价 1000 号").setBargainPrice(30)); | |
| 57 | + | |
| 58 | + // 调用:100 - 30 * 1 = 70 优惠 | |
| 59 | + tradeBargainActivityPriceCalculator.calculate(param, result); | |
| 60 | + | |
| 61 | + // 断言:订单价格 | |
| 62 | + TradePriceCalculateRespBO.Price price = result.getPrice(); | |
| 63 | + assertEquals(price.getTotalPrice(), 100); | |
| 64 | + assertEquals(price.getDiscountPrice(), 70); | |
| 65 | + assertEquals(price.getPayPrice(), 30); | |
| 66 | + assertEquals(result.getBargainActivityId(), 1000L); | |
| 67 | + | |
| 68 | + // 断言:促销明细的 id 来自砍价活动而非秒杀活动 | |
| 69 | + assertEquals(result.getPromotions().size(), 1); | |
| 70 | + TradePriceCalculateRespBO.Promotion promotion = result.getPromotions().get(0); | |
| 71 | + assertEquals(promotion.getId(), 1000L); | |
| 72 | + assertEquals(promotion.getName(), "砍价 1000 号"); | |
| 73 | + assertEquals(promotion.getType(), PromotionTypeEnum.BARGAIN_ACTIVITY.getType()); | |
| 74 | + assertEquals(promotion.getDiscountPrice(), 70); | |
| 75 | + assertTrue(promotion.getMatch()); | |
| 76 | + assertEquals(promotion.getDescription(), "砍价活动:省 0.70 元"); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @Test | |
| 80 | + public void testCalculate_skipNonBargainOrder() { | |
| 81 | + // 准备参数:普通订单 | |
| 82 | + TradePriceCalculateReqBO param = new TradePriceCalculateReqBO() | |
| 83 | + .setItems(singletonList( | |
| 84 | + new TradePriceCalculateReqBO.Item().setSkuId(10L).setCount(1).setSelected(true) | |
| 85 | + )); | |
| 86 | + TradePriceCalculateRespBO result = new TradePriceCalculateRespBO() | |
| 87 | + .setType(TradeOrderTypeEnum.NORMAL.getType()) | |
| 88 | + .setPrice(new TradePriceCalculateRespBO.Price()) | |
| 89 | + .setPromotions(new ArrayList<>()) | |
| 90 | + .setItems(singletonList( | |
| 91 | + new TradePriceCalculateRespBO.OrderItem().setSkuId(10L).setCount(1).setSelected(true) | |
| 92 | + .setPrice(100).setSpuId(1L) | |
| 93 | + )); | |
| 94 | + TradePriceCalculatorHelper.recountPayPrice(result.getItems()); | |
| 95 | + TradePriceCalculatorHelper.recountAllPrice(result); | |
| 96 | + | |
| 97 | + // 调用:非砍价订单,直接跳过,不会调用 API | |
| 98 | + tradeBargainActivityPriceCalculator.calculate(param, result); | |
| 99 | + | |
| 100 | + // 断言:未产生促销 | |
| 101 | + assertEquals(result.getPromotions().size(), 0); | |
| 102 | + } | |
| 103 | + | |
| 104 | +} | ... | ... |
yudao-module-report/pom.xml
| ... | ... | @@ -56,7 +56,7 @@ |
| 56 | 56 | <!-- 积木报表--> |
| 57 | 57 | <dependency> |
| 58 | 58 | <groupId>org.jeecgframework.jimureport</groupId> |
| 59 | - <artifactId>jimureport-spring-boot3-starter-fastjson2</artifactId> | |
| 59 | + <artifactId>jimureport-spring-boot3-starter</artifactId> | |
| 60 | 60 | </dependency> |
| 61 | 61 | <dependency> |
| 62 | 62 | <groupId>org.jeecgframework.jimureport</groupId> | ... | ... |