| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include "respgetfinishedinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetFinishedInfo::RespGetFinishedInfo(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("finishtime",sv1.property("finishtime").toString());
- 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());
- map.insert("ispass",sv1.property("ispass").toString());
- map.insert("isdeliver",sv1.property("isdeliver").toString());
- map.insert("delivertime",sv1.property("delivertime").toString());
- }
- }
- }
- }
- int RespGetFinishedInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetFinishedInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetFinishedInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetFinishedInfo::getRs()
- {
- return this->map;
- }
|