Bladeren bron

增加对mac系统的支持

seyason 5 jaren geleden
bovenliggende
commit
438e5bc6f8

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/vo/ScreenshotVO.java

@@ -14,4 +14,5 @@ import org.springframework.web.multipart.MultipartFile;
 public class ScreenshotVO extends Screenshot {
     private MultipartFile file;
     private String processList;
+    private String osType;//操作系统类型
 }

+ 11 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ScreenshotServiceImpl.java

@@ -161,8 +161,18 @@ public class ScreenshotServiceImpl extends ServiceImpl<ScreenshotMapper, Screens
         } else if (isDocument(textContents)) {
             screenshot.setPicType(2);//看文档
         } else {
+            List<String> exeprocessList = new ArrayList<String>();
+            if ("Q_OS_WIN".equals(screenshotvo.getOsType())) {
+                exeprocessList = ProcessUtil.getWinExeprocessListfromProcessStr(screenshotvo.getProcessList());
+            } else if ("Q_OS_LINUX".equals(screenshotvo.getOsType())
+                        ||"Q_OS_MAC".equals(screenshotvo.getOsType())) {
+                exeprocessList = ProcessUtil.getWinExeprocessListfromProcessStr(screenshotvo.getProcessList());
+            } else {
+                HttpRespMsg msg = new HttpRespMsg();
+                msg.setError("请求缺少操作系统类型, 只支持Q_OS_WIN,Q_OS_LINUX, Q_OS_MAC ");
+                return msg;
+            }
 
-            List<String> exeprocessList = ProcessUtil.getExeprocessListfromProcessStr(screenshotvo.getProcessList());
             boolean derail = false;//判断是否匹配的开关
             Integer lastType = null;
             for (String textContent : textContents) {

File diff suppressed because it is too large
+ 108 - 44
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/ProcessUtil.java


+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-prod.yml

@@ -54,6 +54,7 @@ logging:
     #打印sql语句
     com.management.platform.mapper: debug
   path: /log/
+  file: worktime.log
 ##########
 mybatis-plus:
   #  mapper-locations: classpath:mapper/*/*.xml

+ 17 - 0
fhKeeper/formulahousekeeper/mywork/home.cpp

@@ -148,6 +148,23 @@ void Home::captureScreen() {
     textPart3.setBody(processList.toUtf8());
     multiPart->append(textPart3);
 
+    //add os infomation
+    QString osType = "";
+    #if defined(Q_OS_WIN)
+    osType = "Q_OS_WIN";
+    #endif
+    #if defined(Q_OS_MAC)
+    osType = "Q_OS_MAC";
+    #endif
+    #if defined(Q_OS_LINUX)
+    osType = "Q_OS_LINUX";
+    #endif
+    qDebug() << "osType=="<<osType;
+    QHttpPart textPart4;
+    textPart4.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"osType\""));
+    textPart4.setBody(osType.toUtf8());
+    multiPart->append(textPart4);
+
     QNetworkAccessManager *m_pNetWorkManager = new QNetworkAccessManager();
     m_pNetWorkManager->post(request, multiPart);
 }

+ 2 - 2
fhKeeper/formulahousekeeper/mywork/httpapi.h

@@ -6,8 +6,8 @@
 #include <QPair>
 #include <QJsonObject>
 #include "baseapi.h"
-//const QString SERVER_URL = QString("http://127.0.0.1:10010");
-const QString SERVER_URL = QString("http://47.100.37.243:10010");
+const QString SERVER_URL = QString("http://127.0.0.1:10010");
+//const QString SERVER_URL = QString("http://47.100.37.243:10010");
 class HttpAPI: public BaseAPI
 {
 public: