From df16aa097e2fcadb00700ebc95d57389cddf26ee Mon Sep 17 00:00:00 2001
From: wumu <mayibase@mayi.com>
Date: 星期五, 01 三月 2024 03:07:31 +0800
Subject: [PATCH] 0301-1

---
 internal_system_v1/converinfo2.cpp |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/internal_system_v1/converinfo2.cpp b/internal_system_v1/converinfo2.cpp
index 5207561..6765e19 100644
--- a/internal_system_v1/converinfo2.cpp
+++ b/internal_system_v1/converinfo2.cpp
@@ -206,12 +206,17 @@
         int index = str.indexOf("鍐呭缁�01琛�");
         qDebug()<<"index:"<<index;
         if(index > 0){
-            QAxObject excel("Excel.Application");
+            QAxObject excel("Excel.Application"); // windows鍐呮牳
+            if(!excel.setControl("Excel.Application")){
+                excel.setControl("ket.Application"); // wps鍐呮牳
+            }
             excel.setProperty("Visible",false);
             excel.setProperty("DisplayAlerts",false);
+
             qDebug()<<"open:"<<str;
             qDebug()<<"excel:"<<excel.className();
             QAxObject * wbs = excel.querySubObject("WorkBooks");
+            qDebug()<<"wbs:"<<wbs->className();
             QAxObject * wb = wbs->querySubObject("Open(QString&)",str);
             //QAxObject* pWorkBook = excel.querySubObject("ActiveWorkBook");
             //QAxObject* pWorkSheets = pWorkBook->querySubObject("Sheets");//鑾峰彇宸ヤ綔琛�
@@ -861,6 +866,7 @@
 
     // 鍏堝垽鏂槸涓嶆槸宸茬粡瀛樺湪鍏徃鍚嶄簡锛岃嫢宸插瓨鍦紝鍒欐洿鏂帮紝涓嶅瓨鍦ㄥ垯鎻掑叆
     QString sql = QString("select id,name from all_company_info where name='%1'").arg(name);
+    qDebug()<<"sql:"<<sql;
     QSqlQuery query;
     int rowCnt = 0;
     if(query.exec(sql)){
@@ -872,7 +878,9 @@
     }
     if(rowCnt == 0){
         // 涓嶅瓨鍦紝鍒欐彃鍏ヤ竴鏉℃柊鏁版嵁
+        qDebug()<<"涓嶅瓨鍦�:"<<name;
     }else{
         // 鏇存柊
+        qDebug()<<"瀛樺湪:"<<name;
     }
 }

--
Gitblit v1.8.0