From ba869fce2e702ff4d129c888689dfb0c3c0c8236 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 21 Jun 2022 16:25:55 +0800
Subject: [PATCH] 20220528

---
 src/main/java/cc/mrbird/febs/mall/vo/MallGoodsDetailsVo.java                    |    3 +++
 src/main/java/cc/mrbird/febs/mall/entity/MallGoods.java                         |    7 +++++++
 src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html          |    9 +++++++++
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java |    3 ++-
 src/main/java/cc/mrbird/febs/mall/vo/AdminMailGoodsDetailVo.java                |    2 ++
 src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html       |   11 +++++++++++
 src/main/java/cc/mrbird/febs/mall/dto/MallGoodsUpdateDto.java                   |    2 ++
 src/main/java/cc/mrbird/febs/mall/dto/AddMallGoodsDto.java                      |    2 ++
 8 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/dto/AddMallGoodsDto.java b/src/main/java/cc/mrbird/febs/mall/dto/AddMallGoodsDto.java
index 1e8dde8..f3cf467 100644
--- a/src/main/java/cc/mrbird/febs/mall/dto/AddMallGoodsDto.java
+++ b/src/main/java/cc/mrbird/febs/mall/dto/AddMallGoodsDto.java
@@ -24,6 +24,8 @@
 
     private String thumbs;
 
+    private String goodsParameter;
+
     private String goodsDetails;
 
     private Integer isSale;
diff --git a/src/main/java/cc/mrbird/febs/mall/dto/MallGoodsUpdateDto.java b/src/main/java/cc/mrbird/febs/mall/dto/MallGoodsUpdateDto.java
index 92bc374..977a0ca 100644
--- a/src/main/java/cc/mrbird/febs/mall/dto/MallGoodsUpdateDto.java
+++ b/src/main/java/cc/mrbird/febs/mall/dto/MallGoodsUpdateDto.java
@@ -21,6 +21,8 @@
 
     private String thumbs;
 
+    private String goodsParameter;
+
     private String goodsIntrodution;
 
     private String unit;
diff --git a/src/main/java/cc/mrbird/febs/mall/entity/MallGoods.java b/src/main/java/cc/mrbird/febs/mall/entity/MallGoods.java
index d543d9b..369b65b 100644
--- a/src/main/java/cc/mrbird/febs/mall/entity/MallGoods.java
+++ b/src/main/java/cc/mrbird/febs/mall/entity/MallGoods.java
@@ -26,6 +26,13 @@
 
     private String thumb;
 
+    /**
+     * ALTER TABLE `mall_goods`
+     * DROP COLUMN `goods_parameter`,
+     * ADD COLUMN `goods_parameter`  text NULL COMMENT '商品参数' AFTER `thumb`;
+     */
+    private String goodsParameter;
+
     private String goodsDetails;
 
     private Integer isSale;
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
index e97f141..ca70a00 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -248,7 +248,8 @@
                         MallGoodsSku sku = mallGoodsSkuMapper.selectById(orderItem.getSkuId());
                         if (mallGoods.getIsNormal() == 2) {
                             hasTc = true;
-                            score = sku.getPresentPrice().multiply(mallGoods.getStaticMulti());
+                            BigDecimal staticMulti = mallGoods.getStaticMulti() == null ? BigDecimal.ZERO : mallGoods.getStaticMulti();
+                            score = sku.getPresentPrice().multiply(staticMulti);
                         }
 
                         if (score.compareTo(BigDecimal.ZERO) > 0) {
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/AdminMailGoodsDetailVo.java b/src/main/java/cc/mrbird/febs/mall/vo/AdminMailGoodsDetailVo.java
index b634bc3..f83ef64 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/AdminMailGoodsDetailVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/AdminMailGoodsDetailVo.java
@@ -17,6 +17,8 @@
 
     private List<AdminMailGoodsSkuDetailVo> mailGoodsSkuDetailVo;
 
+    private String goodsParameter;
+
     private String goodsIntrodution;
 
     private String unit;
diff --git a/src/main/java/cc/mrbird/febs/mall/vo/MallGoodsDetailsVo.java b/src/main/java/cc/mrbird/febs/mall/vo/MallGoodsDetailsVo.java
index 3a457fb..e258a8d 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/MallGoodsDetailsVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/MallGoodsDetailsVo.java
@@ -24,6 +24,9 @@
     @ApiModelProperty(value = "商品名称")
     private String goodsName;
 
+    @ApiModelProperty(value = "商品参数")
+    private String goodsParameter;
+
     @ApiModelProperty(value = "商品介绍")
     private String goodsIntrodution;
 
diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
index 0f38712..bcc7f0c 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
@@ -142,6 +142,15 @@
                                         </div>
 
                                         <div class="layui-form-item">
+                                            <label class="layui-form-label">商品参数:</label>
+                                            <div class="layui-input-block">
+                                                <label>
+                                                    <textarea name="goodsParameter" rows="5" autocomplete="off" class="layui-textarea" ></textarea>
+                                                </label>
+                                            </div>
+                                        </div>
+
+                                        <div class="layui-form-item">
                                             <label class="layui-form-label febs-form-item-require">商品详情:</label>
                                             <div class="layui-input-block">
 <!--                                                <textarea id="goodsDetailEdit" lay-verify="goodsDetails" name = "goodsDetails" class="layui-textarea"></textarea>-->
diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
index fd10a17..10e16e6 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
@@ -164,6 +164,16 @@
                                         </div>
 
                                         <div class="layui-form-item">
+                                            <label class="layui-form-label">商品参数:</label>
+                                            <div class="layui-input-block">
+                                                <label>
+                                                    <textarea name="goodsParameter" rows="5" autoComplete="off"
+                                                              class="layui-textarea"></textarea>
+                                                </label>
+                                            </div>
+                                        </div>
+
+                                        <div class="layui-form-item">
                                             <label class="layui-form-label febs-form-item-require">商品详情:</label>
                                             <div class="layui-input-block">
 <!--                                                <textarea id="lay_edit" lay-verify="goodsDetails" name="goodsDetails" class="layui-textarea"></textarea>-->
@@ -626,6 +636,7 @@
                 "unit": goodsInfo.unit,
                 "stock": goodsInfo.stock,
                 "volume": goodsInfo.volume,
+                "goodsParameter": goodsInfo.goodsParameter,
                 "goodsIntrodution": goodsInfo.goodsIntrodution,
                 "isNormal": goodsInfo.isNormal,
                 "staticMulti": goodsInfo.staticMulti,

--
Gitblit v1.9.1