Bantch.cpp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. #include "stdafx.h"
  2. #include "Bantch.h"
  3. #include "SmartEvaluationService.h"
  4. #include "BatchService.h"
  5. extern int g_my_scan_type;
  6. CBatch::CBatch(bool bOnlineCard, int nSubjectID, int nOnlineScanType) :service(new CBatchService(bOnlineCard, nSubjectID, nOnlineScanType))
  7. {
  8. }
  9. CBatch::~CBatch()
  10. {
  11. LOGI("~CBatch()");
  12. }
  13. void CBatch::leaveCurrentBatch()
  14. {
  15. if (service)
  16. service->leaveCurrentBatch();
  17. }
  18. string CBatch::GetBatchCode()
  19. {
  20. return service->GetBatchCode();
  21. }
  22. int CBatch::LoadSchema(long long examId, std::string examName, long examCourseId, std::string courseName, const std::string schemaPath, std::string rule/* = ""*/)
  23. {
  24. return service->LoadSchema(examId, examName, examCourseId, courseName, schemaPath,rule);
  25. }
  26. int CBatch::ReadyScanEX(FEEDER_TYPE feederType, const ScanParam & param)
  27. {
  28. return service->ReadyScan(feederType, param);
  29. }
  30. int CBatch::SetFolderScanDir(const std::string img_dir)
  31. {
  32. if (1 == g_my_scan_type)
  33. {
  34. service->loadDuXueFirstMode();
  35. }
  36. return service->SetFolderScanDir(img_dir);
  37. }
  38. int CBatch::GetServiceSate()
  39. {
  40. return service->GetServiceSate();
  41. }
  42. int CBatch::Start()
  43. {
  44. return service->Start();
  45. }
  46. int CBatch::Pause()
  47. {
  48. return service->Pause();
  49. }
  50. int CBatch::Resume()
  51. {
  52. return service->Resume();
  53. }
  54. int CBatch::Stop()
  55. {
  56. return service->Stop();
  57. }
  58. int CBatch::GiveUpCurrentBatch()
  59. {
  60. return service->GiveUpCurrentBatch();
  61. }
  62. int CBatch::StartUploadPaper(HWND hWnd)
  63. {
  64. return service->StartUploadPaper(hWnd);
  65. }
  66. int CBatch::ReIdentify(const int paper_id, const std::string& stu_code, const std::vector<img_param>& params)
  67. {
  68. return service->ReIdentify(paper_id, stu_code, params);
  69. }
  70. int CBatch::QueryMubanImgPath(int page_index, std::string& imgPath)
  71. {
  72. return service->QueryMubanImgPath(page_index, imgPath);
  73. }
  74. int CBatch::QueryMubanImgCount(int& page_count)
  75. {
  76. return service->QueryMubanImgCount(page_count);
  77. }
  78. int CBatch::QueryExptionPaperCount(int & exc_count, int & total_count)
  79. {
  80. return service->QueryExptionPaperCount(exc_count ,total_count);
  81. }
  82. int CBatch::QueryExptionTypeInfo(vector<EXCEPTION_TYPE_INFO> & infos)
  83. {
  84. return service->QueryExptionTypeInfo(infos);
  85. }
  86. int CBatch::QueryExceptionPaper(const long exception_type, vector<STUDENT_INFO> &studengList)
  87. {
  88. return service->QueryExceptionPaper(exception_type, studengList);
  89. }
  90. int CBatch::QueryNormalPaper(vector<STUDENT_INFO> &studengList)
  91. {
  92. return service->QueryNormalPaper(studengList);
  93. }
  94. int CBatch::QueryPaperDetail(const int paper_id, PAPER_DETAIL &paper_detail, vector<PAGE_DETAIL> &pageList, vector<GROUP_QUESTION> &questionList)
  95. {
  96. return service->QueryPaperDetail(paper_id, paper_detail, pageList, questionList);
  97. }
  98. int CBatch::UpdatePaperStudent(const int paper_id, const std::string examinee_id, const std::string student_code, const std::string studentName, const long schoolId, const std::string stuCode, const std::string stuSchoolCode, const std::string className, const std::string gradeName, bool bReIdentify /*= false*/)
  99. {
  100. return service->UpdatePaperStudent(paper_id, examinee_id, student_code, studentName, schoolId, stuCode, stuSchoolCode, className, gradeName,bReIdentify);
  101. }
  102. int CBatch::IgnorePaper(const int paper_id)
  103. {
  104. return service->IgnorePaper(paper_id);
  105. }
  106. int CBatch::IgnoreException(const long exceptions)
  107. {
  108. return service->IgnoreException(exceptions);
  109. }
  110. int CBatch::ReplacePaper(const int paper_id, int &paper_id_ret)
  111. {
  112. return service->ReplacePaper(paper_id, paper_id_ret);
  113. }
  114. int CBatch::ClearDbTemp()
  115. {
  116. return service->ClearDbTemp();
  117. }
  118. int CBatch::ReplaceAllKaoHaoChongTu(vector<int> &paper_id_List)
  119. {
  120. return service->ReplaceAllKaoHaoChongTu(paper_id_List);
  121. }
  122. int CBatch::OnBnClickedButtonStartScan()
  123. {
  124. return service->Start();
  125. }
  126. int CBatch::SetHandlerWnd(HWND hwnd)
  127. {
  128. return service->SetHandlerWnd(hwnd);
  129. }
  130. void CBatch::SetDataBaseManager(RTL_CRITICAL_SECTION* database_db_lock, CppSQLite3DB* database_db, int database_id)
  131. {
  132. service->SetDataBaseManager(database_db_lock, database_db, database_id);
  133. }
  134. void CBatch::getCurScanExam(std::string exam_code, std::vector<std::vector<coverStu>> &stuInfo)
  135. {
  136. service->getCurScanExam(exam_code, stuInfo);
  137. }
  138. void CBatch::getCoverStuInfoByExamCode(std::string examCode, std::vector<coverStu> &stuInfo)
  139. {
  140. service->getCoverStuInfoByExamCode(examCode, stuInfo);
  141. }
  142. void CBatch::RestoreErrorHandleSite(const std::string& task_id, const std::string&type, const std::string& strPath)
  143. {
  144. service->RestoreErrorHandleSite(task_id,type, strPath);
  145. }
  146. int CBatch::PreErrorHandleRestoreSite(bool bcontinue, int scan_type, FEEDER_TYPE feederType, const ScanParam & param)
  147. {
  148. return service->PreErrorHandleRestoreSite(bcontinue,scan_type, feederType, param);
  149. }
  150. void CBatch::SetErrorHandle(bool bErrorHandle)
  151. {
  152. return service->SetErrorHandle(bErrorHandle);
  153. }
  154. void CBatch::InitUploadManager(bool bEanble, bool bCountiue, bool bErrorHanle, bool bOnlineCard, IUploudNotify*pNotify)
  155. {
  156. service->InitUploadManager(bEanble, bCountiue,bErrorHanle,bOnlineCard, pNotify);
  157. }
  158. void CBatch::OnScanListFilter(bool bsuccess, int nUploadState)
  159. {
  160. service->OnScanListFilter(bsuccess,nUploadState);
  161. }
  162. int CBatch::UploadOnScanCmd(int nCmd, const char*param, void*ret)
  163. {
  164. return service->UploadOnScanCmd(nCmd, param, ret);
  165. }
  166. int CBatch::BatchServiceCmd(int cmd, void*param, void*ret)
  167. {
  168. int nRet = -1;
  169. if (service){
  170. nRet = service->BatchServiceCmd(cmd, param,ret);
  171. }
  172. return nRet;
  173. }
  174. void CBatch::QuickHandle(bool bGetPath, char*path_nor, int nor_len, char*path_exc, int exc_len)
  175. {
  176. service->QuickHandle(bGetPath, path_nor, nor_len, path_exc, exc_len);
  177. }
  178. vector<int> CBatch::GetAllConfictPaper(int student_paper_id, string student_id)//»ñÈ¡³åÍ»ÊÔ¾í
  179. {
  180. return service->GetAllConfictPaper(student_paper_id, student_id);
  181. }
  182. int CBatch::ExamineThisScan(PAPER_DETAIL& paper_detail)
  183. {
  184. return service->ExamineThisScan(paper_detail);
  185. }
  186. int CBatch::SetAbsentExam(PAPER_DETAIL& paper_detail, int absent)
  187. {
  188. return service->SetAbsentExam(paper_detail, absent);
  189. }
  190. int CBatch::QueryKeGuanTiYiChang(const int paper_id, std::vector<KEGUANTI_DETAIL>& keguantiList)
  191. {
  192. return service->QueryKeGuanTiYiChang(paper_id, keguantiList);
  193. }
  194. int CBatch::UpdateKeGuanTiYiChang(const int paper_id, std::vector<KEGUANTI_DETAIL>& keguantiList)
  195. {
  196. return service->UpdateKeGuanTiYiChang(paper_id, keguantiList);
  197. }