tachain-sdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +148 -60
  3. data/lib/tachain-sdk/api/api_declaration_api.rb +155 -84
  4. data/lib/tachain-sdk/api/api_declaration_upload_api.rb +103 -0
  5. data/lib/tachain-sdk/api/api_delivery_api.rb +218 -138
  6. data/lib/tachain-sdk/api/api_enum_api.rb +2 -2
  7. data/lib/tachain-sdk/api/api_material_api.rb +414 -0
  8. data/lib/tachain-sdk/api/api_order_api.rb +185 -167
  9. data/lib/tachain-sdk/api/api_order_workflow_api.rb +227 -24
  10. data/lib/tachain-sdk/api/api_process_route_api.rb +414 -0
  11. data/lib/tachain-sdk/api/api_product_api.rb +414 -0
  12. data/lib/tachain-sdk/api/api_production_api.rb +141 -136
  13. data/lib/tachain-sdk/api/api_reference_api.rb +192 -0
  14. data/lib/tachain-sdk/models/{product_bom_grouping_dto.rb → api_bom_line_request.rb} +82 -107
  15. data/lib/tachain-sdk/models/api_bom_line_response.rb +205 -0
  16. data/lib/tachain-sdk/models/api_catalog_delete_request.rb +191 -0
  17. data/lib/tachain-sdk/models/{stage_attachment_api_dto.rb → api_declaration_attachment_response.rb} +16 -108
  18. data/lib/tachain-sdk/models/api_declaration_delete_request.rb +127 -17
  19. data/lib/tachain-sdk/models/api_declaration_document_request.rb +5 -27
  20. data/lib/tachain-sdk/models/api_declaration_file_request.rb +172 -0
  21. data/lib/tachain-sdk/models/api_declaration_form_request.rb +177 -0
  22. data/lib/tachain-sdk/models/{order_stage_form_datum_api_dto.rb → api_declaration_form_response.rb} +16 -49
  23. data/lib/tachain-sdk/models/api_declaration_list_response.rb +185 -0
  24. data/lib/tachain-sdk/models/api_declaration_submit_request.rb +171 -20
  25. data/lib/tachain-sdk/models/{api_declaration_submit_result_dto.rb → api_declaration_submit_response.rb} +10 -42
  26. data/lib/tachain-sdk/models/api_delivery_create_request.rb +292 -0
  27. data/lib/tachain-sdk/models/{result_brand_report_unlinked_order_detail.rb → api_delivery_delete_request.rb} +84 -60
  28. data/lib/tachain-sdk/models/api_delivery_detail_create_request.rb +353 -0
  29. data/lib/tachain-sdk/models/{delivery_note_detail_api_dto.rb → api_delivery_detail_response.rb} +23 -82
  30. data/lib/tachain-sdk/models/api_delivery_detail_update_request.rb +358 -0
  31. data/lib/tachain-sdk/models/{delivery_note_api_dto.rb → api_delivery_response.rb} +22 -192
  32. data/lib/tachain-sdk/models/api_delivery_update_request.rb +287 -0
  33. data/lib/tachain-sdk/models/{order_stage_form_dto.rb → api_document_form_response.rb} +16 -65
  34. data/lib/tachain-sdk/models/{document_type_api_dto.rb → api_document_type_response.rb} +30 -125
  35. data/lib/tachain-sdk/models/api_enum_value_response.rb +193 -0
  36. data/lib/tachain-sdk/models/{api_response_string.rb → api_error_response.rb} +22 -34
  37. data/lib/tachain-sdk/models/api_fiber_composition_request.rb +193 -0
  38. data/lib/tachain-sdk/models/api_fiber_composition_response.rb +160 -0
  39. data/lib/tachain-sdk/models/{attachment_in_api_dto.rb → api_file_response.rb} +23 -115
  40. data/lib/tachain-sdk/models/api_file_upload_response.rb +150 -0
  41. data/lib/tachain-sdk/models/api_mapping_response.rb +182 -0
  42. data/lib/tachain-sdk/models/api_material_create_request.rb +556 -0
  43. data/lib/tachain-sdk/models/api_material_response.rb +349 -0
  44. data/lib/tachain-sdk/models/api_material_update_request.rb +582 -0
  45. data/lib/tachain-sdk/models/{result_mapping_order_select.rb → api_order_accept_request.rb} +105 -70
  46. data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +106 -29
  47. data/lib/tachain-sdk/models/api_order_create_request.rb +379 -0
  48. data/lib/tachain-sdk/models/api_order_declaration_verification_request.rb +293 -0
  49. data/lib/tachain-sdk/models/api_order_declaration_verification_response.rb +203 -0
  50. data/lib/tachain-sdk/models/api_order_delete_line_request.rb +315 -0
  51. data/lib/tachain-sdk/models/api_order_delete_request.rb +315 -0
  52. data/lib/tachain-sdk/models/api_order_line_create_request.rb +445 -0
  53. data/lib/tachain-sdk/models/{order_line_api_dto.rb → api_order_line_response.rb} +39 -330
  54. data/lib/tachain-sdk/models/api_order_line_update_request.rb +416 -0
  55. data/lib/tachain-sdk/models/api_order_receipt_pending_line_response.rb +171 -0
  56. data/lib/tachain-sdk/models/{microsoft_asp_net_core_mvc_problem_details.rb → api_order_receipt_pending_response.rb} +28 -45
  57. data/lib/tachain-sdk/models/api_order_receipt_result.rb +185 -0
  58. data/lib/tachain-sdk/models/{order_api_dto.rb → api_order_response.rb} +35 -291
  59. data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +102 -42
  60. data/lib/tachain-sdk/models/api_order_submit_audit_response.rb +196 -0
  61. data/lib/tachain-sdk/models/api_order_update_request.rb +408 -0
  62. data/lib/tachain-sdk/models/api_page_result1_api_delivery_response.rb +220 -0
  63. data/lib/tachain-sdk/models/api_page_result1_api_material_response.rb +220 -0
  64. data/lib/tachain-sdk/models/api_page_result1_api_order_response.rb +220 -0
  65. data/lib/tachain-sdk/models/api_page_result1_api_process_route_response.rb +220 -0
  66. data/lib/tachain-sdk/models/{api_response_api_declaration_list_dto.rb → api_page_result1_api_product_response.rb} +48 -27
  67. data/lib/tachain-sdk/models/api_page_result1_api_production_response.rb +220 -0
  68. data/lib/tachain-sdk/models/{result_api_enum.rb → api_process_route_create_request.rb} +88 -62
  69. data/lib/tachain-sdk/models/api_process_route_response.rb +237 -0
  70. data/lib/tachain-sdk/models/{paged_response_delivery_note_api_dto.rb → api_process_route_update_request.rb} +102 -91
  71. data/lib/tachain-sdk/models/api_process_step_request.rb +201 -0
  72. data/lib/tachain-sdk/models/api_process_step_response.rb +171 -0
  73. data/lib/tachain-sdk/models/api_product_create_request.rb +595 -0
  74. data/lib/tachain-sdk/models/api_product_response.rb +373 -0
  75. data/lib/tachain-sdk/models/api_product_update_request.rb +621 -0
  76. data/lib/tachain-sdk/models/api_production_create_request.rb +381 -0
  77. data/lib/tachain-sdk/models/{api_integration_delete_request.rb → api_production_delete_request.rb} +22 -11
  78. data/lib/tachain-sdk/models/api_production_raw_material_create_request.rb +320 -0
  79. data/lib/tachain-sdk/models/{production_raw_material_api_dto.rb → api_production_raw_material_response.rb} +18 -118
  80. data/lib/tachain-sdk/models/api_production_raw_material_update_request.rb +325 -0
  81. data/lib/tachain-sdk/models/{production_api_dto.rb → api_production_response.rb} +23 -156
  82. data/lib/tachain-sdk/models/api_production_sales_order_create_request.rb +309 -0
  83. data/lib/tachain-sdk/models/{production_sales_order_api_dto.rb → api_production_sales_order_response.rb} +17 -94
  84. data/lib/tachain-sdk/models/api_production_sales_order_update_request.rb +314 -0
  85. data/lib/tachain-sdk/models/api_production_update_request.rb +392 -0
  86. data/lib/tachain-sdk/models/api_receipt_pending_item_response.rb +207 -0
  87. data/lib/tachain-sdk/models/api_reference_page_response1_api_enum_value_response.rb +162 -0
  88. data/lib/tachain-sdk/models/api_reference_page_response1_api_mapping_response.rb +162 -0
  89. data/lib/tachain-sdk/models/{api_response_production_api_dto.rb → api_result1_api_declaration_list_response.rb} +20 -33
  90. data/lib/tachain-sdk/models/api_result1_api_declaration_submit_response.rb +186 -0
  91. data/lib/tachain-sdk/models/{api_response_delivery_note_api_dto.rb → api_result1_api_delivery_response.rb} +20 -33
  92. data/lib/tachain-sdk/models/api_result1_api_file_upload_response.rb +186 -0
  93. data/lib/tachain-sdk/models/api_result1_api_material_response.rb +186 -0
  94. data/lib/tachain-sdk/models/api_result1_api_order_declaration_verification_response.rb +186 -0
  95. data/lib/tachain-sdk/models/{api_response_api_declaration_submit_result_dto.rb → api_result1_api_order_receipt_pending_response.rb} +20 -33
  96. data/lib/tachain-sdk/models/api_result1_api_order_receipt_result.rb +186 -0
  97. data/lib/tachain-sdk/models/api_result1_api_order_response.rb +186 -0
  98. data/lib/tachain-sdk/models/api_result1_api_order_submit_audit_response.rb +186 -0
  99. data/lib/tachain-sdk/models/api_result1_api_process_route_response.rb +186 -0
  100. data/lib/tachain-sdk/models/api_result1_api_product_response.rb +186 -0
  101. data/lib/tachain-sdk/models/api_result1_api_production_response.rb +186 -0
  102. data/lib/tachain-sdk/models/{api_response_order_api_dto.rb → api_result1_string.rb} +22 -33
  103. data/lib/tachain-sdk/models/{attachment_in_api_create_dto.rb → api_verification_file_response.rb} +106 -84
  104. data/lib/tachain-sdk/models/api_verification_response.rb +218 -0
  105. data/lib/tachain-sdk/models/delete_v1_declaration_delete200_response.rb +103 -0
  106. data/lib/tachain-sdk/models/get_v1_declaration_list_paging200_response.rb +103 -0
  107. data/lib/tachain-sdk/models/get_v1_declaration_required_documents200_response.rb +103 -0
  108. data/lib/tachain-sdk/models/get_v1_delivery_list_paging200_response.rb +103 -0
  109. data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +73 -171
  110. data/lib/tachain-sdk/models/get_v1_material_list_paging200_response.rb +103 -0
  111. data/lib/tachain-sdk/models/get_v1_order_po_list_paging200_response.rb +103 -0
  112. data/lib/tachain-sdk/models/get_v1_order_receipt_pending200_response.rb +103 -0
  113. data/lib/tachain-sdk/models/get_v1_process_route_list_paging200_response.rb +103 -0
  114. data/lib/tachain-sdk/models/get_v1_product_list_paging200_response.rb +103 -0
  115. data/lib/tachain-sdk/models/get_v1_production_list_paging200_response.rb +103 -0
  116. data/lib/tachain-sdk/models/get_v1_reference_enum_values200_response.rb +103 -0
  117. data/lib/tachain-sdk/models/get_v1_reference_mappings200_response.rb +103 -0
  118. data/lib/tachain-sdk/models/model1.rb +47 -14
  119. data/lib/tachain-sdk/models/model2.rb +190 -0
  120. data/lib/tachain-sdk/models/model3.rb +17 -33
  121. data/lib/tachain-sdk/models/model4.rb +17 -33
  122. data/lib/tachain-sdk/models/post_v1_declaration_submit200_response.rb +103 -0
  123. data/lib/tachain-sdk/models/post_v1_declaration_upload_file200_response.rb +103 -0
  124. data/lib/tachain-sdk/models/post_v1_material_create200_response.rb +103 -0
  125. data/lib/tachain-sdk/models/post_v1_order_create200_response.rb +103 -0
  126. data/lib/tachain-sdk/models/post_v1_order_declaration_verification200_response.rb +103 -0
  127. data/lib/tachain-sdk/models/post_v1_order_submit_audit200_response.rb +103 -0
  128. data/lib/tachain-sdk/models/post_v1_process_route_create200_response.rb +103 -0
  129. data/lib/tachain-sdk/models/post_v1_product_create200_response.rb +103 -0
  130. data/lib/tachain-sdk/models/post_v1_production_create200_response.rb +103 -0
  131. data/lib/tachain-sdk/models/put_v1_delivery_confirm_receipt200_response.rb +103 -0
  132. data/lib/tachain-sdk/models/put_v1_delivery_return_receipt200_response.rb +103 -0
  133. data/lib/tachain-sdk/models/put_v1_order_confirm_receipt200_response.rb +103 -0
  134. data/lib/tachain-sdk/version.rb +1 -1
  135. data/lib/tachain-sdk.rb +116 -51
  136. metadata +118 -53
  137. data/lib/tachain-sdk/models/api_declaration_list_dto.rb +0 -251
  138. data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +0 -334
  139. data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +0 -880
  140. data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +0 -749
  141. data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +0 -513
  142. data/lib/tachain-sdk/models/company.rb +0 -780
  143. data/lib/tachain-sdk/models/company_compliance_profile.rb +0 -547
  144. data/lib/tachain-sdk/models/company_utility_declaration.rb +0 -592
  145. data/lib/tachain-sdk/models/customer.rb +0 -569
  146. data/lib/tachain-sdk/models/factory.rb +0 -545
  147. data/lib/tachain-sdk/models/order.rb +0 -974
  148. data/lib/tachain-sdk/models/order_line.rb +0 -1184
  149. data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +0 -270
  150. data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +0 -296
  151. data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +0 -296
  152. data/lib/tachain-sdk/models/production_raw_material_dto.rb +0 -548
  153. data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +0 -331
  154. data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +0 -418
  155. data/lib/tachain-sdk/models/result_order_trace_report.rb +0 -721
  156. data/lib/tachain-sdk/models/supplier.rb +0 -585
  157. data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +0 -383
  158. data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +0 -456
  159. data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +0 -227
  160. data/lib/tachain-sdk/models/trader.rb +0 -506
@@ -14,8 +14,8 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module TachainSdk
17
- # 生产记录表
18
- class ProductionApiDto < ApiModelBase
17
+ # 集成接口专用 ApiProductionResponse;只读业务返回字段,不参与写入模型。
18
+ class ApiProductionResponse < ApiModelBase
19
19
  # 批次ID,唯一标识生产批次
20
20
  attr_accessor :id
21
21
 
@@ -34,10 +34,10 @@ module TachainSdk
34
34
  # 成品编码(MTO)
35
35
  attr_accessor :product_code
36
36
 
37
- # 成品名称(MTO)
37
+ # 自动取自所选产品资料的名称。
38
38
  attr_accessor :product_name
39
39
 
40
- # 成品颜色(MTO)
40
+ # 自动取自所选产品资料的颜色。
41
41
  attr_accessor :product_color
42
42
 
43
43
  # 生产数量\\入库数量
@@ -46,13 +46,13 @@ module TachainSdk
46
46
  # 生产工厂编号(MTO)
47
47
  attr_accessor :facility_id
48
48
 
49
- # 生产工厂编码。外部不知道 FacilityId 时,可传枚举接口 Factory.Code/Name/ShortName,由接口解析内部工厂公司 ID。
49
+ # 生产工厂业务编码。
50
50
  attr_accessor :facility_code
51
51
 
52
52
  # 生产工序编号(MTO)
53
53
  attr_accessor :process_route_id
54
54
 
55
- # 工艺路线编码。外部不知道 ProcessRouteId 时,可传枚举接口 ProcessRoute.Code/Name,由接口解析内部工艺路线 ID。
55
+ # 工艺路线业务编码。
56
56
  attr_accessor :process_route_code
57
57
 
58
58
  # 批次描述(MTO)
@@ -61,34 +61,19 @@ module TachainSdk
61
61
  # 生成类型(0 MTO, 1 MTS)
62
62
  attr_accessor :type
63
63
 
64
- # 生产批次状态
64
+ # 记录状态:0 正常,-1 已删除,-9 禁用。
65
65
  attr_accessor :status
66
66
 
67
- # 环境类型:0正式,1测试
68
- attr_accessor :environment_type
69
-
70
- # 创建用户ID
71
- attr_accessor :created_by
72
-
73
67
  # 创建时间
74
68
  attr_accessor :created_at
75
69
 
76
- # 公司ID
77
- attr_accessor :company_id
78
-
79
- # 租户ID
80
- attr_accessor :tenant_id
81
-
82
- # 修改用户ID
83
- attr_accessor :updated_by
84
-
85
70
  # 更新时间
86
71
  attr_accessor :updated_at
87
72
 
88
- # 计量单位(MTO)
73
+ # 生产数量/入库数量的计量单位,自动取自 productCode 对应产品的单位;创建和修改不接收此字段。
89
74
  attr_accessor :unit
90
75
 
91
- # 申报情况是否完成,1完成:0未完成
76
+ # 申报资料是否完成:true 已完成,false 未完成;不代表审核已通过。
92
77
  attr_accessor :declare_complete
93
78
 
94
79
  # 生产使用的bom版本
@@ -103,46 +88,33 @@ module TachainSdk
103
88
  # 入库结束日期(MTS)
104
89
  attr_accessor :receipt_end_date
105
90
 
106
- # 销售订单明细id集合
91
+ # 销售订单生产分配明细。保存返回完整有效分配;领料分页不加载此集合。
107
92
  attr_accessor :production_sales_order_list
108
93
 
109
- # 领料信息
94
+ # 当前生产单的有效且有权查看的领料明细;无可见领料时返回空数组。生产列表按主单分页,同一生产单只返回一次。
110
95
  attr_accessor :production_raw_material_list
111
96
 
112
- # 工厂名称
97
+ # 生产工厂名称。
113
98
  attr_accessor :facility_name
114
99
 
115
100
  # 工艺步骤
116
101
  attr_accessor :process_route_name
117
102
 
118
- # 单位名称
103
+ # 计量单位名称。
119
104
  attr_accessor :u_name
120
105
 
121
106
  # MTS数量
122
107
  attr_accessor :receipt_count
123
108
 
124
- attr_accessor :production_sales_order
125
-
126
- attr_accessor :order_line
127
-
128
- attr_accessor :production_raw_material
129
-
130
- # BOM分组逻辑下的提交结构
131
- attr_accessor :product_bom_grouping_list
132
-
133
109
  # 链条是否审核通过
134
110
  attr_accessor :chain_review_status
135
111
 
112
+ # 当前生产单尚可分配的产出数量。
136
113
  attr_accessor :available_quantity
137
114
 
138
115
  # 生产单类型:0 正常生产 、1 贸易生产
139
116
  attr_accessor :is_trade
140
117
 
141
- # 申报项(大申报使用)
142
- attr_accessor :attachments
143
-
144
- attr_accessor :is_approved
145
-
146
118
  # Attribute mapping from ruby-style variable name to JSON key.
147
119
  def self.attribute_map
148
120
  {
@@ -162,12 +134,7 @@ module TachainSdk
162
134
  :'batch' => :'batch',
163
135
  :'type' => :'type',
164
136
  :'status' => :'status',
165
- :'environment_type' => :'environmentType',
166
- :'created_by' => :'createdBy',
167
137
  :'created_at' => :'createdAt',
168
- :'company_id' => :'companyId',
169
- :'tenant_id' => :'tenantId',
170
- :'updated_by' => :'updatedBy',
171
138
  :'updated_at' => :'updatedAt',
172
139
  :'unit' => :'unit',
173
140
  :'declare_complete' => :'declareComplete',
@@ -181,15 +148,9 @@ module TachainSdk
181
148
  :'process_route_name' => :'processRouteName',
182
149
  :'u_name' => :'uName',
183
150
  :'receipt_count' => :'receiptCount',
184
- :'production_sales_order' => :'productionSalesOrder',
185
- :'order_line' => :'orderLine',
186
- :'production_raw_material' => :'productionRawMaterial',
187
- :'product_bom_grouping_list' => :'productBomGroupingList',
188
151
  :'chain_review_status' => :'chainReviewStatus',
189
152
  :'available_quantity' => :'availableQuantity',
190
- :'is_trade' => :'isTrade',
191
- :'attachments' => :'attachments',
192
- :'is_approved' => :'isApproved'
153
+ :'is_trade' => :'isTrade'
193
154
  }
194
155
  end
195
156
 
@@ -222,12 +183,7 @@ module TachainSdk
222
183
  :'batch' => :'String',
223
184
  :'type' => :'Integer',
224
185
  :'status' => :'Integer',
225
- :'environment_type' => :'Integer',
226
- :'created_by' => :'String',
227
186
  :'created_at' => :'Time',
228
- :'company_id' => :'String',
229
- :'tenant_id' => :'String',
230
- :'updated_by' => :'String',
231
187
  :'updated_at' => :'Time',
232
188
  :'unit' => :'String',
233
189
  :'declare_complete' => :'Boolean',
@@ -235,21 +191,15 @@ module TachainSdk
235
191
  :'receipt_number' => :'String',
236
192
  :'receipt_date' => :'Time',
237
193
  :'receipt_end_date' => :'Time',
238
- :'production_sales_order_list' => :'Array<ProductionSalesOrderApiDto>',
239
- :'production_raw_material_list' => :'Array<ProductionRawMaterialApiDto>',
194
+ :'production_sales_order_list' => :'Array<ApiProductionSalesOrderResponse>',
195
+ :'production_raw_material_list' => :'Array<ApiProductionRawMaterialResponse>',
240
196
  :'facility_name' => :'String',
241
197
  :'process_route_name' => :'String',
242
198
  :'u_name' => :'String',
243
199
  :'receipt_count' => :'Integer',
244
- :'production_sales_order' => :'ProductionSalesOrderApiDto',
245
- :'order_line' => :'OrderLineApiDto',
246
- :'production_raw_material' => :'ProductionRawMaterialApiDto',
247
- :'product_bom_grouping_list' => :'Array<ProductBomGroupingDto>',
248
200
  :'chain_review_status' => :'Boolean',
249
201
  :'available_quantity' => :'Float',
250
- :'is_trade' => :'Integer',
251
- :'attachments' => :'Array<Model1>',
252
- :'is_approved' => :'Boolean'
202
+ :'is_trade' => :'Integer'
253
203
  }
254
204
  end
255
205
 
@@ -272,12 +222,7 @@ module TachainSdk
272
222
  :'batch',
273
223
  :'type',
274
224
  :'status',
275
- :'environment_type',
276
- :'created_by',
277
225
  :'created_at',
278
- :'company_id',
279
- :'tenant_id',
280
- :'updated_by',
281
226
  :'updated_at',
282
227
  :'unit',
283
228
  :'declare_complete',
@@ -291,11 +236,9 @@ module TachainSdk
291
236
  :'process_route_name',
292
237
  :'u_name',
293
238
  :'receipt_count',
294
- :'product_bom_grouping_list',
295
239
  :'chain_review_status',
296
240
  :'available_quantity',
297
- :'is_trade',
298
- :'is_approved'
241
+ :'is_trade'
299
242
  ])
300
243
  end
301
244
 
@@ -303,14 +246,14 @@ module TachainSdk
303
246
  # @param [Hash] attributes Model attributes in the form of hash
304
247
  def initialize(attributes = {})
305
248
  if (!attributes.is_a?(Hash))
306
- fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ProductionApiDto` initialize method"
249
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductionResponse` initialize method"
307
250
  end
308
251
 
309
252
  # check to see if the attribute exists and convert string to symbol for hash key
310
253
  acceptable_attribute_map = self.class.acceptable_attribute_map
311
254
  attributes = attributes.each_with_object({}) { |(k, v), h|
312
255
  if (!acceptable_attribute_map.key?(k.to_sym))
313
- fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ProductionApiDto`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
256
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductionResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
314
257
  end
315
258
  h[k.to_sym] = v
316
259
  }
@@ -379,30 +322,10 @@ module TachainSdk
379
322
  self.status = attributes[:'status']
380
323
  end
381
324
 
382
- if attributes.key?(:'environment_type')
383
- self.environment_type = attributes[:'environment_type']
384
- end
385
-
386
- if attributes.key?(:'created_by')
387
- self.created_by = attributes[:'created_by']
388
- end
389
-
390
325
  if attributes.key?(:'created_at')
391
326
  self.created_at = attributes[:'created_at']
392
327
  end
393
328
 
394
- if attributes.key?(:'company_id')
395
- self.company_id = attributes[:'company_id']
396
- end
397
-
398
- if attributes.key?(:'tenant_id')
399
- self.tenant_id = attributes[:'tenant_id']
400
- end
401
-
402
- if attributes.key?(:'updated_by')
403
- self.updated_by = attributes[:'updated_by']
404
- end
405
-
406
329
  if attributes.key?(:'updated_at')
407
330
  self.updated_at = attributes[:'updated_at']
408
331
  end
@@ -459,24 +382,6 @@ module TachainSdk
459
382
  self.receipt_count = attributes[:'receipt_count']
460
383
  end
461
384
 
462
- if attributes.key?(:'production_sales_order')
463
- self.production_sales_order = attributes[:'production_sales_order']
464
- end
465
-
466
- if attributes.key?(:'order_line')
467
- self.order_line = attributes[:'order_line']
468
- end
469
-
470
- if attributes.key?(:'production_raw_material')
471
- self.production_raw_material = attributes[:'production_raw_material']
472
- end
473
-
474
- if attributes.key?(:'product_bom_grouping_list')
475
- if (value = attributes[:'product_bom_grouping_list']).is_a?(Array)
476
- self.product_bom_grouping_list = value
477
- end
478
- end
479
-
480
385
  if attributes.key?(:'chain_review_status')
481
386
  self.chain_review_status = attributes[:'chain_review_status']
482
387
  end
@@ -488,18 +393,6 @@ module TachainSdk
488
393
  if attributes.key?(:'is_trade')
489
394
  self.is_trade = attributes[:'is_trade']
490
395
  end
491
-
492
- if attributes.key?(:'attachments')
493
- if (value = attributes[:'attachments']).is_a?(Array)
494
- self.attachments = value
495
- end
496
- else
497
- self.attachments = nil
498
- end
499
-
500
- if attributes.key?(:'is_approved')
501
- self.is_approved = attributes[:'is_approved']
502
- end
503
396
  end
504
397
 
505
398
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -507,10 +400,6 @@ module TachainSdk
507
400
  def list_invalid_properties
508
401
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
509
402
  invalid_properties = Array.new
510
- if @attachments.nil?
511
- invalid_properties.push('invalid value for "attachments", attachments cannot be nil.')
512
- end
513
-
514
403
  invalid_properties
515
404
  end
516
405
 
@@ -518,20 +407,9 @@ module TachainSdk
518
407
  # @return true if the model is valid
519
408
  def valid?
520
409
  warn '[DEPRECATED] the `valid?` method is obsolete'
521
- return false if @attachments.nil?
522
410
  true
523
411
  end
524
412
 
525
- # Custom attribute writer method with validation
526
- # @param [Object] attachments Value to be assigned
527
- def attachments=(attachments)
528
- if attachments.nil?
529
- fail ArgumentError, 'attachments cannot be nil'
530
- end
531
-
532
- @attachments = attachments
533
- end
534
-
535
413
  # Checks equality by comparing each attribute.
536
414
  # @param [Object] Object to be compared
537
415
  def ==(o)
@@ -553,12 +431,7 @@ module TachainSdk
553
431
  batch == o.batch &&
554
432
  type == o.type &&
555
433
  status == o.status &&
556
- environment_type == o.environment_type &&
557
- created_by == o.created_by &&
558
434
  created_at == o.created_at &&
559
- company_id == o.company_id &&
560
- tenant_id == o.tenant_id &&
561
- updated_by == o.updated_by &&
562
435
  updated_at == o.updated_at &&
563
436
  unit == o.unit &&
564
437
  declare_complete == o.declare_complete &&
@@ -572,15 +445,9 @@ module TachainSdk
572
445
  process_route_name == o.process_route_name &&
573
446
  u_name == o.u_name &&
574
447
  receipt_count == o.receipt_count &&
575
- production_sales_order == o.production_sales_order &&
576
- order_line == o.order_line &&
577
- production_raw_material == o.production_raw_material &&
578
- product_bom_grouping_list == o.product_bom_grouping_list &&
579
448
  chain_review_status == o.chain_review_status &&
580
449
  available_quantity == o.available_quantity &&
581
- is_trade == o.is_trade &&
582
- attachments == o.attachments &&
583
- is_approved == o.is_approved
450
+ is_trade == o.is_trade
584
451
  end
585
452
 
586
453
  # @see the `==` method
@@ -592,7 +459,7 @@ module TachainSdk
592
459
  # Calculates hash code according to all attributes.
593
460
  # @return [Integer] Hash code
594
461
  def hash
595
- [id, number, production_date, production_end_date, product_id, product_code, product_name, product_color, quantity_produced, facility_id, facility_code, process_route_id, process_route_code, batch, type, status, environment_type, created_by, created_at, company_id, tenant_id, updated_by, updated_at, unit, declare_complete, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_sales_order_list, production_raw_material_list, facility_name, process_route_name, u_name, receipt_count, production_sales_order, order_line, production_raw_material, product_bom_grouping_list, chain_review_status, available_quantity, is_trade, attachments, is_approved].hash
462
+ [id, number, production_date, production_end_date, product_id, product_code, product_name, product_color, quantity_produced, facility_id, facility_code, process_route_id, process_route_code, batch, type, status, created_at, updated_at, unit, declare_complete, use_bom_batch, receipt_number, receipt_date, receipt_end_date, production_sales_order_list, production_raw_material_list, facility_name, process_route_name, u_name, receipt_count, chain_review_status, available_quantity, is_trade].hash
596
463
  end
597
464
 
598
465
  # Builds the object from hash
@@ -0,0 +1,309 @@
1
+ =begin
2
+ #Tactic Chain Public API
3
+
4
+ #Public integration endpoints. Set your own base URL and credential before calling.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TachainSdk
17
+ # 新增专用集成请求;只接收本操作使用的业务字段。
18
+ class ApiProductionSalesOrderCreateRequest < ApiModelBase
19
+ # 销售订单明细ID
20
+ attr_accessor :sales_order_line_id
21
+
22
+ # 分配给所选销售订单行的生产数量;计量单位自动使用当前生产产品的单位,所选订单行必须关联同一产品。
23
+ attr_accessor :quantity_produced
24
+
25
+ # 订单编号
26
+ attr_accessor :order_number
27
+
28
+ # 销售订单日期。外部生产接口按订单号+日期+行号解析销售订单明细时使用。
29
+ attr_accessor :order_date
30
+
31
+ # 订单行号
32
+ attr_accessor :line_number
33
+
34
+ # 查询返回的客户公司 ID,可选。优先使用 CustomerName 或 CustomerCode。
35
+ attr_accessor :customer_id
36
+
37
+ # 客户英文名、当地语言名称或简称,精确匹配当前公司的有效客户关系。
38
+ attr_accessor :customer_name
39
+
40
+ # 当前公司维护的客户编码或启用的 Customer/Company 外部映射值。 条件:外部流水号或单号重复时用于消歧;多个客户字段必须一致。
41
+ attr_accessor :customer_code
42
+
43
+ # 查询返回的供应商公司 ID,可选。优先使用 SupplierName 或 SupplierCode。
44
+ attr_accessor :supplier_id
45
+
46
+ # 供应商英文名、当地语言名称或简称,精确匹配当前公司的有效供应商关系。
47
+ attr_accessor :supplier_name
48
+
49
+ # 当前公司维护的供应商编码或启用的 Supplier/Company 外部映射值。 条件:外部流水号或单号重复时用于消歧;多个供应商字段必须一致。
50
+ attr_accessor :supplier_code
51
+
52
+ # 买方外部系统的订单明细流水号;重复时补充交易对方和订单条件。
53
+ attr_accessor :customer_ext_no
54
+
55
+ # 卖方外部系统的订单明细流水号;重复时补充交易对方和订单条件。
56
+ attr_accessor :supplier_ext_no
57
+
58
+ # 查询返回的系统订单明细唯一流水号。
59
+ attr_accessor :unique_no
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'sales_order_line_id' => :'salesOrderLineId',
65
+ :'quantity_produced' => :'quantityProduced',
66
+ :'order_number' => :'orderNumber',
67
+ :'order_date' => :'orderDate',
68
+ :'line_number' => :'lineNumber',
69
+ :'customer_id' => :'customerId',
70
+ :'customer_name' => :'customerName',
71
+ :'customer_code' => :'customerCode',
72
+ :'supplier_id' => :'supplierId',
73
+ :'supplier_name' => :'supplierName',
74
+ :'supplier_code' => :'supplierCode',
75
+ :'customer_ext_no' => :'customerExtNo',
76
+ :'supplier_ext_no' => :'supplierExtNo',
77
+ :'unique_no' => :'uniqueNo'
78
+ }
79
+ end
80
+
81
+ # Returns attribute mapping this model knows about
82
+ def self.acceptable_attribute_map
83
+ attribute_map
84
+ end
85
+
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ acceptable_attribute_map.values
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.openapi_types
93
+ {
94
+ :'sales_order_line_id' => :'String',
95
+ :'quantity_produced' => :'Float',
96
+ :'order_number' => :'String',
97
+ :'order_date' => :'Time',
98
+ :'line_number' => :'String',
99
+ :'customer_id' => :'String',
100
+ :'customer_name' => :'String',
101
+ :'customer_code' => :'String',
102
+ :'supplier_id' => :'String',
103
+ :'supplier_name' => :'String',
104
+ :'supplier_code' => :'String',
105
+ :'customer_ext_no' => :'String',
106
+ :'supplier_ext_no' => :'String',
107
+ :'unique_no' => :'String'
108
+ }
109
+ end
110
+
111
+ # List of attributes with nullable: true
112
+ def self.openapi_nullable
113
+ Set.new([
114
+ :'sales_order_line_id',
115
+ :'order_number',
116
+ :'order_date',
117
+ :'line_number',
118
+ :'customer_id',
119
+ :'customer_name',
120
+ :'customer_code',
121
+ :'supplier_id',
122
+ :'supplier_name',
123
+ :'supplier_code',
124
+ :'customer_ext_no',
125
+ :'supplier_ext_no',
126
+ :'unique_no'
127
+ ])
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ if (!attributes.is_a?(Hash))
134
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TachainSdk::ApiProductionSalesOrderCreateRequest` initialize method"
135
+ end
136
+
137
+ # check to see if the attribute exists and convert string to symbol for hash key
138
+ acceptable_attribute_map = self.class.acceptable_attribute_map
139
+ attributes = attributes.each_with_object({}) { |(k, v), h|
140
+ if (!acceptable_attribute_map.key?(k.to_sym))
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TachainSdk::ApiProductionSalesOrderCreateRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
142
+ end
143
+ h[k.to_sym] = v
144
+ }
145
+
146
+ if attributes.key?(:'sales_order_line_id')
147
+ self.sales_order_line_id = attributes[:'sales_order_line_id']
148
+ end
149
+
150
+ if attributes.key?(:'quantity_produced')
151
+ self.quantity_produced = attributes[:'quantity_produced']
152
+ else
153
+ self.quantity_produced = nil
154
+ end
155
+
156
+ if attributes.key?(:'order_number')
157
+ self.order_number = attributes[:'order_number']
158
+ end
159
+
160
+ if attributes.key?(:'order_date')
161
+ self.order_date = attributes[:'order_date']
162
+ end
163
+
164
+ if attributes.key?(:'line_number')
165
+ self.line_number = attributes[:'line_number']
166
+ end
167
+
168
+ if attributes.key?(:'customer_id')
169
+ self.customer_id = attributes[:'customer_id']
170
+ end
171
+
172
+ if attributes.key?(:'customer_name')
173
+ self.customer_name = attributes[:'customer_name']
174
+ end
175
+
176
+ if attributes.key?(:'customer_code')
177
+ self.customer_code = attributes[:'customer_code']
178
+ end
179
+
180
+ if attributes.key?(:'supplier_id')
181
+ self.supplier_id = attributes[:'supplier_id']
182
+ end
183
+
184
+ if attributes.key?(:'supplier_name')
185
+ self.supplier_name = attributes[:'supplier_name']
186
+ end
187
+
188
+ if attributes.key?(:'supplier_code')
189
+ self.supplier_code = attributes[:'supplier_code']
190
+ end
191
+
192
+ if attributes.key?(:'customer_ext_no')
193
+ self.customer_ext_no = attributes[:'customer_ext_no']
194
+ end
195
+
196
+ if attributes.key?(:'supplier_ext_no')
197
+ self.supplier_ext_no = attributes[:'supplier_ext_no']
198
+ end
199
+
200
+ if attributes.key?(:'unique_no')
201
+ self.unique_no = attributes[:'unique_no']
202
+ end
203
+ end
204
+
205
+ # Show invalid properties with the reasons. Usually used together with valid?
206
+ # @return Array for valid properties with the reasons
207
+ def list_invalid_properties
208
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
209
+ invalid_properties = Array.new
210
+ if @quantity_produced.nil?
211
+ invalid_properties.push('invalid value for "quantity_produced", quantity_produced cannot be nil.')
212
+ end
213
+
214
+ invalid_properties
215
+ end
216
+
217
+ # Check to see if the all the properties in the model are valid
218
+ # @return true if the model is valid
219
+ def valid?
220
+ warn '[DEPRECATED] the `valid?` method is obsolete'
221
+ return false if @quantity_produced.nil?
222
+ true
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] quantity_produced Value to be assigned
227
+ def quantity_produced=(quantity_produced)
228
+ if quantity_produced.nil?
229
+ fail ArgumentError, 'quantity_produced cannot be nil'
230
+ end
231
+
232
+ @quantity_produced = quantity_produced
233
+ end
234
+
235
+ # Checks equality by comparing each attribute.
236
+ # @param [Object] Object to be compared
237
+ def ==(o)
238
+ return true if self.equal?(o)
239
+ self.class == o.class &&
240
+ sales_order_line_id == o.sales_order_line_id &&
241
+ quantity_produced == o.quantity_produced &&
242
+ order_number == o.order_number &&
243
+ order_date == o.order_date &&
244
+ line_number == o.line_number &&
245
+ customer_id == o.customer_id &&
246
+ customer_name == o.customer_name &&
247
+ customer_code == o.customer_code &&
248
+ supplier_id == o.supplier_id &&
249
+ supplier_name == o.supplier_name &&
250
+ supplier_code == o.supplier_code &&
251
+ customer_ext_no == o.customer_ext_no &&
252
+ supplier_ext_no == o.supplier_ext_no &&
253
+ unique_no == o.unique_no
254
+ end
255
+
256
+ # @see the `==` method
257
+ # @param [Object] Object to be compared
258
+ def eql?(o)
259
+ self == o
260
+ end
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Integer] Hash code
264
+ def hash
265
+ [sales_order_line_id, quantity_produced, order_number, order_date, line_number, customer_id, customer_name, customer_code, supplier_id, supplier_name, supplier_code, customer_ext_no, supplier_ext_no, unique_no].hash
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def self.build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+ attributes = attributes.transform_keys(&:to_sym)
274
+ transformed_hash = {}
275
+ openapi_types.each_pair do |key, type|
276
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = nil
278
+ elsif type =~ /\AArray<(.*)>/i
279
+ # check to ensure the input is an array given that the attribute
280
+ # is documented as an array but the input is not
281
+ if attributes[attribute_map[key]].is_a?(Array)
282
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
283
+ end
284
+ elsif !attributes[attribute_map[key]].nil?
285
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
286
+ end
287
+ end
288
+ new(transformed_hash)
289
+ end
290
+
291
+ # Returns the object in the form of hash
292
+ # @return [Hash] Returns the object in the form of hash
293
+ def to_hash
294
+ hash = {}
295
+ self.class.attribute_map.each_pair do |attr, param|
296
+ value = self.send(attr)
297
+ if value.nil?
298
+ is_nullable = self.class.openapi_nullable.include?(attr)
299
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
300
+ end
301
+
302
+ hash[param] = _to_hash(value)
303
+ end
304
+ hash
305
+ end
306
+
307
+ end
308
+
309
+ end