respgetuserzxshserviceinfo.cpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #include "respgetuserzxshserviceinfo.h"
  2. #include <QScriptValue>
  3. #include <QScriptEngine>
  4. #include <QScriptValueIterator>
  5. RespGetUserZXSHServiceInfo::RespGetUserZXSHServiceInfo(QString json)
  6. {
  7. this->json = json;
  8. QScriptEngine engine;
  9. QScriptValue sv = engine.evaluate("value = " + this->json);
  10. QScriptValueIterator it(sv);
  11. if(json.isEmpty())
  12. {
  13. rtnCode = RTNCODE_NETWORK_NOTAVAILABLE;
  14. rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE;
  15. }
  16. else if(json=="ABORT")
  17. {
  18. rtnCode = RTNCODE_NETWORK_ABORT;
  19. rtnMemo = RTNMEMO_NETWORK_ABORT;
  20. }
  21. else
  22. {
  23. rtnCode = RTNCODE_INVALID_FORMAT;
  24. rtnMemo = RTNMEMO_INVALID_FORMAT;
  25. while (it.hasNext())
  26. {
  27. it.next();
  28. if(it.name()=="rtnCode")
  29. {
  30. this->rtnCode = it.value().toInt32();
  31. }
  32. else if(it.name()=="rtnMemo")
  33. {
  34. this->rtnMemo = it.value().toString();
  35. }
  36. else if(it.name()=="payType")
  37. {
  38. this->rtnMemo = it.value().toString();
  39. }
  40. else if(it.name()=="monthStartTime")
  41. {
  42. this->monthStartTime = it.value().toString();
  43. }
  44. else if(it.name()=="monthEndTime")
  45. {
  46. this->monthEndTime = it.value().toString();
  47. }
  48. else if(it.name()=="monthDownShzs")
  49. {
  50. this->monthDownShzs = it.value().toString();
  51. }
  52. else if(it.name()=="monthMaxDownShzs")
  53. {
  54. this->monthMaxDownShzs = it.value().toString();
  55. }
  56. else if(it.name()=="zxshMonthDownIn7dayShzs")
  57. {
  58. this->zxshMonthDownIn7dayShzs = it.value().toString();
  59. }
  60. else if(it.name()=="zxshMonthMaxDownIn7dayShzs")
  61. {
  62. this->zxshMonthMaxDownIn7dayShzs = it.value().toString();
  63. }
  64. else if(it.name()=="zxshMonthDownIn1MonthShzs")
  65. {
  66. this->zxshMonthDownIn1MonthShzs = it.value().toString();
  67. }
  68. else if(it.name()=="zxshMonthMaxDownIn1MonthShzs")
  69. {
  70. this->zxshMonthMaxDownIn1MonthShzs = it.value().toString();
  71. }
  72. else if(it.name()=="zxshMonthDownIn3MonthShzs")
  73. {
  74. this->zxshMonthDownIn3MonthShzs = it.value().toString();
  75. }
  76. else if(it.name()=="zxshMonthMaxDownIn3MonthShzs")
  77. {
  78. this->zxshMonthMaxDownIn3MonthShzs = it.value().toString();
  79. }
  80. else if(it.name()=="zxshMonthDownShzs")
  81. {
  82. this->zxshMonthDownShzs = it.value().toString();
  83. }
  84. else if(it.name()=="zxshMonthMaxDownShzs")
  85. {
  86. this->zxshMonthMaxDownShzs = it.value().toString();
  87. }
  88. }
  89. }
  90. }
  91. int RespGetUserZXSHServiceInfo::getRtnCode()
  92. {
  93. return this->rtnCode;
  94. }
  95. QString RespGetUserZXSHServiceInfo::getRtnMemo()
  96. {
  97. return this->rtnMemo;
  98. }
  99. QString RespGetUserZXSHServiceInfo::getMonthStartTime()
  100. {
  101. return this->monthStartTime;
  102. }
  103. QString RespGetUserZXSHServiceInfo::getMonthEndTime()
  104. {
  105. return this->monthEndTime;
  106. }
  107. QString RespGetUserZXSHServiceInfo::getMonthDownShzs()
  108. {
  109. return this->monthDownShzs;
  110. }
  111. QString RespGetUserZXSHServiceInfo::getMonthMaxDownShzs()
  112. {
  113. return this->monthMaxDownShzs;
  114. }
  115. QString RespGetUserZXSHServiceInfo::getZxshMonthDownIn7dayShzs()
  116. {
  117. return this->zxshMonthDownIn7dayShzs;
  118. }
  119. QString RespGetUserZXSHServiceInfo::getZxshMonthMaxDownIn7dayShzs()
  120. {
  121. return this->zxshMonthMaxDownIn7dayShzs;
  122. }
  123. QString RespGetUserZXSHServiceInfo::getZxshMonthDownIn1MonthShzs()
  124. {
  125. return this->zxshMonthDownIn1MonthShzs;
  126. }
  127. QString RespGetUserZXSHServiceInfo::getZxshMonthMaxDownIn1MonthShzs()
  128. {
  129. return this->zxshMonthMaxDownIn1MonthShzs;
  130. }
  131. QString RespGetUserZXSHServiceInfo::getZxshMonthDownIn3MonthShzs()
  132. {
  133. return this->zxshMonthDownIn3MonthShzs;
  134. }
  135. QString RespGetUserZXSHServiceInfo::getZxshMonthMaxDownIn3MonthShzs()
  136. {
  137. return this->zxshMonthMaxDownIn3MonthShzs;
  138. }
  139. QString RespGetUserZXSHServiceInfo::getZxshMonthDownShzs()
  140. {
  141. return this->zxshMonthDownShzs;
  142. }
  143. QString RespGetUserZXSHServiceInfo::getZxshMonthMaxDownShzs()
  144. {
  145. return this->zxshMonthMaxDownShzs;
  146. }