From ef04975fe02f150798c42d5d49527f44b81ba74a Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 14 Feb 2023 13:59:02 +0800
Subject: [PATCH] 后台商品修改

---
 src/main/resources/mapper/modules/MallGoodsMapper.xml                     |   12 ++++++++++++
 src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java |    8 +++++++-
 src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html    |    2 +-
 src/main/resources/templates/febs/views/modules/order/commentList.html    |   15 +--------------
 src/main/java/cc/mrbird/febs/mall/mapper/MallGoodsMapper.java             |    4 ++++
 src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html |    2 +-
 src/main/resources/templates/febs/views/modules/order/orderList.html      |    3 ++-
 7 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/mapper/MallGoodsMapper.java b/src/main/java/cc/mrbird/febs/mall/mapper/MallGoodsMapper.java
index 23c1079..e4c99c5 100644
--- a/src/main/java/cc/mrbird/febs/mall/mapper/MallGoodsMapper.java
+++ b/src/main/java/cc/mrbird/febs/mall/mapper/MallGoodsMapper.java
@@ -58,4 +58,8 @@
     List<MallGoods> selectMallGoodsListQueryByRuleId(@Param("id")Long id);
 
     List<MallGoods> selectMallGoodsListQueryByRuleIdAndIsSale(@Param("id")Long id, @Param("isSale")Integer ishotStateYes);
+
+    void updateCarriageRuleId(@Param("id")Long id);
+
+    void updateCarriageAmount(@Param("id")Long id);
 }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
index e46312b..94b3d3e 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallGoodsService.java
@@ -72,7 +72,7 @@
         Integer carriageType = addMallGoodsDto.getCarriageType();
         if(1 == carriageType){
             if(ObjectUtil.isEmpty(addMallGoodsDto.getCarriageAmount())
-                    || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) >= 0){
+                    || BigDecimal.ZERO.compareTo(addMallGoodsDto.getCarriageAmount()) > 0){
                 return new FebsResponse().fail().message("固定邮费不能小于零");
             }
         }else{
@@ -389,6 +389,12 @@
 
         mallGoodsMapper.updateById(mallGoods);
 
+        if( 1 == mallGoods.getCarriageType()){
+            mallGoodsMapper.updateCarriageRuleId(mallGoods.getId());
+        }else{
+            mallGoodsMapper.updateCarriageAmount(mallGoods.getId());
+        }
+
         mallGoodsImagesMapper.deleteByGoodsId(mallGoodsUpdateDto.getId());
         String thumbs = mallGoodsUpdateDto.getThumbs();
         if (StrUtil.isNotEmpty(thumbs)) {
diff --git a/src/main/resources/mapper/modules/MallGoodsMapper.xml b/src/main/resources/mapper/modules/MallGoodsMapper.xml
index 183d570..5162606 100644
--- a/src/main/resources/mapper/modules/MallGoodsMapper.xml
+++ b/src/main/resources/mapper/modules/MallGoodsMapper.xml
@@ -286,6 +286,18 @@
         where id=#{id} and  volume - #{cnt} <![CDATA[ >= ]]> 0
     </update>
 
+    <update id="updateCarriageRuleId">
+        update mall_goods
+        set carriage_rule_id = null
+        where id=#{id}
+    </update>
+
+    <update id="updateCarriageAmount">
+        update mall_goods
+        set carriage_amount = null
+        where id=#{id}
+    </update>
+
     <select id="selectMallGoodsListQueryNoPage" resultType="cc.mrbird.febs.mall.vo.MallGoodsListVo">
         select * from (
         select
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 78817b4..0a39d7e 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsAddNew.html
@@ -89,7 +89,7 @@
                                             <div class="layui-input-block">
                                                 <select name="isNormal" class="goods-type" lay-filter="goods-type-select">
                                                     <option value="1">普通商品区</option>
-                                                    <option value="2">套餐区</option>
+<!--                                                    <option value="2">套餐区</option>-->
                                                 </select>
                                             </div>
                                         </div>
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 393bbf6..eec8ee8 100644
--- a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
+++ b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html
@@ -98,7 +98,7 @@
                                                 <select name="isNormal" class="goods-type"
                                                         lay-filter="goods-type-select">
                                                     <option value="1">普通商品区</option>
-                                                    <option value="2">套餐区</option>
+<!--                                                    <option value="2">套餐区</option>-->
                                                 </select>
                                             </div>
                                         </div>
diff --git a/src/main/resources/templates/febs/views/modules/order/commentList.html b/src/main/resources/templates/febs/views/modules/order/commentList.html
index b95538b..91e7f26 100644
--- a/src/main/resources/templates/febs/views/modules/order/commentList.html
+++ b/src/main/resources/templates/febs/views/modules/order/commentList.html
@@ -29,18 +29,6 @@
                         </div>
                     </form>
                     <table lay-filter="commetTable" lay-data="{id: 'commetTable'}"></table>
-                    <style type="text/css">
-                        .layui-table-cell{
-                            text-align:center;
-                            height: auto;
-                            white-space: nowrap; /*文本不会换行,在同一行显示*/
-                            overflow: hidden; /*超出隐藏*/
-                            text-overflow: ellipsis; /*省略号显示*/
-                        }
-                        .layui-table img{
-                            max-width:100px
-                        }
-                    </style>
                 </div>
             </div>
         </div>
@@ -107,8 +95,7 @@
                 elem: $view.find('table'),
                 id: 'commetTable',
                 url: ctx + 'admin/order/commentList',
-                defaultToolbar: [],
-                toolbar: '#tableToolBar',
+                // toolbar: '#tableToolBar',
                 cols: [[
                         {field: 'memberName', title: '昵称', minWidth: 100,align:'left'},
                         {field: 'orderNo', title: '订单编号', minWidth: 80,align:'left'},
diff --git a/src/main/resources/templates/febs/views/modules/order/orderList.html b/src/main/resources/templates/febs/views/modules/order/orderList.html
index b75c886..d257f3d 100644
--- a/src/main/resources/templates/febs/views/modules/order/orderList.html
+++ b/src/main/resources/templates/febs/views/modules/order/orderList.html
@@ -376,7 +376,8 @@
                 elem: $view.find('table'),
                 id: 'orderTable',
                 url: ctx + 'admin/order/orderList?orderType=1',
-                defaultToolbar: [],
+                // defaultToolbar: [],
+                //系统自带打印导出
                 toolbar: '#tableToolBar',
                 cols: [[
                         {type: 'checkbox', fixed: 'left'},

--
Gitblit v1.9.1