Browse Source

Z991239-5365 #comment 安装时实体检测修正

oilyang 1 year ago
parent
commit
e3b3ae6f94
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Module/mod_vtmloader/VtmLoaderFSM.cpp

+ 9 - 1
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -221,6 +221,7 @@ void CVtmLoaderFSM::s0_on_entry()
 	ErrorCodeEnum eErr = GetEntityBase()->GetFunction()->GetSysVar("TerminalStage", csTmpTS);
 	if (eErr == Error_Succeed && !csTmpTS.IsNullOrEmpty() && csTmpTS.Compare("X") != 0)
 	{
+		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_USER)(" eErr:%d", eErr);
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER)("TerminalStage:%s, The entity maybe lost, and have beed restart by healthmanager.To do GetConfig only", csTmpTS.GetData());
 		GetConfig();
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("redo GetConfig finished.");
@@ -1826,6 +1827,12 @@ void CVtmLoaderFSM::ToCheckIfInstalling()
 }
 void CVtmLoaderFSM::CheckDeviceEntity(SpReqAnsContext<VtmLoaderService_CheckDeviceEntity_Req, VtmLoaderService_CheckDeviceEntity_Ans>::Pointer ctx)
 {
+	if (ctx->Req.entityName.IsNullOrEmpty())
+	{
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ctx->Req.entityName is null or empty.");
+		ctx->Answer(Error_Param, VtmLoader_FailToStartEntity);
+		return;
+	}
 	if (!RefreshDeviceConfig(ctx))
 	{
 		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("RefreshDeviceConfig failed.");
@@ -1962,7 +1969,7 @@ void CVtmLoaderFSM::CheckDeviceBaseEntity(SpReqAnsContext<VtmLoaderService_Check
 	CSmartPointer<IAsynWaitSp> spWait;
 	CEntityRunInfo runInfo;
 
-	CSimpleStringA csEntityName("");
+	CSimpleStringA csEntityName = ctx->Req.entityName;
 	//oiltmp@20240415 to be delete after x months
 	if (ctx->Req.entityName.Compare("CardIssuer") == 0)
 	{
@@ -1971,6 +1978,7 @@ void CVtmLoaderFSM::CheckDeviceBaseEntity(SpReqAnsContext<VtmLoaderService_Check
 		else
 			csEntityName = "CardIssuerStand";
 	}
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("csEntityName:[%s]", csEntityName.GetData());
 	//to check entity state
 	ErrorCodeEnum eErrCode = m_pEntity->GetFunction()->GetEntityRunInfo(csEntityName.GetData(), runInfo);
 	if (eErrCode == Error_Succeed)