From 9247da0df8aaa8ed6153439deb01eb4c6a6c8916 Mon Sep 17 00:00:00 2001 From: qiaohui <924337501@qq.com> Date: Thu, 26 Sep 2024 22:50:51 +0800 Subject: [PATCH] =?UTF-8?q?getByProductSn=20=E5=95=86=E5=93=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BA=93=E5=AD=98=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hiver-admin/src/main/resources/application.yml | 10 +++++----- hiver-admin/test-output/test-report.html | 18 +++++++++--------- .../java/cc/hiver/mall/entity/Product.java | 7 +++++++ .../mybatis/ProductServiceImpl.java | 2 ++ 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index 49c93ed7..2553c28f 100644 --- a/hiver-admin/src/main/resources/application.yml +++ b/hiver-admin/src/main/resources/application.yml @@ -25,8 +25,8 @@ spring: timeout-per-shutdown-phase: 10S # 数据源 datasource: - url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true -# url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true +# url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true + url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true username: reddoor # Jasypt加密 可到common-utils中找到JasyptUtil加解密工具类生成加密结果 格式为ENC(加密结果) 以下解密结果为123456 password: ENC(Zla4U4+yRLPhicvuX2TmiEgxEpzP4dk8BHzFDEtiEhwLQIIaftZrrEUJZce6efoe) @@ -67,8 +67,8 @@ spring: ddl-auto: update # Redis 若设有密码自行添加配置password redis: - host: 154.8.162.157 -# host: 8.140.198.243 +# host: 154.8.162.157 + host: 8.140.198.243 password: reddoor168 # 数据库索引 默认0 database: 1 @@ -347,7 +347,7 @@ ignored: - /hiver/app/logisticsEntruckingLog/getDateLogisticsEntruckingLogPageList - /hiver/app/logisticsEntruckingLog/batchAddLogisticsEntruckingLog - /hiver/purchaseOcrPicture/getLogisticsOrderOfAi - - /hiver/app/productCategory/** + - /hiver/app/product/** # 限流及黑名单不拦截的路径 limitUrls: - /**/*.js diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index b2c8e635..3c56bf13 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -5,7 +5,7 @@ -HiverԱ +Hiver测试报告 @@ -35,7 +35,7 @@ Hiver
  • - 23, 2024 22:26:15 +九月 26, 2024 22:44:51
  • @@ -84,7 +84,7 @@

    passTest

    -

    22:26:16 / 0.015 secs

    +

    22:44:52 下午 / 0.012 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -09.23.2024 22:26:16 -09.23.2024 22:26:16 -0.015 secs +09.26.2024 22:44:52 +09.26.2024 22:44:52 +0.012 secs
    @@ -104,7 +104,7 @@ Pass - 22:26:16 + 22:44:52 Test passed @@ -128,13 +128,13 @@

    Started

    -

    23, 2024 22:26:15

    +

    九月 26, 2024 22:44:51

    Ended

    -

    23, 2024 22:26:16

    +

    九月 26, 2024 22:44:52

    diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java index 95727848..b7d87f14 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/entity/Product.java @@ -18,6 +18,7 @@ import javax.persistence.Transient; import java.io.Serializable; import java.math.BigDecimal; import java.util.Date; +import java.util.List; @Data @ApiModel(value = "商品表") @@ -128,4 +129,10 @@ public class Product implements Serializable { @ApiModelProperty(value = "客户购买数量") private Integer buyCount; + + @Transient + @TableField(exist = false) + @ApiModelProperty(value = "商品库存信息") + private List stockList; + } \ No newline at end of file diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java index 6f64ecf2..763d4b25 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/serviceimpl/mybatis/ProductServiceImpl.java @@ -168,6 +168,8 @@ public class ProductServiceImpl extends ServiceImpl impl } for (Product product : byProductSn) { product.setBuyCount(buyCountMap.getOrDefault(product.getId(), 0)); + final List stockList = stockService.getProductStock(product.getId()); + product.setStockList(stockList); } } return byProductSn;