KbOrderVoucherModel.py 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class KbOrderVoucherModel(object):
  6. def __init__(self):
  7. self._expire_date = None
  8. self._funds_voucher_no = None
  9. self._item_id = None
  10. self._refund_reason = None
  11. self._refund_type = None
  12. self._shop_id = None
  13. self._status = None
  14. self._store_id = None
  15. self._ticket_effect_count = None
  16. self._ticket_refunded_count = None
  17. self._ticket_used_count = None
  18. self._voucher_id = None
  19. @property
  20. def expire_date(self):
  21. return self._expire_date
  22. @expire_date.setter
  23. def expire_date(self, value):
  24. self._expire_date = value
  25. @property
  26. def funds_voucher_no(self):
  27. return self._funds_voucher_no
  28. @funds_voucher_no.setter
  29. def funds_voucher_no(self, value):
  30. self._funds_voucher_no = value
  31. @property
  32. def item_id(self):
  33. return self._item_id
  34. @item_id.setter
  35. def item_id(self, value):
  36. self._item_id = value
  37. @property
  38. def refund_reason(self):
  39. return self._refund_reason
  40. @refund_reason.setter
  41. def refund_reason(self, value):
  42. self._refund_reason = value
  43. @property
  44. def refund_type(self):
  45. return self._refund_type
  46. @refund_type.setter
  47. def refund_type(self, value):
  48. self._refund_type = value
  49. @property
  50. def shop_id(self):
  51. return self._shop_id
  52. @shop_id.setter
  53. def shop_id(self, value):
  54. self._shop_id = value
  55. @property
  56. def status(self):
  57. return self._status
  58. @status.setter
  59. def status(self, value):
  60. self._status = value
  61. @property
  62. def store_id(self):
  63. return self._store_id
  64. @store_id.setter
  65. def store_id(self, value):
  66. self._store_id = value
  67. @property
  68. def ticket_effect_count(self):
  69. return self._ticket_effect_count
  70. @ticket_effect_count.setter
  71. def ticket_effect_count(self, value):
  72. self._ticket_effect_count = value
  73. @property
  74. def ticket_refunded_count(self):
  75. return self._ticket_refunded_count
  76. @ticket_refunded_count.setter
  77. def ticket_refunded_count(self, value):
  78. self._ticket_refunded_count = value
  79. @property
  80. def ticket_used_count(self):
  81. return self._ticket_used_count
  82. @ticket_used_count.setter
  83. def ticket_used_count(self, value):
  84. self._ticket_used_count = value
  85. @property
  86. def voucher_id(self):
  87. return self._voucher_id
  88. @voucher_id.setter
  89. def voucher_id(self, value):
  90. self._voucher_id = value
  91. def to_alipay_dict(self):
  92. params = dict()
  93. if self.expire_date:
  94. if hasattr(self.expire_date, 'to_alipay_dict'):
  95. params['expire_date'] = self.expire_date.to_alipay_dict()
  96. else:
  97. params['expire_date'] = self.expire_date
  98. if self.funds_voucher_no:
  99. if hasattr(self.funds_voucher_no, 'to_alipay_dict'):
  100. params['funds_voucher_no'] = self.funds_voucher_no.to_alipay_dict()
  101. else:
  102. params['funds_voucher_no'] = self.funds_voucher_no
  103. if self.item_id:
  104. if hasattr(self.item_id, 'to_alipay_dict'):
  105. params['item_id'] = self.item_id.to_alipay_dict()
  106. else:
  107. params['item_id'] = self.item_id
  108. if self.refund_reason:
  109. if hasattr(self.refund_reason, 'to_alipay_dict'):
  110. params['refund_reason'] = self.refund_reason.to_alipay_dict()
  111. else:
  112. params['refund_reason'] = self.refund_reason
  113. if self.refund_type:
  114. if hasattr(self.refund_type, 'to_alipay_dict'):
  115. params['refund_type'] = self.refund_type.to_alipay_dict()
  116. else:
  117. params['refund_type'] = self.refund_type
  118. if self.shop_id:
  119. if hasattr(self.shop_id, 'to_alipay_dict'):
  120. params['shop_id'] = self.shop_id.to_alipay_dict()
  121. else:
  122. params['shop_id'] = self.shop_id
  123. if self.status:
  124. if hasattr(self.status, 'to_alipay_dict'):
  125. params['status'] = self.status.to_alipay_dict()
  126. else:
  127. params['status'] = self.status
  128. if self.store_id:
  129. if hasattr(self.store_id, 'to_alipay_dict'):
  130. params['store_id'] = self.store_id.to_alipay_dict()
  131. else:
  132. params['store_id'] = self.store_id
  133. if self.ticket_effect_count:
  134. if hasattr(self.ticket_effect_count, 'to_alipay_dict'):
  135. params['ticket_effect_count'] = self.ticket_effect_count.to_alipay_dict()
  136. else:
  137. params['ticket_effect_count'] = self.ticket_effect_count
  138. if self.ticket_refunded_count:
  139. if hasattr(self.ticket_refunded_count, 'to_alipay_dict'):
  140. params['ticket_refunded_count'] = self.ticket_refunded_count.to_alipay_dict()
  141. else:
  142. params['ticket_refunded_count'] = self.ticket_refunded_count
  143. if self.ticket_used_count:
  144. if hasattr(self.ticket_used_count, 'to_alipay_dict'):
  145. params['ticket_used_count'] = self.ticket_used_count.to_alipay_dict()
  146. else:
  147. params['ticket_used_count'] = self.ticket_used_count
  148. if self.voucher_id:
  149. if hasattr(self.voucher_id, 'to_alipay_dict'):
  150. params['voucher_id'] = self.voucher_id.to_alipay_dict()
  151. else:
  152. params['voucher_id'] = self.voucher_id
  153. return params
  154. @staticmethod
  155. def from_alipay_dict(d):
  156. if not d:
  157. return None
  158. o = KbOrderVoucherModel()
  159. if 'expire_date' in d:
  160. o.expire_date = d['expire_date']
  161. if 'funds_voucher_no' in d:
  162. o.funds_voucher_no = d['funds_voucher_no']
  163. if 'item_id' in d:
  164. o.item_id = d['item_id']
  165. if 'refund_reason' in d:
  166. o.refund_reason = d['refund_reason']
  167. if 'refund_type' in d:
  168. o.refund_type = d['refund_type']
  169. if 'shop_id' in d:
  170. o.shop_id = d['shop_id']
  171. if 'status' in d:
  172. o.status = d['status']
  173. if 'store_id' in d:
  174. o.store_id = d['store_id']
  175. if 'ticket_effect_count' in d:
  176. o.ticket_effect_count = d['ticket_effect_count']
  177. if 'ticket_refunded_count' in d:
  178. o.ticket_refunded_count = d['ticket_refunded_count']
  179. if 'ticket_used_count' in d:
  180. o.ticket_used_count = d['ticket_used_count']
  181. if 'voucher_id' in d:
  182. o.voucher_id = d['voucher_id']
  183. return o