#include "respgetfhymtask.h" #include #include #include RespGetFhymTask::RespGetFhymTask(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()=="rs") { QScriptValueIterator it2(it.value()); while(it2.hasNext()) { it2.next(); if (it2.flags() & QScriptValue::SkipInEnumeration) continue; QScriptValue sv1 = it2.value(); if (sv1.property("taskid").toInt32() > 0) { map.insert("serialnum",sv1.property("serialnum").toString()); map.insert("taskid",sv1.property("taskid").toString()); map.insert("usercode",sv1.property("usercode").toString()); map.insert("pnumfiletype",sv1.property("pnumfiletype").toString()); map.insert("origfilename",sv1.property("origfilename").toString()); map.insert("hmzs",sv1.property("hmzs").toString()); map.insert("feecount",sv1.property("fee_count").toString()); map.insert("createtime",sv1.property("create_time").toString()); map.insert("finishtime",sv1.property("finish_time").toString()); map.insert("state",sv1.property("state").toString()); map.insert("statestr",sv1.property("statestr").toString()); map.insert("price",sv1.property("price").toString()); map.insert("duefee",sv1.property("duefee").toString()); if(sv1.property("settlefee").toString()=="null") map.insert("settlefee",""); else map.insert("settlefee",sv1.property("settlefee").toString()); map.insert("giftfee",sv1.property("giftfee").toString()); map.insert("memo",sv1.property("memo").toString()); } } } else { /* QScriptValue sv1 = it.value(); if (sv1.property("taskid").toInt32() > 0) { map.insert("serialnum",sv1.property("serialnum").toString()); map.insert("taskid",sv1.property("taskid").toString()); map.insert("usercode",sv1.property("usercode").toString()); map.insert("pnumfiletype",sv1.property("pnumfiletype").toString()); map.insert("origfilename",sv1.property("origfilename").toString()); map.insert("hmzs",sv1.property("hmzs").toString()); map.insert("feecount",sv1.property("fee_count").toString()); map.insert("createtime",sv1.property("create_time").toString()); map.insert("finishtime",sv1.property("finish_time").toString()); map.insert("state",sv1.property("state").toString()); map.insert("statestr",sv1.property("statestr").toString()); map.insert("price",sv1.property("price").toString()); map.insert("duefee",sv1.property("duefee").toString()); if(sv1.property("settlefee").toString()=="null") map.insert("settlefee",""); else map.insert("settlefee",sv1.property("settlefee").toString()); map.insert("giftfee",sv1.property("giftfee").toString()); map.insert("memo",sv1.property("memo").toString()); } */ } } } } int RespGetFhymTask::getRtnCode() { return this->rtnCode; } QString RespGetFhymTask::getRtnMemo() { return this->rtnMemo; } int RespGetFhymTask::getRsCount() { return this->rsCount; } QMultiMap RespGetFhymTask::getRs() { return this->map; }