Bladeren bron

Z991239-5644 #comment feat: 新接口RTA错误信息添加

陈纪林80310970 1 jaar geleden
bovenliggende
commit
34e400f875
2 gewijzigde bestanden met toevoegingen van 17 en 18 verwijderingen
  1. 1 1
      DevAdapter/include/DevErrorCode.h
  2. 16 17
      Module/mod_IDCertificate/IDCertFSM.cpp

+ 1 - 1
DevAdapter/include/DevErrorCode.h

@@ -1137,7 +1137,7 @@ typedef short DECRESULT;
 #define MEC_DEVAPI_IDCER_DevOpen				     (DEC_NO_E_IDCERTIFICATE_START + 1) //20100001
 #define MEC_DEVAPI_IDCER_IDCerRFControl				 (DEC_NO_E_IDCERTIFICATE_START + 2) //20100002
 #define MEC_DEVAPI_IDCER_IDCerAuthenticate			 (DEC_NO_E_IDCERTIFICATE_START + 3) //20100003
-#define MEC_DEVAPI_IDCER_IDCerGetData				 (DEC_NO_E_IDCERTIFICATE_START + 4) //20100004
+#define MEC_DEVAPI_IDCER_IDCerAuthenticate_NotIDCard (DEC_NO_E_IDCERTIFICATE_START + 4) //20100004
 #define MEC_DEVAPI_IDCER_IDCerGetDataEx2			 (DEC_NO_E_IDCERTIFICATE_START + 5) //20100005
 #define MEC_DEVAPI_IDCER_ForceIDEject				 (DEC_NO_E_IDCERTIFICATE_START + 6) //20100006
 #define MEC_DEVAPI_IDCER_ScanIDAndSaveImage			 (DEC_NO_E_IDCERTIFICATE_START + 7) //20100007

+ 16 - 17
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -1775,30 +1775,29 @@ int CIDCertFSM::ReadAndScanUTF8JS(SpReqAnsContext<IDCert_ReadAndScanUTF8JS_Req,
 
 				SetErrorAndLog(errReadEx2, MEC_DEVAPI_IDCER_IDCerGetDataEx2, "DevAdapter::IDCerGetDataEx2", __FUNCTION__,
 					true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Invoke IDCerGetDataEx2(Timeout) failed: %s", SpStrError(eErr));
 
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA2109")
-					("Invoke IDCerGetDataEx2(Timeout) failed: %s", SpStrError(eErr));
-
-				ctx->Answer(Error_TimeOut);
+				ctx->Answer(Error_Unexpect, MEC_DEVAPI_IDCER_IDCerGetDataEx2);
 			}
 		}
 		else
 		{
-			SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
-				true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS); //RTA2107
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).
-				setResultCode("RTA2107")
-				("ReadAndScanUTF8::IDCerAuthenticate(Timeout) failed with errcode: %d", errAuth);
-
-			ctx->Answer(Error_TimeOut);
+			
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ReadAndScanUTF8::IDCerAuthenticate(Timeout) failed with errcode: %d", errAuth);
+			if (errAuth == Error_DevMedia)
+			{
+				SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate_NotIDCard, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
+					true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS); //RTA2108
+				ctx->Answer(Error_Unexpect, MEC_DEVAPI_IDCER_IDCerAuthenticate_NotIDCard);
+			}
+			else
+			{
+				SetErrorAndLog(errAuth, MEC_DEVAPI_IDCER_IDCerAuthenticate, "DevAdapter::IDCerAuthenticate", __FUNCTION__,
+					true, m_ullEndTime - m_ullBeginTime, IDCertService_LogCode_ReadAndScanUTF8JS); //RTA2107
+				ctx->Answer(Error_Unexpect, MEC_DEVAPI_IDCER_IDCerAuthenticate);
+			}
 		}
 	}
-	else
-	{
-		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI("DevAdapter::IDCerGetDataEx2").setLogCode("QLR040220106").setResultCode("RTA2104");
-		ctx->Answer(Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed);
-		LogError(Severity_High, Error_Unexpect, IDCertificate_UserErrorCode_ReadAndScan_Failed, "ReadAndScanUTF8JS some thing wrong.");
-	}
 
 	if (eErr1 == Error_Succeed && pos == 2)
 	{