Bladeren bron

Z991239-6316 #comment feat: 优化埋点日志

Signed-Off-By: commit-hook
刘文涛80174520 4 maanden geleden
bovenliggende
commit
d3e98e83d7
1 gewijzigde bestanden met toevoegingen van 93 en 38 verwijderingen
  1. 93 38
      Module/mod_cardissuerstore/CardIssuerStoreFSM.cpp

+ 93 - 38
Module/mod_cardissuerstore/CardIssuerStoreFSM.cpp

@@ -3554,18 +3554,21 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline>, After invoke DetectAndReadICData, retDetectAndRead:%d, activeCardType:%d", retDetectAndRead, activeCardType);
 	if (retDetectAndRead < 0)
 	{
-		if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0)
-			&& m_bCrossPreOnline) {
-			if (IfUseRf()) {
-				bContinue = true; //继续后面的非接流程
-			}
-			else {
-				AfterPreOnlineOnStore(Error_Unexpect, slot);
-			}
-		}
+		//if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0)
+		//	&& m_bCrossPreOnline) {
+		//	if (IfUseRf()) {
+		//		bContinue = true; //继续后面的非接流程
+		//	}
+		//	else {
+		//		AfterPreOnlineOnStore(Error_Unexpect, slot);
+		//	}
+		//}
 		CSimpleStringA xCardName("");
 		if (m_issueStatus && m_currentHopper - 1 >= 0)
 			xCardName = m_PsbNameEx[m_currentHopper - 1];
+
+
+		DWORD dwUserErrCode = 0;
 		if (retDetectAndRead == -1){
 
 			ErrorCodeEnum eErrCode = Error_Unexpect;
@@ -3588,7 +3591,8 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222020").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, dwCode, alarmMsg.GetData());
 					}
-					ctx->Answer(Error_Unexpect, dwCode);
+					dwUserErrCode = dwCode;
+					//ctx->Answer(Error_Unexpect, dwCode);
 				}
 				else {
 					//使用非接兜底
@@ -3610,7 +3614,8 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222003").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
 					}
-					ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
+					dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveICCard_Failed;
+					//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
 				}
 				else {
 					//使用非接兜底
@@ -3630,7 +3635,8 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 				else {
 					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				dwUserErrCode = dwTmpUserErrCode;
+				//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 				
 			}
 			else {
@@ -3655,7 +3661,8 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 				else {
 					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				dwUserErrCode = dwTmpUserErrCode;
+				//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 				
 			}
 			else {
@@ -3669,6 +3676,19 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStoreService_Pre
 			}
 
 		}
+
+		if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
+			if (IfUseRf()) {
+				bContinue = true; //继续后面的非接流程
+			}
+			else {
+				AfterPreOnlineOnStore(Error_Unexpect, slot);
+			}
+		}
+		if (!IfUseRf()){
+			ctx->Answer(Error_Unexpect, dwUserErrCode);
+		}
+
 		bICOK = false;
 		return 0;//读卡失败
 	}
@@ -3985,12 +4005,16 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStoreService_PreOnlin
 	if (retDetectAndRead < 0)
 	{
 		//非接兜底需要移回卡槽
-		if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
-			AfterPreOnlineOnStore(Error_Unexpect, slot);//移回卡槽
-		}
+		//if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
+		//	AfterPreOnlineOnStore(Error_Unexpect, slot);//移回卡槽
+		//}
+
+
 		CSimpleStringA xCardName("");
 		if (m_issueStatus && m_currentHopper - 1 >= 0)
 			xCardName = m_PsbNameEx[m_currentHopper - 1];
+
+		DWORD dwUserErrCode = 0;
 		if (retDetectAndRead == -1) {
 
 			ErrorCodeEnum eErrCode = Error_Unexpect;
@@ -4012,7 +4036,8 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStoreService_PreOnlin
 					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222020").setResultCode("RTA2W27")(csErrMsgWithReturnCode.GetData());
 					LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
 				}
-				ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed);
+				dwUserErrCode = CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed;
+				//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed);
 			}
 			else
 			{
@@ -4027,7 +4052,8 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStoreService_PreOnlin
 					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222003").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
 					LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
 				}
-				ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);
+				dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed;
+				//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);
 			}
 		}
 		else if (retDetectAndRead == -2) {
@@ -4039,7 +4065,8 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStoreService_PreOnlin
 			else {
 				dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
 			}
-			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			dwUserErrCode = dwTmpUserErrCode;
+			//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 		}
 		else if (retDetectAndRead == -3) {
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
@@ -4050,8 +4077,17 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStoreService_PreOnlin
 			else {
 				dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
 			}
-			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			dwUserErrCode = dwTmpUserErrCode;
+			//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 		}
+
+		//非接兜底需要移回卡槽
+		if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
+			AfterPreOnlineOnStore(Error_Unexpect, slot);//移回卡槽
+		}
+
+		ctx->Answer(Error_Unexpect, dwUserErrCode);
+
 		return 0;
 	}
 
@@ -10253,10 +10289,11 @@ int CCardIssuerFSM::PreOnlineCrossJS_Contact(SpReqAnsContext<CardIssuerStoreServ
 			}
 		}
 		else {
-			CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
-			m_findCard = 4;
-			ctx->Ans.findCard = 4;
-			ctx->Ans.cardPos = m_cardPos;
+			//CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
+			//m_findCard = 4;
+			//ctx->Ans.findCard = 4;
+			//ctx->Ans.cardPos = m_cardPos;
+			DWORD dwUserErrCode = 0;
 			if (retDetectAndRead == -1) {
 
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机检测卡片类型时上电失败,slot:%d", slot);
@@ -10269,18 +10306,26 @@ int CCardIssuerFSM::PreOnlineCrossJS_Contact(SpReqAnsContext<CardIssuerStoreServ
 					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222052").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
 					LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
 				}
-				ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
+				dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveICCard_Failed;
+				//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
 			}
 			else if (retDetectAndRead == -2) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机读取IC数据失败,slot:%d", slot);
-				DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				dwUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
+				//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 			}
 			else if (retDetectAndRead == -3) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机读取IC数据失败,slot:%d", slot);
-				DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				dwUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
+				//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 			}
+
+			CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
+			m_findCard = 4;
+			ctx->Ans.findCard = 4;
+			ctx->Ans.cardPos = m_cardPos;
+
+			ctx->Answer(Error_Unexpect, dwUserErrCode);
 		}
 		bICOK = false;
 		return 0;//上电读卡失败
@@ -10591,16 +10636,17 @@ int CCardIssuerFSM::PreOnlineCrossJS_RF(SpReqAnsContext<CardIssuerStoreService_P
 
 	if (retDetectAndRead < 0)
 	{
-		CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
-		m_findCard = 4;
-		ctx->Ans.findCard = 4;
-		ctx->Ans.cardPos = m_cardPos;
+		//CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
+		//m_findCard = 4;
+		//ctx->Ans.findCard = 4;
+		//ctx->Ans.cardPos = m_cardPos;
 
 		ErrorCodeEnum eErrCode = Error_Unexpect;
 		CSimpleStringA ApiName = "";
 		CSimpleStringA alarmMsg = "";
 		CSimpleStringA csErrMsgWithReturnCode = "";
 
+		DWORD dwUserErrCode = 0;
 		if (retDetectAndRead == -1) {	
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机非接检测卡片类型时上电失败,slot:%d", slot);
 			GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
@@ -10613,18 +10659,27 @@ int CCardIssuerFSM::PreOnlineCrossJS_RF(SpReqAnsContext<CardIssuerStoreService_P
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222052").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
 				LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
 			}
-			ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);		
+			dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed;
+			//ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);		
 		}
 		else if (retDetectAndRead == -2) {
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机非接读取IC数据失败,slot:%d", slot);
-			DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
-			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			dwUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
+			//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 		}
 		else if (retDetectAndRead == -3) {
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机非接读取IC数据失败,slot:%d", slot);
-			DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
-			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			dwUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222052", "");
+			//ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 		}
+		CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
+		m_findCard = 4;
+		ctx->Ans.findCard = 4;
+		ctx->Ans.cardPos = m_cardPos;
+
+		ctx->Answer(Error_Unexpect, dwUserErrCode);
+
+
 		return 0;//上电读卡失败
 	}