| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #include "respgetfhymht.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetFhymHt::RespGetFhymHt(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("zcsl",sv1.property("zcsl").toString());
- map.insert("ycsl",sv1.property("ycsl").toString());
- map.insert("wzsl",sv1.property("wzsl").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());
- map.insert("settlefee",sv1.property("settlefee").toString());
- map.insert("giftfee",sv1.property("giftfee").toString());
- map.insert("memo",sv1.property("memo").toString());
- map.insert("isdeliver",sv1.property("isdeliver").toString());
- map.insert("delivertime",sv1.property("delivertime").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("zcsl",sv1.property("zcsl").toString());
- map.insert("ycsl",sv1.property("ycsl").toString());
- map.insert("wzsl",sv1.property("wzsl").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());
- map.insert("settlefee",sv1.property("settlefee").toString());
- map.insert("giftfee",sv1.property("giftfee").toString());
- map.insert("memo",sv1.property("memo").toString());
- map.insert("isdeliver",sv1.property("isdeliver").toString());
- map.insert("delivertime",sv1.property("delivertime").toString());
- }*/
- }
- }
- }
- }
- int RespGetFhymHt::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetFhymHt::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetFhymHt::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetFhymHt::getRs()
- {
- return this->map;
- }
|