Răsfoiți Sursa

Z991239-3374 #comment other: 身份证日志&告警

翟俊伟80258120 3 ani în urmă
părinte
comite
a246deee52

+ 1 - 0
Module/mod_FingerPrint/CMakeLists.txt

@@ -15,6 +15,7 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${DevHeadPath}
 	${MODULE_BASE_DIR}/mod_cardswiper
 	${MODULE_BASE_DIR}/mod_BootManager
+	${RVC_OTHER_DEPENDENIES_DIR}/libpublicFun
 )
 
 # 添加实体需要依赖的其他共享库(包括系统库)

+ 3 - 1
Module/mod_IDCertificate/CMakeLists.txt

@@ -20,6 +20,7 @@ target_include_directories(${MODULE_NAME} PRIVATE
 	${CONAN_INCLUDE_DIRS_OPENCV}/opencv2/imgcodecs
 	${MODULE_BASE_DIR}
 	${OTHER_LIB_BASE_DIR}/libimageproc
+	${RVC_OTHER_DEPENDENIES_DIR}/libpublicFun
 )
 
 target_link_directories(${MODULE_NAME} PRIVATE ${CONAN_BIN_DIRS_OPENCV})
@@ -59,12 +60,13 @@ else()
 endif(RVC_DEBUG_MODE)
 
 # 添加实体需要依赖的其他共享库(包括系统库)
+set(${MODULE_PREFIX}_SYSLIBS libpublicFun)
 set(${MODULE_PREFIX}_LIBS ${MODULE_BASE_ALL_LIBS} ${OPENCV_DYNAMIC_LIBS})
 if(MSVC)
 	set(${MODULE_PREFIX}_LIBS ${MODULE_PREFIX}_LIBS user32)
 endif(MSVC)
 
-target_link_libraries(${MODULE_NAME} libimageproc ${${MODULE_PREFIX}_LIBS})
+target_link_libraries(${MODULE_NAME} libimageproc ${${MODULE_PREFIX}_LIBS} ${${MODULE_PREFIX}_SYSLIBS})
 
 deploy_module(${MODULE_PREFIX} ${MODULE_NAME})
 

+ 153 - 68
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -12,7 +12,6 @@
 #include <cv.h>  
 #include <cxcore.h> 
 #include <highgui.h>
-#include "DevFSMCommBase.hpp"
 #include "fileutil.h"
 #include <CommEntityUtil.hpp>
 using namespace SP::Module::Comm;
@@ -62,6 +61,11 @@ void CIDCertFSM::s0_on_entry()
 	LOG_FUNCTION();
 	m_devState = DEVICE_STATUS_NORMAL;
 	GetEntityBase()->GetFunction()->SetUserDefineState(USER_IDCERTIFICATE_IDLE);
+
+	if (m_FirstStart) {
+		m_FirstStart = FALSE;
+		ToLogWarnInfoAboutTerm(this, m_adapterInfo);
+	}
 }
 void CIDCertFSM::s0_on_exit()
 {
@@ -302,6 +306,109 @@ ErrorCodeEnum CIDCertFSM::OnExit()
 	return Error_Succeed;
 }
 
+ErrorCodeEnum CIDCertFSM::CheckDate(const char* date)
+{
+	string strDate = date;
+	if (strDate.find("长期") != string::npos)
+	{
+		return Error_Succeed;
+	}
+	else
+	{
+		regex pattern("^(([0-9]{4})(\.|-|年)(0[1-9]|1[0-2])(\.|-|月)(0[1-9]|[12][0-9]|3[01])(日)*)$");
+		smatch sm;
+		if (regex_match(strDate, sm, pattern))
+		{
+			int month = atoi(sm[4].str().c_str());
+			int day = atoi(sm[6].str().c_str());
+			if (month > 0 && month <= 12 && day > 0 && day <= 31)
+			{
+				return Error_Succeed;
+			}
+		}
+	}
+	return Error_Unexpect;
+}
+
+ErrorCodeEnum CIDCertFSM::CheckDate(const char* startDate, const char* endDate)
+{
+	string strStartDate = startDate, strEndDate = endDate;
+	regex pattern("^(([0-9]{4})(\.|-))");
+	smatch smStart, smEnd;
+	if (regex_search(strStartDate, smStart, pattern) && regex_search(strEndDate, smEnd, pattern))
+	{
+		strStartDate = smStart.suffix().str();
+		strEndDate = smEnd.suffix().str();
+		if (strStartDate == strEndDate)
+			return Error_Succeed;
+	}
+	return Error_Unexpect;
+}
+
+void CIDCertFSM::LogDate(IDCerInfo idInfo)
+{
+	ErrorCodeEnum eErrCode = CheckDate(idInfo.startDate.data);
+	CSimpleStringA errMsg;
+	if (Error_Succeed != eErrCode)
+	{
+		errMsg = CSimpleStringA::Format("Invalid startDate: %s", idInfo.startDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidStartDate, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.endDate.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("Invalid endDate: %s", idInfo.endDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidEndDate, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.startDate.data, idInfo.endDate.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("起止日期不匹配:start=%s, end=%s", idInfo.startDate.data, idInfo.endDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_NotMatch, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.birthday.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("Invalid birthDate: %s", idInfo.birthday.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidBirthDate, (const char*)errMsg);
+	}
+}
+
+void CIDCertFSM::LogDateEx(IDCerInfoEx idInfo)
+{
+	ErrorCodeEnum eErrCode = CheckDate(idInfo.startDate.data);
+	CSimpleStringA errMsg;
+	if (Error_Succeed != eErrCode)
+	{
+		errMsg = CSimpleStringA::Format("Invalid startDate: %s", idInfo.startDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidStartDate, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.endDate.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("Invalid endDate: %s", idInfo.endDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidEndDate, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.startDate.data, idInfo.endDate.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("起止日期不匹配:start=%s, end=%s", idInfo.startDate.data, idInfo.endDate.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_NotMatch, (const char*)errMsg);
+	}
+
+	eErrCode = CheckDate(idInfo.birthday.data);
+	if (Error_Succeed != eErrCode)
+	{
+		CSimpleStringA errMsg = CSimpleStringA::Format("Invalid birthDate: %s", idInfo.birthday.data);
+		LogWarn(Severity_Middle, eErrCode, IDCertificate_UserErrorCode_InvalidBirthDate, (const char*)errMsg);
+	}
+}
+
 int CIDCertFSM::ReadInfo(SpReqAnsContext<IDCert_Read_Req, IDCert_Read_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
@@ -671,10 +778,7 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 	ErrorCodeEnum eErr;
 	LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_GREEN_ON, "IDCer warning on");
 
-	Dbg("Before readingInfo, do clear job.");
-
 	DeleteZP(Bmp_ZP|Bmp_SCAN);
-	Dbg("Before readingInfo, finish doing clear job.");
 
 	bool bOpenRF = false, bGetIDCert = false;
 	IDCerInfoEx idInfo;
@@ -715,13 +819,8 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 				Dbg("open rf failed.");
 				dwEnd = RVCGetTickCount();
 				elapsed = dwEnd - dwStart;
-				//if cannot open rf in 10s ,quit
-				/*				if (elapsed > 10000)
-				break;
-				else*/ {
-					Sleep(IDCER_AUTH_INTERVAL);
-					continue;
-				}
+				Sleep(IDCER_AUTH_INTERVAL);
+				continue;
 			}
 		}
 
@@ -748,16 +847,15 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 				eErr = m_hDevHelper->IDCerGetData(idInfoOld);
 				if (eErr != Error_Succeed)
 				{
-					LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerGetData);
+					Dbg("Invoke IDCerGetData failed: %s", SpStrError(eErr));
 				}
 				else
 				{
 					Dbg("read succeed.");
+
 					LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
-					//oiltest
+
 					ctx->Ans.name = idInfoOld.name.data;
-					//ctx->Ans.name = "我.们我.们我·们我·们爱邱总";
-					//ctx->Ans.name = "张云虎";
 					ctx->Ans.sex = idInfoOld.sex.data;
 					ctx->Ans.nation = idInfoOld.nation.data;
 					ctx->Ans.birthday = idInfoOld.birthday.data;
@@ -774,22 +872,16 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 					ctx->Ans.department = idInfoOld.department.data;
 					ctx->Ans.startdate = idInfoOld.startDate.data;
 					ctx->Ans.enddate = idInfoOld.endDate.data;
-					//Dbg("nation: %s",(const char*)ctx->Ans.name);
-					Dbg("Name:%s,Sex:%s,Nation:%s,Birthday:%s,StartDate:%s,EndDate:%s,IDNo:%s****%s,Address:%s,"
-					,idInfoOld.name.data
-					,idInfoOld.sex.data
-					,idInfoOld.nation.data
-					,idInfoOld.birthday.data
-					,idInfoOld.startDate.data
-					,idInfoOld.endDate.data
-					,(const char*)ctx->Ans.idcode.SubString(0, 4), (const char*)ctx->Ans.idcode.SubString(ctx->Ans.idcode.GetLength() - 1, 1)
-					,idInfoOld.address.data);
-					/*Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,"
+
+					//hyc@2021.3.24
+					LogDate(idInfoOld);
+
+					Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,"
 						,idInfoOld.sex.data
 						,idInfoOld.nation.data
 						,idInfoOld.endDate.data
 						,(const char*)ctx->Ans.idcode.SubString(0, 4), (const char*)ctx->Ans.idcode.SubString(ctx->Ans.idcode.GetLength() - 1, 1));
-*/
+
 					Dbg("to get photo");
 					GetPngBlobEx(ctx->Ans.headphoto, "zp", true);
 					eErr = GetPngBlob(ctx->Ans.photodata, true);
@@ -807,11 +899,11 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 			{
 				if (eErr != Error_Succeed)
 				{
-					LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerGetDataEx);
+					Dbg("Invoke IDCerGetDataEx failed: %s", SpStrError(eErr));
 				}
 				else
 				{
-					LOG_TRACE("read succeed.");
+					Dbg("read succeed.");
 					LogEvent(Severity_Middle, LOG_EVT_IDCERTIFICATE_OP, "IDCertifacate op.");
 					ctx->Ans.name = idInfo.name.data;
 					ctx->Ans.sex = idInfo.sex.data;
@@ -845,41 +937,25 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 						
 						if (eErrFront == Error_Succeed && eErrBack == Error_Succeed)
 							ctx->Ans.hasscan = 1;
-						/*else
-						{
-							Dbg("Load bmp pic failed.");
-							break;
-						}*/
 					}
-					/*else
+					else
 					{
-						Dbg("Scan image failed.");
-						break;
-					}*/
+						Dbg("Invoke ScanIDAndSaveImage Failed: %s", SpStrError(eErr));
+					}
 					GetPngBlobEx(ctx->Ans.headphoto, "zp", true);
 
-					Dbg("Name:%s,Sex:%s,Nation:%s,Birthday:%s,StartDate:%s,EndDate:%s,IDNo:%s****%s,Address:%s,IDType:%s,Department:%s,EnglishName:%s,Nationality:%s"
-					, (const char*)ctx->Ans.name, (const char*)ctx->Ans.sex, (const char*)ctx->Ans.nation
-					, (const char*)ctx->Ans.birthday
-					, (const char*)ctx->Ans.startdate, (const char*)ctx->Ans.enddate
-					, (const char*)ctx->Ans.idcode.SubString(0, 4), (const char*)ctx->Ans.idcode.SubString(ctx->Ans.idcode.GetLength() - 1, 1)
-					, (const char*)ctx->Ans.address
-					, (const char*)ctx->Ans.idtype
-					, (const char*)ctx->Ans.department
-					, (const char*)ctx->Ans.englishname	, (const char*)ctx->Ans.nationality);
-
-					/*Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,IDType:%s"
+					Dbg("Sex:%s,Nation:%s,EndDate:%s,IDNo:%s****%s,IDType:%s"
 						, (const char*)ctx->Ans.sex, (const char*)ctx->Ans.nation
 						, (const char*)ctx->Ans.enddate
 						, (const char*)ctx->Ans.idcode.SubString(0, 4), (const char*)ctx->Ans.idcode.SubString(ctx->Ans.idcode.GetLength() - 1, 1)
-						, (const char*)ctx->Ans.idtype);*/
+						, (const char*)ctx->Ans.idtype);
 
 					Dbg("to get photo");
 					eErr = GetPngBlob(ctx->Ans.photodata, true);
 					if (eErr != Error_Succeed)
 					{
 						bGetIDCert = false;
-						LOG_TRACE("get photo failed.");
+						Dbg("get photo failed.");
 						break;
 					}
 					bGetIDCert = true;
@@ -950,10 +1026,12 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 		ctx->Answer(Error_TimeOut);
 
         if (ecForIDCerRFControl != Error_Succeed) {
-            LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerRFControl);
+			SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, ecForIDCerRFControl, MEC_DEVAPI_IDCER_IDCerRFControl);
+			AlarmDEC(m_errPkg);
         }
         if (ecForIDCerAuthenticate != Error_Succeed) {
-            LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerAuthenticate);
+			SetErrPackage(m_errPkg, "ReadAndScan::IDCerAuthenticate", m_devSN, ecForIDCerAuthenticate, MEC_DEVAPI_IDCER_IDCerAuthenticate);
+			AlarmDEC(m_errPkg);
         }
 	}
 	else if (eErr == Error_DevMedia)
@@ -962,10 +1040,12 @@ int CIDCertFSM::ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadA
 		ctx->Answer(Error_Unexpect);
 
         if (ecForIDCerRFControl != Error_Succeed) {
-            LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerRFControl);
+			SetErrPackage(m_errPkg, "ReadAndScan::IDCerRFControl", m_devSN, ecForIDCerRFControl, MEC_DEVAPI_IDCER_IDCerRFControl);
+			AlarmDEC(m_errPkg);
         }
         if (ecForIDCerAuthenticate != Error_Succeed) {
-            LOG_IDCER_ERROR_MSG_MACRO(eErr, IDCerAuthenticate);
+			SetErrPackage(m_errPkg, "ReadAndScan::IDCerAuthenticate", m_devSN, ecForIDCerAuthenticate, MEC_DEVAPI_IDCER_IDCerAuthenticate);
+			AlarmDEC(m_errPkg);
         }
 	}
 	if (eErr1 == Error_Succeed && pos == 2)
@@ -1356,9 +1436,11 @@ int CIDCertFSM::Initial()
 	ErrorCodeEnum err = pEntity->ExtractVendorLibFullPath(csLibFullName);
 	if (err != Error_Succeed)
 	{
-		Dbg("Get vendor libname(%s) failed.", (const char*)csLibFullName);
+		LogWarn(Severity_Middle, err, IDCertificate_UserErrorCode_Open_RootCfg_Failed, "get dllname failed");
 		return Error_DevLoadFileFailed;
 	}
+	LogWarn(Severity_Low, Error_Unexpect, IDCertificate_UserErrorCode_RootInfo, csLibFullName.GetData());
+	m_adapterInfo.adapterFileName = csLibFullName;
 	Dbg("To load up vendor lib...");
 	err = m_hDevHelper.LoadUp(csLibFullName);
 	if (err != Error_Succeed)
@@ -1377,6 +1459,7 @@ int CIDCertFSM::Initial()
 	if (tmpDevSN.GetLength() > 12 && tmpDevSN.IndexOf("FWB") > 2)
 	{
 		Dbg("This is fwb device.");
+		m_devSN = tmpDevSN;
 		GetEntityBase()->GetFunction()->GetPath("Dep", csDepPath);
 		dllName = csDepPath + SPLIT_SLASH_STR + "IDCertificate." + tmpVendor + "." + tmpDLLVersion + ".dll";//oiltmp
 		Dbg("%s", (const char*)dllName);
@@ -1393,8 +1476,6 @@ int CIDCertFSM::Initial()
 		HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, str);
 	}
 
-	Dbg("%s", (LPCTSTR)dllName);
-
 	bool bOpenFlag = false;
 	do {
 		int tmpPort = 0;
@@ -1403,7 +1484,7 @@ int CIDCertFSM::Initial()
 		err = spEntityFunction->OpenConfig(Config_Root, spConfig);
 		if (err != Error_Succeed) {
 			Dbg("open cfg file failed!");
-			LogErrMsg("Initial:OpenConfig", err, AlarmDECToBusiness(MEC_CFG_RUN_POINTER_FAILED), TRUE);
+			LogWarn(Severity_Middle, err, IDCertificate_UserErrorCode_Open_RootCfg_Failed, "open root cfg failed.");
 			return 2;
 		}
 		
@@ -1413,7 +1494,8 @@ int CIDCertFSM::Initial()
 		err = m_hDevHelper->DevOpen(tmpPort);
 		if (err != Error_Succeed)
 		{
-			LOG_IDCER_ERROR_MSG_MACRO(err, DevOpen);
+			SetErrPackage(m_errPkg, "Initial::DevOpen", m_devSN, err, MEC_DEVAPI_IDCER_DevOpen);
+			AlarmDEC(m_errPkg);
 			return 2;
 		}
 	} while (!m_hDevHelper && bOpenFlag == false);
@@ -1421,10 +1503,13 @@ int CIDCertFSM::Initial()
 	if (m_hDevHelper)
 	{
 		err = m_hDevHelper->IDCerRFControl(false);
-		if (err != Error_Succeed)
-			LOG_TRACE("close rf failed.");
-		else
-			LOG_TRACE("close rf ok.");
+		if (err != Error_Succeed) {
+			SetErrPackage(m_errPkg, "Initial::IDCerRFControl", m_devSN, err, MEC_DEVAPI_IDCER_IDCerRFControl);
+			AlarmDEC(m_errPkg);
+		}
+		else {
+			Dbg("close rf ok.");
+		}
 	}
 	memset(m_devCatInfo.szModel, 0, MAX_DEV_MODEL_LEN);
 	memset(m_devCatInfo.szType, 0, MAX_DEV_TYPE_LEN);
@@ -1432,12 +1517,12 @@ int CIDCertFSM::Initial()
 	err = m_hDevHelper->GetDevCategory(m_devCatInfo);
 	if (err == Error_Succeed)
 	{
-		Dbg("%d,%d,%d", strlen(m_devCatInfo.szModel), strlen(m_devCatInfo.szType), strlen(m_devCatInfo.szVendor));
-		if (strlen(m_devCatInfo.szModel) < 256)
-			Dbg("szModel:%s", m_devCatInfo.szModel);
+		Dbg("szModel:%s, szType:%s, szVendor:%s", m_devCatInfo.szModel, m_devCatInfo.szType, m_devCatInfo.szVendor);
+		m_adapterInfo.devCatInfo = m_devCatInfo;
 	}
 	else {
-		LOG_IDCER_ERROR_MSG_MACRO(err, GetDevCategory);
+		SetErrPackage(m_errPkg, "Initial::GetDevCategory", m_devSN, err, MEC_DEVAPI_IDCER_GetDevCategory);
+		AlarmDEC(m_errPkg);
 	}
 
 	if (m_hDevHelper)

+ 12 - 2
Module/mod_IDCertificate/IDCertFSM.h

@@ -5,6 +5,7 @@
 
 #include "SpFSM.h"
 #include "SpTest.h"
+#include "DevFSMCommBase.hpp"
 
 enum EvtType
 {
@@ -179,9 +180,11 @@ public:
 	END_FSM_RULE()
 
 	CIDCertFSM():m_devInit(false),m_bCancelRead(false),m_bReading(false),m_bWaitReadMore(false),
-	m_bExit(false),m_testResult(Error_Succeed), m_csMachineType(""), m_csSite(""), m_terminalNo("")
+	m_bExit(false),m_testResult(Error_Succeed), m_csMachineType(""), m_csSite(""), m_terminalNo(""), m_devSN("")
 	,m_devVendor(""), m_devVer(""), m_devBatch("")	, m_bRVCIL(false), m_pHBClient(nullptr){
 			HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x201);
+			m_FirstStart = TRUE;
+			ZeroMemory(&m_adapterInfo, sizeof(m_adapterInfo));
 	};
 	virtual ~CIDCertFSM() {};
 
@@ -254,6 +257,10 @@ protected:
 	ErrorCodeEnum GetPngBlobEx(CBlob &data, CSimpleStringA fileNamePrefix,bool bClear=false);
 	//type:1,delete img about zp; type:2,delete img about scan ID;type:3,delete both zp and scan ID
 	void DeleteZP(int type);
+	ErrorCodeEnum CheckDate(const char* date);
+	ErrorCodeEnum CheckDate(const char* startDate, const char* endDate);
+	void LogDate(IDCerInfo idInfo);
+	void LogDateEx(IDCerInfoEx idInfo);
 
 	//Delete bmp file in dep directory, you should just convey fileName only without paths -Joseph
 	ErrorCodeEnum DeleteFileIfExisted(LPCTSTR fileName);
@@ -264,13 +271,16 @@ protected:
 	ErrorCodeEnum m_testResult;
 	DevCategoryInfo m_devCatInfo;
 	DevStateEnum m_devState;
-	CSimpleStringA m_csMachineType,m_csSite,m_terminalNo;
+	CSimpleStringA m_csMachineType, m_csSite, m_terminalNo, m_devSN;
 	CSimpleStringA m_devVendor, m_devVer, m_devBatch;
 	map<int, CtxInfo> m_mapCtx;
 	HeartBeatService_ClientBase* m_pHBClient;
 	SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadAndScan_Ans>::Pointer m_readAndScanCtx;
 
 	CSimpleStringA m_csAlarmMsg;
+
+	ErrorPackage m_errPkg;
+	AdapterInfo m_adapterInfo;
 };
 struct ReadTask : public ITaskSp
 {

+ 14 - 2
Module/mod_IDCertificate/IDCertificate_UserErrorCode.h

@@ -3,6 +3,18 @@
 #pragma once
 
 #define IDCertificate_UserErrorCode_Start 0x20100200
-//#define IDCertificate_UserErrorCode_Open_RootCfg_Failed	(IDCertificate_UserErrorCode_Start + 1)	//打开Root.ini失败
-
+#define IDCertificate_UserErrorCode_Open_RootCfg_Failed		(IDCertificate_UserErrorCode_Start + 1)	//打开Root.ini失败
+#define IDCertificate_UserErrorCode_LogInfoAboutTerm		(IDCertificate_UserErrorCode_Start + 2)	//告警上送终端模块信息
+#define IDCertificate_UserErrorCode_KxdDeviceInfo			(IDCertificate_UserErrorCode_Start + 3) //告警上送凯欣达机型信息
+#define IDCertificate_UserErrorCode_RootInfo			    (IDCertificate_UserErrorCode_Start + 4) //root信息
+#define IDCertificate_UserErrorCode_ScanIImageFailed        (IDCertificate_UserErrorCode_Start + 5) //扫描图像失败
+#define IDCertificate_UserErrorCode_InvalidStartDate		(IDCertificate_UserErrorCode_Start + 6) //告警开始日期非法
+#define IDCertificate_UserErrorCode_InvalidEndDate		    (IDCertificate_UserErrorCode_Start + 7) //告警结束日期非法
+#define IDCertificate_UserErrorCode_InvalidBirthDate		(IDCertificate_UserErrorCode_Start + 8) //告警生日日期非法
+#define IDCertificate_UserErrorCode_StartDate				(IDCertificate_UserErrorCode_Start + 9) //上传开始日期
+#define IDCertificate_UserErrorCode_EndDate					(IDCertificate_UserErrorCode_Start + 10) //上传结束日期
+#define IDCertificate_UserErrorCode_BirthDate				(IDCertificate_UserErrorCode_Start + 11) //上传生日日期
+#define IDCertificate_UserErrorCode_NotMatch         		(IDCertificate_UserErrorCode_Start + 12) //起止日期不匹配
+#define IDCertificate_UserErrorCode_DevOpenFailed			(IDCertificate_UserErrorCode_Start + 13) //实体打开失败
+#define IDCertificate_UserErrorCode_DevFailAddUp			(IDCertificate_UserErrorCode_Start + 14) //报错累计达到上限
 #endif //_IDCERTIFICATE_USER_ERRORCODE_H