|
@@ -2878,30 +2878,23 @@ int CCardIssuerFSM::ReadCard_Contact(SpReqAnsContext<CardIssuerStoreService_Read
|
|
|
}
|
|
|
else//未访问户口系统或户口系统访问失败或户口未告知介质类型(包括插反卡)
|
|
|
{
|
|
|
- int icRetryTimes = 0;
|
|
|
- while (1)
|
|
|
- {//for poor mag only card,we always retry...
|
|
|
- l_beginTime = RVCGetTickCount();
|
|
|
- bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
- l_endTime = RVCGetTickCount();
|
|
|
- if (!bIC)
|
|
|
- icRetryTimes++;
|
|
|
- else
|
|
|
- break;
|
|
|
- Sleep(500);
|
|
|
- if (icRetryTimes >= m_ICRetryTimes)
|
|
|
- break;
|
|
|
+
|
|
|
+ l_beginTime = RVCGetTickCount();
|
|
|
+ int retDetect = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
+ l_endTime = RVCGetTickCount();
|
|
|
+
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, retDetect:%d", retDetect);
|
|
|
+ if (retDetect == 0) {
|
|
|
+ bIC = true;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, bIC:%d", bIC);
|
|
|
- if (!bIC) {
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WCT")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, 0x2200000a, alarmMsg.GetData());
|
|
|
+ else {
|
|
|
+ bIC = false;
|
|
|
+ CSimpleStringA csDevApi("");
|
|
|
+ DWORD dwDevApi = 0;
|
|
|
+ GetDevApiCodeAndName(retDetect, dwDevApi, csDevApi);
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApi, csDevApi, __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
+
|
|
|
if (Error_Succeed == eMagReadErr && magTracks.track[1].eStatus == CI_DATA_OK)
|
|
|
{
|
|
|
if (bIC)
|
|
@@ -3159,30 +3152,24 @@ int CCardIssuerFSM::ReadCard_RF(SpReqAnsContext<CardIssuerStoreService_Read_Req,
|
|
|
}
|
|
|
else//未访问户口系统或户口系统访问失败(包括插反卡)
|
|
|
{
|
|
|
- int icRetryTimes = 0;
|
|
|
- while (1)
|
|
|
- {//for poor mag only card,we always retry...
|
|
|
- l_beginTime = RVCGetTickCount();
|
|
|
- bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, activeCardType);
|
|
|
- l_endTime = RVCGetTickCount();
|
|
|
- if (!bIC)
|
|
|
- icRetryTimes++;
|
|
|
- else
|
|
|
- break;
|
|
|
- Sleep(500);
|
|
|
- if (icRetryTimes >= m_ICRetryTimes)
|
|
|
- break;
|
|
|
+
|
|
|
+ l_beginTime = RVCGetTickCount();
|
|
|
+ int retDetect = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, activeCardType);
|
|
|
+ l_endTime = RVCGetTickCount();
|
|
|
+
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, retDetect:%d", retDetect);
|
|
|
+
|
|
|
+ if (retDetect == 0) {
|
|
|
+ bIC = true;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<ReadCard::DetectIfICCard>, bIC:%d", bIC);
|
|
|
- if (!bIC) {
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WC6")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, 0x22000017, alarmMsg.GetData());
|
|
|
+ else {
|
|
|
+ bIC = false;
|
|
|
+ CSimpleStringA csDevApi("");
|
|
|
+ DWORD dwDevApi = 0;
|
|
|
+ GetDevApiCodeAndName(retDetect, dwDevApi, csDevApi);
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApi, csDevApi, __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
+
|
|
|
if (!(bIC && activeCardType == 'A'))
|
|
|
bIC = false;
|
|
|
if (Error_Succeed == eMagReadErr && magTracks.track[1].eStatus == CI_DATA_OK)
|
|
@@ -3517,138 +3504,32 @@ 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);
|
|
|
- // }
|
|
|
- //}
|
|
|
- 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;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
|
|
|
- if (m_issueStatus)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("发卡时,检测卡片类型时上电失败");
|
|
|
- if (!IfUseRf())
|
|
|
- {
|
|
|
- const DWORD dwCode(CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed);
|
|
|
- if (IsInBusiness()) {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222020").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, dwCode, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- 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());
|
|
|
- }
|
|
|
- dwUserErrCode = dwCode;
|
|
|
- //ctx->Answer(Error_Unexpect, dwCode);
|
|
|
- }
|
|
|
- else {
|
|
|
- //使用非接兜底
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222020").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
|
|
|
- if (!IfUseRf())
|
|
|
- {
|
|
|
- if (IsInBusiness())
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222003").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- 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());
|
|
|
- }
|
|
|
- dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveICCard_Failed;
|
|
|
- //ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
|
|
|
- }
|
|
|
- else {
|
|
|
- //使用非接兜底
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222003").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- }
|
|
|
- }
|
|
|
+ //新的错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"InIssue\":%d}", m_issueStatus);
|
|
|
+ if (m_issueStatus) {
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_IssueEx;
|
|
|
}
|
|
|
- else if (retDetectAndRead == -2){
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
- if (!IfUseRf())
|
|
|
- {
|
|
|
- DWORD dwTmpUserErrCode = 0;
|
|
|
- if (m_issueStatus) {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- dwUserErrCode = dwTmpUserErrCode;
|
|
|
- //ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
- //使用非接兜底
|
|
|
- if (m_issueStatus) {
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- }
|
|
|
+ else {
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_Read;
|
|
|
}
|
|
|
- else if (retDetectAndRead == -3){
|
|
|
-
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
- if (!IfUseRf())
|
|
|
- {
|
|
|
- DWORD dwTmpUserErrCode = 0;
|
|
|
- if (m_issueStatus) {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- dwUserErrCode = dwTmpUserErrCode;
|
|
|
- //ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
- //使用非接兜底
|
|
|
- if (m_issueStatus) {
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
+ DWORD dwUserErrCode = 0;
|
|
|
+ if (IfUseRf()) {
|
|
|
+ bContinue = true; //继续后面的非接流程
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, false, l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
}
|
|
|
+ else {
|
|
|
+ dwUserErrCode = SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
|
|
|
- if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
|
|
|
- if (IfUseRf()) {
|
|
|
- bContinue = true; //继续后面的非接流程
|
|
|
- }
|
|
|
- else {
|
|
|
+ //非接不兜底需要移回卡槽
|
|
|
+ if (m_bCrossPreOnline) {
|
|
|
AfterPreOnlineOnStore(Error_Unexpect, slot);
|
|
|
}
|
|
|
- }
|
|
|
- if (!IfUseRf()){
|
|
|
+
|
|
|
ctx->Answer(Error_Unexpect, dwUserErrCode);
|
|
|
}
|
|
|
|
|
@@ -3967,85 +3848,24 @@ 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);//移回卡槽
|
|
|
- //}
|
|
|
|
|
|
+ //新错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"InIssue\":%d}", m_issueStatus);
|
|
|
|
|
|
- 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;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-
|
|
|
- if (m_issueStatus)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("发卡时检测卡片类型时上电失败(非接)");
|
|
|
- if (IsInBusiness())
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222020").setResultCode("RTA2W27")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- 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());
|
|
|
- }
|
|
|
- dwUserErrCode = CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed;
|
|
|
- //ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败(非接)");
|
|
|
- if (IsInBusiness())
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222003").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- 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());
|
|
|
- }
|
|
|
- dwUserErrCode = CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed;
|
|
|
- //ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);
|
|
|
- }
|
|
|
+ if (m_issueStatus) {
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_IssueEx;
|
|
|
}
|
|
|
- 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_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- dwUserErrCode = dwTmpUserErrCode;
|
|
|
- //ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
- }
|
|
|
- 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, "QLR040222020", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222003", "");
|
|
|
- }
|
|
|
- dwUserErrCode = dwTmpUserErrCode;
|
|
|
- //ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
+ else {
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_Read;
|
|
|
}
|
|
|
|
|
|
+ DWORD dwUserErrCode = SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
+
|
|
|
//非接兜底需要移回卡槽
|
|
|
- if ((m_csMachineType.Compare("RVC.CardStore") == 0 || m_csMachineType.Compare("RVC.CardPrinter") == 0) && m_bCrossPreOnline) {
|
|
|
+ if (m_bCrossPreOnline) {
|
|
|
AfterPreOnlineOnStore(Error_Unexpect, slot);//移回卡槽
|
|
|
}
|
|
|
|
|
@@ -4881,18 +4701,20 @@ bool CCardIssuerFSM::JustReadCardNo()
|
|
|
m_currCardNo = "";
|
|
|
bool bHasAccount = false;
|
|
|
int activeCardType;
|
|
|
+ bool bIC = false;
|
|
|
l_beginTime = RVCGetTickCount();
|
|
|
- bool bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
+ int retDetect = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
l_endTime = RVCGetTickCount();
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DetectIfICCard, bIC:%d, activeCardType:%d", bIC, activeCardType);
|
|
|
|
|
|
- if (bIC)
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DetectIfICCard, retDetect:%d, activeCardType:%d", retDetect, activeCardType);
|
|
|
+
|
|
|
+ if (retDetect == 0)
|
|
|
{
|
|
|
//oilyang@20201014 add emv support
|
|
|
- int bGetICData = m_pCardProcess->GetICDataFromCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, m_aidList);
|
|
|
- if(bGetICData != 0)
|
|
|
+ bool bGetICData = m_pCardProcess->GetICDataFromCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, m_aidList);
|
|
|
+ if(!bGetICData)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<JustReadCardNo::GetICDataFromCard> faile(%d)", bGetICData);
|
|
|
+ SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
ICData track2(false, 0x57, 0x00);
|
|
|
string t2ICAccount(""), t2ICCardSerial(""), t2ICCVC(""), t2ICTrack2(""), cardType;
|
|
@@ -4945,14 +4767,12 @@ bool CCardIssuerFSM::JustReadCardNo()
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WCT")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, 0x2200000a, alarmMsg.GetData());
|
|
|
+ CSimpleStringA csDevApi("");
|
|
|
+ DWORD dwDevApi = 0;
|
|
|
+ GetDevApiCodeAndName(retDetect, dwDevApi, csDevApi);
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApi, csDevApi, __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
+
|
|
|
if (!bHasAccount)
|
|
|
{
|
|
|
MagTracks magTracks;
|
|
@@ -8754,6 +8574,38 @@ int CCardIssuerFSM::ReadJS(SpReqAnsContext<CardIssuerStoreService_ReadJS_Req, Ca
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void CCardIssuerFSM::GetDevApiCodeAndName(int retValue, DWORD& dwDevApiCode, CSimpleStringA& csDevApiName)
|
|
|
+{
|
|
|
+ switch (retValue)
|
|
|
+ {
|
|
|
+ case -1:
|
|
|
+ dwDevApiCode = MEC_DEVAPI_CARDISSUER_ContactIC;
|
|
|
+ csDevApiName = "DevAdapter::ContactIC";
|
|
|
+ break;
|
|
|
+ case -2:
|
|
|
+ dwDevApiCode = MEC_DEVAPI_CARDISSUER_ActiveICCard;
|
|
|
+ csDevApiName = "DevAdapter::ActiveICCard";
|
|
|
+ break;
|
|
|
+ case -3:
|
|
|
+ dwDevApiCode = MEC_DEVAPI_CARDISSUER_ActiveContactlessICCard;
|
|
|
+ csDevApiName = "DevAdapter::ActiveContactlessICCard";
|
|
|
+ break;
|
|
|
+ case -4:
|
|
|
+ dwDevApiCode = MEC_DEVAPI_CARDISSUER_ICCommand;
|
|
|
+ csDevApiName = "DevAdapter::ICCommand";
|
|
|
+ break;
|
|
|
+ case -5:
|
|
|
+ dwDevApiCode = MEC_DEVAPI_CARDISSUER_RFTypeABCommand;
|
|
|
+ csDevApiName = "DevAdapter::RFTypeABCommand";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ dwDevApiCode = DEC_NO_E_CARDISSUER_START;
|
|
|
+ csDevApiName = "DevAdapter::SthWrong";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
DWORD CCardIssuerFSM::GetFsmStateErrCode()
|
|
|
{
|
|
|
int state = GetFSMState();
|
|
@@ -9080,30 +8932,21 @@ int CCardIssuerFSM::CheckCardType(CSimpleStringA cardNo, bool bReadMag, int& ICt
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType>, begin detect cardType");
|
|
|
//主动探测
|
|
|
int activeCardType;
|
|
|
- int icRetryTimes = 0;
|
|
|
bool bIC(false);
|
|
|
- while (1)
|
|
|
- {//for poor mag only card,we always retry...
|
|
|
- l_beginTime = RVCGetTickCount();
|
|
|
- bIC = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
- l_endTime = RVCGetTickCount();
|
|
|
- if (!bIC)
|
|
|
- icRetryTimes++;
|
|
|
- else
|
|
|
- break;
|
|
|
- Sleep(500);
|
|
|
- if (icRetryTimes >= m_ICRetryTimes)
|
|
|
- break;
|
|
|
+ l_beginTime = RVCGetTickCount();
|
|
|
+ int retDetect = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE, m_hDevHelper, activeCardType);
|
|
|
+ l_endTime = RVCGetTickCount();
|
|
|
+
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard>, retDetect:%d", retDetect);
|
|
|
+ if (retDetect == 0) {
|
|
|
+ bIC = true;
|
|
|
}
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard>, bIC:%d", bIC);
|
|
|
- if (!bIC) {
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WCT")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, 0x2200000a, alarmMsg.GetData());
|
|
|
+ else {
|
|
|
+ bIC = false;
|
|
|
+ CSimpleStringA csDevApi("");
|
|
|
+ DWORD dwDevApi = 0;
|
|
|
+ GetDevApiCodeAndName(retDetect, dwDevApi, csDevApi);
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApi, csDevApi, __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
|
|
|
//ic探测成功,0.无磁条IC 1.复合 2.磁条 3.纯IC
|
|
@@ -9167,28 +9010,20 @@ int CCardIssuerFSM::CheckCardType(CSimpleStringA cardNo, bool bReadMag, int& ICt
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(l_endTime - l_beginTime)("CheckCardType::MoveCard, (CI_MOVECARD_RF_POSITION)");
|
|
|
}
|
|
|
|
|
|
- icRetryTimes = 0;
|
|
|
+
|
|
|
bool bICRF(false);
|
|
|
- while (1)
|
|
|
- {//for poor mag only card,we always retry...
|
|
|
- bICRF = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, activeCardType);
|
|
|
- if (!bICRF)
|
|
|
- icRetryTimes++;
|
|
|
- else
|
|
|
- break;
|
|
|
- Sleep(500);
|
|
|
- if (icRetryTimes >= m_ICRetryTimes)
|
|
|
- break;
|
|
|
- }
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard_RF>, bIC:%d", bICRF);
|
|
|
- if (!bICRF) {
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setResultCode("RTA2WC6")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, 0x22000017, alarmMsg.GetData());
|
|
|
+
|
|
|
+ int retDetect = m_pCardProcess->DetectIfICCard(CARD_MACHINE_ISSUER_STORE_RF, m_hDevHelper, activeCardType);
|
|
|
+
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("<CheckCardType::DetectIfICCard_RF>, retDetect:%d", retDetect);
|
|
|
+ if(retDetect == 0) {
|
|
|
+ bICRF = true;
|
|
|
+ }else{
|
|
|
+ bICRF = false;
|
|
|
+ CSimpleStringA csDevApi("");
|
|
|
+ DWORD dwDevApi = 0;
|
|
|
+ GetDevApiCodeAndName(retDetect, dwDevApi, csDevApi);
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApi, csDevApi, __FUNCTION__, false, l_endTime - l_beginTime);
|
|
|
}
|
|
|
|
|
|
if (!(bICRF && activeCardType == 'A')) {
|
|
@@ -9301,74 +9136,24 @@ int CCardIssuerFSM::PreOnlineJS_Contact(SpReqAnsContext<CardIssuerStoreService_R
|
|
|
|
|
|
if (retDetectAndRead < 0)
|
|
|
{
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
|
|
|
+ //新的错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"InIssue\":%d}", m_issueStatus);//oiltmp
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_ReadJS;
|
|
|
+
|
|
|
+ DWORD dwUserErrCode = 0;
|
|
|
if (IfUseRf()) {
|
|
|
bContinue = true; //继续后面的非接流程
|
|
|
- if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-
|
|
|
- if (m_issueStatus) {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -2) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -3) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- }
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, false, l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
}
|
|
|
else {
|
|
|
- if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败");
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-
|
|
|
- if (m_issueStatus) {
|
|
|
- if (IsInBusiness()) {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0V")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveICCard_Failed);
|
|
|
- }
|
|
|
- else {
|
|
|
- if (IsInBusiness()) {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -2) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("读取IC数据失败");
|
|
|
- DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -3) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("IC卡建立应用列表失败");
|
|
|
- DWORD dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
- }
|
|
|
+ dwUserErrCode = SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
+ ctx->Answer(Error_Unexpect, dwUserErrCode);
|
|
|
}
|
|
|
+
|
|
|
bICOK = false;
|
|
|
return 0;//上电读卡失败
|
|
|
}
|
|
@@ -9684,67 +9469,17 @@ int CCardIssuerFSM::PreOnlineJS_RF(SpReqAnsContext<CardIssuerStoreService_ReadJS
|
|
|
|
|
|
if (retDetectAndRead < 0)
|
|
|
{
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
-
|
|
|
- if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("检测卡片类型时上电失败(非接)");
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-
|
|
|
- if (m_issueStatus) {
|
|
|
- if (IsInBusiness())
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W27")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_IssueCard_ActiveRF_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").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);
|
|
|
- }
|
|
|
- else {
|
|
|
- if (IsInBusiness())
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222040").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
|
|
|
- ctx->Answer(Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed);
|
|
|
- }
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -2) {
|
|
|
+ //新错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"InIssue\":%d}", m_issueStatus);//oiltmp
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_ReadJS;
|
|
|
|
|
|
- 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, "QLR040222040", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- }
|
|
|
- ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -3) {
|
|
|
+ DWORD dwUserErrCode = SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
+ ctx->Answer(Error_Unexpect, dwUserErrCode);
|
|
|
|
|
|
- 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, "QLR040222040", "");
|
|
|
- }
|
|
|
- else {
|
|
|
- dwTmpUserErrCode = SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_RFTypeABCommand, "DevAdapter::RFTypeABCommand", __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, "QLR040222040", "");
|
|
|
- }
|
|
|
- ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
- }
|
|
|
return 0;//上电读卡失败
|
|
|
}
|
|
|
|
|
@@ -10220,68 +9955,29 @@ int CCardIssuerFSM::PreOnlineCrossJS_Contact(SpReqAnsContext<CardIssuerStoreServ
|
|
|
|
|
|
if (retDetectAndRead < 0)
|
|
|
{
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
+ //新的错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"reqSlot\":%d}", slot);//oiltmp
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_PreOnlineCrossJS;
|
|
|
|
|
|
+ DWORD dwUserErrCode = 0;
|
|
|
if (IfUseRf()) {
|
|
|
bContinue = true; //继续后面的非接流程
|
|
|
- if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机检测卡片类型时上电失败,slot:%d",slot);
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
-
|
|
|
- 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());
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -2) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机读取IC数据失败,slot:%d", slot);
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222052", "");
|
|
|
- }
|
|
|
- else if (retDetectAndRead == -3) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机读取IC数据失败,slot:%d", slot);
|
|
|
- SetErrorAndLog(Error_Unexpect, MEC_DEVAPI_CARDISSUER_ICCommand, "DevAdapter::ICCommand", __FUNCTION__, false, l_endTime - l_beginTime, "QLR040222052", "");
|
|
|
- }
|
|
|
+ SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, false, l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
}
|
|
|
else {
|
|
|
- //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);
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
- if (IsInBusiness()) {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222052").setResultCode("RTA2W0M")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- 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());
|
|
|
- }
|
|
|
- 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);
|
|
|
- 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);
|
|
|
- dwUserErrCode = 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, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
|
|
|
CaptureResult = AfterPreOnlineCrossJS(slot, m_currCardNo);//执行移回操作
|
|
|
m_findCard = 4;
|
|
|
ctx->Ans.findCard = 4;
|
|
|
ctx->Ans.cardPos = m_cardPos;
|
|
|
|
|
|
- ctx->Answer(Error_Unexpect, dwUserErrCode);
|
|
|
+ ctx->Answer(Error_Unexpect, dwTmpUserErrCode);
|
|
|
}
|
|
|
+
|
|
|
bICOK = false;
|
|
|
return 0;//上电读卡失败
|
|
|
}
|
|
@@ -10591,42 +10287,16 @@ 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;
|
|
|
|
|
|
- ErrorCodeEnum eErrCode = Error_Unexpect;
|
|
|
- CSimpleStringA ApiName = "";
|
|
|
- CSimpleStringA alarmMsg = "";
|
|
|
- CSimpleStringA csErrMsgWithReturnCode = "";
|
|
|
+ //新错误返回
|
|
|
+ DWORD dwDevApiCode = 0;
|
|
|
+ CSimpleStringA csDevApiName(""), csLogCode("");
|
|
|
+ GetDevApiCodeAndName(retDetectAndRead, dwDevApiCode, csDevApiName);
|
|
|
+ CSimpleStringA csIssueContext = CSimpleStringA::Format("{\"reqSlot\":%d}", slot);//oiltmp
|
|
|
+ csLogCode = CardIssuerStoreService_LogCode_PreOnlineCrossJS;
|
|
|
|
|
|
- DWORD dwUserErrCode = 0;
|
|
|
- if (retDetectAndRead == -1) {
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("跨机非接检测卡片类型时上电失败,slot:%d", slot);
|
|
|
- GetCardProcessLastErr(eErrCode, ApiName, alarmMsg, csErrMsgWithReturnCode);
|
|
|
+ DWORD dwUserErrCode = SetErrorAndLog(Error_Unexpect, dwDevApiCode, csDevApiName, __FUNCTION__, IsInBusiness(), l_endTime - l_beginTime, csLogCode, csIssueContext);
|
|
|
|
|
|
- if (IsInBusiness()) {
|
|
|
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setAPI(ApiName.GetData()).setCostTime(l_endTime - l_beginTime).setLogCode("QLR040222052").setResultCode("RTA2W26")(csErrMsgWithReturnCode.GetData());
|
|
|
- LogError(Severity_Middle, Error_Unexpect, CardIssuerStore_UserErrorCode_ActiveContactlessICCard_Failed, alarmMsg.GetData());
|
|
|
- }
|
|
|
- else {
|
|
|
- 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());
|
|
|
- }
|
|
|
- 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);
|
|
|
- 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);
|
|
|
- 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;
|