| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include "respgettransferinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetTransferInfo::RespGetTransferInfo(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()=="sum_trsfmoney")
- {
- this->sumTransferMoney = it.value().toString();
- }
- else
- {
- QScriptValue sv1 = it.value();
- map.insert("serialnum",sv1.property("serialnum").toString());
- map.insert("trsfid",sv1.property("trsfid").toString());
- map.insert("sndsysname",sv1.property("sndsysname").toString());
- map.insert("rcvsysname",sv1.property("rcvsysname").toString());
- map.insert("trsfmoney",sv1.property("trsfmoney").toString());
- map.insert("trsftime",sv1.property("trsftime").toString());
- map.insert("trsftype",sv1.property("trsftype").toString());
- map.insert("trsfmemo",sv1.property("trsfmemo").toString());
- }
- }
- }
- }
- int RespGetTransferInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetTransferInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- QString RespGetTransferInfo::getSumTransferMoney()
- {
- return this->sumTransferMoney;
- }
- int RespGetTransferInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetTransferInfo::getRs()
- {
- return this->map;
- }
|