ソースを参照

Z991239-6492 #comment feat:去掉卡机公共库多余的日志记录;完善数据

oilyang 3 週間 前
コミット
5ff80fdc56

+ 3 - 27
DevAdapter/include/CardAssist.cpp

@@ -705,9 +705,6 @@ ErrorCodeEnum CCardProcess::BuildSupportedAppList(CardReadType eType,DeviceBaseC
 						{
 							//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("BuildSupportedAppList::RFTypeABCommand err=%s", SpStrError(eErr));
 						}
-						QueryLastErr(eType, errMsg);
-						errMsg = CSimpleStringA::Format("BuildSupportedAppList::ICCommand 2 failed(%d):%s", eErr, errMsg.GetData());
-						LogWarn(Severity_Middle, Error_Unexpect, errICCommand, errMsg.GetData());
 						return Error_Interact;
 					}
 				}while(!bNoMoreRec);
@@ -775,11 +772,6 @@ ErrorCodeEnum CCardProcess::BuildSupportedAppList(CardReadType eType,DeviceBaseC
 		{
 			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("BuildSupportedAppList::RFTypeABCommand err=%s", SpStrError(eErr));
 		}
-
-		QueryLastErr(eType, errMsg);
-		errMsg = CSimpleStringA::Format("BuildSupportedAppList::ICCommand failed(%d):%s", eErr, errMsg.GetData());
-		LogWarn(Severity_Middle, Error_Unexpect, errICCommand, errMsg.GetData());
-
 		delete[] recvBuf;
 		return Error_Interact;
 	}
@@ -970,9 +962,6 @@ Step7:
 			{
 				//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("BuildAppListByAIDs::RFTypeABCommand err=%s", SpStrError(eErr));
 			}
-			CSimpleStringA errMsg("");
-			QueryLastErr(eType, errMsg);
-			DbgWarn(CSimpleStringA::Format("<BuildAppListByAIDs>, ICCommand failed with errCode:%d(0x%x), errMsg:%s", eErr, eErr, errMsg.GetData()));
 			return Error_Interact;
 		}
 	}
@@ -1285,9 +1274,6 @@ ErrorCodeEnum CCardProcess::ReadData(CardReadType eType,DeviceBaseClass *pCardX,
 				{
 					//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("ReadData::RFTypeABCommand err=%s", SpStrError(eErr));
 				}
-				CSimpleStringA errMsg("");
-				QueryLastErr(eType, errMsg);
-				DbgWarn(CSimpleStringA::Format("<ReadData>, ICCommand failed with errCode:%d(0x%x), errMsg:%s", eErr, eErr, errMsg.GetData()));
 				return Error_Interact;
 			}
 		}
@@ -1500,9 +1486,6 @@ void CCardProcess::ProcessDDFRecord(CardReadType eType,DeviceBaseClass *pCardX,v
 						{
 							//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("ProcessDDFRecord::RFTypeABCommand err=%s", SpStrError(eErr));
 						}
-						CSimpleStringA errMsg("");
-						QueryLastErr(eType, errMsg);
-						DbgWarn(CSimpleStringA::Format("<ProcessADFRecord>, ICCommand 2 failed with errCode:%d(0x%x), errMsg:%s", eErr, eErr, errMsg.GetData()));
 						break;
 					}
 				}while(!bNoMoreRec);
@@ -1530,10 +1513,6 @@ void CCardProcess::ProcessDDFRecord(CardReadType eType,DeviceBaseClass *pCardX,v
 		{
 			//DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::RFTypeABCommand").setCostTime(l_endTime - l_beginTime).setResultCode("RTA2J02")("ProcessDDFRecord::RFTypeABCommand err=%s", SpStrError(eErr));
 		}
-
-		CSimpleStringA errMsg("");
-		QueryLastErr(eType, errMsg);
-		DbgWarn(CSimpleStringA::Format("<ProcessADFRecord>, ICCommand failed with errCode:%d(0x%x), errMsg:%s", eErr, eErr, errMsg.GetData()));
 	}
 	delete[] recvBuf;
 	delete[] show;
@@ -2322,10 +2301,8 @@ void CCardProcess::ExecuteIssuerScript(CardReadType eType,DeviceBaseClass *pCard
 			}
 			else
 			{
-				CSimpleStringA errMsg;
-				QueryLastErr(eType, errMsg);
-				DbgWarn(CSimpleStringA::Format("<ExecuteIssuerScript>, Execute script command error [%d][%d].errCode:%d, errMsg:%s",
-						cmdRecv.data[cmdRecv.dwSize-2],cmdRecv.data[cmdRecv.dwSize-1], eErr, errMsg.GetData()));
+				DbgInfo(CSimpleStringA::Format("<ExecuteIssuerScript>, Execute script command error [%d][%d].errCode:%d",
+						cmdRecv.data[cmdRecv.dwSize-2],cmdRecv.data[cmdRecv.dwSize-1], eErr));
 			}
 			i += cmdLen;
 		}
@@ -2643,8 +2620,7 @@ bool CCardProcess::GetICDataFromCard(CardReadType eType,DeviceBaseClass *pCardX,
 
 		if (eErr != Error_Succeed)
 		{
-			QueryLastErr(eType, errMsg);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("BuildSupportedAppList failed(%d):%s.", eErr, errMsg.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("BuildSupportedAppList failed(%d):%s.", eErr);
 			if(eErr == Error_Interact)
 				return false;
 			else

+ 0 - 23
DevAdapter/include/CardAssist.h

@@ -104,29 +104,6 @@ public:
 	bool FillCDOL(ICData& cdol,PBYTE &pBYTE,DWORD &lenPDOL);
 	void ConstructAPDU(BYTE cls,BYTE ins,BYTE p1,BYTE p2,BYTE lc,LPBYTE data,LPBYTE le);
 	BYTE GetP1(){return m_P1;}
-	void QueryLastErr(CardReadType carReadType, CSimpleStringA& errMsg)
-	{
-		DevErrorInfo devErrInfo;
-		memset(&devErrInfo, 0, sizeof(devErrInfo));
-		if (carReadType == CARD_MACHINE_ISSUER || carReadType == CARD_MACHINE_ISSUER_RF || carReadType == CARD_MACHINE_ISSUER_STORE || carReadType == CARD_MACHINE_ISSUER_STORE_RF){
-			pCardI->GetLastErr(devErrInfo);
-		}
-		else if (carReadType == CARD_MACHINE_RFIC) {
-			pCardR->GetLastErr(devErrInfo);
-		}
-		errMsg = devErrInfo.szErrMsg;
-	}
-	void setCardAssistLastErr(ErrorCodeEnum eErr,CSimpleStringA errMsg,CSimpleStringA lastApiName)
-	{
-		m_lastErrCode = eErr;
-		m_lastErrMsg = errMsg;
-		m_lastApiName = lastApiName;
-	}
-	void getCardAssistLastErr(ErrorCodeEnum &eErrCode, CSimpleStringA &errMsg,CSimpleStringA &lastApiName) {
-		eErrCode = m_lastErrCode;
-		errMsg = m_lastErrMsg;
-		lastApiName = m_lastApiName;
-	}
 	CSimpleStringA m_lastErrMsg;
 	ErrorCodeEnum m_lastErrCode;
 	CSimpleStringA m_lastApiName;

+ 1 - 1
Module/mod_CardIssuerStand/CardIssuerStandFSM.cpp

@@ -4579,7 +4579,7 @@ int CCardIssuerFSM::PreOnlineJS_ReadViaRF(SpReqAnsContext<CardIssuerStandService
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::MoveCard").setCostTime(m_ullEndTime - m_ullBeginTime)("PreOnlineJS_RF::MoveCard, (CI_MOVECARD_RF_POSITION)");
 	}
 	else {
-		DWORD dwTmpUserErrCode = SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, false, m_ullEndTime - m_ullBeginTime, "QLR040220340");
+		DWORD dwTmpUserErrCode = SetErrorAndLog(eErr, MEC_DEVAPI_CARDISSUER_MoveCard, "DevAdapter::MoveCard", __FUNCTION__, !bContinue && IsInBusiness(), m_ullEndTime - m_ullBeginTime, "QLR040220340");
 		ctx->Ans.icMsg = GetErrMsgByCode(dwTmpUserErrCode);
 		if (bContinue)
 			return -1;

+ 0 - 33
Module/mod_cardissuerstore/CardIssuerStoreFSM.cpp

@@ -6994,39 +6994,6 @@ CSimpleStringA CCardIssuerFSM::generateJsonString(std::map<std::string, JsonElem
 	return CSimpleStringA(csRet);
 }
 
-void CCardIssuerFSM::GetCardProcessLastErr(ErrorCodeEnum& eErrCode, CSimpleStringA& ApiName, CSimpleStringA& alarmMsg, CSimpleStringA& csErrMsgWithReturnCode)
-{
-	if (m_pCardProcess == NULL) {
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("GetCardProcessLastErr m_pCardProcess is null");
-		eErrCode = Error_Null;
-		ApiName = "";
-		alarmMsg = "";
-		csErrMsgWithReturnCode = "";
-		return;
-	}
-	
-	ErrorCodeEnum lastErrCode = Error_Succeed;
-	CSimpleStringA lastErrMsg = "";
-	CSimpleStringA lastApiName = "";
-	m_pCardProcess->getCardAssistLastErr(lastErrCode, lastErrMsg, lastApiName);
-	
-	const CSimpleStringA alarmMsgStr = CSimpleStringA::Format("{\"Function\":\"%s\", \"DevApi\":\"%s\", \"ReturnCode\":\"%s\", \"Msg\":\"%s\", \"Context\":\"%s\"}"
-		, __FUNCTION__, lastApiName.GetData(), SpStrError(lastErrCode), lastErrMsg.GetData(), "");
-
-	std::map<std::string, std::string> msgInfo;
-	msgInfo["ReturnCode"] = SpStrError(lastErrCode);
-	msgInfo["ErrMsg"] = lastErrMsg.GetData();
-	msgInfo["Context"] = "";
-	std::pair<bool, std::string> strResult;
-	strResult = generateJsonStr(msgInfo);
-	CSimpleStringA csErrMsgWithReturnCodeStr = strResult.second.c_str();
-	
-	eErrCode = lastErrCode;
-	ApiName = lastApiName;
-	alarmMsg = alarmMsgStr.GetData();
-	csErrMsgWithReturnCode = csErrMsgWithReturnCodeStr.GetData();
-}
-
 //js实现
 int CCardIssuerFSM::EjectJS(SpReqAnsContext<CardIssuerStoreService_EjectJS_Req, CardIssuerStoreService_EjectJS_Ans>::Pointer ctx)
 {

+ 0 - 1
Module/mod_cardissuerstore/CardIssuerStoreFSM.h

@@ -1422,7 +1422,6 @@ private:
 		return (m_bCrossPreOnline || m_iInWhatPage == PageType_Other);
 	}
 
-	void GetCardProcessLastErr(ErrorCodeEnum& eErrCode, CSimpleStringA& lastApiName,CSimpleStringA& alarmMsg,CSimpleStringA& csErrMsgWithReturnCode);
 
 #pragma region JS接口具体实现方法
 public:

+ 2 - 1
Module/mod_pinpad/PinPadFSM.cpp

@@ -1119,7 +1119,6 @@ int CPinPadFSM::EncryptSM(SpReqAnsContext<PinPadService_EncryptDataSM_Req, PinPa
 	ErrorCodeEnum eErr = m_hDevHelper->ActiveWorkingKey(1, 1);
 	m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
 		
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode(PinPadService_LogCode_EncryptDataSM).setCostTime(m_ullEndTime - m_ullBeginTime)("%s", SpStrError(eErr));
 	if (eErr != Error_Succeed)
 	{
 		DWORD dwUserCode = SetErrorAndLog(eErr, MEC_DEVAPI_EPP_ActiveWorkingKey, "DevAdapter::ActiveWorkingKey", __FUNCTION__, IsInBusiness(), m_ullEndTime - m_ullBeginTime);
@@ -1130,6 +1129,8 @@ int CPinPadFSM::EncryptSM(SpReqAnsContext<PinPadService_EncryptDataSM_Req, PinPa
 		m_bEncrypt = false;
 		return 0;
 	}
+	else
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI("DevAdapter::ActiveWorkingKey").setCostTime(m_ullEndTime - m_ullBeginTime)();
 	DbgToBeidou(ctx->link, "ActiveWorkingKey")();
 	EnDecryptInfo srcData, dstData;
 	ZeroMemory(srcData.data, MAX_EN_DECRYPT_DATA_SIZE);