123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #pragma once
- #include "ResultHandler.h"
- #include "..\sqlite\CppSQLite3.h"
- #include "DataBaseHolder.h"
- #include "DataBaseManagerHolder.h"
- /************************************************************************/
- /* 成绩上传服务 */
- /* 2014年12月9日16:04:06 */
- /* 作者:唐林 */
- /************************************************************************/
- class CResultUploader:public IService,public CDataBaseHolder,public CDataBaseManagerHolder
- {
- public:
- CResultUploader(void);
- ~CResultUploader(void);
- void SetResultHandler(CResultHandler * m_result_hadler);
- void SetResultHandler(boost::shared_ptr<CResultHandler> pPtr);
- int SetHandlerWnd(HWND hwnd);
- void SetBatchCode(const CString&strBatchCode){ m_batch_code = strBatchCode; }
- CString MarkHttpHeaderData();
- protected:
- virtual ServiceState OnStarting(void);
- virtual ServiceState OnRunning(void);
- virtual ServiceState OnStoping(void);
- private:
- CResultHandler * m_result_hadler;
- boost::weak_ptr<CResultHandler> m_pWeakResult;
- HWND m_hwnd;
- CString url_str;
- int m_total;
- int m_current_count;
- int m_sccuss_count;
- int last_student_paper_id;
- BOOL m_failtrue;
- CppSQLite3DB upload_database_db;
- bool m_bOnlineCard;
- int m_nSubjectID;
- int m_nOnlineScanType;
- bool m_bErrorHandle;
- CString m_batch_code;
- bool m_bUploadOnScanModel;// 是否是边扫描边上传模式
- std::map<int,bool> m_vctUploadOnScanPapers;//待上传的paperid
- CRITICAL_SECTION m_csUploadOnScanPapers;
- public:
- string m_strMsg;
- // 因之前服务器容量有限,需要换个服务器
- CString m_strNewUploadUrl;
- void readNewUploadUrl();
- int m_nCourseId;
- int readCourseId();
- void logForDbg(string strLog);
- void getupLoadUrl(char *strUrl, int &len);
- void EnableOnLineCard(bool bEnable, int nSubjectID, int nOnlineScanType){ m_bOnlineCard = bEnable; m_nSubjectID = nSubjectID; m_nOnlineScanType = nOnlineScanType; };
- void SetErrorHandle(bool bErrorHandl){ m_bErrorHandle = bErrorHandl; };
- void SetUploadOnScan(bool bUploadOnScan, int student_paper_id,bool bErrorPaper);
- std::string get_ucloud_key(const std::string&eid);
- std::string bucket_name;
- };
|