From ffb8b05b06cbe324d9f8c1c4d8918661fd2cc675 Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期五, 27 五月 2022 11:33:49 +0800
Subject: [PATCH] 设备列表

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedSFileService.java |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedSFileService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedSFileService.java
index ae34cb4..190ac59 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedSFileService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedSFileService.java
@@ -3,9 +3,11 @@
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.PageHelper;
 import com.sandu.common.execption.BusinessException;
 import com.sandu.common.file.FileUploadDto;
 import com.sandu.common.file.impl.AliOssFileServiceImpl;
+import com.sandu.common.object.BaseConditionVO;
 import com.sandu.common.service.impl.BaseServiceImpl;
 import com.sandu.ximon.admin.security.SecurityUtils;
 import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils;
@@ -15,7 +17,11 @@
 import lombok.AllArgsConstructor;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @Author liuhaonan
@@ -54,7 +60,7 @@
         /**
          * 鐔欐睕鏂囦欢涓婁紶 鏃ュ織璁板綍寮�濮�
          */
-        String content = "鏂囦欢鍐呭:"+ JSON.toJSONString(fileUploadDto);
+        String content = "鏂囦欢鍐呭:" + JSON.toJSONString(fileUploadDto);
         StoreOperationRecordsUtils.storeOperationData(null, null, "鐔欐睕鏂囦欢涓婁紶", content);
         /**
          * 鐔欐睕鏂囦欢涓婁紶 鏃ュ織璁板綍缁撴潫
@@ -71,7 +77,7 @@
         /**
          * 鐔欐睕鏂囦欢鍒犻櫎 鏃ュ織璁板綍寮�濮�
          */
-        String content = "鏂囦欢鍐呭id:"+ id+"鏂囦欢鍐呭:"+ JSON.toJSONString(byId);
+        String content = "鏂囦欢鍐呭id:" + id + "鏂囦欢鍐呭:" + JSON.toJSONString(byId);
         StoreOperationRecordsUtils.storeOperationData(null, null, "鐔欐睕鏂囦欢鍒犻櫎", content);
         /**
          * 鐔欐睕鏂囦欢鍒犻櫎 鏃ュ織璁板綍缁撴潫
@@ -79,16 +85,28 @@
         return removeById(id);
     }
 
-    public LambdaQueryWrapper<LedSFile> listFile() {
-        LambdaQueryWrapper<LedSFile> ledProgramFileLambdaQueryWrapper = Wrappers.lambdaQuery(LedSFile.class);
+
+    /**
+     * 鍒楄〃
+     *
+     * @param baseConditionVO
+     * @param keyword
+     * @return
+     */
+    public List<LedSFile> listfile(BaseConditionVO baseConditionVO, String keyword) {
+        LambdaQueryWrapper<LedSFile> wrapper = Wrappers.lambdaQuery(LedSFile.class);
         if (SecurityUtils.getClientId() != null) {
-            return ledProgramFileLambdaQueryWrapper.eq(LedSFile::getCilentId, SecurityUtils.getUserId()).or(w -> {
+            wrapper.eq(LedSFile::getCilentId, SecurityUtils.getUserId()).or(w -> {
                 w.eq(LedSFile::getUserId, SecurityUtils.getUserId());
             });
-        } else {
-            return ledProgramFileLambdaQueryWrapper;
         }
 
+        if (keyword != null && !keyword.isEmpty()) {
+            wrapper.like(LedSFile::getOriginName, keyword);
+        }
+
+        PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
+        return list(wrapper);
     }
 
 }

--
Gitblit v1.9.3