Bläddra i källkod

# IQRV #comment 合并st2内容

gifur 3 år sedan
förälder
incheckning
0d31c29023

+ 22 - 5
CMakeLists.txt

@@ -54,6 +54,7 @@ endif()
 
 set(DEVOPS_ON FALSE)
 set(FORMAT_UPDATE_PKG FALSE)
+set(FORMAT_WITH_SUFFIX TRUE)
 if(WITH_UPDATE_FORMAT AND NOT PACK_AS_DEB_PKG)
 	set(FORMAT_UPDATE_PKG TRUE)
 endif(WITH_UPDATE_FORMAT AND NOT PACK_AS_DEB_PKG)
@@ -85,8 +86,13 @@ else()
 	message(STATUS "Git branch is ${GIT_BRANCH}")
 endif($ENV{PIPELINE_BUILD_ID})
 
+# alpha: 内测版本,BUG多,不稳定
+# beta1,beta2: 公测版本,不稳定(比alpha稍微稳定),BUG相对较多
+# rc1,rc2: 候选版本
+# stable 稳定版本
+
 #Set the project version
-set(RAW_VERSION_STRING "0.2.1-dev1")
+set(RAW_VERSION_STRING "0.2.1-beta1")
 string(STRIP ${RAW_VERSION_STRING} RAW_VERSION_STRING)
 
 set(VERSION_REGEX "^.?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?(.*)")
@@ -106,16 +112,26 @@ if(DEVOPS_ON)
 	endif()
 	set(DEVOPS_ENV_STR $ENV{DEVOPS_ENV})
 	string(TOLOWER $ENV{DEVOPS_ENV} DEVOPS_ENV_STR)
-	# set(RVC_VERSION_SUFFIX "${DEVOPS_ENV_STR}$ENV{PIPELINE_NUMBER}")
-	set(RVC_VERSION_SUFFIX "$ENV{DEVOPS_ENV}($ENV{PIPELINE_NAME})")
-
+	
 	string(COMPARE EQUAL ${DEVOPS_ENV_STR} "uat" IS_DEVOPS_UAT)
 	if(IS_DEVOPS_UAT)
 		set(BUILD_NUMBER 0)
+		set(FORMAT_WITH_SUFFIX FALSE)
 		message(STATUS "UAT devops environment, reset build number.")
-		unset(RVC_VERSION_SUFFIX)
+		if(DEFINED ENV{NOT_STABLE_VERSION})
+			if($ENV{NOT_STABLE_VERSION})
+				set(FORMAT_WITH_SUFFIX TRUE)
+				message(STATUS "test: $ENV{NOT_STABLE_VERSION}")
+			endif($ENV{NOT_STABLE_VERSION})
+		endif(DEFINED ENV{NOT_STABLE_VERSION})
+	else(IS_DEVOPS_UAT)
+		set(RVC_VERSION_SUFFIX "$ENV{DEVOPS_ENV}($ENV{PIPELINE_NAME})")
 	endif(IS_DEVOPS_UAT)
 
+	if(NOT FORMAT_WITH_SUFFIX)
+		unset(RVC_VERSION_SUFFIX)
+	endif(NOT FORMAT_WITH_SUFFIX)
+
 	if(DEFINED ENV{BUILD_UPDATE_FORMAT} AND NOT PACK_AS_DEB_PKG)
 		if($ENV{BUILD_UPDATE_FORMAT})
 			set(FORMAT_UPDATE_PKG TRUE)
@@ -136,6 +152,7 @@ set(RVC_API_VERSION "${RVC_VERSION_MAJOR}")
 set(RVC_VERSION "${RVC_VERSION_MAJOR}.${RVC_VERSION_MINOR}.${RVC_VERSION_REVISION}.${RVC_VERSION_BUILD}")
 set(RVC_FRAMEWORK_VERSION "${RVC_VERSION_MAJOR}.${RVC_VERSION_MINOR}.${RVC_VERSION_REVISION}")
 if (RVC_VERSION_SUFFIX)
+	set(RVC_FRAMEWORK_VERSION "${RVC_FRAMEWORK_VERSION}-${RVC_VERSION_SUFFIX}")
 	set(RVC_VERSION_FULL "${RVC_VERSION}-${RVC_VERSION_SUFFIX}")
 else()
 	set(RVC_VERSION_FULL "${RVC_VERSION}")

+ 3 - 0
Module/include/EventCode.h

@@ -871,6 +871,9 @@ ERR_ACCESSAUTH_SHA1_HASH}
 #define LOG_ERR_SET_DNS_FAILED		0x50A00032
 #define LOG_WARN_DELETE_DNS_CUST	0x50A00033
 #define LOG_ERR_DELETE_DNS_FAILED	0x50A00034
+
+#define LOG_WARN_VER_DELETE	0x50A00040
+
 #define LOG_WARN_NET_PROBE_FAILED_BASE	0x50A35500 //预留100个错误码50A35500-50A35599,用于网络探测监控
 #define LOG_WARN_NET_PROBE_SUCCESS_BASE	0x50A35600 //预留100个错误码50A35600-50A35699,用于网络探测监控
 

+ 1 - 3
Module/mod_Initializer/mod_Initializer.cpp

@@ -948,9 +948,7 @@ DWORD CInitializerEntity::ReportInitMKState(const char *pszUserID, DWORD dwErrCo
             return rc;
         }
         assert(m_pConnection->IsConnectionOK());
-        std::string errStr = SP::Utility::UTF8ToGBK(std::string(pszErrMsg));
-		auto test = SP::Utility::GBK2UTF8(errStr);
-        return m_pConnection->SendReportStatePackage("InitMK", pszUserID, dwErrCode, errStr.c_str());
+        return m_pConnection->SendReportStatePackage("InitMK", pszUserID, dwErrCode, pszErrMsg);
 	} else {
 		return Error_Succeed;
 	}

+ 47 - 3
Module/mod_ResourceWatcher/ResourceWatcher.xml

@@ -79,10 +79,8 @@
 						-1: 操作无效
 						-2:  操作失败 attachment2 字段存储错误信息
 						>0:  操作成功
-						
 				 -->
 				<param name="result" type="int" />
-			
 				<!-- 当前卷/目录/文件的完整路径 
 					当 mode = 0 时,header 与 传递过来的 current 是一致的;
 					当 mode = 6 时,header 为 重命名后的目录或文件的完整路径
@@ -156,8 +154,54 @@
 				<!-- 储存事件日志的文件名称,entiries 为 0 时无效 -->
 				<param name="evtLogFileName" type="string" />
 			</res>
+		</twoway>	
+		<!--网络连接类型检测-->
+		<twoway name="CheckNetType" overlap="true">
+			<req>
+			</req>
+			<res>
+				<!--0:未知,1:网络无连接,2:有线,3:无线,4:移动网络 ...-->
+				<param name="netType" type="int"/>
+				<param name="strParam" type="string"/>
+				<param name="intParam" type="int"/>
+			</res>
+		</twoway>
+
+		<!--业务站点信息查询-->
+		<twoway name="GetBizLinks" overlap="true">
+			<req>
+				<!--备用过滤参数,目前只支持传入0,表示不过滤,返回所有业务站点。后续如有其他过滤需求可通过此参数进行选择-->
+				<param name="filter" type="int"/>
+			</req>
+			<res>
+				<param name="bizLinks" type="array_string"/>
+				<param name="bizNames" type="array_string"/>
+				<param name="params1" type="array_string"/>
+			</res>
+		</twoway>
+
+		<!--业务站点检测-->
+		<twoway name="BizLinkDetect" overlap="true">
+			<req>
+				<!--扩展使用,预留通过参数设置检测方式:0.ping、 1.http... ,目前传0即可-->
+				<param name="protocol" type="int"/>
+				<param name="bizLink" type="string"/>
+				<!--后续扩展使用-->
+				<param name="attachment1" type="string"/>
+				<!--后续扩展使用-->
+				<param name="attachment2" type="string"/>
+			</req>
+			<res>
+				<param name="bizLinkStatus" type="bool"/>
+				<!--在bizLinkStatus为 true的情况下,该值方有效,返回PING后的延迟时间,单位为毫秒 -->
+				<param name="bizLinkDelayMS" type="uint"/>
+				<!--后续扩展使用-->
+				<param name="strParam" type="string"/>
+				<!--后续扩展使用-->
+				<param name="intParam" type="int"/>
+			</res>
 		</twoway>
-    <twoway  name="UpdateDNS" overlap="true">
+		    <twoway  name="UpdateDNS" overlap="true">
       <req>
         <param name="interface" type="string" />
         <param name="dns1" type="string" />

+ 119 - 19
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -5,6 +5,8 @@
 #include <string> 
 #include <fstream> 
 #include <iostream> 
+#include <dirent.h>
+#include <vector>
 #if defined(RVC_OS_WIN)
 #include <intrin.h>
 #include <ShlObj.h>
@@ -270,16 +272,6 @@ unsigned int ResourceWatcherFSM::s1_on_event(FSMEvent* e)
     e->SetHandled();
     break;
     case USER_EVT_CLEAR_VIDEOFILE_ENHANCE_FINISHED:
-    {
-        PostEventFIFO(new FSMEvent(USER_EVT_VERSION_CLEAR));
-    }
-    e->SetHandled();
-    break;
-    case USER_EVT_VERSION_CLEAR:
-    {
-        ClearVersionTask* task = new ClearVersionTask(this);
-        GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
-    }
     e->SetHandled();
     break;
     case USER_EVT_VERSION_CLEAR_FINISHED:
@@ -1728,8 +1720,98 @@ BOOL ResourceWatcherFSM::DeleteVersionPackage()
         return TRUE;
     }
 
-    vector<CInstallInfoEx> intallInfoVects;
-    CVersion lastVer = info.PreviousInstallVersion;
+    CSimpleStringA strRunInfo, strStartTime;
+    if (m_pEntity->GetFunction()->GetPath("RunInfo", strRunInfo) == Error_Succeed) {
+        strStartTime = strRunInfo + "/runcfg/starttime.dat";
+        if (!ExistsFileA(strStartTime.GetData())) {
+            Dbg("upgrade porcess done, try to delete version files.");//完成升级过程,通过
+        }
+        else {
+            Dbg("upgrade process is not end ,should not delete version files.");
+            return FALSE;//升级未完成,不进行删除
+        }
+    }
+    else {
+        Dbg("upgrade process is not end ,get runinfo path is error, should not delete version files.");
+        return FALSE;//失败,继续等待
+    }
+
+    //获取当前目录下的文件夹名称, 将符合命名规则的终端版本名称push_back
+    CSimpleStringA csPath;
+    ErrorCodeEnum Error = m_pEntity->GetFunction()->GetPath("RootVer", csPath);   //获取当前版本路劲 例如:C:\Run
+    if (Error_Succeed == Error) {
+        if (csPath.IsNullOrEmpty())
+        {
+            Dbg("get currVer path is null");
+            return FALSE;
+        }
+        else
+        {
+            /*csPath.Append("/version");*/
+            Dbg("CUR VERSION PATH = %s.", csPath.GetData());
+        }
+    }
+    else {
+        Dbg("get upgradeVer path is error");
+        return FALSE;
+    }
+
+    //vector<CInstallInfoEx> intallInfoVects;
+    vector<CVersion> intallInfoVects;
+    vector<string> files;
+    DIR* dp;
+    struct dirent* dirp;
+
+    if ((dp = opendir(csPath.GetData())) != NULL) {
+        while ((dirp = readdir(dp)) != NULL) {
+            //files.push_back(string(dirp->d_name));
+            CInstallInfo verInfo = {};
+            DWORD dwMajor(0), dwMinor(0), dwRevision(0), dwBuild(0);
+            int n = sscanf(dirp->d_name, "%d.%d.%d.%d", &dwMajor, &dwMinor, &dwRevision, &dwBuild);
+            if (n != 4)
+            {
+                Dbg("Not version file.[%s]", dirp->d_name);
+                continue;
+            }
+            else {
+                CVersion verName(dwMajor, dwMinor, dwRevision, dwBuild);
+                if (verName.IsValid() && verName < info.InstallVersion)   //对高于自身版本的文件不予删除
+                {                    
+                    //verInfo.InstallVersion = verName;
+                    intallInfoVects.push_back(verName);
+                }
+                else {
+                    Dbg("Not version file.[%s]", dirp->d_name);
+                }
+            }
+        }
+        closedir(dp);
+    }
+
+    CSimpleStringA upPath;
+    ErrorCodeEnum upError = m_pEntity->GetFunction()->GetPath("Upgraded", upPath);
+    if (Error_Succeed != upError) {
+        Dbg("get Upgraded path error");
+        return FALSE;
+    }
+
+    DIR* updp;
+    struct dirent* updirp;
+    if ((updp = opendir(upPath.GetData())) != NULL) {
+        while ((updirp = readdir(updp)) != NULL) {
+            char szPath[MAX_VERSION_PATH] = { 0 };
+            strcat(szPath, upPath.GetData());
+            CSimpleStringA tmpDirPath = szPath;
+            strcat(szPath, "/");
+            strcat(szPath, updirp->d_name);
+            Dbg("operating Upgrade path: [%s][%s]", (LPCTSTR)tmpDirPath, szPath);
+            RemoveFileA(szPath);
+        }
+        closedir(updp);
+    }
+    
+
+    /*CVersion lastVer = info.PreviousInstallVersion;
     while (lastVer.IsValid()) {
         CInstallInfo lastVerInfo = {};
         erroCode = pFunc->GetInstallInfo(lastVer, lastVerInfo);
@@ -1738,7 +1820,19 @@ BOOL ResourceWatcherFSM::DeleteVersionPackage()
         }
         intallInfoVects.push_back(CInstallInfoEx(lastVerInfo));
         lastVer = lastVerInfo.PreviousInstallVersion;
+    }*/
+    
+    int verSaved = DEFAULT_VERSION_SAVED_COUNT;
+    int tmpSaved = 0;
+    CSmartPointer<IEntityFunction> spFunction = this->GetEntityBase()->GetFunction();
+    CSmartPointer<IConfigInfo> spConfig;
+    spFunction->OpenConfig(Config_Software, spConfig);
+    spConfig->ReadConfigValueInt("VersionSaved", "default", tmpSaved);
+    if (tmpSaved > DEFAULT_VERSION_SAVED_COUNT)
+    {
+        verSaved = tmpSaved;
     }
+
     int nPackCount = intallInfoVects.size();
     Dbg("Install Package's count: %d", nPackCount);
     bool bFailFlag = false;
@@ -1746,20 +1840,23 @@ BOOL ResourceWatcherFSM::DeleteVersionPackage()
     if (nPackCount != 0) {
         int nSavedCount = 0;
         sort(intallInfoVects.begin(), intallInfoVects.end());
-        vector<CInstallInfoEx>::iterator iter = intallInfoVects.begin();
-        while (iter != intallInfoVects.end()) {
-            Dbg("InstallPackage Info: %s, SwithOverDate: %s", (LPCTSTR)iter->InstallVersion.ToString(), (LPCTSTR)iter->tmSwithOverDate.ToTimeString());
-            if (++nSavedCount <= DEFAULT_VERSION_SAVED_COUNT) {
+        //vector<CInstallInfoEx>::iterator iter = intallInfoVects.begin();
+        vector<CVersion>::reverse_iterator riter = intallInfoVects.rbegin();
+        while (riter != intallInfoVects.rend()) {
+            //Dbg("InstallPackage Info: %s, SwithOverDate: %s", (LPCTSTR)iter->InstallVersion.ToString(), (LPCTSTR)iter->tmSwithOverDate.ToTimeString());
+            Dbg("InstallPackage Info: %s", (LPCTSTR)(*riter).ToString());
+            if (++nSavedCount <= verSaved) {
                 Dbg("Save above version");
-                iter++;
+                riter++;
                 continue;
             }
-            if (!DeleteSpecificeVersionDir(iter->InstallVersion))
+            //if (!DeleteSpecificeVersionDir(iter->InstallVersion))
+            if(!DeleteSpecificeVersionDir(*riter))
                 bFailFlag = true;
             else
                 nDelVersionCnt++;
 
-            iter++;
+            riter++;
         }
     }
 
@@ -1768,6 +1865,9 @@ BOOL ResourceWatcherFSM::DeleteVersionPackage()
     spConfigRun->WriteConfigValueInt("VersionClear", "LastCondi", nLstFlag);
     spConfigRun->WriteConfigValue("VersionClear", "LastTime",
                                   (LPCTSTR)CSimpleStringA::Format("0x%08X", (DWORD)CSmallDateTime::GetNow()));
+
+    string warn = "Delete Version files count : " + to_string(nDelVersionCnt);
+    LogWarn(Severity_Low, Error_Debug, LOG_WARN_VER_DELETE, CSimpleStringA::Format("%s", warn.c_str()));
     return TRUE;
 }
 

+ 1 - 3
Module/mod_ResourceWatcher/ResourceWatcherFSM.h

@@ -214,7 +214,7 @@ public:
 
 		BEGIN_FSM_RULE(ResourceWatcherFSM, s0)
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_RUN, 0)
-		FSM_RULE_ENTRY(s1, s3, USER_EVT_VERSION_CLEAR_FINISHED, 0)
+		FSM_RULE_ENTRY(s1, s3, USER_EVT_CLEAR_VIDEOFILE_ENHANCE_FINISHED, 0)
 		END_FSM_RULE()
 
 		virtual ErrorCodeEnum OnInit();
@@ -628,9 +628,7 @@ struct ClearVersionTask : public ITaskSp
 	ClearVersionTask(ResourceWatcherFSM* pFSM) : m_pFSM(pFSM) {}
 	void Process()
 	{
-		FSMEvent* fsmEvent = new FSMEvent(USER_EVT_VERSION_CLEAR_FINISHED);
 		m_pFSM->DeleteVersionPackage();
-		m_pFSM->PostEventFIFO(fsmEvent);
 	}
 };
 

+ 99 - 41
Module/mod_ResourceWatcher/ResourceWatcher_client_g.h

@@ -213,6 +213,93 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		return pFunc->AsyncRequest(ResourceWatcherService_Method_CheckNetType, ResourceWatcherService_MethodSignature_CheckNetType, Buf, spAsyncWait, dwTimeout);
+	}
+	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, ResourceWatcherService_CheckNetType_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = CheckNetType(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, ResourceWatcherService_CheckNetType_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = CheckNetType(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
+	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		return pFunc->AsyncRequest(ResourceWatcherService_Method_GetBizLinks, ResourceWatcherService_MethodSignature_GetBizLinks, Buf, spAsyncWait, dwTimeout);
+	}
+	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, ResourceWatcherService_GetBizLinks_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetBizLinks(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, ResourceWatcherService_GetBizLinks_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetBizLinks(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
+	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		return pFunc->AsyncRequest(ResourceWatcherService_Method_BizLinkDetect, ResourceWatcherService_MethodSignature_BizLinkDetect, Buf, spAsyncWait, dwTimeout);
+	}
+	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, ResourceWatcherService_BizLinkDetect_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = BizLinkDetect(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, ResourceWatcherService_BizLinkDetect_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = BizLinkDetect(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 	ErrorCodeEnum UpdateDNS(ResourceWatcherService_UpdateDNS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -329,45 +416,16 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		return pFunc->AsyncRequest(ResourceWatcherService_Method_CheckNetType, ResourceWatcherService_MethodSignature_CheckNetType, Buf, spAsyncWait, dwTimeout);
-	}
-	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, ResourceWatcherService_CheckNetType_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = CheckNetType(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum CheckNetType(ResourceWatcherService_CheckNetType_Req &Req, ResourceWatcherService_CheckNetType_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = CheckNetType(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	ErrorCodeEnum GetTerminalVersionList(ResourceWatcherService_GetTerminalVersionList_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
 		CAutoBuffer Buf = SpObject2Buffer(Req);
-		return pFunc->AsyncRequest(ResourceWatcherService_Method_GetBizLinks, ResourceWatcherService_MethodSignature_GetBizLinks, Buf, spAsyncWait, dwTimeout);
+		return pFunc->AsyncRequest(ResourceWatcherService_Method_GetTerminalVersionList, ResourceWatcherService_MethodSignature_GetTerminalVersionList, Buf, spAsyncWait, dwTimeout);
 	}
-	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, ResourceWatcherService_GetBizLinks_Ans &Ans, DWORD dwTimeout)
+	ErrorCodeEnum GetTerminalVersionList(ResourceWatcherService_GetTerminalVersionList_Req &Req, ResourceWatcherService_GetTerminalVersionList_Ans &Ans, DWORD dwTimeout)
 	{
 		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetBizLinks(Req, spAsyncWait, dwTimeout);
+		ErrorCodeEnum Error = GetTerminalVersionList(Req, spAsyncWait, dwTimeout);
 		if (Error == Error_Succeed) {
 			bool bEnd = false;
 			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
@@ -375,10 +433,10 @@ public:
 		}
 		return Error;
 	}
-	ErrorCodeEnum GetBizLinks(ResourceWatcherService_GetBizLinks_Req &Req, ResourceWatcherService_GetBizLinks_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	ErrorCodeEnum GetTerminalVersionList(ResourceWatcherService_GetTerminalVersionList_Req &Req, ResourceWatcherService_GetTerminalVersionList_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
 	{
 		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetBizLinks(Req, spAsyncWait, dwTimeout);
+		ErrorCodeEnum Error = GetTerminalVersionList(Req, spAsyncWait, dwTimeout);
 		if (Error == Error_Succeed) {
 			bool bEnd = false;
 			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
@@ -387,16 +445,16 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	ErrorCodeEnum ManipulateVersion(ResourceWatcherService_ManipulateVersion_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
 		CAutoBuffer Buf = SpObject2Buffer(Req);
-		return pFunc->AsyncRequest(ResourceWatcherService_Method_BizLinkDetect, ResourceWatcherService_MethodSignature_BizLinkDetect, Buf, spAsyncWait, dwTimeout);
+		return pFunc->AsyncRequest(ResourceWatcherService_Method_ManipulateVersion, ResourceWatcherService_MethodSignature_ManipulateVersion, Buf, spAsyncWait, dwTimeout);
 	}
-	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, ResourceWatcherService_BizLinkDetect_Ans &Ans, DWORD dwTimeout)
+	ErrorCodeEnum ManipulateVersion(ResourceWatcherService_ManipulateVersion_Req &Req, ResourceWatcherService_ManipulateVersion_Ans &Ans, DWORD dwTimeout)
 	{
 		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BizLinkDetect(Req, spAsyncWait, dwTimeout);
+		ErrorCodeEnum Error = ManipulateVersion(Req, spAsyncWait, dwTimeout);
 		if (Error == Error_Succeed) {
 			bool bEnd = false;
 			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
@@ -404,10 +462,10 @@ public:
 		}
 		return Error;
 	}
-	ErrorCodeEnum BizLinkDetect(ResourceWatcherService_BizLinkDetect_Req &Req, ResourceWatcherService_BizLinkDetect_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	ErrorCodeEnum ManipulateVersion(ResourceWatcherService_ManipulateVersion_Req &Req, ResourceWatcherService_ManipulateVersion_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
 	{
 		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = BizLinkDetect(Req, spAsyncWait, dwTimeout);
+		ErrorCodeEnum Error = ManipulateVersion(Req, spAsyncWait, dwTimeout);
 		if (Error == Error_Succeed) {
 			bool bEnd = false;
 			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);

+ 114 - 55
Module/mod_ResourceWatcher/ResourceWatcher_def_g.h

@@ -18,13 +18,13 @@ namespace ResourceWatcher {
 #define ResourceWatcherService_Method_GetCpuType 2
 #define ResourceWatcherService_Method_OperateFile 3
 #define ResourceWatcherService_Method_ExtractEventLog 4
-#define ResourceWatcherService_Method_UpdateDNS 5
-#define ResourceWatcherService_Method_GetNetworkInfo 6
-#define ResourceWatcherService_Method_GetThirdPartyInstallState 7
-#define ResourceWatcherService_Method_InstallThirdPartyProgram 8
-#define ResourceWatcherService_Method_CheckNetType 9
-#define ResourceWatcherService_Method_GetBizLinks 10
-#define ResourceWatcherService_Method_BizLinkDetect 11
+#define ResourceWatcherService_Method_CheckNetType 5
+#define ResourceWatcherService_Method_GetBizLinks 6
+#define ResourceWatcherService_Method_BizLinkDetect 7
+#define ResourceWatcherService_Method_UpdateDNS 8
+#define ResourceWatcherService_Method_GetNetworkInfo 9
+#define ResourceWatcherService_Method_GetThirdPartyInstallState 10
+#define ResourceWatcherService_Method_InstallThirdPartyProgram 11
 #define ResourceWatcherService_Method_GetTerminalVersionList 12
 #define ResourceWatcherService_Method_ManipulateVersion 13
 
@@ -34,15 +34,15 @@ namespace ResourceWatcher {
 #define ResourceWatcherService_MethodSignature_GetCpuType -1911838440
 #define ResourceWatcherService_MethodSignature_OperateFile 935567963
 #define ResourceWatcherService_MethodSignature_ExtractEventLog -1046715334
-#define ResourceWatcherService_MethodSignature_UpdateDNS -943970884
-#define ResourceWatcherService_MethodSignature_GetNetworkInfo 1741482404
-#define ResourceWatcherService_MethodSignature_GetThirdPartyInstallState -15861483
-#define ResourceWatcherService_MethodSignature_InstallThirdPartyProgram -1049249852
 #define ResourceWatcherService_MethodSignature_CheckNetType 1341887614
 #define ResourceWatcherService_MethodSignature_GetBizLinks 651862197
 #define ResourceWatcherService_MethodSignature_BizLinkDetect 1476437131
-#define ResourceWatcherService_MethodSignature_GetTerminalVersionList 598083609
-#define ResourceWatcherService_MethodSignature_ManipulateVersion 671931256
+#define ResourceWatcherService_MethodSignature_UpdateDNS 689391692
+#define ResourceWatcherService_MethodSignature_GetNetworkInfo -799638104
+#define ResourceWatcherService_MethodSignature_GetThirdPartyInstallState -15861483
+#define ResourceWatcherService_MethodSignature_InstallThirdPartyProgram -1049249852
+#define ResourceWatcherService_MethodSignature_GetTerminalVersionList -504582702
+#define ResourceWatcherService_MethodSignature_ManipulateVersion -313717631
 
 struct ResourceWatcherService_Fetch_Req
 {
@@ -217,6 +217,80 @@ struct ResourceWatcherService_ExtractEventLog_Ans
 
 };
 
+struct ResourceWatcherService_CheckNetType_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct ResourceWatcherService_CheckNetType_Ans
+{
+	int netType;
+	CSimpleStringA strParam;
+	int intParam;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & netType & strParam & intParam;
+	}
+
+};
+
+struct ResourceWatcherService_GetBizLinks_Req
+{
+	int filter;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & filter;
+	}
+
+};
+
+struct ResourceWatcherService_GetBizLinks_Ans
+{
+	CAutoArray<CSimpleStringA> bizLinks;
+	CAutoArray<CSimpleStringA> bizNames;
+	CAutoArray<CSimpleStringA> params1;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & bizLinks & bizNames & params1;
+	}
+
+};
+
+struct ResourceWatcherService_BizLinkDetect_Req
+{
+	int protocol;
+	CSimpleStringA bizLink;
+	CSimpleStringA attachment1;
+	CSimpleStringA attachment2;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & protocol & bizLink & attachment1 & attachment2;
+	}
+
+};
+
+struct ResourceWatcherService_BizLinkDetect_Ans
+{
+	bool bizLinkStatus;
+	unsigned int bizLinkDelayMS;
+	CSimpleStringA strParam;
+	int intParam;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & bizLinkStatus & bizLinkDelayMS & strParam & intParam;
+	}
+
+};
+
 struct ResourceWatcherService_UpdateDNS_Req
 {
 	CSimpleStringA interface;
@@ -325,76 +399,61 @@ struct ResourceWatcherService_InstallThirdPartyProgram_Ans
 
 };
 
-struct ResourceWatcherService_CheckNetType_Req
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
-struct ResourceWatcherService_CheckNetType_Ans
-{
-	int netType;
-	CSimpleStringA strParam;
-	int intParam;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & netType & strParam & intParam;
-	}
-
-};
-
-struct ResourceWatcherService_GetBizLinks_Req
+struct ResourceWatcherService_GetTerminalVersionList_Req
 {
-	int filter;
+	int filter1;
+	int filter2;
+	int filter3;
+	CSimpleStringA filter4;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & filter;
+		auto & buf = Buf & filter1 & filter2 & filter3 & filter4;
 	}
 
 };
 
-struct ResourceWatcherService_GetBizLinks_Ans
+struct ResourceWatcherService_GetTerminalVersionList_Ans
 {
-	CAutoArray<CSimpleStringA> bizLinks;
-	CAutoArray<CSimpleStringA> bizNames;
-	CAutoArray<CSimpleStringA> params1;
+	int current;
+	CAutoArray<int> index;
+	CAutoArray<CSimpleStringA> version;
+	CAutoArray<CSimpleStringA> remark;
+	CAutoArray<int> type;
+	CAutoArray<int> status;
+	CSimpleStringA msg;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & bizLinks & bizNames & params1;
+		auto & buf = Buf & current & index & version & remark & type & status & msg;
 	}
 
 };
 
-struct ResourceWatcherService_BizLinkDetect_Req
+struct ResourceWatcherService_ManipulateVersion_Req
 {
-	int protocol;
-	CSimpleStringA bizLink;
-	CSimpleStringA attachment1;
-	CSimpleStringA attachment2;
+	int operation;
+	CSimpleStringA value;
+	int additional1;
+	int additional2;
+	CSimpleStringA additional3;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & protocol & bizLink & attachment1 & attachment2;
+		auto & buf = Buf & operation & value & additional1 & additional2 & additional3;
 	}
 
 };
 
-struct ResourceWatcherService_BizLinkDetect_Ans
+struct ResourceWatcherService_ManipulateVersion_Ans
 {
-	bool bizLinkStatus;
-	unsigned int bizLinkDelayMS;
-	CSimpleStringA strParam;
-	int intParam;
+	int result;
+	int addition;
+	CSimpleStringA msg;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & bizLinkStatus & bizLinkDelayMS & strParam & intParam;
+		auto & buf = Buf & result & addition & msg;
 	}
 
 };

+ 93 - 43
Module/mod_ResourceWatcher/ResourceWatcher_server_g.h

@@ -72,6 +72,27 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ResourceWatcherService_Method_CheckNetType:
+			if (dwSignature == ResourceWatcherService_MethodSignature_CheckNetType) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case ResourceWatcherService_Method_GetBizLinks:
+			if (dwSignature == ResourceWatcherService_MethodSignature_GetBizLinks) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case ResourceWatcherService_Method_BizLinkDetect:
+			if (dwSignature == ResourceWatcherService_MethodSignature_BizLinkDetect) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		case ResourceWatcherService_Method_UpdateDNS:
 			if (dwSignature == ResourceWatcherService_MethodSignature_UpdateDNS) {
 				bOverlap = true;
@@ -100,22 +121,15 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case ResourceWatcherService_Method_CheckNetType:
-			if (dwSignature == ResourceWatcherService_MethodSignature_CheckNetType) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case ResourceWatcherService_Method_GetBizLinks:
-			if (dwSignature == ResourceWatcherService_MethodSignature_GetBizLinks) {
+		case ResourceWatcherService_Method_GetTerminalVersionList:
+			if (dwSignature == ResourceWatcherService_MethodSignature_GetTerminalVersionList) {
 				bOverlap = true;
 			} else {
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case ResourceWatcherService_Method_BizLinkDetect:
-			if (dwSignature == ResourceWatcherService_MethodSignature_BizLinkDetect) {
+		case ResourceWatcherService_Method_ManipulateVersion:
+			if (dwSignature == ResourceWatcherService_MethodSignature_ManipulateVersion) {
 				bOverlap = true;
 			} else {
 				Error = Error_MethodSignatureFailed;
@@ -176,6 +190,21 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case ResourceWatcherService_Method_CheckNetType:
+			if (dwSignature != ResourceWatcherService_MethodSignature_CheckNetType) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case ResourceWatcherService_Method_GetBizLinks:
+			if (dwSignature != ResourceWatcherService_MethodSignature_GetBizLinks) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
+		case ResourceWatcherService_Method_BizLinkDetect:
+			if (dwSignature != ResourceWatcherService_MethodSignature_BizLinkDetect) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		case ResourceWatcherService_Method_UpdateDNS:
 			if (dwSignature != ResourceWatcherService_MethodSignature_UpdateDNS) {
 				Error = Error_MethodSignatureFailed;
@@ -196,18 +225,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case ResourceWatcherService_Method_CheckNetType:
-			if (dwSignature != ResourceWatcherService_MethodSignature_CheckNetType) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case ResourceWatcherService_Method_GetBizLinks:
-			if (dwSignature != ResourceWatcherService_MethodSignature_GetBizLinks) {
+		case ResourceWatcherService_Method_GetTerminalVersionList:
+			if (dwSignature != ResourceWatcherService_MethodSignature_GetTerminalVersionList) {
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case ResourceWatcherService_Method_BizLinkDetect:
-			if (dwSignature != ResourceWatcherService_MethodSignature_BizLinkDetect) {
+		case ResourceWatcherService_Method_ManipulateVersion:
+			if (dwSignature != ResourceWatcherService_MethodSignature_ManipulateVersion) {
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
@@ -258,37 +282,47 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_UpdateDNS(SpReqAnsContext<ResourceWatcherService_UpdateDNS_Req, ResourceWatcherService_UpdateDNS_Ans>::Pointer ctx)
+	virtual void Handle_CheckNetType(SpReqAnsContext<ResourceWatcherService_CheckNetType_Req, ResourceWatcherService_CheckNetType_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_GetNetworkInfo(SpReqAnsContext<ResourceWatcherService_GetNetworkInfo_Req, ResourceWatcherService_GetNetworkInfo_Ans>::Pointer ctx)
+	virtual void Handle_GetBizLinks(SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req, ResourceWatcherService_GetBizLinks_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_GetThirdPartyInstallState(SpReqAnsContext<ResourceWatcherService_GetThirdPartyInstallState_Req, ResourceWatcherService_GetThirdPartyInstallState_Ans>::Pointer ctx)
+	virtual void Handle_BizLinkDetect(SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req, ResourceWatcherService_BizLinkDetect_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_InstallThirdPartyProgram(SpReqAnsContext<ResourceWatcherService_InstallThirdPartyProgram_Req, ResourceWatcherService_InstallThirdPartyProgram_Ans>::Pointer ctx)
+	virtual void Handle_UpdateDNS(SpReqAnsContext<ResourceWatcherService_UpdateDNS_Req, ResourceWatcherService_UpdateDNS_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_CheckNetType(SpReqAnsContext<ResourceWatcherService_CheckNetType_Req, ResourceWatcherService_CheckNetType_Ans>::Pointer ctx)
+	virtual void Handle_GetNetworkInfo(SpReqAnsContext<ResourceWatcherService_GetNetworkInfo_Req, ResourceWatcherService_GetNetworkInfo_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_GetBizLinks(SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req, ResourceWatcherService_GetBizLinks_Ans>::Pointer ctx)
+	virtual void Handle_GetThirdPartyInstallState(SpReqAnsContext<ResourceWatcherService_GetThirdPartyInstallState_Req, ResourceWatcherService_GetThirdPartyInstallState_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
 
-	virtual void Handle_BizLinkDetect(SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req, ResourceWatcherService_BizLinkDetect_Ans>::Pointer ctx)
+	virtual void Handle_InstallThirdPartyProgram(SpReqAnsContext<ResourceWatcherService_InstallThirdPartyProgram_Req, ResourceWatcherService_InstallThirdPartyProgram_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
+	virtual void Handle_GetTerminalVersionList(SpReqAnsContext<ResourceWatcherService_GetTerminalVersionList_Req, ResourceWatcherService_GetTerminalVersionList_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
+	virtual void Handle_ManipulateVersion(SpReqAnsContext<ResourceWatcherService_ManipulateVersion_Req, ResourceWatcherService_ManipulateVersion_Ans>::Pointer ctx)
 	{
 	/// override by user
 	}
@@ -367,6 +401,30 @@ public:
 						Handle_ExtractEventLog(ctx);
 					}
 					break;
+				case ResourceWatcherService_Method_CheckNetType:
+					{
+						SpReqAnsContext<ResourceWatcherService_CheckNetType_Req,ResourceWatcherService_CheckNetType_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_CheckNetType_Req,ResourceWatcherService_CheckNetType_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						Handle_CheckNetType(ctx);
+					}
+					break;
+				case ResourceWatcherService_Method_GetBizLinks:
+					{
+						SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req,ResourceWatcherService_GetBizLinks_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req,ResourceWatcherService_GetBizLinks_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						Handle_GetBizLinks(ctx);
+					}
+					break;
+				case ResourceWatcherService_Method_BizLinkDetect:
+					{
+						SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req,ResourceWatcherService_BizLinkDetect_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req,ResourceWatcherService_BizLinkDetect_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						Handle_BizLinkDetect(ctx);
+					}
+					break;
 				case ResourceWatcherService_Method_UpdateDNS:
 					{
 						SpReqAnsContext<ResourceWatcherService_UpdateDNS_Req,ResourceWatcherService_UpdateDNS_Ans>::Pointer ctx;
@@ -399,28 +457,20 @@ public:
 						Handle_InstallThirdPartyProgram(ctx);
 					}
 					break;
-				case ResourceWatcherService_Method_CheckNetType:
-					{
-						SpReqAnsContext<ResourceWatcherService_CheckNetType_Req,ResourceWatcherService_CheckNetType_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_CheckNetType_Req,ResourceWatcherService_CheckNetType_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						Handle_CheckNetType(ctx);
-					}
-					break;
-				case ResourceWatcherService_Method_GetBizLinks:
+				case ResourceWatcherService_Method_GetTerminalVersionList:
 					{
-						SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req,ResourceWatcherService_GetBizLinks_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_GetBizLinks_Req,ResourceWatcherService_GetBizLinks_Ans>(pTransactionContext));
+						SpReqAnsContext<ResourceWatcherService_GetTerminalVersionList_Req,ResourceWatcherService_GetTerminalVersionList_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_GetTerminalVersionList_Req,ResourceWatcherService_GetTerminalVersionList_Ans>(pTransactionContext));
 						SpBuffer2Object(Buf, ctx->Req);
-						Handle_GetBizLinks(ctx);
+						Handle_GetTerminalVersionList(ctx);
 					}
 					break;
-				case ResourceWatcherService_Method_BizLinkDetect:
+				case ResourceWatcherService_Method_ManipulateVersion:
 					{
-						SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req,ResourceWatcherService_BizLinkDetect_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_BizLinkDetect_Req,ResourceWatcherService_BizLinkDetect_Ans>(pTransactionContext));
+						SpReqAnsContext<ResourceWatcherService_ManipulateVersion_Req,ResourceWatcherService_ManipulateVersion_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<ResourceWatcherService_ManipulateVersion_Req,ResourceWatcherService_ManipulateVersion_Ans>(pTransactionContext));
 						SpBuffer2Object(Buf, ctx->Req);
-						Handle_BizLinkDetect(ctx);
+						Handle_ManipulateVersion(ctx);
 					}
 					break;
 				case ResourceWatcherService_Method_GetTerminalVersionList:

+ 13 - 0
Module/mod_ResourceWatcher/mod_ResourceWatcher.cpp

@@ -1170,6 +1170,19 @@ std::vector<std::string> ResourceWatcherEntity::GetUserNameList(bool bExcludeRoo
     return results;
 }
 
+
+void ResourceWatcherEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
+{
+    Dbg("OnSysVarEvent pszKey = %s, pszValue = %s", pszKey, pszValue);
+    if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0)) {
+        if (_strnicmp(pszValue, "M", strlen("M")) == 0) {
+            ClearVersionTask* task = new ClearVersionTask(&m_fsm);
+            GetFunction()->PostThreadPoolTask(task);
+        }
+    }
+
+}
+
 SP_BEGIN_ENTITY_MAP()
 SP_ENTITY(ResourceWatcherEntity)
 SP_END_ENTITY_MAP()

+ 21 - 1
Module/mod_ResourceWatcher/mod_ResourceWatcher.h

@@ -58,7 +58,7 @@ private:
 	ResourceWatcherEntity* m_pEntity;
 };
 
-class ResourceWatcherEntity : public CEntityBase, public IBroadcastListener, public ITimerListener
+class ResourceWatcherEntity : public CEntityBase, public IBroadcastListener, public ITimerListener, public ISysVarListener
 {
 public:
 	ResourceWatcherEntity():m_bInitMode(FALSE) {}
@@ -89,6 +89,9 @@ public:
 
 		errorCode = m_fsm.Init(this);
 		if (errorCode == Error_Succeed) {
+
+			GetFunction()->RegistSysVarEvent("UIState", this);
+
             CSmartPointer<IEntityFunction> spEntityFunction = GetFunction();
             CSystemStaticInfo staticInfo;
             spEntityFunction->GetSystemStaticInfo(staticInfo);
@@ -251,6 +254,20 @@ public:
 
     void InstallThirdPartyProgram(SpReqAnsContext<ResourceWatcherService_InstallThirdPartyProgram_Req, ResourceWatcherService_InstallThirdPartyProgram_Ans>::Pointer ctx);
 
+	/*void OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
+	{
+		Dbg("OnSysVarEvent pszKey = %s, pszValue = %s", pszKey, pszValue);
+		if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
+		{
+			if (_strnicmp(pszValue, "M", strlen("M")) == 0)
+			{
+				m_fsm.DeleteVersionPackage();
+			}
+		}
+
+	}*/
+
+	virtual void OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName);
 
 #if defined(_MSC_VER)
     SP_BEGIN_MSG_DISPATCH_MAP(ResourceWatcherEntity)
@@ -288,6 +305,9 @@ private:
 				auto err = GetFunction()->GetSysVar("UIState",strState);
 				/** 让进入首页之后才获取输入法信息 [Gifur@20211212]*/
 				if(/*TRUE || */err == Error_Succeed && strState == "M") {
+
+					//m_fsm.DeleteVersionPackage();
+
 					Dbg("to check Sogou input install state...");
 					if(Error_Succeed == DoCheckInstallStateJob()) {
 						GetFunction()->KillTimer(ENT_TIMERID_CHECK_SOGOU_INPUT_INSTALLED_STATE);

+ 4 - 2
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -2411,6 +2411,7 @@ void CHealthManagerFSM::ToLogWarnTermAboutInfo(BOOL bSuccessFlag)
     CSmartPointer<IConfigInfo> pConfig;
 	GetEntityBase()->GetFunction()->OpenConfig(Config_Cache, pConfig);
     int stepStatus(0), curStep(0), lastRecordTime(0);
+	CSimpleStringA strInstallVersion;
     pConfig->ReadConfigValueInt("TerminalDeploy", "CurrStep", curStep);
 
 
@@ -2418,10 +2419,11 @@ void CHealthManagerFSM::ToLogWarnTermAboutInfo(BOOL bSuccessFlag)
 
         pConfig->ReadConfigValueInt("TerminalDeploy", "CurrState", stepStatus);
         pConfig->ReadConfigValueInt("TerminalDeploy", "TimeStamp", lastRecordTime);
+		pConfig->ReadConfigValue("TerminalDeploy", "InstallVersion", strInstallVersion);
 
         LogWarn(Severity_High, Error_Debug, LOG_WARN_HEALTH_INSTALL_TIMESTAMP, 
-				CSimpleString::Format("[{\"timeStamp\":\"%s\",\"step\":%d,\"state\":%d}]", 
-									  CSmallDateTime(lastRecordTime).ToTimeString().GetData(), curStep, stepStatus));
+				CSimpleString::Format("[{\"timeStamp\":\"%s\",\"step\":%d,\"state\":%d, \"version\":\"%s\"}]", 
+									  CSmallDateTime(lastRecordTime).ToTimeString().GetData(), curStep, stepStatus, strInstallVersion.GetData()));
 
         pConfig->WriteConfigValueInt("TerminalDeploy", "CurrStep", DeployStep_Begin);
         pConfig->WriteConfigValueInt("TerminalDeploy", "CurrState", DEPLOYSTATE_NOTINIT);

+ 6 - 0
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -2654,6 +2654,7 @@ void CHealthManagerEntity::DeployTerminal(SpReqAnsContext<HealthManagerService_D
 					pConfig->WriteConfigValue("TerminalDeploy", "Manufacturer", NULL);
 					pConfig->WriteConfigValue("TerminalDeploy", "ServerIP", NULL);
 					pConfig->WriteConfigValue("TerminalDeploy", "HeadOfficeMode", NULL);
+					pConfig->WriteConfigValue("TerminalDeploy", "InstallVersion", NULL);
 				}
 					break;
                 case DeployStep_FetchCenterSettings:
@@ -3331,6 +3332,11 @@ void CHealthManagerEntity::DeployTerminal(SpReqAnsContext<HealthManagerService_D
             Dbg("to clear root.ini backup file.");
         }
 
+		CSystemStaticInfo info;
+		GetFunction()->GetSystemStaticInfo(info);
+        CSmartPointer<IConfigInfo> pConfig;
+        GetFunction()->OpenConfig(Config_Cache, pConfig);
+		pConfig->WriteConfigValue("TerminalDeploy", "InstallVersion", info.InstallVersion.ToString());
         //int nTemp(0);
         //CSmartPointer<IConfigInfo> pConfig;
         //GetFunction()->OpenConfig(Config_Cache, pConfig);

+ 3 - 0
addin/cfg/ResourceWatcher.ini

@@ -40,3 +40,6 @@ DisableOSD=1
 [TOPProcess]
 cpu=10
 mem=10
+
+[VersionSaved]
+default=5

+ 1 - 1
addin/cfg/shell.ini.in

@@ -176,7 +176,7 @@ Number=1
 1=runCCPhone.bat
 
 [CenterSettingsDownloadUrl]
-LAN=https://centerconfig.paas.cmbchina.com/api/terminal/center/config
+LAN=https://centerconfig.paas.cmbchina.cn/api/terminal/center/config
 [CenterSettingsDownloadUrl_ST]
 LAN=http://centerconfig.paasst.cmbchina.cn/api/terminal/center/config
 

+ 11 - 1
addin/res/ManagerDesktop/guide.html

@@ -653,6 +653,9 @@
                                         oncontextmenu="return false;" maxlength="128" value="">
                                 </div>
                             </div>
+                            <div id="guide_sync_centersetting_server_ip_test_div" class="pull-left margin-left-10">
+                                <button id="guide_sync_centersetting_server_ip_test" style="color: #F37253; border: 1px solid #d3d3d3;border-radius: 5px;padding: 6px 12px;margin-left: 8px;">连通性测试</button>
+                            </div>
                             <div id="guide_sync_centersetting_ip_tips" class="clearboth">
                                 <div class="pull-left" style="width:330px;">&nbsp;</div>
                                 <div class="pull-left">
@@ -699,6 +702,13 @@
                         <div style="padding-top:20px;height:48px;" class="border_bottom" align="center">
                             <div class="guide_sub_tip" style="font-size:18px;">终端准入</div>
                         </div>
+                        <div align="center" style="padding-top:5px; padding-bottom:20px;width:640px;">
+                            <div class="ic_warning_small pull-left" style="margin-top: 2px;"></div>
+                            <div class="pull-left text-left" style="width:580px;padding-left: 8px;">
+                                为兼容旧逻辑,此处仍填写分行服务器IP和初始化端口号(正常会自动填充),后台会自行根据当前终端是否激活灰度走总行或分行初始化流程。
+                                <br/>* 请填写用户名和对应密码即可
+                            </div>
+                        </div>
                         <div id="access_authorize_content" style="max-height: 510px; width: 998px;">
                             <div class="clearboth" style="padding-top:30px;" id="guide_access_authorize_server_ip">
                                 <div class="pull-left" style="width:330px;">
@@ -777,7 +787,7 @@
                                     </div>
                                 </div>
                             </div>
-                            <div class="clearboth" style="height:30px;"></div>
+                            <div class="clearboth" style="height:20px;"></div>
                             <div id="captive_access_authorize_btns">
                                 <div id="guide_access_authorize_btns" class="clearboth" align="center">
                                     <div id="guide_access_authorize_next"

+ 20 - 9
addin/res/ManagerDesktop/js/guide.js

@@ -554,8 +554,8 @@ $(function () {
             }
         });
     }
-
-    function UrlConnectableTest(url)
+    
+    function UrlConnectableTest(url, err_tip_id, check_btn_id)
     {
         let req = new Request();
         req.protocol = 4; //Http Probe
@@ -566,17 +566,17 @@ $(function () {
 
         function showErrTips(val) {
             setTimeout(function () {
-                $('#text_guide_init_param_ip_tips').addClass('hide');
+                $('#' + err_tip_id).addClass('hide');
             }, 2000);
-            $('#text_guide_init_param_ip_tips').removeClass('hide')
+            $('#' + err_tip_id).removeClass('hide')
             .removeClass('guide_input_descript').addClass('guide_error').html(val);
         }
 
         function showSuccTips(val) {
             setTimeout(function () {
-                $('#text_guide_init_param_ip_tips').addClass('hide');
+                $('#' + err_tip_id).addClass('hide');
             }, 2000);
-            $('#text_guide_init_param_ip_tips').removeClass('hide')
+            $('#'+ err_tip_id).removeClass('hide')
             .removeClass('guide_error').addClass('guide_input_descript').html(val);
         }
 
@@ -586,9 +586,9 @@ $(function () {
         }
 
         showSuccTips('正在连接验证...');
-        setBtnStatus(false, 'ip_connect_check');
+        setBtnStatus(false, check_btn_id);
         RVC.DeviceControlEntityCtrl.TestConnectivity(req, function(ret) {
-            setBtnStatus(true, 'ip_connect_check');
+            setBtnStatus(true, check_btn_id);
             if(ret.errorCode === 0) {
                 let result = JSON.parse(ret[RVC.EntityController.sigResponseUUID])
                 if(result.result >= 0) {
@@ -1850,7 +1850,7 @@ $(function () {
         var ip = $('#guide_server_ip').val();
         console.log('ip: ' + ip);
         if(swtichStateIsOn('guide_server_type_switch')) {
-            UrlConnectableTest(ip);
+            UrlConnectableTest(ip,'text_guide_init_param_ip_tips', 'ip_connect_check')
         } else {
             IPConnectableTest(ip);
         }
@@ -1858,6 +1858,17 @@ $(function () {
 
     });
 
+    $(document).on('click', '#guide_sync_centersetting_server_ip_test', function(){
+
+        if(!isButtonEnable('guide_sync_centersetting_server_ip_test')) {
+            return;
+        }
+
+        var url = $('#guide_sync_centersetting_server_ip_content').val();
+        console.log('url: ' + url);
+        UrlConnectableTest(url, 'text_guide_sync_centersetting_ip_tips', 'guide_sync_centersetting_server_ip_test');
+    });
+
     $(document).on('click', '#guide_init_param_next', function() {
 
         const debranchOn = swtichStateIsOn('guide_server_type_switch');

+ 7 - 7
addin/res/ManagerDesktop/js/public.js

@@ -2351,18 +2351,18 @@ $(function () {
         entityName: 'ResourceWatcher',
         className: 'ResourceWatcherService',
         methodID: {
-            UpdateDNS : 5,
-            GetNetworkInfo: 6,
-            GetThirdPartyInstallState:7,
+            UpdateDNS : 8,
+            GetNetworkInfo: 9,
+            GetThirdPartyInstallState:10,
             GetTerminalVersionList:12,
             ManipulateVersion:13
         },
         methodSignature: {
-            UpdateDNS : -943970884,
-            GetNetworkInfo: 1741482404,
+            UpdateDNS : 689391692,
+            GetNetworkInfo: -799638104,
             GetThirdPartyInstallState:-15861483,
-            GetTerminalVersionList:598083609,
-            ManipulateVersion:671931256
+            GetTerminalVersionList:-504582702,
+            ManipulateVersion:-313717631
         },
 
         GetNetworkInfo: function(req, callback) {