| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- #include "respgetdealinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetDealInfo::RespGetDealInfo(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
- {
- 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("resulttj",sv1.property("resulttj").toString());
- map.insert("usercode",sv1.property("usercode").toString());
- map.insert("submittime",sv1.property("submittime").toString());
- map.insert("tftime",sv1.property("tftime").toString());
- map.insert("vftime",sv1.property("vftime").toString());
- map.insert("isverify",sv1.property("isverify").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("numcount",sv1.property("numcount").toString());
- map.insert("dlcount",sv1.property("dlcount").toString());
- map.insert("finishcount",sv1.property("finishcount").toString());
- map.insert("optstatus",sv1.property("optstatus").toString());
- }
- }
- }
- }
- int RespGetDealInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetDealInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetDealInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetDealInfo::getRs()
- {
- return this->map;
- }
|