BillInferenceResult.py 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class BillInferenceResult(object):
  6. def __init__(self):
  7. self._angle = None
  8. self._bill_score = None
  9. self._bill_version = None
  10. self._capital_sum = None
  11. self._date = None
  12. self._name = None
  13. self._no = None
  14. self._rotate_shape = None
  15. self._title = None
  16. @property
  17. def angle(self):
  18. return self._angle
  19. @angle.setter
  20. def angle(self, value):
  21. self._angle = value
  22. @property
  23. def bill_score(self):
  24. return self._bill_score
  25. @bill_score.setter
  26. def bill_score(self, value):
  27. self._bill_score = value
  28. @property
  29. def bill_version(self):
  30. return self._bill_version
  31. @bill_version.setter
  32. def bill_version(self, value):
  33. self._bill_version = value
  34. @property
  35. def capital_sum(self):
  36. return self._capital_sum
  37. @capital_sum.setter
  38. def capital_sum(self, value):
  39. if isinstance(value, list):
  40. self._capital_sum = list()
  41. for i in value:
  42. self._capital_sum.append(i)
  43. @property
  44. def date(self):
  45. return self._date
  46. @date.setter
  47. def date(self, value):
  48. if isinstance(value, list):
  49. self._date = list()
  50. for i in value:
  51. self._date.append(i)
  52. @property
  53. def name(self):
  54. return self._name
  55. @name.setter
  56. def name(self, value):
  57. if isinstance(value, list):
  58. self._name = list()
  59. for i in value:
  60. self._name.append(i)
  61. @property
  62. def no(self):
  63. return self._no
  64. @no.setter
  65. def no(self, value):
  66. if isinstance(value, list):
  67. self._no = list()
  68. for i in value:
  69. self._no.append(i)
  70. @property
  71. def rotate_shape(self):
  72. return self._rotate_shape
  73. @rotate_shape.setter
  74. def rotate_shape(self, value):
  75. if isinstance(value, list):
  76. self._rotate_shape = list()
  77. for i in value:
  78. self._rotate_shape.append(i)
  79. @property
  80. def title(self):
  81. return self._title
  82. @title.setter
  83. def title(self, value):
  84. if isinstance(value, list):
  85. self._title = list()
  86. for i in value:
  87. self._title.append(i)
  88. def to_alipay_dict(self):
  89. params = dict()
  90. if self.angle:
  91. if hasattr(self.angle, 'to_alipay_dict'):
  92. params['angle'] = self.angle.to_alipay_dict()
  93. else:
  94. params['angle'] = self.angle
  95. if self.bill_score:
  96. if hasattr(self.bill_score, 'to_alipay_dict'):
  97. params['bill_score'] = self.bill_score.to_alipay_dict()
  98. else:
  99. params['bill_score'] = self.bill_score
  100. if self.bill_version:
  101. if hasattr(self.bill_version, 'to_alipay_dict'):
  102. params['bill_version'] = self.bill_version.to_alipay_dict()
  103. else:
  104. params['bill_version'] = self.bill_version
  105. if self.capital_sum:
  106. if isinstance(self.capital_sum, list):
  107. for i in range(0, len(self.capital_sum)):
  108. element = self.capital_sum[i]
  109. if hasattr(element, 'to_alipay_dict'):
  110. self.capital_sum[i] = element.to_alipay_dict()
  111. if hasattr(self.capital_sum, 'to_alipay_dict'):
  112. params['capital_sum'] = self.capital_sum.to_alipay_dict()
  113. else:
  114. params['capital_sum'] = self.capital_sum
  115. if self.date:
  116. if isinstance(self.date, list):
  117. for i in range(0, len(self.date)):
  118. element = self.date[i]
  119. if hasattr(element, 'to_alipay_dict'):
  120. self.date[i] = element.to_alipay_dict()
  121. if hasattr(self.date, 'to_alipay_dict'):
  122. params['date'] = self.date.to_alipay_dict()
  123. else:
  124. params['date'] = self.date
  125. if self.name:
  126. if isinstance(self.name, list):
  127. for i in range(0, len(self.name)):
  128. element = self.name[i]
  129. if hasattr(element, 'to_alipay_dict'):
  130. self.name[i] = element.to_alipay_dict()
  131. if hasattr(self.name, 'to_alipay_dict'):
  132. params['name'] = self.name.to_alipay_dict()
  133. else:
  134. params['name'] = self.name
  135. if self.no:
  136. if isinstance(self.no, list):
  137. for i in range(0, len(self.no)):
  138. element = self.no[i]
  139. if hasattr(element, 'to_alipay_dict'):
  140. self.no[i] = element.to_alipay_dict()
  141. if hasattr(self.no, 'to_alipay_dict'):
  142. params['no'] = self.no.to_alipay_dict()
  143. else:
  144. params['no'] = self.no
  145. if self.rotate_shape:
  146. if isinstance(self.rotate_shape, list):
  147. for i in range(0, len(self.rotate_shape)):
  148. element = self.rotate_shape[i]
  149. if hasattr(element, 'to_alipay_dict'):
  150. self.rotate_shape[i] = element.to_alipay_dict()
  151. if hasattr(self.rotate_shape, 'to_alipay_dict'):
  152. params['rotate_shape'] = self.rotate_shape.to_alipay_dict()
  153. else:
  154. params['rotate_shape'] = self.rotate_shape
  155. if self.title:
  156. if isinstance(self.title, list):
  157. for i in range(0, len(self.title)):
  158. element = self.title[i]
  159. if hasattr(element, 'to_alipay_dict'):
  160. self.title[i] = element.to_alipay_dict()
  161. if hasattr(self.title, 'to_alipay_dict'):
  162. params['title'] = self.title.to_alipay_dict()
  163. else:
  164. params['title'] = self.title
  165. return params
  166. @staticmethod
  167. def from_alipay_dict(d):
  168. if not d:
  169. return None
  170. o = BillInferenceResult()
  171. if 'angle' in d:
  172. o.angle = d['angle']
  173. if 'bill_score' in d:
  174. o.bill_score = d['bill_score']
  175. if 'bill_version' in d:
  176. o.bill_version = d['bill_version']
  177. if 'capital_sum' in d:
  178. o.capital_sum = d['capital_sum']
  179. if 'date' in d:
  180. o.date = d['date']
  181. if 'name' in d:
  182. o.name = d['name']
  183. if 'no' in d:
  184. o.no = d['no']
  185. if 'rotate_shape' in d:
  186. o.rotate_shape = d['rotate_shape']
  187. if 'title' in d:
  188. o.title = d['title']
  189. return o