#include "respgetjsjcinfo.h" #include #include #include RespGetJSJCinfo::RespGetJSJCinfo(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("ltfid",sv1.property("ltfid").toString()); map.insert("uqrycode",sv1.property("uqrycode").toString()); map.insert("detail",sv1.property("detail").toString()); map.insert("batchsrc",sv1.property("batchsrc").toString()); map.insert("batchid",sv1.property("batchid").toString()); map.insert("ltf_tj",sv1.property("ltf_tj").toString()); map.insert("ltf_list",sv1.property("ltf_list").toString()); map.insert("forecast_tj",sv1.property("forecast_tj").toString()); map.insert("forecast_list",sv1.property("forecast_list").toString()); map.insert("hmzs",sv1.property("hmzs").toString()); map.insert("inserttime",sv1.property("inserttime").toString()); map.insert("finishtime",sv1.property("finishtime").toString()); map.insert("dealstatus",sv1.property("dealstatus").toString()); } } } } int RespGetJSJCinfo::getRtnCode() { return this->rtnCode; } QString RespGetJSJCinfo::getRtnMemo() { return this->rtnMemo; } int RespGetJSJCinfo::getRsCount() { return this->rsCount; } QMultiMap RespGetJSJCinfo::getRs() { return this->map; }