#include "respgetmfuserblance.h" #include #include #include RespGetMfUserBlance::RespGetMfUserBlance(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()=="rsCount") { this->rsCount = it.value().toInt32(); } else { QScriptValue sv1 = it.value(); map.insert("payid",sv1.property("payid").toString()); map.insert("paymoney",sv1.property("paymoney").toString()); map.insert("starttime",sv1.property("starttime").toString()); map.insert("endtime",sv1.property("endtime").toString()); map.insert("paytime",sv1.property("paytime").toString()); } } } } int RespGetMfUserBlance::getRtnCode() { return this->rtnCode; } QString RespGetMfUserBlance::getRtnMemo() { return this->rtnMemo; } int RespGetMfUserBlance::getRsCount() { return this->rsCount; } QMultiMap RespGetMfUserBlance::getRs() { return this->map; }