ScanDll.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. using namespace std;
  5. enum batch_exc
  6. {
  7. batch_exc_success = -1,
  8. batch_exc_ori = 0,
  9. batch_exc_scanning = 1,
  10. //batch_exc_schema = 1 << 1,//模板异常 2
  11. batch_exc_scan_excption = 1 << 2,//扫描有异常 4
  12. batch_exc_multiple = 1 << 3,//非整数倍 8
  13. batch_exc_unzip = 1 << 4,//解压失败 16
  14. batch_exc_pages_missed = 1 << 5,//缺页 32
  15. batch_exc_invalid_qrcode = 1 << 6,//批次二维码无效 64
  16. };
  17. enum paper_exc
  18. {
  19. paper_exc_success = -1,
  20. paper_exc_ori = 0,
  21. paper_exc_open_fail = 1,
  22. //paper_exc_unfind_qrcode = 1 << 1,//未找到二维码 2
  23. paper_exc_qrcode_unmatch = 1 << 2,//二维码不匹配 4
  24. paper_exc_locate = 1 << 3,//8
  25. paper_exc_same_page = 1 << 4,//16
  26. paper_exc_code_conflict = 1 << 5,//32
  27. paper_exc_upload = 1 << 6,//64
  28. paper_exc_pages_missed = 1 << 7,//128//缺页
  29. };
  30. struct batch_info
  31. {
  32. int id;
  33. int state;
  34. char create_time[64];
  35. char batchdb_path[512];
  36. int total_cnt;
  37. int success_cnt;
  38. char work_dir[512];
  39. char zipfile_name[512];
  40. int zipfile_cnt;
  41. string exam_id;
  42. string task_id;
  43. batch_info()
  44. {
  45. id = -1;
  46. state = 0;
  47. memset(create_time, 0, 64);
  48. memset(batchdb_path, 0, 512);
  49. memset(zipfile_name, 0, 512);
  50. memset(work_dir, 0, 512);
  51. total_cnt = 0;
  52. success_cnt = 0;
  53. zipfile_cnt = 0;
  54. exam_id = "";
  55. task_id = "";
  56. }
  57. };
  58. struct paper_info
  59. {
  60. int id;
  61. int state;
  62. char student_id[512]; // 学号
  63. char qr_code[512];
  64. char page0_path[512];
  65. char page1_path[512];
  66. char exam_name[512];
  67. char subject_name[512];
  68. char err_msg[2048];
  69. __int64 scan_time;
  70. paper_info()
  71. {
  72. id = -1;
  73. state = 0;
  74. scan_time = 0;
  75. memset(student_id, 0, 512);
  76. memset(page0_path, 0, 512);
  77. memset(page1_path, 0, 512);
  78. memset(qr_code, 0, 512);
  79. memset(exam_name, 0, 512);
  80. memset(subject_name, 0, 512);
  81. memset(err_msg, 0, 2048);
  82. }
  83. };
  84. #ifdef SMARTEVALUATIONLOGIC_EXPORTS
  85. #define SMARTEVALUATIONLOGIC_API __declspec(dllexport)
  86. #else
  87. #define SMARTEVALUATIONLOGIC_API __declspec(dllimport)
  88. #endif
  89. SMARTEVALUATIONLOGIC_API bool StartScan(HWND wnd,int batch_id);
  90. SMARTEVALUATIONLOGIC_API bool InitScanDll(HWND hWnd);
  91. SMARTEVALUATIONLOGIC_API bool ReScan(int batch_id,int paper_id,char* page0,char* page1,string exam_id="");
  92. SMARTEVALUATIONLOGIC_API bool TestDb();
  93. SMARTEVALUATIONLOGIC_API bool ReScan(int batch_id, vector<int> paper_ids, string exam_id);
  94. SMARTEVALUATIONLOGIC_API bool ReBatchScan(int batch_id, string exam_id); // 批量识别
  95. SMARTEVALUATIONLOGIC_API bool ReUploadAllFailed();
  96. SMARTEVALUATIONLOGIC_API vector<batch_info> GetFailedBatch();