AccessProduceOrder.py 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import json
  4. from alipay.aop.api.constant.ParamConstants import *
  5. class AccessProduceOrder(object):
  6. def __init__(self):
  7. self._batch_id = None
  8. self._produce_order_id = None
  9. self._produce_quantity = None
  10. self._stuff_attr_name = None
  11. self._stuff_material = None
  12. self._stuff_size = None
  13. self._stuff_type = None
  14. self._template_id = None
  15. self._template_name = None
  16. @property
  17. def batch_id(self):
  18. return self._batch_id
  19. @batch_id.setter
  20. def batch_id(self, value):
  21. self._batch_id = value
  22. @property
  23. def produce_order_id(self):
  24. return self._produce_order_id
  25. @produce_order_id.setter
  26. def produce_order_id(self, value):
  27. self._produce_order_id = value
  28. @property
  29. def produce_quantity(self):
  30. return self._produce_quantity
  31. @produce_quantity.setter
  32. def produce_quantity(self, value):
  33. self._produce_quantity = value
  34. @property
  35. def stuff_attr_name(self):
  36. return self._stuff_attr_name
  37. @stuff_attr_name.setter
  38. def stuff_attr_name(self, value):
  39. self._stuff_attr_name = value
  40. @property
  41. def stuff_material(self):
  42. return self._stuff_material
  43. @stuff_material.setter
  44. def stuff_material(self, value):
  45. self._stuff_material = value
  46. @property
  47. def stuff_size(self):
  48. return self._stuff_size
  49. @stuff_size.setter
  50. def stuff_size(self, value):
  51. self._stuff_size = value
  52. @property
  53. def stuff_type(self):
  54. return self._stuff_type
  55. @stuff_type.setter
  56. def stuff_type(self, value):
  57. self._stuff_type = value
  58. @property
  59. def template_id(self):
  60. return self._template_id
  61. @template_id.setter
  62. def template_id(self, value):
  63. self._template_id = value
  64. @property
  65. def template_name(self):
  66. return self._template_name
  67. @template_name.setter
  68. def template_name(self, value):
  69. self._template_name = value
  70. def to_alipay_dict(self):
  71. params = dict()
  72. if self.batch_id:
  73. if hasattr(self.batch_id, 'to_alipay_dict'):
  74. params['batch_id'] = self.batch_id.to_alipay_dict()
  75. else:
  76. params['batch_id'] = self.batch_id
  77. if self.produce_order_id:
  78. if hasattr(self.produce_order_id, 'to_alipay_dict'):
  79. params['produce_order_id'] = self.produce_order_id.to_alipay_dict()
  80. else:
  81. params['produce_order_id'] = self.produce_order_id
  82. if self.produce_quantity:
  83. if hasattr(self.produce_quantity, 'to_alipay_dict'):
  84. params['produce_quantity'] = self.produce_quantity.to_alipay_dict()
  85. else:
  86. params['produce_quantity'] = self.produce_quantity
  87. if self.stuff_attr_name:
  88. if hasattr(self.stuff_attr_name, 'to_alipay_dict'):
  89. params['stuff_attr_name'] = self.stuff_attr_name.to_alipay_dict()
  90. else:
  91. params['stuff_attr_name'] = self.stuff_attr_name
  92. if self.stuff_material:
  93. if hasattr(self.stuff_material, 'to_alipay_dict'):
  94. params['stuff_material'] = self.stuff_material.to_alipay_dict()
  95. else:
  96. params['stuff_material'] = self.stuff_material
  97. if self.stuff_size:
  98. if hasattr(self.stuff_size, 'to_alipay_dict'):
  99. params['stuff_size'] = self.stuff_size.to_alipay_dict()
  100. else:
  101. params['stuff_size'] = self.stuff_size
  102. if self.stuff_type:
  103. if hasattr(self.stuff_type, 'to_alipay_dict'):
  104. params['stuff_type'] = self.stuff_type.to_alipay_dict()
  105. else:
  106. params['stuff_type'] = self.stuff_type
  107. if self.template_id:
  108. if hasattr(self.template_id, 'to_alipay_dict'):
  109. params['template_id'] = self.template_id.to_alipay_dict()
  110. else:
  111. params['template_id'] = self.template_id
  112. if self.template_name:
  113. if hasattr(self.template_name, 'to_alipay_dict'):
  114. params['template_name'] = self.template_name.to_alipay_dict()
  115. else:
  116. params['template_name'] = self.template_name
  117. return params
  118. @staticmethod
  119. def from_alipay_dict(d):
  120. if not d:
  121. return None
  122. o = AccessProduceOrder()
  123. if 'batch_id' in d:
  124. o.batch_id = d['batch_id']
  125. if 'produce_order_id' in d:
  126. o.produce_order_id = d['produce_order_id']
  127. if 'produce_quantity' in d:
  128. o.produce_quantity = d['produce_quantity']
  129. if 'stuff_attr_name' in d:
  130. o.stuff_attr_name = d['stuff_attr_name']
  131. if 'stuff_material' in d:
  132. o.stuff_material = d['stuff_material']
  133. if 'stuff_size' in d:
  134. o.stuff_size = d['stuff_size']
  135. if 'stuff_type' in d:
  136. o.stuff_type = d['stuff_type']
  137. if 'template_id' in d:
  138. o.template_id = d['template_id']
  139. if 'template_name' in d:
  140. o.template_name = d['template_name']
  141. return o