Procházet zdrojové kódy

Z991239-5950 #comment 去掉GetVTMErrMsg异常记录,只需要返回即可,由调用方记录

oilyang před 8 měsíci
rodič
revize
95a1c9cb9b

+ 4 - 8
Framework/spbase/SpEntity.cpp

@@ -2134,7 +2134,6 @@ ErrorCodeEnum SpEntity::GetVTMErrMsg(DWORD dwUserCode, CSimpleStringA& strDescri
 		{
 			strVTMCode = "RTA42F2";
 			strDescription = "实体Id异常";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(strVTMCode)("GetVTMErrMsg get error entity id %d, convert to %s", id, idHexStr.c_str());
 			return ErrorCodeEnum::Error_Unregisted;
 		}
 
@@ -2147,7 +2146,6 @@ ErrorCodeEnum SpEntity::GetVTMErrMsg(DWORD dwUserCode, CSimpleStringA& strDescri
 		if (num < 0 || num >= 36) {
 			strVTMCode = "RTA42F2";
 			strDescription = "无法转换实体Id";
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(strVTMCode)("GetVTMErrMsg cannot convert entity id %d ", id);
 			return ErrorCodeEnum::Error_DataCheck;
 		}
 
@@ -2176,7 +2174,6 @@ ErrorCodeEnum SpEntity::GetVTMErrMsg(DWORD dwUserCode, CSimpleStringA& strDescri
 	{
 		strVTMCode = "RTA42F1";
 		strDescription = "错误映射异常";
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(strVTMCode)("GetVTMErrMsg entity did not contain the usercode %s ", userCodeStr.c_str());
 		return ErrorCodeEnum::Error_NotExist;
 	}
 
@@ -2185,11 +2182,10 @@ ErrorCodeEnum SpEntity::GetVTMErrMsg(DWORD dwUserCode, CSimpleStringA& strDescri
 }
 CSimpleStringA SpEntity::UserCodeToRTACode(DWORD dwUserCode)
 {
-	CSimpleStringA tmpDesc, tmpVtmCode;
-	if (GetVTMErrMsg(dwUserCode, tmpDesc, tmpVtmCode) != Error_Succeed)
-		return "";
-	else
-		return CSimpleStringA(tmpVtmCode);
+	CSimpleStringA tmpDesc, tmpVtmCode("");
+	//transmit the return of GetVTMErrMsg directly
+	GetVTMErrMsg(dwUserCode, tmpDesc, tmpVtmCode);
+	return CSimpleStringA(tmpVtmCode);
 }
 ErrorCodeEnum SpEntity::SetSelfPriority(EntityPriorityEnum nPriority)
 {

+ 1 - 2
Module/include/DevFSMCommBase.hpp

@@ -759,8 +759,7 @@ public:
 
 		
 		CSimpleStringA tmpRTA(true), tmpDesc(true);
-		if (this->GetEntityBase()->GetFunction()->GetVTMErrMsg(dwCode, tmpDesc, tmpRTA) != Error_Succeed)
-			tmpRTA = CSimpleStringA::Format("0x%X", dwCode);//if map failed, use dwCode instead
+		this->GetEntityBase()->GetFunction()->GetVTMErrMsg(dwCode, tmpDesc, tmpRTA);
 
 
 		if (bInBusiness) {