| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include "respsubmitfhymfile.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespSubmitFhymFile::RespSubmitFhymFile(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- if(json.isEmpty())
- {
- rtnCode = RTNCODE_NETWORK_NOTAVAILABLE;
- rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE;
- }
- else if(json=="ABORT")
- {
- rtnCode = RTNCODE_NETWORK_ABORT;
- rtnMemo = RTNMEMO_NETWORK_ABORT;
- }
- else
- {
- rtnCode = RTNCODE_INVALID_FORMAT;
- rtnMemo = RTNMEMO_INVALID_FORMAT;
- while (it.hasNext())
- {
- it.next();
- if(it.name()=="rtnCode")
- {
- this->rtnCode = it.value().toInt32();
- }
- else if(it.name()=="rtnMemo")
- {
- this->rtnMemo = it.value().toString();
- }
- else if(it.name()=="taskid")
- {
- this->taskid = it.value().toString();
- }
- else if(it.name()=="inserttime")
- {
- this->submitTime = it.value().toString();
- }
- else if(it.name()=="submitNum")
- {
- this->submitNum = it.value().toInt32();
- }
- }
- }
- }
- int RespSubmitFhymFile::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespSubmitFhymFile::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespSubmitFhymFile::getSubmitNum()
- {
- return this->submitNum;
- }
- QString RespSubmitFhymFile::getSubmitTime()
- {
- return this->submitTime;
- }
- QString RespSubmitFhymFile::getTaskID()
- {
- return this->taskid;
- }
|