소스 검색

#IQRV #comment [BugFix][Initializer] 初始化格式错乱调整

gifur 3 년 전
부모
커밋
2c5c627c13
2개의 변경된 파일19개의 추가작업 그리고 23개의 파일을 삭제
  1. 7 7
      Module/mod_Initializer/InitializerConn.cpp
  2. 12 16
      Module/mod_Initializer/mod_Initializer.cpp

+ 7 - 7
Module/mod_Initializer/InitializerConn.cpp

@@ -536,15 +536,15 @@ DWORD CInitializerConn::HandleInitMKRet(const CSmartPointer<IPackage> &pRecvPkg)
 			if (rc != Error_Succeed)
 			{
 				strRetErrMsg = "加载SM密钥到密码键盘失败";
-				LogWarn(Severity_Middle, (ErrorCodeEnum)rc, ERR_INITIALIZER_LOAD_KEYS_TO_PINPAD,
-					GetOutPutStr("%s%08X%s%s", "LoadKeysToPinPad", rc, "strRetErrMsg", strRetErrMsg).c_str());
-
                 CEntityLastErrorInfo lastInfo;
                 pEntity->GetFunction()->GetEntityLastError("PinPad", lastInfo);
-				if (!lastInfo.strErrMsg.IsNullOrEmpty()) {
-					strRetErrMsg += ": ";
-					strRetErrMsg += lastInfo.strErrMsg;
-				}
+                if (!lastInfo.strErrMsg.IsNullOrEmpty()) {
+                    strRetErrMsg += ": ";
+                    strRetErrMsg += lastInfo.strErrMsg;
+                }
+
+				LogWarn(Severity_Middle, (ErrorCodeEnum)rc, ERR_INITIALIZER_LOAD_KEYS_TO_PINPAD,
+					GetOutPutStr("%s%08X%s%s", "LoadKeysToPinPad", rc, "strRetErrMsg", strRetErrMsg.GetData()).c_str());
 			}
 		}
 	}

+ 12 - 16
Module/mod_Initializer/mod_Initializer.cpp

@@ -939,22 +939,17 @@ void CInitializerEntity::EndGetKMCKey(DWORD rc, const char* pszErrMsg) {
 DWORD CInitializerEntity::ReportInitMKState(const char *pszUserID, DWORD dwErrCode, const char *pszErrMsg)
 {
 	LOG_FUNCTION();
-	auto rc = SecureClientConnect();
-	if (rc != Error_Succeed)
-	{
-		LogWarn(Severity_Middle, Error_Unexpect, ERR_INITIALIZER_NET_CONNECT,
-					GetOutPutStr("%s%08X", "SecureClientConnect", rc).c_str());
-		return rc;
-	}
-	assert(m_pConnection->IsConnectionOK());
-	if (m_bACS)
-	{
-		std::string errStr = SP::Utility::UTF8ToGBK(std::string(pszErrMsg));
-		return m_pConnection->SendReportStatePackage("InitMK", pszUserID, dwErrCode, errStr.c_str());
-	}
-	else
-	{
-		return m_pConnection->SendReportStatePackage("InitMK", pszUserID, dwErrCode, pszErrMsg);
+
+	if (!m_bACS) {
+        auto rc = SecureClientConnect();
+        if (rc != Error_Succeed) {
+            LogWarn(Severity_Middle, Error_Unexpect, ERR_INITIALIZER_NET_CONNECT,
+                    GetOutPutStr("%s%08X", "SecureClientConnect", rc).c_str());
+            return rc;
+        }
+        assert(m_pConnection->IsConnectionOK());
+        std::string errStr = SP::Utility::UTF8ToGBK(std::string(pszErrMsg));
+        return m_pConnection->SendReportStatePackage("InitMK", pszUserID, dwErrCode, errStr.c_str());
 	}
 }
 
@@ -997,6 +992,7 @@ void CInitializerEntity::EndInitMK(DWORD rc, const char *pszErrMsg)
 
 	// 通知到中台
 	ReportInitMKState(m_strInitUserID, rc, m_strLastErrMsg);
+
 	if (rc != Error_Succeed)
 	{
 		LogWarn(Severity_Middle, Error_Unexpect, ERR_INITIALIZER_INIT_MK,