InstRepayPlan.py 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class InstRepayPlan(object):
  6. def __init__(self):
  7. self._cur_term = None
  8. self._cur_term_interest = None
  9. self._cur_term_interest_penalty = None
  10. self._cur_term_principal = None
  11. self._cur_term_principal_penalty = None
  12. self._repaid_interest = None
  13. self._repaid_interest_penalty = None
  14. self._repaid_principal = None
  15. self._repaid_principal_penalty = None
  16. self._status = None
  17. self._term_end_date = None
  18. self._term_no = None
  19. self._term_start_date = None
  20. @property
  21. def cur_term(self):
  22. return self._cur_term
  23. @cur_term.setter
  24. def cur_term(self, value):
  25. self._cur_term = value
  26. @property
  27. def cur_term_interest(self):
  28. return self._cur_term_interest
  29. @cur_term_interest.setter
  30. def cur_term_interest(self, value):
  31. self._cur_term_interest = value
  32. @property
  33. def cur_term_interest_penalty(self):
  34. return self._cur_term_interest_penalty
  35. @cur_term_interest_penalty.setter
  36. def cur_term_interest_penalty(self, value):
  37. self._cur_term_interest_penalty = value
  38. @property
  39. def cur_term_principal(self):
  40. return self._cur_term_principal
  41. @cur_term_principal.setter
  42. def cur_term_principal(self, value):
  43. self._cur_term_principal = value
  44. @property
  45. def cur_term_principal_penalty(self):
  46. return self._cur_term_principal_penalty
  47. @cur_term_principal_penalty.setter
  48. def cur_term_principal_penalty(self, value):
  49. self._cur_term_principal_penalty = value
  50. @property
  51. def repaid_interest(self):
  52. return self._repaid_interest
  53. @repaid_interest.setter
  54. def repaid_interest(self, value):
  55. self._repaid_interest = value
  56. @property
  57. def repaid_interest_penalty(self):
  58. return self._repaid_interest_penalty
  59. @repaid_interest_penalty.setter
  60. def repaid_interest_penalty(self, value):
  61. self._repaid_interest_penalty = value
  62. @property
  63. def repaid_principal(self):
  64. return self._repaid_principal
  65. @repaid_principal.setter
  66. def repaid_principal(self, value):
  67. self._repaid_principal = value
  68. @property
  69. def repaid_principal_penalty(self):
  70. return self._repaid_principal_penalty
  71. @repaid_principal_penalty.setter
  72. def repaid_principal_penalty(self, value):
  73. self._repaid_principal_penalty = value
  74. @property
  75. def status(self):
  76. return self._status
  77. @status.setter
  78. def status(self, value):
  79. self._status = value
  80. @property
  81. def term_end_date(self):
  82. return self._term_end_date
  83. @term_end_date.setter
  84. def term_end_date(self, value):
  85. self._term_end_date = value
  86. @property
  87. def term_no(self):
  88. return self._term_no
  89. @term_no.setter
  90. def term_no(self, value):
  91. self._term_no = value
  92. @property
  93. def term_start_date(self):
  94. return self._term_start_date
  95. @term_start_date.setter
  96. def term_start_date(self, value):
  97. self._term_start_date = value
  98. def to_alipay_dict(self):
  99. params = dict()
  100. if self.cur_term:
  101. if hasattr(self.cur_term, 'to_alipay_dict'):
  102. params['cur_term'] = self.cur_term.to_alipay_dict()
  103. else:
  104. params['cur_term'] = self.cur_term
  105. if self.cur_term_interest:
  106. if hasattr(self.cur_term_interest, 'to_alipay_dict'):
  107. params['cur_term_interest'] = self.cur_term_interest.to_alipay_dict()
  108. else:
  109. params['cur_term_interest'] = self.cur_term_interest
  110. if self.cur_term_interest_penalty:
  111. if hasattr(self.cur_term_interest_penalty, 'to_alipay_dict'):
  112. params['cur_term_interest_penalty'] = self.cur_term_interest_penalty.to_alipay_dict()
  113. else:
  114. params['cur_term_interest_penalty'] = self.cur_term_interest_penalty
  115. if self.cur_term_principal:
  116. if hasattr(self.cur_term_principal, 'to_alipay_dict'):
  117. params['cur_term_principal'] = self.cur_term_principal.to_alipay_dict()
  118. else:
  119. params['cur_term_principal'] = self.cur_term_principal
  120. if self.cur_term_principal_penalty:
  121. if hasattr(self.cur_term_principal_penalty, 'to_alipay_dict'):
  122. params['cur_term_principal_penalty'] = self.cur_term_principal_penalty.to_alipay_dict()
  123. else:
  124. params['cur_term_principal_penalty'] = self.cur_term_principal_penalty
  125. if self.repaid_interest:
  126. if hasattr(self.repaid_interest, 'to_alipay_dict'):
  127. params['repaid_interest'] = self.repaid_interest.to_alipay_dict()
  128. else:
  129. params['repaid_interest'] = self.repaid_interest
  130. if self.repaid_interest_penalty:
  131. if hasattr(self.repaid_interest_penalty, 'to_alipay_dict'):
  132. params['repaid_interest_penalty'] = self.repaid_interest_penalty.to_alipay_dict()
  133. else:
  134. params['repaid_interest_penalty'] = self.repaid_interest_penalty
  135. if self.repaid_principal:
  136. if hasattr(self.repaid_principal, 'to_alipay_dict'):
  137. params['repaid_principal'] = self.repaid_principal.to_alipay_dict()
  138. else:
  139. params['repaid_principal'] = self.repaid_principal
  140. if self.repaid_principal_penalty:
  141. if hasattr(self.repaid_principal_penalty, 'to_alipay_dict'):
  142. params['repaid_principal_penalty'] = self.repaid_principal_penalty.to_alipay_dict()
  143. else:
  144. params['repaid_principal_penalty'] = self.repaid_principal_penalty
  145. if self.status:
  146. if hasattr(self.status, 'to_alipay_dict'):
  147. params['status'] = self.status.to_alipay_dict()
  148. else:
  149. params['status'] = self.status
  150. if self.term_end_date:
  151. if hasattr(self.term_end_date, 'to_alipay_dict'):
  152. params['term_end_date'] = self.term_end_date.to_alipay_dict()
  153. else:
  154. params['term_end_date'] = self.term_end_date
  155. if self.term_no:
  156. if hasattr(self.term_no, 'to_alipay_dict'):
  157. params['term_no'] = self.term_no.to_alipay_dict()
  158. else:
  159. params['term_no'] = self.term_no
  160. if self.term_start_date:
  161. if hasattr(self.term_start_date, 'to_alipay_dict'):
  162. params['term_start_date'] = self.term_start_date.to_alipay_dict()
  163. else:
  164. params['term_start_date'] = self.term_start_date
  165. return params
  166. @staticmethod
  167. def from_alipay_dict(d):
  168. if not d:
  169. return None
  170. o = InstRepayPlan()
  171. if 'cur_term' in d:
  172. o.cur_term = d['cur_term']
  173. if 'cur_term_interest' in d:
  174. o.cur_term_interest = d['cur_term_interest']
  175. if 'cur_term_interest_penalty' in d:
  176. o.cur_term_interest_penalty = d['cur_term_interest_penalty']
  177. if 'cur_term_principal' in d:
  178. o.cur_term_principal = d['cur_term_principal']
  179. if 'cur_term_principal_penalty' in d:
  180. o.cur_term_principal_penalty = d['cur_term_principal_penalty']
  181. if 'repaid_interest' in d:
  182. o.repaid_interest = d['repaid_interest']
  183. if 'repaid_interest_penalty' in d:
  184. o.repaid_interest_penalty = d['repaid_interest_penalty']
  185. if 'repaid_principal' in d:
  186. o.repaid_principal = d['repaid_principal']
  187. if 'repaid_principal_penalty' in d:
  188. o.repaid_principal_penalty = d['repaid_principal_penalty']
  189. if 'status' in d:
  190. o.status = d['status']
  191. if 'term_end_date' in d:
  192. o.term_end_date = d['term_end_date']
  193. if 'term_no' in d:
  194. o.term_no = d['term_no']
  195. if 'term_start_date' in d:
  196. o.term_start_date = d['term_start_date']
  197. return o