#pragma once #include #include using namespace std; enum batch_exc { batch_exc_success = -1, batch_exc_ori = 0, batch_exc_scanning = 1, //batch_exc_schema = 1 << 1,//模板异常 2 batch_exc_scan_excption = 1 << 2,//扫描有异常 4 batch_exc_multiple = 1 << 3,//非整数倍 8 batch_exc_unzip = 1 << 4,//解压失败 16 batch_exc_pages_missed = 1 << 5,//缺页 32 batch_exc_invalid_qrcode = 1 << 6,//批次二维码无效 64 }; enum paper_exc { paper_exc_success = -1, paper_exc_ori = 0, paper_exc_open_fail = 1, //paper_exc_unfind_qrcode = 1 << 1,//未找到二维码 2 paper_exc_qrcode_unmatch = 1 << 2,//二维码不匹配 4 paper_exc_locate = 1 << 3,//8 paper_exc_same_page = 1 << 4,//16 paper_exc_code_conflict = 1 << 5,//32 paper_exc_upload = 1 << 6,//64 paper_exc_pages_missed = 1 << 7,//128//缺页 }; struct batch_info { int id; int state; char create_time[64]; char batchdb_path[512]; int total_cnt; int success_cnt; char work_dir[512]; char zipfile_name[512]; int zipfile_cnt; string exam_id; string task_id; batch_info() { id = -1; state = 0; memset(create_time, 0, 64); memset(batchdb_path, 0, 512); memset(zipfile_name, 0, 512); memset(work_dir, 0, 512); total_cnt = 0; success_cnt = 0; zipfile_cnt = 0; exam_id = ""; task_id = ""; } }; struct paper_info { int id; int state; char student_id[512]; // 学号 char qr_code[512]; char page0_path[512]; char page1_path[512]; char exam_name[512]; char subject_name[512]; char err_msg[2048]; __int64 scan_time; paper_info() { id = -1; state = 0; scan_time = 0; memset(student_id, 0, 512); memset(page0_path, 0, 512); memset(page1_path, 0, 512); memset(qr_code, 0, 512); memset(exam_name, 0, 512); memset(subject_name, 0, 512); memset(err_msg, 0, 2048); } }; #ifdef SMARTEVALUATIONLOGIC_EXPORTS #define SMARTEVALUATIONLOGIC_API __declspec(dllexport) #else #define SMARTEVALUATIONLOGIC_API __declspec(dllimport) #endif SMARTEVALUATIONLOGIC_API bool StartScan(HWND wnd,int batch_id); SMARTEVALUATIONLOGIC_API bool InitScanDll(HWND hWnd); SMARTEVALUATIONLOGIC_API bool ReScan(int batch_id,int paper_id,char* page0,char* page1,string exam_id=""); SMARTEVALUATIONLOGIC_API bool TestDb(); SMARTEVALUATIONLOGIC_API bool ReScan(int batch_id, vector paper_ids, string exam_id); SMARTEVALUATIONLOGIC_API bool ReBatchScan(int batch_id, string exam_id); // 批量识别 SMARTEVALUATIONLOGIC_API bool ReUploadAllFailed(); SMARTEVALUATIONLOGIC_API vector GetFailedBatch();