From cd0fa3261b49dbab89bb01dfa94dc3ebdb08dec4 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期四, 07 七月 2022 16:32:11 +0800
Subject: [PATCH] changes

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

diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
index 9994bfc..5986ccf 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LightService.java
@@ -73,7 +73,7 @@
         Boolean hasKey = redisService.hasKey(LightKey.REPORT_MAC.key(deviceName));
         if (!hasKey) {
             int count = count(Wrappers.lambdaQuery(Light.class).eq(Light::getDeviceCode, deviceName));
-            log.info("redis鏌ヤ笉鍒拌矾鐏暟鎹畕}={}", count, deviceName);
+            log.info("redis鏌ヤ笉鍒拌矾鐏暟鎹� 鏁伴噺:{}={}", count, deviceName);
             // 褰撳墠璺伅琛ㄦ病鏈夊綍鍏ヨ澶囧悧
             if (count == 0) {
                 Light light = new Light();
@@ -81,15 +81,15 @@
                 light.setLightPercent(heartBeatDataPackage.getLightPercent());
                 light.setLight2Percent(heartBeatDataPackage.getLight2Percent());
                 save(light);
+                log.info("鏂板璺伅");
             }
             redisService.set(LightKey.REPORT_MAC.key(deviceName), 1, LightKey.REPORT_MAC.expireSeconds());
-            log.info("鏂板璺伅");
         } else {
             Light light = new Light();
             light.setLightPercent(heartBeatDataPackage.getLightPercent());
             light.setLight2Percent(heartBeatDataPackage.getLight2Percent());
-            update(light, Wrappers.lambdaUpdate(Light.class).eq(Light::getDeviceCode, deviceName));
-            log.info("鏇存柊璺伅浜害");
+            boolean update = update(light, Wrappers.lambdaUpdate(Light.class).eq(Light::getDeviceCode, deviceName));
+            log.info("鏇存柊璺伅浜害 {}", update);
         }
     }
 
@@ -102,7 +102,7 @@
         Long clientId = SecurityUtils.getClientId();
 
         //鎺掑簭瀛楁
-        String orderByResult = OrderByEnums.LIGHT_POLE_NAME.getCode();
+        String orderByResult = "light_id";
         //姝e簭銆佸�掑彊
         String orderBySeq = OrderByEnums.ASC.getCode();
         if (order != null) {

--
Gitblit v1.9.3