瀏覽代碼

Z991239-6469 #comment feat: 去掉已废弃,没必要的逻辑

oilyang 4 月之前
父節點
當前提交
6fab38c213
共有 2 個文件被更改,包括 45 次插入158 次删除
  1. 41 154
      Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp
  2. 4 4
      Module/mod_CardIssuerStand/CardIssuerStandFSM.h

+ 41 - 154
Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp

@@ -1509,27 +1509,21 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
 	spConfig->WriteConfigValueInt("1", "CardPercent", m_CardPercentEx[0]);
 	spEntityFunction->OpenConfig(Config_CenterSetting, spConfigCS);
 
-	int tmpCardnoMismatch = 0, tmpICRetryTimes = 1, tmpStopUseRF = 0, tmpCheckInterval = 200;
+	int tmpCardnoMismatch = 0, tmpCheckInterval = 200;
 
 	spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "EacQueryFlag", m_eacQueryFlag);
 	spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "UseCardnoMismatch", tmpCardnoMismatch);
-	spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "ICRetryTimes", tmpICRetryTimes);
-	spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "StopUseRF", tmpStopUseRF);
 	spConfigCS->ReadConfigValueInt(GetEntityBase()->GetEntityName(), "CheckCardInInterval", tmpCheckInterval);
 	spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "RFVendorList", m_rfVendorList);
 	spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SwallowCardUrl", m_csSwallowCardUrl);
 	spConfigCS->ReadConfigValue(GetEntityBase()->GetEntityName(), "SyncMaterialUrl", m_csSyncMaterialUrl);
 	spConfigCS->ReadConfigValue("Common", "EacQueryHost", m_EacQueryHost);
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EacQueryFlag:%d,EacQueryHost:%s,UseCardnoMismatch:%d,ICRetryTimes:%d,StopUseRF:%d"
-		, m_eacQueryFlag, m_EacQueryHost.GetData(), tmpCardnoMismatch, tmpICRetryTimes, tmpStopUseRF);
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("EacQueryFlag:%d,EacQueryHost:%s,UseCardnoMismatch:%d"
+		, m_eacQueryFlag, m_EacQueryHost.GetData(), tmpCardnoMismatch);
 
 	if (tmpCardnoMismatch == 1)
 		m_bUseCardnoMismatch = true;
-	if (tmpICRetryTimes > 0 && tmpICRetryTimes < 4)
-		m_ICRetryTimes = tmpICRetryTimes;
-	if (tmpStopUseRF == 1)
-		m_bStopUseRF = true;
 	if (tmpCheckInterval >= 100 && tmpCheckInterval <= 1000)
 		m_iCheckCardInInterval = tmpCheckInterval;
 
@@ -2394,20 +2388,11 @@ int CCardIssuerFSM::ReadCard_Contact(SpReqAnsContext<CardIssuerStandService_Read
 		}
 		else//未访问户口系统或户口系统访问失败或户口未告知介质类型(包括插反卡)
 		{
-			int icRetryTimes = 0;
-			while (1)
-			{//for poor mag only card,we always retry...
-				l_beginTime = GetTickCountRVC();
-				bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER, m_hDevHelper, activeCardType);
-				l_endTime = GetTickCountRVC();
-				if (!bIC)
-					icRetryTimes++;
-				else
-					break;
-				Sleep(500);
-				if (icRetryTimes >= m_ICRetryTimes)
-					break;
-			}
+
+			l_beginTime = GetTickCountRVC();
+			bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER, m_hDevHelper, activeCardType);
+			l_endTime = GetTickCountRVC();
+
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, bIC:%d", bIC);
 			if (!bIC) {
 				ErrorCodeEnum eErrCode = Error_Unexpect;
@@ -2456,7 +2441,7 @@ int CCardIssuerFSM::ReadCard_Contact(SpReqAnsContext<CardIssuerStandService_Read
 				l_beginTime = GetTickCountRVC();
 				eErr = m_hDevHelper->DeactivateICCard();
 				l_endTime = GetTickCountRVC();
-				
+
 				if (eErr != Error_Succeed) {
 					SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactivateICCard, "DevAdapter::DeactivateICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "ReadCard_Contact::DeactivateICCard err");
 				}
@@ -2666,20 +2651,11 @@ int CCardIssuerFSM::ReadCard_RF(SpReqAnsContext<CardIssuerStandService_Read_Req,
 		}
 		else//未访问户口系统或户口系统访问失败(包括插反卡)
 		{
-			int icRetryTimes = 0;
-			while (1)
-			{//for poor mag only card,we always retry...
-				l_beginTime = GetTickCountRVC();
-				bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_RF, m_hDevHelper, activeCardType);
-				l_endTime = GetTickCountRVC();
-				if (!bIC)
-					icRetryTimes++;
-				else
-					break;
-				Sleep(500);
-				if (icRetryTimes >= m_ICRetryTimes)
-					break;
-			}
+
+			l_beginTime = GetTickCountRVC();
+			bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_RF, m_hDevHelper, activeCardType);
+			l_endTime = GetTickCountRVC();
+
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, bIC:%d", bIC);
 			if (!bIC) {
 				ErrorCodeEnum eErrCode = Error_Unexpect;
@@ -2719,7 +2695,7 @@ int CCardIssuerFSM::ReadCard_RF(SpReqAnsContext<CardIssuerStandService_Read_Req,
 				l_beginTime = GetTickCountRVC();
 				eErr = m_hDevHelper->DeactContactlessICCard();
 				l_endTime = GetTickCountRVC();
-				
+
 				if (eErr != Error_Succeed) {
 					SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_DeactivateICCard, "DevAdapter::DeactContactlessICCard", __FUNCTION__, false, l_endTime - l_beginTime, "", "ReadCard_RF::DeactContactlessICCard err");
 				}
@@ -2775,20 +2751,9 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 	if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
 	{
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline>, the front BusinessData han't provide aid data.");
-		int icRetryTimes = 0;
-		while (1)
-		{
-			l_beginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		l_beginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
+		l_endTime = GetTickCountRVC();
 	}
 	else {
 		char* pAIDTmp = new char[64];
@@ -2798,20 +2763,10 @@ int CCardIssuerFSM::PreOnline_Contact(SpReqAnsContext<CardIssuerStandService_Pre
 		CAutoArray<CSimpleString> preAIDs;
 		preAIDs.Init(1);
 		preAIDs[0] = (CSimpleStringA)pAIDTmp;
-		int icRetryTimes = 0;
-		while (1)
-		{
-			l_beginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		l_beginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
+		l_endTime = GetTickCountRVC();
+
 		if (pAIDTmp != NULL)
 			delete[]pAIDTmp;
 	}
@@ -3153,20 +3108,9 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStandService_PreOnlin
 	if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
 	{
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnline_RF>, the front BusinessData han't provide aid data.");
-		int icRetryTimes = 0;
-		while (1)
-		{
-			l_beginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		l_beginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
+		l_endTime = GetTickCountRVC();
 	}
 	else {
 		char* pAIDTmp = new char[64];
@@ -3176,20 +3120,9 @@ int CCardIssuerFSM::PreOnline_RF(SpReqAnsContext<CardIssuerStandService_PreOnlin
 		CAutoArray<CSimpleString> preAIDs;
 		preAIDs.Init(1);
 		preAIDs[0] = (CSimpleStringA)pAIDTmp;
-		int icRetryTimes = 0;
-		while (1)
-		{
-			l_beginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		l_beginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
+		l_endTime = GetTickCountRVC();
 		if (pAIDTmp != NULL)
 			delete[]pAIDTmp;
 	}
@@ -4965,9 +4898,6 @@ bool CCardIssuerFSM::ToRegistCaptureCardInfo()
 }
 void CCardIssuerFSM::CheckSupportRf()
 {
-	if (m_bStopUseRF)
-		m_bSupportRF = false;
-
 	//加入szmodel非接字段属性判断
 	if (m_csRF.Compare("Y") == 0) {
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("szModel,RF=%s", m_csRF.GetData());
@@ -5537,20 +5467,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 	if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
 	{
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_Contact>, the front BusinessData have not provide aid data.");
-		int icRetryTimes = 0;
-		while (1)
-		{
-			m_ullBeginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			m_ullEndTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		m_ullBeginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
+		m_ullEndTime = GetTickCountRVC();
 	}
 	else {
 		char* pAIDTmp = new char[64];
@@ -5560,20 +5479,10 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 		CAutoArray<CSimpleString> preAIDs;
 		preAIDs.Init(1);
 		preAIDs[0] = (CSimpleStringA)pAIDTmp;
-		int icRetryTimes = 0;
-		while (1)
-		{
-			m_ullBeginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			m_ullEndTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+
+		m_ullBeginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
+		m_ullEndTime = GetTickCountRVC();
 		if (pAIDTmp != NULL)
 			delete[]pAIDTmp;
 	}
@@ -5743,20 +5652,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 	if (m_pCardProcess->FindTagValue(TAG_VECTOR_BUS, aidFromBus, false, 0) == -1)
 	{
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<PreOnlineJS_RF>, the front BusinessData have not provide aid data.");
-		int icRetryTimes = 0;
-		while (1)
-		{
-			m_ullBeginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			m_ullEndTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		m_ullBeginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
+		m_ullEndTime = GetTickCountRVC();
 	}
 	else {
 		char* pAIDTmp = new char[64];
@@ -5766,20 +5664,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 		CAutoArray<CSimpleString> preAIDs;
 		preAIDs.Init(1);
 		preAIDs[0] = (CSimpleStringA)pAIDTmp;
-		int icRetryTimes = 0;
-		while (1)
-		{
-			m_ullBeginTime = GetTickCountRVC();
-			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			m_ullEndTime = GetTickCountRVC();
-			if (retDetectAndRead == -1)//only retry for active ic card failed!
-				icRetryTimes++;
-			else
-				break;
-			Sleep(500);
-			if (icRetryTimes >= m_ICRetryTimes)
-				break;
-		}
+		m_ullBeginTime = GetTickCountRVC();
+		retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
+		m_ullEndTime = GetTickCountRVC();
 		if (pAIDTmp != NULL)
 			delete[]pAIDTmp;
 	}

+ 4 - 4
Module/mod_CardIssuerStand/CardIssuerStandFSM.h

@@ -745,8 +745,8 @@ public:
 		, m_captureReason(""), m_machineType(1), m_currentHopper(1), m_hopperNum(1)
 		, m_bSettingMaterial(false), m_addCardSerial("")
 		, m_bCancelByRFIC(false), m_devOpenFailedCount(0)
-		, m_EacQueryHost(""), m_eacQueryFlag(0), m_bUseCardnoMismatch(false), m_ICRetryTimes(1)
-		, m_bCardFromHopper(true), m_bStopUseRF(false), m_rfVendorList(""), m_bUseRFTillNext(false), m_csSwallowCardUrl(""), m_csSyncMaterialUrl("")
+		, m_EacQueryHost(""), m_eacQueryFlag(0), m_bUseCardnoMismatch(false)
+		, m_bCardFromHopper(true), m_rfVendorList(""), m_bUseRFTillNext(false), m_csSwallowCardUrl(""), m_csSyncMaterialUrl("")
 		, m_bCancelInsert(false), m_iCheckCardInInterval(200), m_bMainPageWhileWorking(false)
 	{
 		HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x203);
@@ -889,7 +889,7 @@ private:
 	bool m_bCancelAccept, m_bWaitingAccept, m_bWaitAccepteMore, m_bExit
 		, m_bCDA, m_bCardIssued, m_bHasHopper[HOPPER_NUM]
 		, m_bSettingMaterial, m_bCancelByRFIC
-		, m_bCardActiveNotify, m_bCardFromHopper, m_bUseCardnoMismatch, m_bStopUseRF, m_bMainPageWhileWorking/*Accepting、Read(JS)ing、Issue(JS)ing*/;
+		, m_bCardActiveNotify, m_bCardFromHopper, m_bUseCardnoMismatch, m_bMainPageWhileWorking/*Accepting、Read(JS)ing、Issue(JS)ing*/;
 	bool m_bSupportRF, m_bUseRFTillNext;//if ReadCard by RF,the following PreOnline & PostOnline always use RF till the next card(insert/issue)
 	ErrorCodeEnum m_testResult;
 
@@ -899,7 +899,7 @@ private:
 	int m_machineType;
 	int m_currentHopper, m_devOpenFailedCount;
 	int m_maxSlot, m_findCard, m_cardPos, m_maxRetainCount, m_eacQueryFlag/*accout query*/
-		, m_ICRetryTimes, m_iCheckCardInInterval;
+		, m_iCheckCardInInterval;
 	CSimpleStringA m_CardBoxNoEx[HOPPER_NUM], m_PsbCodeEx[HOPPER_NUM], m_PsbNameEx[HOPPER_NUM], m_MaintainerEx[HOPPER_NUM], m_csMaintainTimeEx[HOPPER_NUM];
 	int m_CardInitEx[HOPPER_NUM], m_CardPercentEx[HOPPER_NUM], m_remainsEx[HOPPER_NUM], m_issuedEx[HOPPER_NUM], m_mixedEx[HOPPER_NUM], m_hopperNum;
 	DWORD m_MaintainTimeEx[HOPPER_NUM];