Explorar o código

Merge branch 'ST2_0611_firewall' of http://gitee.itc.cmbchina.cn/QD_RemoteBankArea/LR04.02_RVCTerminalPlus into ST2_0611_firewall

chenliangyu hai 3 meses
pai
achega
f2b261e5bc

+ 24 - 0
Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

@@ -1671,6 +1671,8 @@ namespace Task
 				failStatus = m_fsm->ExecDepInstall(errMsg);
 			}
 			if(failStatus == 1){
+				//安装成功,执行防火墙设置
+				m_fsm->SetNewVersionPathToFirewall();
 				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("======end ExecInstall:succ======");
 				isInstallSucc =true;
 			}else{
@@ -5624,6 +5626,28 @@ CSimpleStringA CUpgradeTaskFSM::getAlarmCurrVersion()
 	return m_currentVersion.ToString();
 }
 
+ErrorCodeEnum CUpgradeTaskFSM::SetNewVersionPathToFirewall()
+{
+	if (m_TempDepUpgradeFlag) {
+		return Error_Succeed;//适配器升级,不设置
+	}
+	if (isTerminalInstall()) {
+		return Error_Succeed;//安装新设备,不设置
+	}
+	if (!m_currentTask.NewVersion.IsNullOrEmpty()) {
+		//升级应用版本
+
+		CSimpleStringA rootVerPath;
+		ErrorCodeEnum rc = m_pEntity->GetFunction()->GetPath("RootVer", rootVerPath);//获取version根路径
+		if (rc != Error_Succeed) {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SetNewVersionPathToFirewall fail , get RootVer path is fail");
+			return Error_Bug;
+		}
+		CSimpleStringA strNewVerPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", rootVerPath.GetData(), m_currentTask.NewVersion.GetData());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("SetNewVersionPathToFirewall path = %s", strNewVerPath.GetData());
+		return m_pEntity->GetFunction()->SetNewPathToFirewall(strNewVerPath);
+	}
+}
 
 ErrorCodeEnum CUpgradeTaskFSM::SM3FileToStr(CSimpleStringA strFilePath, CSimpleStringA &strSM3,bool isSub)
 {

+ 2 - 1
Module/mod_UpgradeMgr/UpgradeTaskFSM.h

@@ -444,7 +444,8 @@ public:
 
 	CSimpleStringA getAlarmCurrVersion();
 
-
+	//Éý¼¶Ê±Ìí¼Ó·À»ðǽ²ßÂÔ
+	ErrorCodeEnum SetNewVersionPathToFirewall();
 
 	bool isWork();
 	bool isAuthSucc();