From 58aa9500960dbfc2d0314864b946364591262686 Mon Sep 17 00:00:00 2001
From: jyy <935090232@qq.com>
Date: Mon, 25 Jan 2021 15:36:27 +0800
Subject: [PATCH] 1、商品排序

---
 zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html |   18 ++++----
 zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java           |    7 ++-
 zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java     |    7 ++-
 zq-erp/src/main/resources/config/application.properties                                   |    6 ++
 zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html  |   16 ++++----
 zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html  |   14 +++---
 6 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
index 26d1c64..f70a262 100644
--- a/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hive/action/ShoppingGoodsController.java
@@ -176,8 +176,11 @@
     public @ResponseBody
     AjaxResult showList(ShoppingGoods shoppingGoods, PaginationVO pageVo) {
         QueryUtil.setQueryLimit(shoppingGoods);
-        pageVo.setOrder("desc");
-        pageVo.setSort("createTime");
+       if(StringUtils.isBlank(pageVo.getSort())){
+           pageVo.setOrder("desc");
+           pageVo.setSort("createTime");
+       }
+
         //2表示查询总部产品
         if (shoppingGoods.getHeadquarters()!=null && 2==shoppingGoods.getHeadquarters()) {
             //仅查询本店产品
diff --git a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java
index e0e3f79..6e78a24 100644
--- a/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java
+++ b/zq-erp/src/main/java/com/matrix/system/hiveErp/action/ErpShoppingGoodsController.java
@@ -4,6 +4,7 @@
 import com.matrix.core.pojo.AjaxResult;
 import com.matrix.core.pojo.PaginationVO;
 import com.matrix.core.tools.DateUtil;
+import com.matrix.core.tools.StringUtils;
 import com.matrix.core.tools.WebUtil;
 import com.matrix.core.tools.excl.ExcelSheetPO;
 import com.matrix.core.tools.excl.ExcelVersion;
@@ -66,8 +67,10 @@
     @RequestMapping(value = "/showList")
     public @ResponseBody
     AjaxResult showList(ShoppingGoods shoppingGoods, PaginationVO pageVo) {
-        pageVo.setOrder("desc");
-        pageVo.setSort("createTime");
+        if(StringUtils.isBlank(pageVo.getSort())){
+            pageVo.setOrder("desc");
+            pageVo.setSort("createTime");
+        }
         QueryUtil.setQueryLimitCom(shoppingGoods);
         shoppingGoods.setIsDel(ShoppingGoods.NORMAL);
         List<ShoppingGoods> dataList = shoppingGoodsService.findInPage(shoppingGoods, pageVo);
diff --git a/zq-erp/src/main/resources/config/application.properties b/zq-erp/src/main/resources/config/application.properties
index 466f6f6..23157c8 100644
--- a/zq-erp/src/main/resources/config/application.properties
+++ b/zq-erp/src/main/resources/config/application.properties
@@ -6,7 +6,8 @@
 
 spring.datasource.username=chuhuan
 spring.datasource.password=chuhuan
-spring.datasource.url=jdbc:mysql://119.3.52.84:3306/hive_plus_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
+spring.datasource.url=jdbc:mysql://175.6.132.141:3306/hive_v2_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8
+
 
 
 
@@ -64,3 +65,6 @@
 swagger.security.password=admin
 
 
+#默认头像
+default.vip.photo.woman=https://filehive2.jyymatrix.cc/uploadeFile/20210125/db53552e688040afb286686f081e1e68f3fe946f75624598828f01898635152e.png
+default.vip.photo.man=https://filehive2.jyymatrix.cc/uploadeFile/20210125/3642f1d827c44c76832fea106c85e0f89e089c16cbcc4dd0a82bb52b9ac700f4.png
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html
index d5ee48e..15facb0 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive-erp/products/shoppinggoods-list.html
@@ -107,18 +107,18 @@
             <tr>
                 <th data-checkbox="true"></th>
                 <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th>
-                <th data-field="code">商品编号</th>
-                <th data-field="name">商品名称</th>
-                <th data-field="sealPice">售价/(本金)</th>
+                <th data-field="code"  data-sortable="true">商品编号</th>
+                <th data-field="name"  data-sortable="true">商品名称</th>
+                <th data-field="sealPice" data-sortable="true">售价/(本金)</th>
                 <th data-field="referencePice">参考价/(赠送金额)</th>
-                <th data-field="realSealCount">真实销量</th>
-                <th data-field="staus">状态</th>
-                <th data-field="isPresent">是否赠送</th>
-                <th data-field="goodType">类型</th>
+                <th data-field="realSealCount" data-sortable="true">真实销量</th>
+                <th data-field="staus" data-sortable="true">状态</th>
+                <th data-field="isPresent" data-sortable="true">是否赠送</th>
+                <th data-field="goodType" data-sortable="true" >类型</th>
                 <th data-field="cateName">分类</th>
                 <th data-field="isCourse" data-formatter="getCourse">套餐卡</th>
-                <th  data-field="shopName">所属门店</th>
-                <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th>
+                <th  data-field="shopName" >所属门店</th>
+                <th data-field="createTime" data-sortable="true" data-formatter="MGrid.getTime">创建时间</th>
             </tr>
             </thead>
         </table>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html
index e3e4b38..8608af7 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-md-list.html
@@ -105,16 +105,16 @@
             <tr>
                 <th data-checkbox="true"></th>
                 <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th>
-                <th data-field="code">商品编号</th>
-                <th data-field="name">商品名称</th>
-                <th data-field="sealPice">售价/(本金)</th>
+                <th data-field="code"  data-sortable="true">商品编号</th>
+                <th data-field="name" data-sortable="true">商品名称</th>
+                <th data-field="sealPice" data-sortable="true">售价/(本金)</th>
                 <th data-field="giftMoney">赠送金额</th>
-                <th data-field="realSealCount">真实销量</th>
-                <th data-field="staus">状态</th>
+                <th data-field="realSealCount" data-sortable="true">真实销量</th>
+                <th data-field="staus" data-sortable="true">状态</th>
                 <th data-field="isPresent">是否赠送</th>
-                <th data-field="goodType">类型</th>
+                <th data-field="goodType" data-sortable="true">类型</th>
                 <th data-field="cateName">分类</th>
-                <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th>
+                <th data-field="createTime"  data-sortable="true" data-formatter="MGrid.getTime">创建时间</th>
             </tr>
             </thead>
         </table>
diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html
index 0e1ef0e..b2d8c30 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/products/shoppinggoods-zb-list.html
@@ -101,16 +101,16 @@
             <tr>
                 <th data-checkbox="true"></th>
                 <th data-formatter="MGrid.indexfn" data-align="center" data-width="30px">序号</th>
-                <th data-field="code">商品编号</th>
-                <th data-field="name">商品名称</th>
-                <th data-field="sealPice">售价/(本金)</th>
+                <th data-field="code"  data-sortable="true">商品编号</th>
+                <th data-field="name" data-sortable="true">商品名称</th>
+                <th data-field="sealPice" data-sortable="true">售价/(本金)</th>
                 <th data-field="giftMoney">赠送金额</th>
-                <th data-field="realSealCount">真实销量</th>
-                <th data-field="staus">状态</th>
+                <th data-field="realSealCount" data-sortable="true">真实销量</th>
+                <th data-field="staus" data-sortable="true">状态</th>
                 <th data-field="isPresent">是否赠送</th>
-                <th data-field="goodType">类型</th>
-                <th data-field="cateName">分类</th>
-                <th data-field="createTime" data-formatter="MGrid.getTime">创建时间</th>
+                <th data-field="goodType" data-sortable="true">类型</th>
+                <th data-field="cateName" >分类</th>
+                <th data-field="createTime"  data-sortable="true" data-formatter="MGrid.getTime">创建时间</th>
             </tr>
             </thead>
         </table>

--
Gitblit v1.9.1