| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include "respgetshkjinfo.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespGetShkjInfo::RespGetShkjInfo(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- this->rsCount = 0;
- 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("ltfid",sv1.property("ltfid").toString());
- map.insert("uqrycode",sv1.property("uqrycode").toString());
- map.insert("dealstatus",sv1.property("dealstatus").toString());
- map.insert("detail",sv1.property("detail").toString());
- map.insert("batchsrc",sv1.property("batchsrc").toString());
- map.insert("batchid",sv1.property("batchid").toString());
- map.insert("ltf_tj",sv1.property("ltf_tj").toString());
- map.insert("ltf_list",sv1.property("ltf_list").toString());
- map.insert("forecast_tj",sv1.property("forecast_tj").toString());
- map.insert("forecast_list",sv1.property("forecast_list").toString());
- map.insert("hmzs",sv1.property("hmzs").toString());
- map.insert("shsl",sv1.property("shsl").toString());
- map.insert("inserttime",sv1.property("inserttime").toString());
- map.insert("finishtime",sv1.property("finishtime").toString());
- map.insert("memo",sv1.property("memo").toString());
- }
- }
- }
- }
- int RespGetShkjInfo::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespGetShkjInfo::getRtnMemo()
- {
- return this->rtnMemo;
- }
- int RespGetShkjInfo::getRsCount()
- {
- return this->rsCount;
- }
- QMultiMap<QString,QString> RespGetShkjInfo::getRs()
- {
- return this->map;
- }
|