12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #include "stdafx.h"
- #include "UnZipService.h"
- #include "../jsonLib/json/json.h"
- #include <list>
- #include "../Util/Util.h"
- #include "../SmartEvaluationLogic/ScanDll.h"
- #define UM_TERMINATE WM_USER + 100
- CDataBaseService g_dataBaseService;
- CUnZipService::CUnZipService(const wstring& _indexdbpath, const wstring& _batchdbpath,
- const wstring& _iamgepath, const wstring& _workpath,
- const wstring& _sharefilename, const wstring& _sharefilepath)
- {
- m_strIamgePath = _iamgepath;
- m_strWorkPath = _workpath;
- CString strFilePath(_sharefilepath.c_str());
- strFilePath.Replace(L"\\", L"/");
- wstring _filePath(strFilePath);
- g_dataBaseService.SetDataBasePath(_indexdbpath, _batchdbpath, _sharefilename, _filePath, _workpath);
- }
- CUnZipService::CUnZipService(const wstring& _indexdbpath, vector<int>& vct)
- {
- g_dataBaseService.LoadUnhandleBatch(_indexdbpath, vct);
- }
- CUnZipService::~CUnZipService()
- {
-
- }
- bool CUnZipService::ParseImageDir(int& last_id)
- {
- vector<string> _listImage;
- DetectDirectory(m_strIamgePath, _listImage);
- if (_listImage.size() == 0 || _listImage.size() % 2 == 1)
- {
- g_dataBaseService.InsertBatchFail(batch_exc_multiple, _listImage.size());
- return false;
- }
-
- g_dataBaseService.InsertPapers(_listImage);
- g_dataBaseService.InsertIndex(_listImage.size() / 2, last_id);
- return true;
- }
- void CUnZipService::InsertBatchFail(int state, int zipfile_cnt)
- {
- g_dataBaseService.InsertBatchFail(state, zipfile_cnt);
- }
- void CUnZipService::InsertBatchInfo()
- {
- g_dataBaseService.InsertBatchInfo();
- }
|