From ce72201c7cd63b8eb02af930b7b8302d5395ae6a Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期五, 27 五月 2022 14:34:19 +0800
Subject: [PATCH] fix

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java |   46 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java
index 36561b4..dbb5b9b 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/IpVolumeFileService.java
@@ -16,9 +16,11 @@
 import com.sandu.ximon.admin.security.SecurityUtils;
 import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils;
 import com.sandu.ximon.dao.domain.IpVolumeFile;
+import com.sandu.ximon.dao.enums.OrderByEnums;
 import com.sandu.ximon.dao.mapper.IpVolumeFileMapper;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
@@ -82,7 +84,7 @@
         /**
          * 闊虫煴鏂囦欢鍒犻櫎 鏃ュ織璁板綍寮�濮�
          */
-        String content = "鍒犻櫎鏂囦欢id:"+fileId+"闊虫煴鏂囦欢鍚嶇О锛�" + byId.getFileName() + "锛屾枃浠跺ぇ灏忥細" + byId.getOriginSize() + "锛屾枃浠惰矾寰勶細" + byId.getFileUrl();
+        String content = "鍒犻櫎鏂囦欢id:" + fileId + "闊虫煴鏂囦欢鍚嶇О锛�" + byId.getFileName() + "锛屾枃浠跺ぇ灏忥細" + byId.getOriginSize() + "锛屾枃浠惰矾寰勶細" + byId.getFileUrl();
         StoreOperationRecordsUtils.storeOperationData(null, null, "闊虫煴鏂囦欢鍒犻櫎", content);
         /**
          * 闊虫煴鏂囦欢鍒犻櫎 鏃ュ織璁板綍缁撴潫
@@ -91,10 +93,8 @@
         return removeById(fileId);
     }
 
-    public LambdaQueryWrapper<IpVolumeFile> listFile(BaseConditionVO baseConditionVO, String keyword) {
-        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
+    public List<IpVolumeFile> ipVolumeFileList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) {
         LambdaQueryWrapper<IpVolumeFile> wrapper = Wrappers.lambdaQuery(IpVolumeFile.class);
-
         //涓嶆槸瓒呯
         if (SecurityUtils.getClientId() != null) {
             wrapper = wrapper.eq(IpVolumeFile::getClientId, SecurityUtils.getUserId())
@@ -106,7 +106,38 @@
         if (keyword != null && !keyword.isEmpty()) {
             wrapper.like(IpVolumeFile::getFileName, keyword);
         }
-        return wrapper;
+
+        //鎺掑簭瀛楁
+        String orderByResult = OrderByEnums.IP_VOLUME_FILE_CREATE_TIME.getCode();
+        //姝e簭銆佸�掑彊
+        String orderBySeq = OrderByEnums.ASC.getCode();
+        if (order != null) {
+            switch (order) {
+                case 1:
+                    orderByResult = OrderByEnums.IP_VOLUME_FILE_CREATE_TIME.getCode();
+                    break;
+                default:
+            }
+        }
+        if (seq != null) {
+            switch (seq) {
+                case 1:
+                    orderBySeq = OrderByEnums.ASC.getCode();
+                    break;
+                case 2:
+                    orderBySeq = OrderByEnums.DESC.getCode();
+                    break;
+                default:
+                    break;
+            }
+        }
+        //鎺掑簭鏂瑰紡
+        String orderBy = orderByResult + " " + orderBySeq;
+
+        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
+        List<IpVolumeFile> list = list(wrapper);
+
+        return list;
     }
 
     public List<IpVolumeFile> listFiles() {
@@ -121,9 +152,6 @@
         }
         return list(wrapper);
     }
-
-
-
 
 
     /**
@@ -168,7 +196,7 @@
         /**
          * 闊虫煴鏂囦欢涓婁紶 鏃ュ織璁板綍寮�濮�
          */
-        String content = "鏂囦欢鍐呭:"+ JSON.toJSONString(fileUploadDto);
+        String content = "鏂囦欢鍐呭:" + JSON.toJSONString(fileUploadDto);
         StoreOperationRecordsUtils.storeOperationData(null, null, "闊虫煴鏂囦欢涓婁紶", content);
         /**
          * 闊虫煴鏂囦欢涓婁紶 鏃ュ織璁板綍缁撴潫

--
Gitblit v1.9.3