#include "respgetusrslfsltpacksltinfo.h" #include #include #include RespGetUsrSlfSltPackSltInfo::RespGetUsrSlfSltPackSltInfo(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("province",sv1.property("province").toString()); map.insert("city",sv1.property("city").toString()); map.insert("packno",sv1.property("packno").toString()); map.insert("inserttime",sv1.property("inserttime").toString()); } } } } int RespGetUsrSlfSltPackSltInfo::getRtnCode() { return this->rtnCode; } QString RespGetUsrSlfSltPackSltInfo::getRtnMemo() { return this->rtnMemo; } int RespGetUsrSlfSltPackSltInfo::getRsCount() { return this->rsCount; } QMultiMap RespGetUsrSlfSltPackSltInfo::getRs() { return this->map; }