Parcourir la source

!10300 st2合并到卡机下线pad分支
Merge pull request !10300 from 80174520/ST2

刘文涛80174520 il y a 1 an
Parent
commit
7fedd7f4d2

+ 0 - 1
Module/mod_CustMngrAuth/CMakeLists.txt

@@ -14,7 +14,6 @@ add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
 target_include_directories(${MODULE_NAME} PRIVATE
 	${RVC_COMMOM_INCLUDE_DIR}
 	${MODULE_BASE_DIR}/mod_FingerPrint
-	${MODULE_BASE_DIR}/mod_DeviceControl
 	${CONAN_INCLUDE_DIRS_JSONCPP}
 )
 

+ 29 - 101
Module/mod_CustMngrAuth/CustMngrAuthFSM.cpp

@@ -28,11 +28,11 @@ using namespace std;
 using std::string;
 #endif
 
-//const int UPDATE_INTERNAL = 10 * 60 * 1000;	//query data from branch server internal, 10min
-//const int CONNECT_INTERNAL = 10 * 60 * 1000;		//connect branch server internal, 10min
-//const int FINGER_NUM = 8;					//suuport max register finger num
+
+
+
 #define IMAGE_NUM 3
-//const int COLLECT_TIMES = 3;				//press finger times
+
 
 class CCustMngrAuthEntity;
 
@@ -715,11 +715,8 @@ ErrorCodeEnum CCustMngrAuthFSM::GetImgBlob(CBlob& data, CSimpleStringA imgPath)
 
 #pragma endregion
 
-#pragma region Save fingerprint process
 
 
-#pragma endregion
-
 #pragma region authorize process
 
 ErrorCodeEnum CCustMngrAuthFSM::MatchFingerPrintEx(SpReqAnsContext<CustMngrAuthService_QueryAuthorInfo_Req, CustMngrAuthService_QueryAuthorInfo_Ans>::Pointer ctx, bool& bStopAuthorize, DWORD& dwUserErrCode)
@@ -928,31 +925,31 @@ void CCustMngrAuthFSM::BroadcastGetFinger(int status)
 
 #pragma region invoked function
 
-ErrorCodeEnum CCustMngrAuthFSM::WaitForUkey(ErrorCodeEnum eErr)
-{
-	//与朱毅约定,4表示本地无指纹数据,3表示指纹仪实体异常(包括旧接口的其他错误码和新接口的Error_HardWare)
-	//4: no data in local, 3:enitty exception
-//	DbgInfo(CSimpleStringA::Format("WaitForUkey, eErr:%d(0x%x)", eErr, eErr));
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("WaitForUkey, eErr:%d(0x%x)", eErr, eErr);
-	int status = (eErr == Error_NoTarget) ? 4 : 3;
-	BroadcastGetFinger(status);
-	while (1) {
-#ifdef RVC_OS_WIN
-		Sleep(300);
-#else
-		SLEEP(300);
-#endif
-		if (m_bCancelAuthorize) {
-			m_bCancelAuthorize = false;
-			if (m_bAuthorizeTimeout){
-				m_bAuthorizeTimeout = false;
-				return Error_TimeOut;
-			}
-			else
-				return Error_Cancel;
-		}
-	}
-}
+//ErrorCodeEnum CCustMngrAuthFSM::WaitForUkey(ErrorCodeEnum eErr)
+//{
+//	//与朱毅约定,4表示本地无指纹数据,3表示指纹仪实体异常(包括旧接口的其他错误码和新接口的Error_HardWare)
+//	//4: no data in local, 3:enitty exception
+////	DbgInfo(CSimpleStringA::Format("WaitForUkey, eErr:%d(0x%x)", eErr, eErr));
+//	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("WaitForUkey, eErr:%d(0x%x)", eErr, eErr);
+//	int status = (eErr == Error_NoTarget) ? 4 : 3;
+//	BroadcastGetFinger(status);
+//	while (1) {
+//#ifdef RVC_OS_WIN
+//		Sleep(300);
+//#else
+//		SLEEP(300);
+//#endif
+//		if (m_bCancelAuthorize) {
+//			m_bCancelAuthorize = false;
+//			if (m_bAuthorizeTimeout){
+//				m_bAuthorizeTimeout = false;
+//				return Error_TimeOut;
+//			}
+//			else
+//				return Error_Cancel;
+//		}
+//	}
+//}
 
 void CCustMngrAuthFSM::CancelAuthorize()
 {
@@ -968,48 +965,7 @@ void CCustMngrAuthFSM::CancelCollect()
 		(*m_pFingerPrint)(EntityResource::getLink().upgradeLink())->CancelRegister();
 }
 
-ErrorCodeEnum CCustMngrAuthFSM::SwitchUSB(bool bOpen)
-{
-	LOG_FUNCTION();
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("connecting DeviceControl");
-	ErrorCodeEnum eErr;
-	//connect devicecontrol and open usb
-	m_pDeviceControl = new DeviceControlService_ClientBase(GetEntityBase());
-
-	if (m_pDeviceControl != NULL) {
-		eErr = m_pDeviceControl->Connect();
-		if (eErr != Error_Succeed) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("m_pDeviceControl connect failed with errCode %x0x", eErr);
-			m_pDeviceControl->SafeDelete();
-		}
-		else {
-			if (bOpen) {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Open USB");
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Close USB");
-			}
-			DeviceControlService_USB_Req usbReq;
-			DeviceControlService_USB_Ans usbAns;
-			usbReq.open = bOpen;//open or close usb
-			eErr = (*m_pDeviceControl)(EntityResource::getLink().upgradeLink())->USB(usbReq, usbAns, 2000);
-			if (eErr != Error_Succeed) {
-				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Open/Close usb failed.");
-			}
-			else {
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Open/Close usb success.");
-			}
-			m_pDeviceControl->GetFunction()->CloseSession();
-		}
-		m_pDeviceControl = NULL;
-		return eErr;
-	}
-	else {
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("DeviceControl is null.");
-		return Error_Unexpect;
-	}
-}
 
 #pragma endregion
 
@@ -1020,20 +976,6 @@ ErrorCodeEnum CCustMngrAuthFSM::SwitchUSB(bool bOpen)
 
 
 
-#pragma region update feature process
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 
@@ -1041,18 +983,4 @@ ErrorCodeEnum CCustMngrAuthFSM::SwitchUSB(bool bOpen)
 
 
 
-
-
-
-
-
-
-
-#pragma endregion
-
-
-
-
-
-
 

+ 3 - 56
Module/mod_CustMngrAuth/CustMngrAuthFSM.h

@@ -11,7 +11,6 @@
 #include "CustMngrAuth_msg_g.h"
 #include "json/json.h"
 #include "FingerPrint_client_g.h"
-#include "DeviceControl_client_g.h"
 #include "CommEntityUtil.hpp"
 
 using namespace CustMngrAuth;
@@ -19,44 +18,8 @@ using namespace CustMngrAuth;
 
 
 using namespace std;
-using namespace DeviceControl;
 using namespace FingerPrint;
 
-//下载特征库所调用的分行服务接口
-#pragma region 废弃的参数
-//废弃参数
-// [StructName("FETQYREQ")]
-struct FeatReq
-{
-	char TerminalID[16];
-	char BranchID[16];
-	char CurrentAgent[16];
-	char UpdateTime[20];
-};
-//废弃参数
-// [StructName("FETQYANS")]
-struct FeatReply
-{
-	int ResultCode;
-	char BranchID[16];
-	char CurrentAgent[16];
-	char Data[0];//no more than 45k
-};
-//废弃参数
-struct FeatureData
-{
-	CAutoArray<CSimpleStringA> FingerIDArray;
-	CAutoArray<int> FingerIDLenArray;
-};
-//废弃参数
-struct TemplateInfo
-{
-	CSimpleStringA CustomerID;
-	int TemplateNum;
-};
-
-#pragma endregion
-
 
 enum EvtType{
 	USER_EVT_TEST = EVT_USER + 1,
@@ -494,7 +457,7 @@ public:
 		FSM_RULE_ENTRY(s5, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
 	END_FSM_RULE()
 
-	CCustMngrAuthFSM():m_pFingerPrint(NULL), m_pDeviceControl(NULL), m_bCancelCollectFP(false)
+	CCustMngrAuthFSM():m_pFingerPrint(NULL),  m_bCancelCollectFP(false)
 	, m_bCancelAuthorize(false), m_bAuthorizeTimeout(false) {
 		hStopUpdate = ::CreateEventA(NULL, TRUE, FALSE, NULL);
 		m_TimeLimit = 55;//默认授权超时秒数
@@ -554,8 +517,7 @@ public:
 
 	ErrorCodeEnum OpenRunInfoFile();//Initial使用
 
-	ErrorCodeEnum WaitForUkey(ErrorCodeEnum eErr);//未使用,废弃
-	ErrorCodeEnum SwitchUSB(bool bOpen);//未使用,废弃
+	//ErrorCodeEnum WaitForUkey(ErrorCodeEnum eErr);//未使用,废弃
 #pragma region 废弃的方法
 
 
@@ -567,7 +529,7 @@ public:
 #pragma endregion
 
 private:
-	DeviceControlService_ClientBase *m_pDeviceControl;
+	
 	FingerPrintService_ClientBase *m_pFingerPrint;
 
 
@@ -577,13 +539,10 @@ private:
 
 	bool m_bCancelCollectFP, m_bCancelAuthorize, m_bAuthorizeTimeout;
 	int m_TimeLimit;
-	map<CSimpleStringA, FeatureData*> m_featureData;
 
 	CRITICAL_SECTION m_cs;//临界区变量
 };
-#pragma region 废弃的结构
 
-#pragma endregion
 
 //初始化:检查、配置路径、起特征更新任务(使用)
 struct InitTask : public ITaskSp
@@ -673,18 +632,6 @@ struct GenerateTemplateTask : public ITaskSp
 };
 
 #pragma region 废弃的结构
-//特征定期更新(废弃)
-struct FeatureUpdateTask : public ITaskSp
-{
-	CCustMngrAuthFSM* fsm;
-	FeatureUpdateTask(CCustMngrAuthFSM* f) : fsm(f) {}
-
-	void Process()
-	{
-		LOG_FUNCTION();
-		//fsm->FeatureUpdate();
-	}
-};
 
 //因StartAuthorize不使用(废弃)
 struct MatchFingerPrintTask : public ITaskSp

+ 0 - 23
Module/mod_FingerPrint/FingerPrintFSM.cpp

@@ -332,7 +332,6 @@ int CFingerPrintFSM::Initial()
 		return 2;
 	}
 
-	spConfig->ReadConfigValue("Device.PinPad", "Version", m_version);
 
 	//TODO:device init
 	int initCount = 0;
@@ -362,28 +361,6 @@ int CFingerPrintFSM::Initial()
 					strVersion = "7";
 					//TODO: Support new or old edition machine.
 				}
-				//else if (!m_csMachineType.Compare("RVC.PAD", true)) {
-				//	if (isFWB) {//蓝牙多合一
-				//		GetEntityBase()->GetFunction()->GetSysVar("FWBVendor", strVendor);
-				//		strVersion = "8";
-				//	}
-				//	else if ((!strVendor.Compare("Nantian", true) || !strVendor.Compare("grg", true) || !strVendor.Compare("Yihua", true))
-				//		&& !strVersion.Compare("4", true)) {
-				//		strVersion = "4";
-				//	}
-				//	else
-				//		strVersion = "1";
-				//}
-				else if (!m_csMachineType.Compare("RVC.Desk2S", true)) {
-					strVersion = "4";
-					if (m_machineVersion.Compare("1.0", true)) {//低柜一体机(贵宾理财2.0&非贵宾理财2.1)
-						strBatch = "20";
-					}
-				}
-				else if (!m_csMachineType.Compare("RVC.Desk1S", true) && !m_machineVersion.Compare("1.0", true)) {//低柜一体机(厅堂自助)
-					strVersion = "4";
-					strBatch = "20";
-				}
 				else if (!m_csMachineType.Compare("RVC.CardStore", true)) {
 					strVersion = "5";
 				}

+ 4 - 10
Module/mod_FingerPrint/FingerPrintFSM.h

@@ -235,7 +235,7 @@ public:
 
 	CFingerPrintFSM():m_bCancelRegister(false), m_bCancelMatch(false), m_bExit(false),
 					  m_testResult(Error_Succeed), m_csDevSN(""), m_iInWhatPage(PageType_Other),
-					  m_csMachineType(""), m_terminalNo(""),m_fwbSN(""), m_version(""), m_machineVersion("")
+					  m_csMachineType(""), m_terminalNo(""), m_machineVersion("")
 					{	
 						HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x204); 
 					}
@@ -269,12 +269,11 @@ public:
 	void DeleteBmp(int type);
 	ErrorCodeEnum DeleteFileIfExisted(const char* fileName);
 
-	ErrorCodeEnum GetDevCatInfo(DevCategoryInfo& devInfo);//废弃
-	ErrorCodeEnum GetDevState(int &state);//废弃
+	ErrorCodeEnum GetDevCatInfo(DevCategoryInfo& devInfo);
+	ErrorCodeEnum GetDevState(int &state);
 
 	int Initial();
 	bool GetDevInitFlag() { return m_bOpened; }
-	void ResetDevInitFlag() { m_bOpened = false; }//蓝牙多合一使用
 	void SetInWhatPage(int bValue) { m_iInWhatPage = bValue; }
 
 	DevStateEnum GetDevState(){
@@ -293,12 +292,7 @@ private:
 	bool m_bExit;
 	int m_iInWhatPage/*在哪个页面,区分首页,用户桌面,其他页*/;
 
-	CSimpleStringA m_csDevSN;//蓝牙多合一设备sn
-
-	CSimpleStringA m_csMachineType,m_terminalNo;//site,terminalNo只是临时使用,可以去除
-	CSimpleStringA m_fwbSN;//FWBDevSN值
-	CSimpleStringA m_version;//蓝牙多合一pinpad版本
-	CSimpleStringA m_machineVersion;//终端大版本
+	CSimpleStringA m_csDevSN, m_csMachineType, m_terminalNo, m_machineVersion;
 };
 //废弃
 struct ScanTask : public ITaskSp   

+ 0 - 4
Module/mod_FingerPrint/mod_FingerPrint.cpp

@@ -100,10 +100,6 @@ void CFingerPrintEntity::OnSysVarEvent(const char *pszKey,
 			m_fsm.SetInWhatPage(PageType_Other);
 		}
 	}
-	else if (_strnicmp(pszValue, "D", strlen("D")) == 0 )
-	{
-		m_fsm.ResetDevInitFlag();
-	}
 #endif	
 }
 

+ 1 - 0
Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

@@ -3460,6 +3460,7 @@ void CUpgradeTaskFSM::SendUpgradeTaskProgress(CTaskProcess &process)
 
 	if(!upgradeStr.empty()){
 		LogWarn(Severity_Low,Error_Succeed,LOG_WRAN_UPGRADE_PROGRESS,upgradeStr.c_str());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("SendUpgradeTaskProgress")(upgradeStr.c_str());
 	}else{
 		LogError(Severity_Middle,Error_Unexpect,ERR_WRAN_UPGRADE_PROGRESS,"获取升级过程信息错误");
 	}

+ 3 - 3
Module/mod_alarm/AlarmFSM.cpp

@@ -17,8 +17,8 @@ namespace Task
 			while(true){
 
 				if(m_fsm->m_NewUploading_alarm.empty()&&m_fsm->m_unSendAlarm.IsNullOrEmpty()){
-					if(logSum>=120){
-						DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("no warn,wait 6min");
+					if(logSum>=1200){
+						DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("no warn,wait 1 hour");
 						logSum=0;
 					}else{
 						logSum++;
@@ -112,7 +112,7 @@ namespace Task
 
 			bool isSucc = rootRet["success"].asBool();
 			if(isSucc){
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SendAlarmTaskImpl")("SendAlarmTask [success] is succ,m_eachSum=%d",m_fsm->m_eachSum);
+				//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SendAlarmTaskImpl")("SendAlarmTask [success] is succ,m_eachSum=%d",m_fsm->m_eachSum);
 				m_fsm->m_unSendAlarm="";//置为空
 				m_fsm->m_iSucc = m_fsm->m_iSucc+ m_fsm->m_eachSum ;//发送成功
 				m_fsm->m_eachSum = 0;//清空批次数量

+ 7 - 3
Module/mod_upload/UploadFSM.cpp

@@ -727,11 +727,15 @@ void UploadFSM::OnStateTrans( int iSrcState, int iDstState )
 
 void UploadFSM::OnSysVarEvent( const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName )
 {
-	DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
+	//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
 	if (pszValue[0] == 'O') {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
 		m_isOffLine = true;
 		PostEventFIFO(new FSMEvent(USER_EVT_JMP_ENABLE));
 	} else {
+		if (m_isOffLine) {
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
+		}
 		m_isOffLine = false;
 		PostEventFIFO(new FSMEvent(USER_EVT_JMP_DISABLE));
 	}
@@ -1018,7 +1022,7 @@ unsigned int UploadFSM::s2_on_event(FSMEvent* event)
 
 		//上传模式确定
 		if(m_centerModel == (int)centerModel){
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("centerModel");
+			//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("centerModel");
 			//防止url无效,新模式直接停止上传,等待下一次
 			if(m_centerUrl.addUploadFailUrl.empty()||m_centerUrl.queryPlanUrl.empty()||
 				m_centerUrl.queryTempFileUrl.empty()||m_centerUrl.updateStateUrl.empty()){
@@ -1050,7 +1054,7 @@ unsigned int UploadFSM::s2_on_event(FSMEvent* event)
 		}
 		
 	}else if (event->iEvt == USER_EVT_JMP_NEW_SCAN) {
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("enter new model upload");
+		//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("enter new model upload");
 		//新模式
 		if (m_uploadList->size() == 0) {
 			//重新扫描文件