#include "stdafx.h" #include "UnZipService.h" #include "../jsonLib/json/json.h" #include #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& vct) { g_dataBaseService.LoadUnhandleBatch(_indexdbpath, vct); } CUnZipService::~CUnZipService() { } bool CUnZipService::ParseImageDir(int& last_id) { vector _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(); }