|
@@ -12,10 +12,12 @@
|
|
|
#include <sstream>
|
|
#include <sstream>
|
|
|
#include <thread>
|
|
#include <thread>
|
|
|
#include <chrono>
|
|
#include <chrono>
|
|
|
|
|
+#include <time.h>
|
|
|
|
|
+#include "path.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
using namespace std;
|
|
|
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
|
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
|
|
-#include <atltime.h>
|
|
|
|
|
|
|
+//#include <atltime.h>
|
|
|
|
|
|
|
|
const int UPDATEINTERNAL = 10*60*1000; //query data from branch server internal, 10min
|
|
const int UPDATEINTERNAL = 10*60*1000; //query data from branch server internal, 10min
|
|
|
const int CONNECTINTERNAL = 30*1000; //connect branch server internal, 30s
|
|
const int CONNECTINTERNAL = 30*1000; //connect branch server internal, 30s
|
|
@@ -373,7 +375,10 @@ bool CCustMngrAuthFSM::ReadDataIntoMemory(bool& bHasData)
|
|
|
ErrorCodeEnum eErr;
|
|
ErrorCodeEnum eErr;
|
|
|
|
|
|
|
|
CSimpleStringA strPath;
|
|
CSimpleStringA strPath;
|
|
|
- CSimpleStringA runInfoFile = m_runInfoPath + "\\runcfg\\CustMngrAuth.ini";
|
|
|
|
|
|
|
+ CSimpleStringA runInfoFile;
|
|
|
|
|
+ runInfoFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "CustMngrAuth.ini"
|
|
|
|
|
+ , (const char*)m_runInfoPath);
|
|
|
|
|
+
|
|
|
ifstream inFile(runInfoFile);
|
|
ifstream inFile(runInfoFile);
|
|
|
string line;
|
|
string line;
|
|
|
int customerNum = 0;
|
|
int customerNum = 0;
|
|
@@ -588,8 +593,12 @@ void CCustMngrAuthFSM::FeatureUpdate()
|
|
|
Dbg("Transmission finished successfully. Ready to decode json data and write into runcfg");
|
|
Dbg("Transmission finished successfully. Ready to decode json data and write into runcfg");
|
|
|
|
|
|
|
|
//写入文件前,先判断是否已存在CustMngrAuth.ini文件,若不存在则直接写入,若存在,则先备份该文件
|
|
//写入文件前,先判断是否已存在CustMngrAuth.ini文件,若不存在则直接写入,若存在,则先备份该文件
|
|
|
- CSimpleStringA srcFile = m_runInfoPath + "\\runcfg\\CustMngrAuth.ini";
|
|
|
|
|
- CSimpleStringA backupFile = m_runInfoPath + "\\runcfg\\CustMngrAuth_bak.ini";
|
|
|
|
|
|
|
+ CSimpleStringA srcFile(true);
|
|
|
|
|
+ CSimpleStringA backupFile(true);
|
|
|
|
|
+ srcFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "CustMngrAuth.ini"
|
|
|
|
|
+ , (const char*)m_runInfoPath);
|
|
|
|
|
+ backupFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "CustMngrAuth_bak.ini"
|
|
|
|
|
+ , (const char*)m_runInfoPath);
|
|
|
|
|
|
|
|
EnterCriticalSection(&m_cs);
|
|
EnterCriticalSection(&m_cs);
|
|
|
if(!BackupFile(srcFile, backupFile)){
|
|
if(!BackupFile(srcFile, backupFile)){
|
|
@@ -1013,7 +1022,10 @@ ErrorCodeEnum CCustMngrAuthFSM::CollectFingerPrint(SpReqAnsContext<CustMngrAuthS
|
|
|
getImgNum += 1;
|
|
getImgNum += 1;
|
|
|
BroadcastPressFinger(i+1, false);//lift finger
|
|
BroadcastPressFinger(i+1, false);//lift finger
|
|
|
CBlob data;
|
|
CBlob data;
|
|
|
- eErr = GetImgBlob(data, strPath + "\\" + gifAns.imageName);
|
|
|
|
|
|
|
+ CSimpleStringA tempFullPath;
|
|
|
|
|
+ tempFullPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s"
|
|
|
|
|
+ , (const char*)strPath, (const char*)gifAns.imageName);
|
|
|
|
|
+ eErr = GetImgBlob(data, tempFullPath);
|
|
|
if (eErr != Error_Succeed){
|
|
if (eErr != Error_Succeed){
|
|
|
Dbg("Failed to load finger image.");
|
|
Dbg("Failed to load finger image.");
|
|
|
break;
|
|
break;
|
|
@@ -1046,11 +1058,16 @@ ErrorCodeEnum CCustMngrAuthFSM::CollectFingerPrint(SpReqAnsContext<CustMngrAuthS
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//delete bmp files in dep
|
|
//delete bmp files in dep
|
|
|
- for (int j = 0; j < getImgNum; ++j){
|
|
|
|
|
- if(remove(strPath + "\\" + (const char*)imgPaths[j])==0)
|
|
|
|
|
- Dbg("finger image %s deleted!", strPath + "\\" + (const char*)imgPaths[j]);
|
|
|
|
|
|
|
+ for (int j = 0; j < getImgNum; ++j)
|
|
|
|
|
+ {
|
|
|
|
|
+ CSimpleStringA tempFullPath(true);
|
|
|
|
|
+ tempFullPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s"
|
|
|
|
|
+ , (const char*)strPath, (const char*)imgPaths[j]);
|
|
|
|
|
+
|
|
|
|
|
+ if(remove((const char*)tempFullPath) == 0)
|
|
|
|
|
+ Dbg("finger image %s deleted!", (const char*)tempFullPath);
|
|
|
else
|
|
else
|
|
|
- Dbg("fail to delete image %s!", strPath + "\\" + (const char*)imgPaths[j]);
|
|
|
|
|
|
|
+ Dbg("fail to delete image %s!", (const char*)tempFullPath);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (eErr == Error_Succeed){
|
|
if (eErr == Error_Succeed){
|