Эх сурвалжийг харах

#IQRV #comment: 交易码调整

陈纪林80310970 4 сар өмнө
parent
commit
a9be60ea0b

+ 16 - 13
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -598,7 +598,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			OpenRFControlTime = m_ullEndTime - m_ullBeginTime;
 			if (Error_Succeed == errRfOpen)
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)
 					.setAPI("DevAdapter::IDCerRFControl").setLogCode(IDCertService_LogCode_OpenIDCerRFControl)
 					.setCostTime(OpenRFControlTime)();
 			}
@@ -626,8 +626,8 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 		}
 		else
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
-				.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)
+				.setAPI("DevAdapter::IDCerAuthenticate").setLogCode(IDCertService_LogCode_IDCerAuthenticate).setCostTime(IDCerAuthenticateTime)();
 			bIDCerAuthenticate = true;
 
 			m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
@@ -669,7 +669,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 					unsigned char IssuedSN[1024]; memset(IssuedSN, 0, 1024); //换证次数
 
 					DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER)
-						.setAPI("DevAdapter::IDCerGetDataEx2").setCostTime(IDCerGetDataEx2Time)();
+						.setAPI("DevAdapter::IDCerGetDataEx2").setLogCode(IDCertService_LogCode_IDCerGetDataEx2).setCostTime(IDCerGetDataEx2Time)();
 					bReadSuccess = true;
 					LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
 
@@ -830,7 +830,8 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 						if (eErr == Error_Succeed)
 						{
 							curDeleteType = Bmp_ZP | Bmp_SCAN;
-							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::ScanIDAndSaveImage")
+							DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::ScanIDAndSaveImage")
+								.setLogCode(IDCertService_LogCode_ScanIDAndSaveImage)
 								.setCostTime(ScanIDAndSaveImageTime)();
 
 							transImgMsg.Clear();
@@ -879,7 +880,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 						{
 							if (eErr != Error_NotImpl)
 								SetErrorAndLog(eErr, MEC_DEVAPI_IDCER_ScanIDAndSaveImage, "DevAdapter::ScanIDAndSaveImage", __FUNCTION__,
-									false, ScanIDAndSaveImageTime);
+									false, ScanIDAndSaveImageTime, IDCertService_LogCode_ScanIDAndSaveImage);
 						}
 					}
 
@@ -928,7 +929,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 	}
 	else
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerRFControl")
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerRFControl")
 			.setLogCode(IDCertService_LogCode_CloseIDCerRFControl)
 			.setCostTime(CloseRFControlTime)();
 	}
@@ -947,7 +948,7 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			if (bInvokeReadEx2 && !bReadSuccess) {
 
 				SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
-					true, IDCerGetDataEx2Time);
+					true, IDCerGetDataEx2Time, IDCertService_LogCode_IDCerGetDataEx2);
 				ctx->Answer(Error_TimeOut, GetAlarmDEC()); //RTA2109
 			}
 		}
@@ -962,19 +963,21 @@ int CIDCertFSM::ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCe
 			if (errAuth == Error_DevMedia)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_OtherCard, "读证超时,插入的卡片非身份.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_IDCerAuthenticate)
+					.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else if(errAuth == Error_Dev_IDCardNotFound)
 			{
 				LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_Timeout_NoCard, "读证超时,未检测到有卡片插入.");
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(IDCertService_LogCode_IDCerAuthenticate)
+					.setAPI("DevAdapter::IDCerAuthenticate").setCostTime(IDCerAuthenticateTime)();
 				ctx->Answer(Error_TimeOut);
 			}
 			else
 			{
 				SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
-					false, IDCerAuthenticateTime); //RTA2107
+					false, IDCerAuthenticateTime, IDCertService_LogCode_IDCerAuthenticate); //RTA2107
 				ctx->Answer(Error_Unexpect, GetAlarmDEC());
 			}
 		}
@@ -1071,7 +1074,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 			
 			if (Error_Succeed == errRfOpen)
 			{
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)
 					.setAPI("DevAdapter::IDCerRFControl").setLogCode(IDCertService_LogCode_OpenIDCerRFControl)
 					.setCostTime(OpenRFControlTime)();
 			}
@@ -1402,7 +1405,7 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 	}
 	else
 	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::IDCerRFControl")
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::IDCerRFControl")
 			.setLogCode(IDCertService_LogCode_CloseIDCerRFControl)
 			.setCostTime(CloseRFControlTime)();
 	}

+ 3 - 0
Module/mod_IDCertificate/IDCertificate_LogCode.h

@@ -6,6 +6,9 @@ namespace IDCertificate {
 
 #define IDCertService_LogCode_OpenIDCerRFControl "QLR040220121"
 #define IDCertService_LogCode_CloseIDCerRFControl "QLR040220122"
+#define IDCertService_LogCode_IDCerAuthenticate "QLR040220123"
+#define IDCertService_LogCode_IDCerGetDataEx2 "QLR040220124"
+#define IDCertService_LogCode_ScanIDAndSaveImage "QLR040220125"
 
 }
 #endif

+ 3 - 3
Module/mod_accessauth/AccessAuthFSM.cpp

@@ -656,7 +656,7 @@ void CAccessAuthFSM::s3_on_entry()
 {
 	LOG_FUNCTION();
 	CSystemStaticInfo si;
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode(AccessAuthService_LogCode_Regist)("终端准入成功");
+	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(AccessAuthService_LogCode_Regist)("终端准入成功");
 
 	m_pEntity->GetFunction()->GetSystemStaticInfo(si);
 	if (si.InstallVersion.ToString().IsNullOrEmpty()) {
@@ -1012,7 +1012,7 @@ void CAccessAuthFSM::AuthLogWarn(const T& ret, const string& url, const string&
 			msg = CSimpleStringA::Format("%s失败,请尝试重启应用", method.c_str());
 		}
 		doWarnMsg(acsErrCode, msg.GetData(), bNeedEvent);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setLogCode(AccessAuthService_LogCode_Regist)(msg.GetData());
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode(AccessAuthService_LogCode_Regist)(msg.GetData());
 	}
 	else {
 		SP::Module::Restful::CommResponseJson responseStatus;
@@ -1020,7 +1020,7 @@ void CAccessAuthFSM::AuthLogWarn(const T& ret, const string& url, const string&
 		msg = CSimpleStringA::Format("{\"errcode\": \"%s\", \"message\": %s}",
 			responseStatus.errorCode.c_str(), responseStatus.errorMsg.c_str());
 		doWarnMsg(ERR_ACCESSAUTH_SERVICE_FAILED, msg.GetData(), bNeedEvent);
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA520A").setLogCode(AccessAuthService_LogCode_Regist)
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setResultCode("RTA520A").setLogCode(AccessAuthService_LogCode_Regist)
 			(msg.GetData());
 	}
 }