瀏覽代碼

Z991239-4942 #comment feat: 启动改造合并

陈良瑜80374463 1 年之前
父節點
當前提交
650c0aecd8

+ 1 - 1
CMakeLists.txt

@@ -284,7 +284,7 @@ if(CONAN_CACHE_CLEAR)
 	conan_local_remove()
 endif(CONAN_CACHE_CLEAR)
 
-conan_cmake_run(REQUIRES RvcFramework/1.2.0.19@LR04.02_FrameworkLib/dev
+conan_cmake_run(REQUIRES RvcFramework/1.2.0.28@LR04.02_FrameworkLib/dev
 	Audio/2023.0509.01@LR04.02_MediaRes/testing
 BASIC_SETUP CMAKE_TARGETS)
 include(DependencyConanFiles)

+ 1 - 1
Module/include/CommEntityUtil.hpp

@@ -891,7 +891,7 @@ static ErrorCodeEnum GetINETMacAddresses(NetworkAddressesList &nameList, Network
         if (tmpip.Compare("127.0.0.1") == 0 && tmpmac.Compare("00:00:00:00:00:00") == 0) {
             //skip
         } else {
-			tmpname = map_it->first;
+			tmpname = map_it->first.c_str();
 			nameList.Append(&tmpname, 0, 1);
             ipList.Append(&tmpip, 0, 1);
             macList.Append(&tmpmac, 0, 1);

+ 4 - 2
Module/mod_chromium/mod_chromium.h

@@ -124,7 +124,7 @@ namespace Chromium {
 		void openMainPage();
 		void openAdPage();
 		void openExtendPage();
-
+		void startWithCfg();
 		bool CheckIsCardStore();
 
 	private:
@@ -142,12 +142,14 @@ namespace Chromium {
 		boost::container::deque<SYS_EVENT_PARAM> m_eventArr;
 		boost::mutex m_eventContorl, m_eventConditionMu; //sysvarEvent变化时阻塞修改
 		boost::condition_variable_any m_eventCondition;//满足有数据时激活线程
+		CAutoArray<CSimpleStringA> m_strArgs;
+		CSmartPointer<ITransactionContext> m_pTransactionContext;
 	public:
 		boost::timed_mutex m_firstStartMain;//首次启动主页
 		int getBrowserStartTimes();
 	private:
 		//subscribe
-		CUUID m_uidCameraListener, m_uuidAccessAuth, m_uuidResourceWatch,m_uidBrowserListenser, m_uuidAccessAuthErr, m_uuidAllFault;
+		CUUID m_uidCameraListener, m_uuidAccessAuth, m_uuidResourceWatch,m_uidBrowserListenser, m_uuidAccessAuthErr, m_uuidAllFault, m_uuidVTMLoader;
         virtual void OnLog(const CAutoArray<CUUID>& SubIDs, const CUUID nLogID, const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
                            const DWORD dwSysError, const DWORD dwUserCode, const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
                            const CAutoArray<DWORD>& Param, const char* pszEntityName, const char* pszModuleName, const char* pszMessage, const linkContext& pLinkInfo);

+ 0 - 90
Module/mod_chromium/portCheck/portCheck.cpp

@@ -1,90 +0,0 @@
-#include "stdafx.h"
-#include <stdio.h>
-#include <string>
-
-#if (defined _WIN32 || defined _WIN64)
-#include <winsock.h>
-#pragma comment(lib,"Ws2_32.lib")
-#include "Wininet.h"  
-#pragma comment(lib,"Wininet.lib") 
-#else
-#include <requests/Exception.hpp>
-#include <requests/Request.hpp>
-#include <requests/Url.hpp>
-#endif
-
-
-#if (defined _WIN32 || defined _WIN64)
-bool checkHttpActive(const char* httpUrl)
-{
-	TCHAR szHostName[128];
-	TCHAR szUrlPath[256];
-	URL_COMPONENTS crackedURL = { 0 };
-	crackedURL.dwStructSize = sizeof(URL_COMPONENTS);
-	crackedURL.lpszHostName = szHostName;
-	crackedURL.dwHostNameLength = ARRAYSIZE(szHostName);
-	crackedURL.lpszUrlPath = szUrlPath;
-	crackedURL.dwUrlPathLength = ARRAYSIZE(szUrlPath);
-	InternetCrackUrl(httpUrl, (DWORD)strlen(httpUrl), 0, &crackedURL);
-
-	HINTERNET hInternet = InternetOpen("Microsoft InternetExplorer", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
-	if (hInternet == NULL)
-		return false;
-
-	HINTERNET hHttpSession = InternetConnect(hInternet, crackedURL.lpszHostName, crackedURL.nPort, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0);
-	if (hHttpSession == NULL)
-	{
-		InternetCloseHandle(hInternet);
-		return false;
-	}
-
-	HINTERNET hHttpRequest = HttpOpenRequest(hHttpSession, "GET", crackedURL.lpszUrlPath, NULL, "", NULL, 0, 0);
-	if (hHttpRequest == NULL)
-	{
-		InternetCloseHandle(hHttpSession);
-		InternetCloseHandle(hInternet);
-		return false;
-	}
-
-	/**
-	 * 查询http状态码(这一步不是必须的),但是HttpSendRequest()必须要调用
-	 */
-
-	DWORD dwRetCode = 0;
-	DWORD dwSizeOfRq = sizeof(DWORD);
-	if (!HttpSendRequest(hHttpRequest, NULL, 0, NULL, 0) ||
-		!HttpQueryInfo(hHttpRequest, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwRetCode, &dwSizeOfRq, NULL)
-		|| dwRetCode >= 400)
-	{
-		InternetCloseHandle(hHttpRequest);
-		InternetCloseHandle(hHttpSession);
-		InternetCloseHandle(hInternet);
-
-		return false;
-	}
-	InternetCloseHandle(hHttpRequest);
-	InternetCloseHandle(hHttpSession);
-
-	return true;
-}
-#else
-bool checkHttpActive(const char* httpUrl)
-{
-	requests::Request request;
-	requests::Url url(httpUrl);
-
-	try
-	{
-		// 发起 HTTP 请求,阻塞
-		auto resp = request.get(url);
-		return true;
-	}
-	catch (requests::Exception& e)
-	{
-		std::cout << e.what() << std::endl;
-	}
-	return false;
-}
-
-#endif
-

+ 0 - 2
Module/mod_chromium/portCheck/portCheck.h

@@ -1,2 +0,0 @@
-
-bool checkHttpActive(const char* httpUrl);

+ 12 - 0
Module/mod_guiconsole/GUIConsole_def_g.h

@@ -36,6 +36,18 @@ namespace GUIConsole {
 #define GUIConsoleService_MethodSignature_AddTradeManage 485018637
 #define GUIConsoleService_MethodSignature_QueryMaterialInfo 467755649
 
+#define GUIConsoleService_LogCode_GetCurrentMaintainer "QLR040250800"
+#define GUIConsoleService_LogCode_Empower "QLR040250801"
+#define GUIConsoleService_LogCode_Takeover "QLR040250802"
+#define GUIConsoleService_LogCode_ForceQuit "QLR040250803"
+#define GUIConsoleService_LogCode_AddMaterialCounter "QLR040250804"
+#define GUIConsoleService_LogCode_GetMaterialCounter "QLR040250805"
+#define GUIConsoleService_LogCode_ResetMaterialCounter "QLR040250806"
+#define GUIConsoleService_LogCode_RegistSwallowedCard "QLR040250807"
+#define GUIConsoleService_LogCode_SyncMaterialCount "QLR040250808"
+#define GUIConsoleService_LogCode_AddTradeManage "QLR040250809"
+#define GUIConsoleService_LogCode_QueryMaterialInfo "QLR040250810"
+
 struct GUIConsoleService_GetCurrentMaintainer_Req
 {
 

+ 45 - 9
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -765,6 +765,44 @@ unsigned int CVtmLoaderFSM::s5_on_event(FSMEvent* pEvt)
 	return 0;
 }
 
+void CVtmLoaderFSM::LoadNetworkCheckURLConfig()
+{
+	CSmartPointer<IConfigInfo> spConfigCen;
+	CSimpleStringA strValue(true);
+	GetEntityBase()->GetFunction()->OpenConfig(Config_CenterSetting, spConfigCen);
+	int internetOrNot(0);
+	spConfigCen->ReadConfigValueInt("Common", "InternetEnv", internetOrNot);
+	spConfigCen->ReadConfigValue("Common", "CheckURL", strValue);
+	if (!strValue.IsNullOrEmpty()) {
+		m_strNetworkCheckUrl = strValue;
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Read check url from CS: %s", m_strNetworkCheckUrl.GetData());
+	}
+	else {
+		CSmartPointer<IConfigInfo> spConfigShell;
+		GetEntityBase()->GetFunction()->OpenConfig(Config_Shell, spConfigShell);
+		CSimpleStringA strURLSection = "URL";
+#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
+		strURLSection = "URL-ST";
+#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
+		//strURLSection = "URL-PRD";
+		if (1 == internetOrNot) {
+			strURLSection = "URL-Internet";
+		}
+#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
+		strURLSection = "URL-UAT";
+#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
+		strURLSection = "URL-Dev";
+#else/*本地编译等非DevOps环境编译的版本*/
+		strURLSection = "URL-Dev";
+#endif
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Section [%s]", strURLSection.GetData());
+		spConfigShell->ReadConfigValue("NetworkCheck", strURLSection, strValue);
+		if (!strValue.IsNullOrEmpty()) {
+			m_strNetworkCheckUrl = strValue;
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Read check url from local shell %s=%s", strURLSection.GetData(), m_strNetworkCheckUrl.GetData());
+		}
+	}
+}
 
 BOOL CVtmLoaderFSM::DetectNetworkLegality(CSimpleStringA& strInfo)
 {
@@ -926,8 +964,7 @@ int CVtmLoaderFSM::EntityLoad()
 		arrEntity = arrCoreBoot[i].Split('=');
 		if (arrEntity.GetCount() <= 0)
 			break;
-		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0
-			|| arrEntity[0].Compare("GuiConsole", true) == 0)
+		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0)
 			continue;
 		m_vCoreBoot.push_back(arrEntity[0]);
 		if (arrEntity[1].Compare("1") == 0)
@@ -950,8 +987,7 @@ int CVtmLoaderFSM::EntityLoad()
 		arrEntity = arrSafeLoad[i].Split('=');
 		if (arrEntity.GetCount() <= 0)
 			break;
-		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0
-			|| arrEntity[0].Compare("GuiConsole", true) == 0)
+		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0)
 			continue;
 		//去重,防止前面已经加载了
 		if (find(m_vCoreBoot.begin(), m_vCoreBoot.end(), arrEntity[0].GetData()) != m_vCoreBoot.end())
@@ -977,8 +1013,7 @@ int CVtmLoaderFSM::EntityLoad()
 		arrEntity = arrOperating[i].Split('=');
 		if (arrEntity.GetCount() <= 0)
 			break;
-		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0
-			|| arrEntity[0].Compare("GuiConsole", true) == 0)
+		if (arrEntity[0].Compare("VtmLoader", true) == 0 || arrEntity[0].Compare("Chromium", true) == 0)
 			continue;
 		//去重,防止前面已经加载了
 		if (find(m_vCoreBoot.begin(), m_vCoreBoot.end(), arrEntity[0].GetData()) != m_vCoreBoot.end()
@@ -1389,6 +1424,7 @@ bool CVtmLoaderFSM::GetCenterSetting()
 		GetEntityBase()->GetFunction()->GetPrivilegeFunction()->BeginLogSend(default_endpoint, topicSys, topicUser, topicBeidou, topicBussSys, topicBussUser);
 	}
 
+	CSystemStaticInfo m_sysInfo;
 	GetEntityBase()->GetFunction()->GetSystemStaticInfo(m_sysInfo);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("terminalNo:%s, MachineType:%s, MachineVersion:%s, Site:%s, Screen:%d, EnrolGPS:%f.%f, EnrolAddr:%s"
 		, m_sysInfo.strTerminalID.GetData(), m_sysInfo.strMachineType.GetData(), m_sysInfo.MachineVersion.ToString().GetData()
@@ -1443,9 +1479,9 @@ int CVtmLoaderFSM::HttpConnCheck(CSimpleStringA csHttAddr, HttpAddrType eType)
 			if (SP::Module::Net::GetINETMacAddresses(interNames, macAddrs, ipAddrs) == Error_Succeed)
 			{
 				for (int i = 0; i < min(ipAddrs.GetCount(),macAddrs.GetCount()); i++) {
-					LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("interface(%d):%s", i, interNames[i].GetData()));
-					LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("ip(%d):%s", i, ipAddrs[i].GetData()));
-					LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("mac(%d):%s", i, macAddrs[i].GetData()));
+					GetEntityBase()->GetFunction()->ShowStartupInfo(CSimpleStringA::Format("interface(%d):%s", i, interNames[i].GetData()));
+					GetEntityBase()->GetFunction()->ShowStartupInfo(CSimpleStringA::Format("ip(%d):%s", i, ipAddrs[i].GetData()));
+					GetEntityBase()->GetFunction()->ShowStartupInfo(CSimpleStringA::Format("mac(%d):%s", i, macAddrs[i].GetData()));
 				}
 			}
 		}

+ 1 - 0
Module/mod_vtmloader/VtmLoaderFSM.h

@@ -139,6 +139,7 @@ private:
 	void s5_on_exit();
 	unsigned int s5_on_event(FSMEvent* event);
 
+	void LoadNetworkCheckURLConfig();
 	ErrorCodeEnum AsyncStartEntity(const char* entity_name, const char* cmdline, void* pData);
 	void OnAnswer(CSmartPointer<IAsynWaitSp> pAsynWaitSp);
 	bool IsRootINIExist();