#include "autouploadfile.h" #include "sncdatabase.h" #include "fileprepare.h" #include "respsubmitshkjfile.h" #include "resppackmerge.h" #include "resppacktran.h" #include "respuserserviceverify.h" #include "filesplitter.h" AutoUploadFile::AutoUploadFile() { m_stop = false; m_cubeWs = new WSCube2(); m_moduleID = "shkj"; m_clientID = ""; m_skip = false; m_stop = false; } void AutoUploadFile::abort() { m_stop = true; m_cubeWs->abort(); } void AutoUploadFile::setSkip(bool skip) { m_skip = skip; } AutoUploadFile::~AutoUploadFile() { m_cubeWs->abort(); delete m_cubeWs; qDebug()< accountInfo) { m_account = accountInfo; qDebug()< list = SNCDataBase::getAllUpload(m_moduleID,m_clientID,userCode); int cols = list.uniqueKeys().size(); int rows = 0; if(cols!=0) rows = list.size()/cols; for(int i=0;im_moduleID,this->m_clientID); if(!filePrepare.prepare()) { m_errCode = -1; m_errMsg = filePrepare.getRtnMsg(); return -1; } if(m_stop) { return 0; } qDebug()<<"sumit"<userServiceVerify("SubmitShkjFile",QString("%1").arg(filePrepare.getCount()),m_account.value("ssohash")); RespUserServiceVerify response(json); qDebug()<packTran(packName,m_account.value("ssohash")); RespPackTran response(json); if(response.getRtnCode()==1) { QFile::remove(packName); } else { m_errMsg = response.getRtnMemo(); m_errCode = -4; if(response.getRtnCode()==RTNCODE_NETWORK_ABORT) { return 0; } else if(response.getRtnCode()==RTNCODE_NETWORK_NOTAVAILABLE) { m_errCode = -2; return -1; } allupload = false; break; } SNCDataBase::updateFileUploadPercent(fileid,(i+1)*100.0/list.size()); emit uploadProgressUpdated(); } if(allupload) { splitter.cleanup(); QString json = m_cubeWs->packMerge(packName,m_account.value("ssohash")); qDebug()<submitShkjFile(filePrepare.getLastUploadFileName(),response.getFileHash(),"PackMerge",fileType,memo,m_account.value("ssohash")); qDebug()<