From ea5a9a7ea7dc79e9144bb9d084d766eda6e46284 Mon Sep 17 00:00:00 2001
From: lzz <xiguabobo_2020@qq.com>
Date: 星期五, 01 十一月 2024 12:09:23 +0800
Subject: [PATCH] Merge branch 'master' of ssh://115.28.86.8:29418/~admin/昆仑_1025

---
 Client/姜可庚/code/2024kunlun_project_permisson/PmsClientSocket.cpp |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp" "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp"
index 264c552..8449947 100644
--- "a/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp"
+++ "b/Client/\345\247\234\345\217\257\345\272\232/code/2024kunlun_project_permisson/PmsClientSocket.cpp"
@@ -2,7 +2,7 @@
 
 #include <QMessageBox>
 
-PmsClientSocket::PmsClientSocket(QObject * parent):QObject(parent)
+PmsClientSocket::PmsClientSocket(QWidget * parent):QWidget(parent)
 {
     client = new QTcpSocket(this);
 
@@ -68,10 +68,9 @@
           res = (QueryPmsResponse *)buf.data();
           if(res->success){
               vector<PmsQueryResult> vecs;
-
-              for(int i =0;i<100;i++){
-                  if(*(int *)&res->pmsList[i]){
-                      PmsRes structRes = res->pmsList[i];
+              int pmsLen = res->head.len-sizeof(QueryPmsResponse);
+              for(int i =0;i<pmsLen;i+=sizeof(PmsRes)){
+                  PmsRes structRes = *(PmsRes*)(res + sizeof(QueryPmsResponse) + i*sizeof(PmsRes));
                       PmsQueryResult res;
                       res.setName(string(structRes.name));
                       res.setUserNo(string(structRes.userNo));
@@ -83,12 +82,8 @@
                       res.setDevManage(structRes.devManage);
                       res.setProductPlan(structRes.productPlan);
                       res.setQueryHistory(structRes.queryHistory);
-
                       res.setPermissonType(string(structRes.permissonType));
-
                       vecs.push_back(res);
-
-                  }else break;
               }
               if(!vecs.empty()){
                   emit notifyDateChange(vecs);
@@ -100,10 +95,10 @@
         if(res->success){
             QString dlgTitle = "鏇存柊缁撴灉";
             QString strInfo = "鏉冮檺淇℃伅鏇存柊鎴愬姛";
-//            QMessageBox::information(this,dlgTitle,strInfo,
-//                                     QMessageBox::Ok, QMessageBox::NoButton);
+            QMessageBox::information(this,dlgTitle,strInfo,
+                                      QMessageBox::Ok, QMessageBox::NoButton);
         }else{
-//            QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触");
+            QMessageBox::warning(this, "鏇存柊缁撴灉", "鏉冮檺淇℃伅鏇存柊澶辫触");
         }
     }
 }

--
Gitblit v1.8.0