From d5797ece3ae0099831cf7b70de0f71014a16ef20 Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期二, 19 四月 2022 10:17:01 +0800
Subject: [PATCH] 首页

---
 ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
index 51697b0..dda19fd 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -115,10 +115,11 @@
 
     /**
      * 缁熻鍦ㄧ嚎鐏潌鏁伴噺
+     *
      * @return
      */
-    public Map<String,Integer> poleCount() {
-        Map<String,Integer> result = new HashMap<>();
+    public Map<String, Integer> poleCount() {
+        Map<String, Integer> result = new HashMap<>();
         List<Pole> list = new ArrayList<>();
         LambdaQueryWrapper<Pole> wrapper = new LambdaQueryWrapper<>();
         if (SecurityUtils.getClientId() == null) {
@@ -129,10 +130,11 @@
                         w.eq(Pole::getUserId, SecurityUtils.getUserId());
                     });
         }
+        //鐏潌
         list = list(wrapper);
         List<Pole> poles = isOnLine(list);
-        result.put("poleOnlineCount",poles.size());
-        result.put("poleTotalCount",list.size());
+        result.put("poleOnlineCount", poles.size());
+        result.put("poleTotalCount", list.size());
         return result;
     }
 
@@ -147,7 +149,7 @@
                         w.eq(Pole::getUserId, SecurityUtils.getUserId());
                     });
         }
-        if (!param.getKeyword().isEmpty()) {
+        if (param.getKeyword() != null && !param.getKeyword().isEmpty()) {
             wrapper.like(Pole::getPoleCode, param.getKeyword()).or(
                     wrappers -> {
                         wrappers.like(Pole::getPoleName, param.getKeyword());
@@ -155,6 +157,7 @@
             );
         }
 
+        PageHelper.startPage(pageNo, pageSize);
         list = list(wrapper);
         if (param.getGroupid() != null) {
             //  List<Long> poleIds = new ArrayList<>();

--
Gitblit v1.9.3