| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #include "respgetzxshtaskinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetZxshTaskInfo::RespGetZxshTaskInfo(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- this->rsCount = 0;
- 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()=="rsCount")
- {
- this->rsCount = it.value().toInt32();
- }
- else
- {
- QScriptValue sv1 = it.value();
- map.insert("serialnum",sv1.property("serialnum").toString());
- map.insert("ssid",sv1.property("ssid").toString());
- map.insert("dealstatus",sv1.property("dealstatus").toString());
- map.insert("province",sv1.property("province").toString());
- map.insert("city",sv1.property("city").toString());
- map.insert("updatedays",sv1.property("updateDays").toString());
- map.insert("isp",sv1.property("isp").toString());
- map.insert("slttype",sv1.property("slttype").toString());
- map.insert("neednum",sv1.property("neednum").toString());
- map.insert("rpnum",sv1.property("rpnum").toString());
- map.insert("inserttime",sv1.property("inserttime").toString());
- map.insert("finishtime",sv1.property("finishtime").toString());
- }
- }
- }
- }
- int RespGetZxshTaskInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetZxshTaskInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetZxshTaskInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetZxshTaskInfo::getRs()
- {
- return this->map;
- }
|