InvoiceElementModel.py 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class InvoiceElementModel(object):
  6. def __init__(self):
  7. self._expense_status = None
  8. self._has_pdf_file = None
  9. self._has_risk = None
  10. self._invoice_amount = None
  11. self._invoice_code = None
  12. self._invoice_date = None
  13. self._invoice_img_url = None
  14. self._invoice_kind = None
  15. self._invoice_no = None
  16. self._invoice_status = None
  17. self._isv_contact = None
  18. self._isv_name = None
  19. self._logo_url = None
  20. self._m_name = None
  21. self._payee_name = None
  22. self._payee_tax_no = None
  23. self._payer_name = None
  24. self._payer_tax_no = None
  25. self._pdf_url = None
  26. @property
  27. def expense_status(self):
  28. return self._expense_status
  29. @expense_status.setter
  30. def expense_status(self, value):
  31. self._expense_status = value
  32. @property
  33. def has_pdf_file(self):
  34. return self._has_pdf_file
  35. @has_pdf_file.setter
  36. def has_pdf_file(self, value):
  37. self._has_pdf_file = value
  38. @property
  39. def has_risk(self):
  40. return self._has_risk
  41. @has_risk.setter
  42. def has_risk(self, value):
  43. self._has_risk = value
  44. @property
  45. def invoice_amount(self):
  46. return self._invoice_amount
  47. @invoice_amount.setter
  48. def invoice_amount(self, value):
  49. self._invoice_amount = value
  50. @property
  51. def invoice_code(self):
  52. return self._invoice_code
  53. @invoice_code.setter
  54. def invoice_code(self, value):
  55. self._invoice_code = value
  56. @property
  57. def invoice_date(self):
  58. return self._invoice_date
  59. @invoice_date.setter
  60. def invoice_date(self, value):
  61. self._invoice_date = value
  62. @property
  63. def invoice_img_url(self):
  64. return self._invoice_img_url
  65. @invoice_img_url.setter
  66. def invoice_img_url(self, value):
  67. self._invoice_img_url = value
  68. @property
  69. def invoice_kind(self):
  70. return self._invoice_kind
  71. @invoice_kind.setter
  72. def invoice_kind(self, value):
  73. self._invoice_kind = value
  74. @property
  75. def invoice_no(self):
  76. return self._invoice_no
  77. @invoice_no.setter
  78. def invoice_no(self, value):
  79. self._invoice_no = value
  80. @property
  81. def invoice_status(self):
  82. return self._invoice_status
  83. @invoice_status.setter
  84. def invoice_status(self, value):
  85. self._invoice_status = value
  86. @property
  87. def isv_contact(self):
  88. return self._isv_contact
  89. @isv_contact.setter
  90. def isv_contact(self, value):
  91. self._isv_contact = value
  92. @property
  93. def isv_name(self):
  94. return self._isv_name
  95. @isv_name.setter
  96. def isv_name(self, value):
  97. self._isv_name = value
  98. @property
  99. def logo_url(self):
  100. return self._logo_url
  101. @logo_url.setter
  102. def logo_url(self, value):
  103. self._logo_url = value
  104. @property
  105. def m_name(self):
  106. return self._m_name
  107. @m_name.setter
  108. def m_name(self, value):
  109. self._m_name = value
  110. @property
  111. def payee_name(self):
  112. return self._payee_name
  113. @payee_name.setter
  114. def payee_name(self, value):
  115. self._payee_name = value
  116. @property
  117. def payee_tax_no(self):
  118. return self._payee_tax_no
  119. @payee_tax_no.setter
  120. def payee_tax_no(self, value):
  121. self._payee_tax_no = value
  122. @property
  123. def payer_name(self):
  124. return self._payer_name
  125. @payer_name.setter
  126. def payer_name(self, value):
  127. self._payer_name = value
  128. @property
  129. def payer_tax_no(self):
  130. return self._payer_tax_no
  131. @payer_tax_no.setter
  132. def payer_tax_no(self, value):
  133. self._payer_tax_no = value
  134. @property
  135. def pdf_url(self):
  136. return self._pdf_url
  137. @pdf_url.setter
  138. def pdf_url(self, value):
  139. self._pdf_url = value
  140. def to_alipay_dict(self):
  141. params = dict()
  142. if self.expense_status:
  143. if hasattr(self.expense_status, 'to_alipay_dict'):
  144. params['expense_status'] = self.expense_status.to_alipay_dict()
  145. else:
  146. params['expense_status'] = self.expense_status
  147. if self.has_pdf_file:
  148. if hasattr(self.has_pdf_file, 'to_alipay_dict'):
  149. params['has_pdf_file'] = self.has_pdf_file.to_alipay_dict()
  150. else:
  151. params['has_pdf_file'] = self.has_pdf_file
  152. if self.has_risk:
  153. if hasattr(self.has_risk, 'to_alipay_dict'):
  154. params['has_risk'] = self.has_risk.to_alipay_dict()
  155. else:
  156. params['has_risk'] = self.has_risk
  157. if self.invoice_amount:
  158. if hasattr(self.invoice_amount, 'to_alipay_dict'):
  159. params['invoice_amount'] = self.invoice_amount.to_alipay_dict()
  160. else:
  161. params['invoice_amount'] = self.invoice_amount
  162. if self.invoice_code:
  163. if hasattr(self.invoice_code, 'to_alipay_dict'):
  164. params['invoice_code'] = self.invoice_code.to_alipay_dict()
  165. else:
  166. params['invoice_code'] = self.invoice_code
  167. if self.invoice_date:
  168. if hasattr(self.invoice_date, 'to_alipay_dict'):
  169. params['invoice_date'] = self.invoice_date.to_alipay_dict()
  170. else:
  171. params['invoice_date'] = self.invoice_date
  172. if self.invoice_img_url:
  173. if hasattr(self.invoice_img_url, 'to_alipay_dict'):
  174. params['invoice_img_url'] = self.invoice_img_url.to_alipay_dict()
  175. else:
  176. params['invoice_img_url'] = self.invoice_img_url
  177. if self.invoice_kind:
  178. if hasattr(self.invoice_kind, 'to_alipay_dict'):
  179. params['invoice_kind'] = self.invoice_kind.to_alipay_dict()
  180. else:
  181. params['invoice_kind'] = self.invoice_kind
  182. if self.invoice_no:
  183. if hasattr(self.invoice_no, 'to_alipay_dict'):
  184. params['invoice_no'] = self.invoice_no.to_alipay_dict()
  185. else:
  186. params['invoice_no'] = self.invoice_no
  187. if self.invoice_status:
  188. if hasattr(self.invoice_status, 'to_alipay_dict'):
  189. params['invoice_status'] = self.invoice_status.to_alipay_dict()
  190. else:
  191. params['invoice_status'] = self.invoice_status
  192. if self.isv_contact:
  193. if hasattr(self.isv_contact, 'to_alipay_dict'):
  194. params['isv_contact'] = self.isv_contact.to_alipay_dict()
  195. else:
  196. params['isv_contact'] = self.isv_contact
  197. if self.isv_name:
  198. if hasattr(self.isv_name, 'to_alipay_dict'):
  199. params['isv_name'] = self.isv_name.to_alipay_dict()
  200. else:
  201. params['isv_name'] = self.isv_name
  202. if self.logo_url:
  203. if hasattr(self.logo_url, 'to_alipay_dict'):
  204. params['logo_url'] = self.logo_url.to_alipay_dict()
  205. else:
  206. params['logo_url'] = self.logo_url
  207. if self.m_name:
  208. if hasattr(self.m_name, 'to_alipay_dict'):
  209. params['m_name'] = self.m_name.to_alipay_dict()
  210. else:
  211. params['m_name'] = self.m_name
  212. if self.payee_name:
  213. if hasattr(self.payee_name, 'to_alipay_dict'):
  214. params['payee_name'] = self.payee_name.to_alipay_dict()
  215. else:
  216. params['payee_name'] = self.payee_name
  217. if self.payee_tax_no:
  218. if hasattr(self.payee_tax_no, 'to_alipay_dict'):
  219. params['payee_tax_no'] = self.payee_tax_no.to_alipay_dict()
  220. else:
  221. params['payee_tax_no'] = self.payee_tax_no
  222. if self.payer_name:
  223. if hasattr(self.payer_name, 'to_alipay_dict'):
  224. params['payer_name'] = self.payer_name.to_alipay_dict()
  225. else:
  226. params['payer_name'] = self.payer_name
  227. if self.payer_tax_no:
  228. if hasattr(self.payer_tax_no, 'to_alipay_dict'):
  229. params['payer_tax_no'] = self.payer_tax_no.to_alipay_dict()
  230. else:
  231. params['payer_tax_no'] = self.payer_tax_no
  232. if self.pdf_url:
  233. if hasattr(self.pdf_url, 'to_alipay_dict'):
  234. params['pdf_url'] = self.pdf_url.to_alipay_dict()
  235. else:
  236. params['pdf_url'] = self.pdf_url
  237. return params
  238. @staticmethod
  239. def from_alipay_dict(d):
  240. if not d:
  241. return None
  242. o = InvoiceElementModel()
  243. if 'expense_status' in d:
  244. o.expense_status = d['expense_status']
  245. if 'has_pdf_file' in d:
  246. o.has_pdf_file = d['has_pdf_file']
  247. if 'has_risk' in d:
  248. o.has_risk = d['has_risk']
  249. if 'invoice_amount' in d:
  250. o.invoice_amount = d['invoice_amount']
  251. if 'invoice_code' in d:
  252. o.invoice_code = d['invoice_code']
  253. if 'invoice_date' in d:
  254. o.invoice_date = d['invoice_date']
  255. if 'invoice_img_url' in d:
  256. o.invoice_img_url = d['invoice_img_url']
  257. if 'invoice_kind' in d:
  258. o.invoice_kind = d['invoice_kind']
  259. if 'invoice_no' in d:
  260. o.invoice_no = d['invoice_no']
  261. if 'invoice_status' in d:
  262. o.invoice_status = d['invoice_status']
  263. if 'isv_contact' in d:
  264. o.isv_contact = d['isv_contact']
  265. if 'isv_name' in d:
  266. o.isv_name = d['isv_name']
  267. if 'logo_url' in d:
  268. o.logo_url = d['logo_url']
  269. if 'm_name' in d:
  270. o.m_name = d['m_name']
  271. if 'payee_name' in d:
  272. o.payee_name = d['payee_name']
  273. if 'payee_tax_no' in d:
  274. o.payee_tax_no = d['payee_tax_no']
  275. if 'payer_name' in d:
  276. o.payer_name = d['payer_name']
  277. if 'payer_tax_no' in d:
  278. o.payer_tax_no = d['payer_tax_no']
  279. if 'pdf_url' in d:
  280. o.pdf_url = d['pdf_url']
  281. return o