#include "respgetmf2sysparam.h" #include #include #include RespGetMf2SysParam::RespGetMf2SysParam(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()=="ShkjPnumMinSize") { this->map.insert("ShkjPnumMinSize",it.value().toString()); } else if(it.name()=="ShkjPnumMaxSize") { this->map.insert("ShkjPnumMaxSize",it.value().toString()); } else if(it.name()=="ZxshPnumMaxSize") { this->map.insert("ZxshPnumMaxSize",it.value().toString()); } else if(it.name()=="srvStatus") { this->map.insert("srvStatus",it.value().toString()); } } } } int RespGetMf2SysParam::getRtnCode() { return this->rtnCode; } QString RespGetMf2SysParam::getRtnMemo() { return this->rtnMemo; } int RespGetMf2SysParam::getRsCount() { return this->rsCount; } QMap RespGetMf2SysParam::getRs() { return this->map; }