#pragma once #include "scan_common.h" #include "FolderFeeder.h" #include "Identifor.h" #include "ResultUploader.h" #include "basic_struct.h" #include "SeparateThreadTwainFeeder.h" #include "ImgUploader.h" #include "basic_struct_result.h" #include "StudentMatcher.h" #include "CManualMatchFeeder.h" #include "RescanFromServerFeeder.h" #include "..\Schema\schema_struct.h" #include "DataBaseManagerHolder.h" class CSmartEvaluationService :public IService,public CDataBaseManagerHolder { public: CSmartEvaluationService(void); ~CSmartEvaluationService(void); public: /************************************************************************/ /* 注册窗口,识别模块遇到问题将向该窗口发送消息 */ /************************************************************************/ int SetHandlerWnd(HWND hwnd); /************************************************************************/ /* 添加重新扫描的图像 */ /************************************************************************/ int AddRescanPic(const char * pic_path); /************************************************************************/ /* 清除重新扫描的图像 */ /************************************************************************/ int ClearRescanPic(); /************************************************************************/ /* 准备扫描 */ /************************************************************************/ int ReadyScan(FEEDER_TYPE feederType, const ScanParam & param); int QueryExceptionPaper(const long exception_type, vector& studentList); int QueryPaperDetail(const int paper_id, PAPER_DETAIL &paper_detail, vector &pageList, vector &questionList); int UpdatePaperStudent(const int paper_id, const std::string examinee_id, const std::string student_code, const std::string studentName, const long schoolId); int ReIdentify(const int paper_id, const std::vector& params); //忽略试卷 int IgnorePaper(const int paper_id); //忽略异常 int IgnoreException(const long exceptions); //开始上传 int StartUploadPaper(HWND hWnd); //放弃本次扫描结果 int GiveUpCurrentBatch(); virtual BOOL SupportPause(void); /*从文件夹扫描继续扫描时设置扫描路径*/ int SetFolderScanDir(const std::string& img_dir); virtual BOOL Stop(void); //查询异常卷总数 int QueryExptionPaperCount(int & total_count); //查询异常类型信息 int QueryExptionTypeInfo(vector & infos); int LoadSchema(long long examId, std::string examName, long examCourseId, std::string courseName, std::string schemaPath); int SetCookie(CString path, CString name, CString value); void saveQuestionStd(long long examId, std::string examName, long examCourseId, std::string courseName, std::vector &questions); int QueryNormalPaper(vector & studentList); int QueryMubanImgPath(int page_index, std::string& imgPath); int QueryMubanImgCount(int& page_count); int SetLocalServerCookie(CString name, CString value); protected: virtual ServiceState OnStarting( void ); virtual ServiceState OnRunning( void ); virtual ServiceState OnStoping(void); virtual ServiceState OnPausing(void); virtual ServiceState OnResuming(void); private: CIdentifyTaskManager taskManager; CImgUploader m_img_uploader; CSeparateThreadTwainFeeder m_twain_feeder;//TWAIN扫描仪图像送入器 CRescanFromServerFeeder m_server_feeder; CFolderFeeder m_folder_feeder;//文件夹图像送入器 CManualMatchFeeder m_manualmatch_feeder;//重新识别图像送入器 CIdentifor m_identifor;//试卷识别服务 CResultHandler m_result_handler;//识别结果处理服务 CResultUploader m_result_uploader;//成绩上传服务 IFeeder * m_current_feeder;//当前图像送入器 FEEDER_TYPE m_feeder_type;//当前图像送入器类型 RTL_CRITICAL_SECTION bantch_db_lock; CppSQLite3DB bantch_db; HWND m_hwnd; //批次号 CString m_bantch_code; //本次扫描原始图像存放目录 CString m_norimg_dir; CString m_excimg_dir; CString m_img_clips_dir; CString m_img_alynasis_dir; CString m_img_alynasis_result_dir; //当前批次的数据库的ID int m_database_id; CString m_bantch_dir; //标记是否非正常关闭 BOOL m_abnormal_stop; CString m_paper_code; std::string m_muban_img_dir; boost::shared_ptr m_schema; boost::shared_ptr m_handleInfo; schema::SCHEMA m_schema0; CStudentMatcher m_student_matcher; long m_examCourseId; long m_examId; CString m_img_down_load_dir; std::string m_examName; std::string m_courseName; };