| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #include "respgetmyhmyyinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetMyHmyyInfo::RespGetMyHmyyInfo(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("ordid",sv1.property("ordid").toString());
- map.insert("province",sv1.property("province").toString());
- map.insert("city",sv1.property("city").toString());
- map.insert("isp",sv1.property("isp").toString());
- map.insert("attennum",sv1.property("attennum").toString());
- map.insert("ordtime",sv1.property("ordtime").toString());
- map.insert("updatetime",sv1.property("updatetime").toString());
- map.insert("updatenum",sv1.property("updatenum").toString());
- map.insert("state",sv1.property("state").toString());
- }
- }
- }
- }
- int RespGetMyHmyyInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetMyHmyyInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetMyHmyyInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetMyHmyyInfo::getRs()
- {
- return this->map;
- }
|