Răsfoiți Sursa

!10867 优化发卡标志的逻辑,下掉废弃逻辑;修复返回数据状态缺陷;修复纯磁条卡缺陷,磁道芯片只要有一个存在,返回就不报错
Merge pull request !10867 from 80174847/oilyang_fixed_everything

杨诗友80174847 1 lună în urmă
părinte
comite
55e9eb7f57

+ 1 - 3
Module/mod_CardIssuerStand/CardIssuerStand.xml

@@ -76,8 +76,6 @@
 			<res>
 			</res>			
 		</twoway>				
-		<oneway name="SetIssueFlag" overlap="true" method_id="12">			
-		</oneway>
 		<twoway name="QueryCardInfo" overlap="true" method_id="14">
 			<req>
 			</req>
@@ -299,7 +297,7 @@
 				<param name="magData" type="string"/>
 				<!--读IC结果 0成功 1失败 2未执行-->
 				<param name="icStatus" type="int"/>
-				<!--读IC成功下接触方式 0接触 1非接-->
+				<!--读IC成功时,所用的通讯方式 0接触 1非接;不成功,值无意义-->
 				<param name="icMode" type="int"/>
 				<!--IC读取的数据<json格式>
 					ACTION:行为代码	ATC_CODE:交易计数器code	ARQC_CODE:授权请求code

+ 119 - 137
Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp

@@ -1547,8 +1547,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
 			CloseAndClearDevObj(false);
 			return eErrDev;
 		}
-		int ret = 0, isIssue = 99;
-		spConfig->ReadConfigValueInt("all", "IsIssue", isIssue);
+		int ret = 0;
 		spConfig->ReadConfigValueInt("all", "HopperNum", m_hopperNum);
 		spConfig->ReadConfigValueInt("all", "CardCaptured", m_CardCaptured);
 
@@ -1603,7 +1602,6 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("use new hopper cfg record"));
 		}
 		//oilyang 回写卡机配置
-		spConfig->WriteConfigValueInt("all", "IsIssue", isIssue);
 		spConfig->WriteConfigValueInt("all", "HopperNum", m_hopperNum);
 		spConfig->WriteConfigValueInt("1", "CardPercent", m_CardPercentEx[0]);
 		spEntityFunction->OpenConfig(Config_CenterSetting, spConfigCS);
@@ -1631,23 +1629,12 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
 			m_bStopUseRF = true;
 		if (tmpCheckInterval >= 100 && tmpCheckInterval <= 1000)
 			m_iCheckCardInInterval = tmpCheckInterval;
-		m_issueStatusFromFile = m_issueStatus = isIssue;
-		if (m_issueStatusFromFile == 0)
-			m_bCardFromHopper = false;
+
 
 		ret = CheckIfHasCardOnCase(CheckCard_OnOpen);
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("ret: %d, isIssue: %d, m_hasCardWhileDevOpen:%d, m_issueStatusFromFile:%d",
-			ret, isIssue, m_hasCardWhileDevOpen, m_issueStatusFromFile);
 
 		if (ret == 0)
 		{
-			if (m_hasCardWhileDevOpen && m_issueStatusFromFile > 0)
-			{
-				//oilyang@20171220 遗留卡片已经被吞,重置数据
-				m_issueStatusFromFile = 0;
-				m_currCardNo = m_addCardNo = "";
-				FSMSetIssueFlag(0);
-			}
 			//oilyang@20191219 获取吞卡箱容量,目前有便携卡机,大机
 			//超过5,认为是脏数据,用默认值3
 			CardIssuerStatus cis;
@@ -1707,9 +1694,7 @@ int CCardIssuerFSM::CheckIfHasCardOnCase(CheckCardCase eCase)
 		{
 		case CI_MEDIA_PRESENT:
 		{
-			if (eCase == CheckCard_OnOpen)
-				m_hasCardWhileDevOpen = true;
-			else if (eCase == CheckCard_OnFail)
+			if (eCase == CheckCard_OnFail)
 				return 2;
 
 			if (m_currCardNo.GetLength() > 1)
@@ -1974,17 +1959,13 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 	if (errCode != Error_Succeed)
 	{
 		
-		CSimpleStringA ErrMsg = CSimpleStringA::Format("IssueCard::MoveCard err , m_currentHopper:%d", m_currentHopper);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(ErrMsg.GetData());
-		FSMSetIssueFlag(2);
+		CSimpleStringA ErrMsg = CSimpleStringA::Format("m_currentHopper:%d", m_currentHopper);
 		
 		if (ctx != NULL) {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("从卡箱移动卡片到读卡器失败,请重试或检查是否有塞卡");
 			SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, "DevAdapter::MoveCard", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", ErrMsg.GetData());
 			ctx->Answer(Error_Unexpect, GetAlarmDEC());
 		}
 		else {
-			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("从卡箱移动卡片到读卡器失败,请重试或检查是否有塞卡");
 			SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, "DevAdapter::MoveCard", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", ErrMsg.GetData());
 			ctxEx->Answer(Error_Unexpect, GetAlarmDEC());
 		}
@@ -1993,7 +1974,6 @@ int CCardIssuerFSM::IssueCard(SpReqAnsContext<CardIssuerStandService_Issue_Req,
 	else {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320")("IssueCard::MoveCard succ, m_currentHopper:%d", m_currentHopper);
 	}
-	//LogWarn(Severity_Low, Error_Succeed, CardIssuer_UserErrorCode_MoveCard_FromHopper, "MoveCard from hopper suc.");
 	m_issuedEx[m_currentHopper - 1]++;
 	m_remainsEx[m_currentHopper - 1]--;
 	m_bSettingMaterial = true;//oilyang 借用于延迟同步,紧接着设置remains时更新到后台数据库
@@ -2035,10 +2015,10 @@ int CCardIssuerFSM::CaptureCard(SpReqAnsContext<CardIssuerStandService_Capture_R
 	{
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040220304")();
 		bool bCaptured = ToRegistCaptureCardInfo();
-		m_currCardNo = m_addCardNo = "";
 	}
 	else
 		ret = 1;
+	m_currCardNo = "";
 	m_CardCaptured++;
 	if (!SetCardCaptured(m_CardCaptured))
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CaptureCard>, set card captured failed");
@@ -3795,40 +3775,6 @@ void CCardIssuerFSM::SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactio
 {
 	OnHardwareShakeHand(pTransactionContext);
 }
-
-bool CCardIssuerFSM::FSMSetIssueFlag(int value)
-{
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("FSMSetIssueFlag, value:%d,from file:%d", value, m_issueStatusFromFile);
-	if (value == 0 && m_issueStatusFromFile >1)
-	{
-		//oilyang@20171220 如果曾经卡片卡住,但启动时没有发现卡片,则更新本次发卡方向但不写文件,以防后续卡片被移动到卡槽
-		if (!m_hasCardWhileDevOpen)
-		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("card jamed havn't been process.");
-			m_issueStatus = 0;
-		}
-		else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("insert succeed,but there maybe some card jamed...");
-		return true;
-	}
-	
-	m_issueStatus = value;
-	CSmartPointer<IEntityFunction> spEntityFunction = GetEntityBase()->GetFunction();
-	CSmartPointer<IConfigInfo> spConfig;
-	ErrorCodeEnum eErrDev = spEntityFunction->OpenConfig(Config_Run, spConfig);
-	if (eErrDev != Error_Succeed) {
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(RTAERR_CONFIG_OPEN_FAILED)("(FSMSetIssueFlag) open cfg file failed!");
-		return false;
-	}
-	eErrDev = spConfig->WriteConfigValueInt("all", "IsIssue", value);
-	if (eErrDev == Error_Succeed) {
-		return true;
-	}
-	else {
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(RTAERR_CONFIG_WRITE_FAILED)("(FSMSetIssueFlag) write IsIssue err:%d, value:%d", eErrDev, value);
-		return false;
-	}
-}
 bool CCardIssuerFSM::SetCardCaptured(const int num,bool bClear)
 {
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<SetCardCaptured>, num:%d, bClear:%d, m_maxRetainCount:%d, m_bSettingMaterial:%d",
@@ -4054,17 +4000,9 @@ ErrorCodeEnum CCardIssuerFSM::MachineMoveCardFrontGate(bool bInBussiness)
 
 	if (eMoveFrontGate != Error_Succeed){
 		if (m_bCardFromHopper)
-		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("发卡,卡片吐出失败,请联系厂商检查卡嘴是否没对齐或是否有塞卡");
 			SetErrorAndLog(eMoveFrontGate, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FRONT_GATE, "DevAdapter::MoveCard", __FUNCTION__, bInBussiness, l_endTime - l_beginTime, "QLR040220305", "后端发卡,卡片吐出失败");
-
-		}
 		else
-		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("前端进卡,卡片吐出失败,请确认卡片是否平整");
 			SetErrorAndLog(eMoveFrontGate, CardIssuer_UserErrorCode_MoveCardToGate_Failed, "DevAdapter::MoveCard", __FUNCTION__, bInBussiness, l_endTime - l_beginTime, "QLR040220305", "前端进卡,卡片吐出失败");
-		
-		}
 	}
 	else {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220305")("MachineMoveCardFrontGate::MoveCard");
@@ -5344,7 +5282,7 @@ int CCardIssuerFSM::EjectJS(SpReqAnsContext<CardIssuerStandService_EjectJS_Req,
 			m_CardCaptured++;
 			m_captureReason = "4998";//超时未取卡引起吞卡
 			ToRegistCaptureCardInfo();//登记吞卡记录
-			m_currCardNo = m_addCardNo = "";
+			m_currCardNo = "";
 
 			l_beginTime = GetTickCountRVC();
 			ErrorCodeEnum eErrSet = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
@@ -5419,7 +5357,7 @@ int CCardIssuerFSM::CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_R
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::SetCardInType").setCostTime(l_endTime - l_beginTime)("CaptureJS::SetCardInType");
 			}
 			CSimpleStringA maskCardno = MaskCardno(m_currCardNo.GetData());
-			m_currCardNo = m_addCardNo = "";
+			m_currCardNo = "";
 			if (ctx != NULL) {
 				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setLogCode("QLR040220343").setResultCode("RTA23CS")("CaptureJS::GetDevStatus succ, No card found in cardReader, m_currCardNo=%s", maskCardno.GetData());
 				LogWarn(Severity_Low, Error_Unexpect, CardIssuer_UserErrorCode_Capture_NoCard_Failed, "Capture card, No card found in cardReader");
@@ -5444,7 +5382,7 @@ int CCardIssuerFSM::CaptureJS(SpReqAnsContext<CardIssuerStandService_CaptureJS_R
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("CaptureJS::MoveCard(CI_MOVECARD_BACK_NOT_HOLD)");
 		m_CardCaptured++;
 		ToRegistCaptureCardInfo();//登记吞卡记录
-		m_currCardNo = m_addCardNo = "";
+		m_currCardNo = "";
 
 		l_beginTime = GetTickCountRVC();
 		ErrorCodeEnum eErrSet = m_hDevHelper->SetCardInType(CI_CARD_IN_TYPE_FORBIDDEN);
@@ -5638,9 +5576,7 @@ int CCardIssuerFSM::IssueFromBoxJS(SpReqAnsContext<CardIssuerStandService_IssueF
 	m_bCardFromHopper = true;//用于区分吐卡报错不同
 	if (errCode != Error_Succeed)
 	{
-		CSimpleStringA errMsg = CSimpleStringA::Format("IssueFromBoxJS::MoveCard err, m_currentHopper:%d", m_currentHopper);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(errMsg.GetData());
-		FSMSetIssueFlag(2);
+		CSimpleStringA errMsg = CSimpleStringA::Format("m_currentHopper:%d", m_currentHopper);
 		DWORD dwTmpUserErrCode = SetErrorAndLog(errCode, MEC_DEVAPI_CARDISSUER_CI_MOVECARD_FROM_HOPPER, "DevAdapter::MoveCard", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220345", errMsg.GetData());
 		ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
 		return 2;//S9 
@@ -5732,7 +5668,6 @@ int CCardIssuerFSM::PostOnlineJS_RF(SpReqAnsContext<CardIssuerStandService_PostO
 void CCardIssuerFSM::ReadMag(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx)
 {
 	m_currCardNo = "";
-	ctx->Ans.magStatus = 0;
 	MagTracks magTracks;
 	memset(magTracks.track[0].data, 0, sizeof(magTracks.track[0].data));
 	memset(magTracks.track[1].data, 0, sizeof(magTracks.track[1].data));
@@ -5781,10 +5716,24 @@ void CCardIssuerFSM::ReadMag(SpReqAnsContext<CardIssuerStandService_ReadJS_Req,
 
 int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx, bool bContinue)
 {
-	//oiltmp TODO? need to judge if need movecard to the position?
 	LOG_FUNCTION();
-	long l_beginTime, l_endTime;
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PreOnlineJS_Contact, business data[%s]", ctx->Req.businessData.GetData());
+	ctx->Ans.icStatus = 1;
+	m_ullBeginTime = GetTickCountRVC();
+	ErrorCodeEnum eErr = m_hDevHelper->MoveCard(CI_MOVECARD_IC_POSITION);
+	m_ullEndTime = GetTickCountRVC();
+	if (eErr == Error_Succeed) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(m_ullEndTime - m_ullBeginTime)("MoveCard to CI_MOVECARD_IC_POSITION");
+	}
+	else {
+		DWORD dwTmpUserErrCode = SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220340");
+		if (bContinue)
+			return -1;
+		else
+		{
+			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			return -1;
+		}
+	}
 
 	m_pCardProcess->DataInit();
 	//split the business data for pboc process
@@ -5801,9 +5750,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 		int icRetryTimes = 0;
 		while (1)
 		{
-			l_beginTime = GetTickCountRVC();
+			m_ullBeginTime = GetTickCountRVC();
 			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
+			m_ullEndTime = GetTickCountRVC();
 			if (retDetectAndRead == -1)//only retry for active ic card failed!
 				icRetryTimes++;
 			else
@@ -5824,9 +5773,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 		int icRetryTimes = 0;
 		while (1)
 		{
-			l_beginTime = GetTickCountRVC();
+			m_ullBeginTime = GetTickCountRVC();
 			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
+			m_ullEndTime = GetTickCountRVC();
 			if (retDetectAndRead == -1)//only retry for active ic card failed!
 				icRetryTimes++;
 			else
@@ -5854,28 +5803,28 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 				GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
 
 				if (m_issueStatus) {
-					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
+					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
 				}
 				else {
-					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
+					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
 				}
 			}
 			else if (retDetectAndRead == -2) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败 bContinue");
 				if (m_issueStatus) {
-					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "读取IC数据失败");
+					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220320", "读取IC数据失败");
 				}
 				else {
-					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220303", "读取IC数据失败");
+					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220303", "读取IC数据失败");
 				}
 			}
 			else if (retDetectAndRead == -3) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败 bContinue");
 				if (m_issueStatus) {
-					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "retDetectAndRead = -3");
+					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220320", "retDetectAndRead = -3");
 				}
 				else {
-					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220303", "retDetectAndRead = -3");
+					SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220303", "retDetectAndRead = -3");
 				}
 			}
 		}
@@ -5886,48 +5835,64 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 
 				if (m_issueStatus) {
 					if (IsInBusiness()) {
-						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
 						LogError(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
 					}
 					else {
-						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA230V")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
 					}
-					ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveICCard_Failed);
+					//oilyang@20250822 if read mag successfully, we should return magData
+					if (ctx->Ans.magStatus != 0)
+						ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveICCard_Failed);
+					else
+						ctx->Answer(Error_Succeed);
 				}
 				else {
 					if (IsInBusiness()) {
-						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
 						LogError(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
 					}
 					else {
-						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA230M")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
 					}
-					ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_ActiveICCard_Failed);
+					//oilyang@20250822 if read mag successfully, we should return magData
+					if (ctx->Ans.magStatus != 0)
+						ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_ActiveICCard_Failed);
+					else
+						ctx->Answer(Error_Succeed);
 				}
 			}
 			else if (retDetectAndRead == -2) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220320", "读取IC数据失败");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220303", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220303", "读取IC数据失败");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				//oilyang@20250822 if read mag successfully, we should return magData
+				if (ctx->Ans.magStatus != 0)
+					ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				else
+					ctx->Answer(Error_Succeed);
 			}
 			else if (retDetectAndRead == -3) {
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "retDetectAndRead =-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220320", "retDetectAndRead =-3");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220303", "retDetectAndRead =-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220303", "retDetectAndRead =-3");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				//oilyang@20250822 if read mag successfully, we should return magData
+				if (ctx->Ans.magStatus != 0)
+					ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				else
+					ctx->Answer(Error_Succeed);
 			}
 		}
 		return -1;
@@ -5952,26 +5917,31 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaContact(SpReqAnsContext<CardIssuerStandSe
 		break;
 	}
 	ctx->Ans.pbocData = taaResult;
+	ctx->Ans.icMode = 0;
 	return 0;
 }
 
 int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx, bool bContinue)
 {
 	LOG_FUNCTION();
-	long l_beginTime, l_endTime;
-	l_beginTime = GetTickCountRVC();
+	ctx->Ans.icStatus = 1;
+	m_ullBeginTime = GetTickCountRVC();
 	ErrorCodeEnum eErr = m_hDevHelper->MoveCard(CI_MOVECARD_RF_POSITION);
-	l_endTime = GetTickCountRVC();
+	m_ullEndTime = GetTickCountRVC();
 	if (eErr == Error_Succeed) {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("PreOnlineJS_RF::MoveCard, (CI_MOVECARD_RF_POSITION)");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(m_ullEndTime - m_ullBeginTime)("PreOnlineJS_RF::MoveCard, (CI_MOVECARD_RF_POSITION)");
 	}
 	else {
-		SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220340", "PreOnlineJS_RF::MoveCard err");
-		//oiltmp move card failed, not to halt process?
+		DWORD dwTmpUserErrCode = SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220340");
+		if (bContinue)
+			return -1;
+		else
+		{
+			ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+			return -1;
+		}
 	}
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("PreOnlineJS_RF, business data[%s]", ctx->Req.businessData.GetData());
-
 	m_pCardProcess->DataInit();
 	//数据已读出,开始pmoc流程
 	m_pCardProcess->SplitBusinessData(ctx->Req.businessData, ctx->Req.businessData.GetLength());
@@ -5986,9 +5956,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 		int icRetryTimes = 0;
 		while (1)
 		{
-			l_beginTime = GetTickCountRVC();
+			m_ullBeginTime = GetTickCountRVC();
 			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, m_aidList, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
+			m_ullEndTime = GetTickCountRVC();
 			if (retDetectAndRead == -1)//only retry for active ic card failed!
 				icRetryTimes++;
 			else
@@ -6009,9 +5979,9 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 		int icRetryTimes = 0;
 		while (1)
 		{
-			l_beginTime = GetTickCountRVC();
+			m_ullBeginTime = GetTickCountRVC();
 			retDetectAndRead = m_pCardProcess->DetectAndReadICData(CARD_MACHINE_ISSUER_RF, m_hDevHelper, preAIDs, activeCardType, m_issueStatus);
-			l_endTime = GetTickCountRVC();
+			m_ullEndTime = GetTickCountRVC();
 			if (retDetectAndRead == -1)//only retry for active ic card failed!
 				icRetryTimes++;
 			else
@@ -6040,10 +6010,10 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 				GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
 
 				if (m_issueStatus) {
-					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
+					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
 				}
 				else {
-					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
+					DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
 				}
 			}
 			else if (retDetectAndRead == -2) {
@@ -6051,10 +6021,10 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败 bContinue");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220320", "读取IC数据失败");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220303", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220303", "读取IC数据失败");
 				}
 			}
 			else if (retDetectAndRead == -3) {
@@ -6062,10 +6032,10 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败 bContinue");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220320", "retDetectAndRead=-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220320", "retDetectAndRead=-3");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040220303", "retDetectAndRead=-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220303", "retDetectAndRead=-3");
 				}
 			}
 		}
@@ -6078,29 +6048,35 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 				if (m_issueStatus) {
 					if (IsInBusiness())
 					{
-						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
 						LogError(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
 					}
 					else {
-						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220320").setResultCode("RTA2327")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
 					}
-
-					ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveRF_Failed);
+					//oilyang@20250822 if read mag successfully, we should return magData
+					if (ctx->Ans.magStatus != 0)
+						ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_IssueCard_ActiveRF_Failed);
+					else
+						ctx->Answer(Error_Succeed);
 				}
 				else {
 					if (IsInBusiness())
 					{
-						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
 						LogError(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
 					}
 					else
 					{
-						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(m_ullEndTime - m_ullBeginTime).setLogCode("QLR040220303").setResultCode("RTA2326")(csErrMsgWithReturnCode.GetData());
 						LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
 					}
-
-					ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_ActiveContactlessICCard_Failed);
+					//oilyang@20250822 if read mag successfully, we should return magData
+					if (ctx->Ans.magStatus != 0)
+						ctx->Answer(Error_Unexpect, CardIssuer_UserErrorCode_ActiveContactlessICCard_Failed);
+					else
+						ctx->Answer(Error_Succeed);
 				}
 			}
 			else if (retDetectAndRead == -2) {
@@ -6108,24 +6084,32 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220320", "读取IC数据失败");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220303", "读取IC数据失败");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220303", "读取IC数据失败");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				//oilyang@20250822 if read mag successfully, we should return magData
+				if (ctx->Ans.magStatus != 0)
+					ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				else
+					ctx->Answer(Error_Succeed);
 			}
 			else if (retDetectAndRead == -3) {
 
 				DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
 				DWORD dwTmpUserErrCode = 0;
 				if (m_issueStatus) {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220320", "retDetectAndRead=-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220320", "retDetectAndRead=-3");
 				}
 				else {
-					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040220303", "retDetectAndRead=-3");
+					dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220303", "retDetectAndRead=-3");
 				}
-				ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				//oilyang@20250822 if read mag successfully, we should return magData
+				if (ctx->Ans.magStatus != 0)
+					ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
+				else
+					ctx->Answer(Error_Succeed);
 			}
 		}
 		return -1;//上电读卡失败
@@ -6150,6 +6134,7 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 		break;
 	}
 	ctx->Ans.pbocData = taaResult;
+	ctx->Ans.icMode = 1;
 	return 0;
 }
 int CCardIssuerFSM::PreOnlineJS_ICDataProcess(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, CardIssuerStandService_ReadJS_Ans>::Pointer ctx)
@@ -6158,6 +6143,7 @@ int CCardIssuerFSM::PreOnlineJS_ICDataProcess(SpReqAnsContext<CardIssuerStandSer
 	if (ctx->Ans.pbocData.GetLength() == 0)
 	{
 		ctx->Ans.icStatus = 0;
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("no need to pboc?");
 		ctx->Answer(Error_Succeed);
 		return 0;
 	}
@@ -6184,10 +6170,6 @@ int CCardIssuerFSM::PreOnlineJS_ICDataProcess(SpReqAnsContext<CardIssuerStandSer
 	if (m_pCardProcess->FindTagValue(TAG_VECTOR_IC, appExpiryDate, false, 0) == -1)
 	{
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA23E1")("<PreOnlineJS_Contact>, can't find expire date");
-		if (m_bSupportRF) {
-			delete[] pExpireDate;
-			return -1;
-		}
 	}
 	else {
 		HexBuf2StrBuf(appExpiryDate.value, &pExpireDate, appExpiryDate.lenth);
@@ -6337,7 +6319,8 @@ int CCardIssuerFSM::ReadJS(SpReqAnsContext<CardIssuerStandService_ReadJS_Req, Ca
 {
 	//init value, 2 for 
 	ctx->Ans.magStatus = 2;
-	ctx->Ans.icMode = 2;
+	ctx->Ans.icStatus = 2;
+	ctx->Ans.icMode = -1;
 	switch (ctx->Req.mode)
 	{
 	case ReadMode_MagOnly:
@@ -6455,7 +6438,6 @@ int CCardIssuerFSM::InsertJS(SpReqAnsContext<CardIssuerStandService_InsertJS_Req
 	if (rc == 0) {
 		FSMSetIssueFlag(0);
 		m_bCardFromHopper = false;
-		//LogWarn(Severity_Low, Error_Succeed, CardIssuer_UserErrorCode_InsertCardSucceed, "InsertJS, insert succeed");
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("InsertJS, insert succeed");
 		m_bUseRFTillNext = false;
 		ctx->Answer(Error_Succeed);

+ 6 - 7
Module/mod_CardIssuerStand/CardIssuerStandFSM.h

@@ -754,9 +754,9 @@ public:
 		m_bWaitAccepteMore(false), m_bExit(false), m_resetTimes(0), m_testResult(Error_Succeed)
 		//,m_pTACReject(NULL),m_pIACOnline(NULL),m_pTACOnline(NULL),m_pIACDefault(NULL),m_pTACDefault(NULL)
 		, m_bCDA(false), m_pDataToARQC(NULL), m_bIssuingExit(false)
-		, m_bCardIssued(false), m_issueStatusFromFile(1), m_issueStatus(1), m_currCardNo("")
+		, m_bCardIssued(false), m_issueStatus(1), m_currCardNo("")
 		, m_captureReason(""), m_machineType(1), m_currentHopper(1), m_hopperNum(1)
-		, m_bSettingMaterial(false), m_addCardNo(""), m_addCardSerial(""), m_hasCardWhileDevOpen(false)
+		, 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("")
@@ -842,8 +842,7 @@ public:
 	bool GetWaitFlag() { return m_bWaitingAccept; }
 	void SetWaitMore() { m_bWaitAccepteMore = true; }
 	void SetExitFlag(bool bFlag = true) { m_bExit = bFlag; }
-	bool FSMSetIssueFlag(int value = 1);
-	void FrontSetIssueFlag(bool bValue = true) { FSMSetIssueFlag(bValue); }
+	void FSMSetIssueFlag(int value) { m_issueStatus = value; }
 	int QueryIssueFlag() { return m_issueStatus; }
 	bool SetCardCaptured(const int num, bool bNewClear = false);
 	bool SetCardIssued(const int num, const int hopper);
@@ -903,13 +902,13 @@ private:
 	lpCMBdecodeEx cmdDecodeEx;
 	bool m_bCancelAccept, m_bWaitingAccept, m_bWaitAccepteMore, m_bExit
 		, m_bCDA, m_bIssuingExit, m_bCardIssued, m_bHasHopper[HOPPER_NUM]
-		, m_bSettingMaterial, m_hasCardWhileDevOpen, m_bCancelByRFIC
+		, m_bSettingMaterial, m_bCancelByRFIC
 		, m_bCardActiveNotify, m_bCardFromHopper, m_bUseCardnoMismatch, m_bStopUseRF, 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;
 
 	int m_CardCaptured;
-	int m_issueStatusFromFile, m_issueStatus/*the status maybe changed by Business call*/;
+	int m_issueStatus/*the status maybe changed by Business call*/;
 	//1:default, 2:SCI, 3:no cfg
 	int m_machineType;
 	int m_currentHopper, m_devOpenFailedCount;
@@ -925,7 +924,7 @@ private:
 
 	char* m_pDataToARQC;
 	long xxTest;
-	CSimpleStringA m_currCardNo, m_captureReason, m_csMachineType, m_terminalNo, m_addCardNo, m_addCardSerial, m_rfVendorList, m_csRF;
+	CSimpleStringA m_currCardNo, m_captureReason, m_csMachineType, m_terminalNo, m_addCardSerial, m_rfVendorList, m_csRF;
 	char m_AuthCode[2];
 	vector<CMBBin> m_vBin;
 	int SplitTrack2(CSimpleStringA pTrack2, Track2Data& decodeData);

+ 0 - 14
Module/mod_CardIssuerStand/CardIssuerStand_client_g.h

@@ -444,20 +444,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum SetIssueFlag()
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->OnewayCall(CardIssuerStandService_Method_SetIssueFlag, CardIssuerStandService_MethodSignature_SetIssueFlag, m_context);
-		m_context.clear();
-		return ret;
-	}
-
 	ErrorCodeEnum QueryCardInfo(CardIssuerStandService_QueryCardInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 0 - 12
Module/mod_CardIssuerStand/CardIssuerStand_def_g.h

@@ -22,7 +22,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_Method_PostOnline 7
 #define CardIssuerStandService_Method_Exit 8
 #define CardIssuerStandService_Method_Issue 9
-#define CardIssuerStandService_Method_SetIssueFlag 12
 #define CardIssuerStandService_Method_QueryCardInfo 14
 #define CardIssuerStandService_Method_WriteTrack 15
 #define CardIssuerStandService_Method_GetMaterialCountEx 16
@@ -54,7 +53,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_MethodSignature_PostOnline 923284555
 #define CardIssuerStandService_MethodSignature_Exit -1158854104
 #define CardIssuerStandService_MethodSignature_Issue 438783077
-#define CardIssuerStandService_MethodSignature_SetIssueFlag 187641303
 #define CardIssuerStandService_MethodSignature_QueryCardInfo 154962579
 #define CardIssuerStandService_MethodSignature_WriteTrack -1424799012
 #define CardIssuerStandService_MethodSignature_GetMaterialCountEx 1356148904
@@ -86,7 +84,6 @@ namespace CardIssuerStand {
 #define CardIssuerStandService_LogCode_PostOnline "QLR040220307"
 #define CardIssuerStandService_LogCode_Exit "QLR040220308"
 #define CardIssuerStandService_LogCode_Issue "QLR040220309"
-#define CardIssuerStandService_LogCode_SetIssueFlag "QLR040220312"
 #define CardIssuerStandService_LogCode_QueryCardInfo "QLR040220314"
 #define CardIssuerStandService_LogCode_WriteTrack "QLR040220315"
 #define CardIssuerStandService_LogCode_GetMaterialCountEx "QLR040220316"
@@ -295,15 +292,6 @@ struct CardIssuerStandService_Issue_Ans
 
 };
 
-struct CardIssuerStandService_SetIssueFlag_Info
-{
-
-	void Serialize(SpBuffer &Buf)
-	{
-	}
-
-};
-
 struct CardIssuerStandService_QueryCardInfo_Req
 {
 

+ 0 - 27
Module/mod_CardIssuerStand/CardIssuerStand_server_g.h

@@ -100,13 +100,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_SetIssueFlag:
-			if (dwSignature == CardIssuerStandService_MethodSignature_SetIssueFlag) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_QueryCardInfo:
 			if (dwSignature == CardIssuerStandService_MethodSignature_QueryCardInfo) {
 				bOverlap = true;
@@ -308,11 +301,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case CardIssuerStandService_Method_SetIssueFlag:
-			if (dwSignature != CardIssuerStandService_MethodSignature_SetIssueFlag) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case CardIssuerStandService_Method_QueryCardInfo:
 			if (dwSignature != CardIssuerStandService_MethodSignature_QueryCardInfo) {
 				Error = Error_MethodSignatureFailed;
@@ -470,11 +458,6 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -691,16 +674,6 @@ public:
 						Handle_Issue(ctx);
 					}
 					break;
-				case CardIssuerStandService_Method_SetIssueFlag:
-					{
-						SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_SetIssueFlag(ctx);
-					}
-					break;
 				case CardIssuerStandService_Method_QueryCardInfo:
 					{
 						SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req,CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx;

+ 1 - 7
Module/mod_CardIssuerStand/mod_cardissuerStand.cpp

@@ -76,13 +76,7 @@ void CardIssuerServerSession::Handle_Exit(SpOnewayCallContext<CardIssuerStandSer
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Exit");
 	m_pEntity->Exit(ctx);
 }
- void CardIssuerServerSession::Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx)
-{
-	LOG_FUNCTION();
-	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("SetIssueFlag");
-	m_pEntity->SetIssueFlag(ctx);
-}
+
 void CardIssuerServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();

+ 4 - 6
Module/mod_CardIssuerStand/mod_cardissuerStand.h

@@ -20,7 +20,6 @@ public:
 	virtual void Handle_PreOnline(SpReqAnsContext<CardIssuerStandService_PreOnline_Req, CardIssuerStandService_PreOnline_Ans>::Pointer ctx);
 	virtual void Handle_PostOnline(SpReqAnsContext<CardIssuerStandService_PostOnline_Req, CardIssuerStandService_PostOnline_Ans>::Pointer ctx);
 	virtual void Handle_Exit(SpOnewayCallContext<CardIssuerStandService_Exit_Info>::Pointer ctx);
-	virtual void Handle_SetIssueFlag(SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx);
 	virtual void Handle_QueryCardInfo(SpReqAnsContext<CardIssuerStandService_QueryCardInfo_Req, CardIssuerStandService_QueryCardInfo_Ans>::Pointer ctx);
 	virtual void Handle_WriteTrack(SpReqAnsContext<CardIssuerStandService_WriteTrack_Req, CardIssuerStandService_WriteTrack_Ans>::Pointer ctx);
 	virtual void Handle_GetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_GetMaterialCountEx_Req, CardIssuerStandService_GetMaterialCountEx_Ans>::Pointer ctx);
@@ -204,7 +203,6 @@ public:
 			ctx->Answer(Error_Succeed);
 		}
 	}
-	void SetIssueFlag(SpOnewayCallContext<CardIssuerStandService_SetIssueFlag_Info>::Pointer ctx){ m_fsm.FrontSetIssueFlag(true); }
 	void GetMaterialCountEx(SpReqAnsContext<CardIssuerStandService_GetMaterialCountEx_Req, CardIssuerStandService_GetMaterialCountEx_Ans>::Pointer ctx)
 	{
 		m_bNewSessionInit = false;
@@ -221,16 +219,16 @@ public:
 	}
 	void SetSomeFlag(SpReqAnsContext<CardIssuerStandService_SetSomeFlag_Req, CardIssuerStandService_SetSomeFlag_Ans>::Pointer ctx)
 	{
-		//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set issue flag to %d", ctx->Req.IssueBusiness);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("set issue flag to %d", ctx->Req.IssueBusiness);
 		if (ctx->Req.IssueBusiness == 1)
-			m_fsm.FrontSetIssueFlag(true);
+			m_fsm.FSMSetIssueFlag(1);
 		else if (ctx->Req.IssueBusiness == 0)
-			m_fsm.FrontSetIssueFlag(false);
+			m_fsm.FSMSetIssueFlag(0);
 		else if (ctx->Req.IssueBusiness == 2)//oilyang@20170621 query issue direction
 		{
 			ctx->Ans.reserved1.Init(1);
 			ctx->Ans.reserved1[0] = (m_fsm.QueryIssueFlag() ? 0 : 1);//according to yzx
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("issue direction:%d",ctx->Ans.reserved1[0]);//if 0 capture card eles eject card
+			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("issue direction:%d",ctx->Ans.reserved1[0]);//if 0 capture card eles eject card
 		}
 		else if (ctx->Req.IssueBusiness == 3)//oilyang@20181210 
 		{