Przeglądaj źródła

Merge branch 'dev_ver_sync' into uat

gifur 2 lat temu
rodzic
commit
7c30460d1c

+ 2 - 0
Module/mod_ContactlessCard/ContactlessCard_UserErrorCode.h

@@ -31,4 +31,6 @@
 //实际root配置
 #define ContactlessCard_UserErrorCode_Real_Root_Config						(ContactlessCard_UserErrorCode_Start + 36)	//实际root配置
 
+#define ContactlessCard_UserErrorCode_AccoutInfo							(ContactlessCard_UserErrorCode_Start + 40)	//卡号(脱敏后)
+
 #endif //_CONTACTLESSCARD_USER_ERRORCODE_H

+ 3 - 0
Module/mod_ContactlessCard/ContactlessFSM.cpp

@@ -964,6 +964,9 @@ int CContactlessCardFSM::AcceptCard(SpReqAnsContext<ContactlessCardService_Inser
 				t2ICTrack2 = pICTrack2;
 				t2ICAccount = (char*)ddd;//oiltest
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("split pos:%d, card acount:%s,%s", pos, t2ICAccount.substr(0, 6).c_str(), t2ICAccount.substr(t2ICAccount.length() - 4, 4).c_str());
+				LogWarn(Severity_Low, Error_Succeed, ContactlessCard_UserErrorCode_AccoutInfo,
+					CSimpleStringA::Format("card acount:%s****%s", t2ICAccount.substr(0, 6).c_str(), t2ICAccount.substr(t2ICAccount.length() - 4, 4).c_str()));
+				
 				ctx->Ans.ICData = ctx->Ans.t2Account = t2ICAccount.c_str();
 				ctx->Ans.ICType = 4;
 				ctx->Ans.status = 0;

+ 11 - 41
Module/mod_heartbeat/HeartBeatFSM.cpp

@@ -38,40 +38,7 @@ const char * ProcessTimeQuery	= "\\Processor Information(_Total)\\% Processor Ti
 #define MINUS_DIV (60)
 
 // End Performance Component [Josephus in 9:32:05 2016/4/23]
-//oiltmp need to move together?
-int StrBuf2HexBuf(LPCTSTR strBuf, PBYTE* hexBuf)
-{
-	int len = strlen(strBuf);
-	if (len == 0 || len % 2 != 0)
-		return 0;
-	BYTE* buf = new BYTE[len / 2];
-	if (buf == NULL)
-		return 0;
-	int j = 0;
-	for (int i = 0; i < len;)
-	{
-		int tmpVal;
-		sscanf(strBuf + i, "%2X", &tmpVal);
-		buf[j] = tmpVal;
-		//buf[j] = char2int(strBuf[i])*16 + char2int(strBuf[i+1]);
-		i += 2;
-		j++;
-	}
-	//memcpy(buf,strBuf,len);
-	*hexBuf = buf;
-	return j;
-}
-int HexBuf2StrBuf(PBYTE hexBuf, char** strBuf, DWORD len)
-{
-	char* tmpStr = *strBuf;
-	int count = 0;
-	for (int i = 0; i < len; ++i)
-	{
-		sprintf(tmpStr + count, "%0.2X", hexBuf[i]);
-		count += 2;
-	}
-	return count;
-}
+
 ErrorCodeEnum CHeartBeatFSM::OnInit()
 {
 	LOG_FUNCTION();
@@ -713,12 +680,12 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
 	CardReadAdapterService_ClientBase *pCardReadAdapterClient = NULL;
 	ErrorCodeEnum eErr = Error_Unexpect;
 	pCardReadAdapterClient = new CardReadAdapterService_ClientBase(GetEntityBase());
-	if (pCardReadAdapterClient != NULL)
-		eErr = pCardReadAdapterClient->Connect();
-	if (pCardReadAdapterClient == NULL || eErr != Error_Succeed)
+	eErr = pCardReadAdapterClient->Connect();
+	if (eErr != Error_Succeed)
 	{
 		CSimpleStringA errMsg = CSimpleStringA::Format("LocalPreOnline, pGuiConsoleClient is null or connect CardReadAdapter failed:%d(0x%x)", eErr, eErr);
 		LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardReader_Failed, errMsg.GetData());
+		pCardReadAdapterClient->SafeDelete();
 		return;
 	}
 	CardReadAdapterService_PreOnline_Req req;
@@ -742,6 +709,7 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
 		if (eErr == Error_Duplication)
 		{
 			ReceivePreOnlineBack(Error_Duplication, "", 0, 0);
+			pCardReadAdapterClient->GetFunction()->CloseSession();
 			return;
 		}
 		LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_Connect_CardStore_Invoke_PreOnline_Falied, outParam.GetData());
@@ -762,17 +730,19 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
 		m_pHandShakeConn->SendCardActive(1,slot,eErr, (const char*)termNo, (const char*)account,
 			account.GetLength(), (const char*)ans.result, ans.result.GetLength(),ansX.findCard,ansX.cardPos);
 	}
+	pCardReadAdapterClient->GetFunction()->CloseSession();
 }
 void CHeartBeatFSM::ReceivePreOnlineBack(unsigned long errCode,CSimpleStringA data, unsigned long findCard, unsigned long cardPos)
 {
+	LOG_FUNCTION();
 	CardIssuerService_ClientBase *pCardIssuerClient = NULL;
 	ErrorCodeEnum eErr = Error_Unexpect;
 	pCardIssuerClient = new CardIssuerService_ClientBase(GetEntityBase());
-	if (pCardIssuerClient != NULL)
-		eErr = pCardIssuerClient->Connect();
-	if (pCardIssuerClient == NULL || eErr != Error_Succeed)
+	eErr = pCardIssuerClient->Connect();	
+	if (eErr != Error_Succeed)
 	{
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("pGuiConsoleClient is null or connect to cardissuer failed.%d", eErr);
+		pCardIssuerClient->SafeDelete();
 		return;
 	}
 	CardIssuerService_NotifyPreonline_Req req;
@@ -783,6 +753,7 @@ void CHeartBeatFSM::ReceivePreOnlineBack(unsigned long errCode,CSimpleStringA da
 	req.errCode = errCode;
 	eErr = pCardIssuerClient->NotifyPreonline(req, ans, 10000);
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("NotifyPreonline ret:%d",eErr);
+	pCardIssuerClient->GetFunction()->CloseSession();
 }
 int CHeartBeatFSM::CrossTermCall(SpReqAnsContext<HeartBeatService_CrossTermCall_Req, HeartBeatService_CrossTermCall_Ans>::Pointer ctx)
 {
@@ -1877,7 +1848,6 @@ void CHeartBeatFSM::ProcessPreOnline(CardActiveReq* req)
 		LocalPreOnline(req->slot, req->TerminalNo, req->FromTerminalNo, req->Account, req->Param2);
 	else if (req->type == 1)
 		ReceivePreOnlineBack(req->ErrCode, req->Param2, req->findCard, req->cardPos);
-	delete req;
 }
 
 void HeartBeatConnection::PkgRcvProcCardActive(const CSmartPointer<IPackage> &pRecvPkg)

+ 4 - 0
Module/mod_pinpad/PinPadFSM.cpp

@@ -968,7 +968,11 @@ Err:
 	PinBlock pinBlk;
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("to getpinblk");
 	Sleep(500);//nantian
+	ULLINT l_beginTime = GetTickCount();//oiltmp
 	errCode = m_hDevHelper->GetPinBlock(pinBlk);
+	ULLINT l_endTime = GetTickCount();//oiltmp
+	LogWarn(Severity_Low, Error_Succeed, PinPad_UserErrorCode_PinPad_GetPinBlock_Call
+		, CSimpleStringA::Format("{\"cost\":%d}", l_endTime - l_beginTime));
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("getpinblock(%d),size:%d",errCode,pinBlk.dwSize);
 	if (errCode == Error_Succeed)
 	{