From 02b0dbf0ba5db15a0650dcbe90cfb25a1292f804 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期四, 16 一月 2025 10:28:42 +0800
Subject: [PATCH] 首页统计

---
 src/main/java/com/whyc/webSocket/HomeSocket.java |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/whyc/webSocket/HomeSocket.java b/src/main/java/com/whyc/webSocket/HomeSocket.java
index 0e5b697..e1d08e7 100644
--- a/src/main/java/com/whyc/webSocket/HomeSocket.java
+++ b/src/main/java/com/whyc/webSocket/HomeSocket.java
@@ -6,6 +6,7 @@
 import com.whyc.pojo.db_user.UserInf;
 import com.whyc.service.AreaInfService;
 import com.whyc.service.LockCtlLogService;
+import com.whyc.service.LockInfService;
 import com.whyc.service.UserInfService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -39,6 +40,8 @@
 
     private static AreaInfService ainfService;
 
+    private static LockInfService lockInfService;
+
     @Autowired
     public void setLockCtlLogService(LockCtlLogService ctlLogService) {
         HomeSocket.ctlLogService = ctlLogService;
@@ -49,6 +52,11 @@
         HomeSocket.ainfService = ainfService;
     }
 
+    @Autowired
+    public void setLockInfService(LockInfService lockInfService) {
+        HomeSocket.lockInfService = lockInfService;
+    }
+
     @OnOpen
     public void onOpen(Session session, EndpointConfig config) {
         this.session = session;
@@ -57,7 +65,7 @@
 
     @OnMessage
     public void onMessage(Session session, String message){
-       /* UserInf user = (UserInf) this.httpSession.getAttribute("user");
+       UserInf user = (UserInf) this.httpSession.getAttribute("user");
         final int userId = user.getUid();
         final int urole = user.getUrole();
         Thread thread = new Thread() {
@@ -75,9 +83,9 @@
                             latch.countDown();
                         });
                         poolExecutor.execute(() -> {
-                            //鍩虹璧勬簮淇℃伅
-                            Response resBattInfoAnalysis = battInfService.getBattInfoAnalysis(userId);
-                            res.put("resBattInfoAnalysis", resBattInfoAnalysis);
+                            //灞忔煖绫诲瀷
+                            Response resScreenBox = ainfService.getScreenBoxType(userId,urole);
+                            res.put("resScreenBox", resScreenBox);
                             latch.countDown();
                         });
                         poolExecutor.execute(() -> {
@@ -89,14 +97,13 @@
                         });
                         poolExecutor.execute(() -> {
                             //涓嶅悓鍝佺墝鍚屼竴鏃堕棿鍝佽川鍜屽悓鍝佺墝鍚屾椂闂村搧璐�
-                            Response resProductQuaAnalysis = badBattMonService.getProductQuaAnalysis(userId);
+                            Response resProductQuaAnalysis = new Response();
                             res.put("resProductQuaAnalysis", resProductQuaAnalysis);
                             latch.countDown();
                         });
                         poolExecutor.execute(() -> {
                             //鐢垫睜淇℃伅
                             Response res_battGroupInfo = new Response();
-
                             res.put("battGroupInfo", res_battGroupInfo);
                             latch.countDown();
                         });
@@ -109,7 +116,7 @@
                         });
                         poolExecutor.execute(() -> {
                             //娴嬭瘯淇℃伅
-                            Response resTestdataInfAnalysis = batttestdataInfService.getTestdataInfAnalysis(userId);
+                            Response resTestdataInfAnalysis = new Response();
                             res.put("resTestdataInfAnalysis", resTestdataInfAnalysis);
                             latch.countDown();
                         });
@@ -123,7 +130,7 @@
             }
         };
         thread.start();
-        this.thread = thread;*/
+        this.thread = thread;
     }
 
     @OnClose

--
Gitblit v1.9.1