#include "respgetcostinfo.h" #include #include #include RespGetCostInfo::RespGetCostInfo(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 if(it.name()=="sum_settlefee") { this->totalFee = it.value().toString(); } else { QScriptValue sv1 = it.value(); map.insert("serialnum",sv1.property("serialnum").toString()); map.insert("batchid",sv1.property("batchid").toString()); map.insert("batchtype",sv1.property("batchtype").toString()); map.insert("detail",sv1.property("detail").toString()); map.insert("usercode",sv1.property("usercode").toString()); map.insert("submittime",sv1.property("submittime").toString()); map.insert("finishtime",sv1.property("finishtime").toString()); map.insert("numcount",sv1.property("numcount").toString()); map.insert("finishcount",sv1.property("finishcount").toString()); map.insert("price",sv1.property("price").toString()); map.insert("settlefee",sv1.property("settlefee").toString()); map.insert("giftfee",sv1.property("giftfee").toString()); } } } } int RespGetCostInfo::getRtnCode() { return this->rtnCode; } QString RespGetCostInfo::getRtnMemo() { return this->rtnMemo; } int RespGetCostInfo::getRsCount() { return this->rsCount; } QMultiMap RespGetCostInfo::getRs() { return this->map; }