tachain-sdk 0.1.0
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +226 -0
- data/Rakefile +10 -0
- data/git_push.sh +54 -0
- data/lib/tachain-sdk/api/api_declaration_api.rb +396 -0
- data/lib/tachain-sdk/api/api_delivery_api.rb +676 -0
- data/lib/tachain-sdk/api/api_enum_api.rb +94 -0
- data/lib/tachain-sdk/api/api_order_api.rb +846 -0
- data/lib/tachain-sdk/api/api_order_workflow_api.rb +170 -0
- data/lib/tachain-sdk/api/api_production_api.rb +466 -0
- data/lib/tachain-sdk/api_client.rb +397 -0
- data/lib/tachain-sdk/api_error.rb +58 -0
- data/lib/tachain-sdk/api_model_base.rb +88 -0
- data/lib/tachain-sdk/configuration.rb +329 -0
- data/lib/tachain-sdk/models/api_declaration_delete_request.rb +341 -0
- data/lib/tachain-sdk/models/api_declaration_document_request.rb +209 -0
- data/lib/tachain-sdk/models/api_declaration_list_dto.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_request.rb +251 -0
- data/lib/tachain-sdk/models/api_declaration_submit_result_dto.rb +197 -0
- data/lib/tachain-sdk/models/api_integration_delete_request.rb +209 -0
- data/lib/tachain-sdk/models/api_order_confirm_receipt_request.rb +216 -0
- data/lib/tachain-sdk/models/api_order_submit_audit_request.rb +243 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_list_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_api_declaration_submit_result_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_delivery_note_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_order_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_production_api_dto.rb +199 -0
- data/lib/tachain-sdk/models/api_response_string.rb +200 -0
- data/lib/tachain-sdk/models/attachment_in_api_create_dto.rb +262 -0
- data/lib/tachain-sdk/models/attachment_in_api_dto.rb +363 -0
- data/lib/tachain-sdk/models/brand_kpi_policy_result.rb +334 -0
- data/lib/tachain-sdk/models/brand_order_kpi_snapshot_dto.rb +880 -0
- data/lib/tachain-sdk/models/brand_order_supplier_order_snapshot_dto.rb +749 -0
- data/lib/tachain-sdk/models/brand_order_uncompleted_declare_snapshot_dto.rb +513 -0
- data/lib/tachain-sdk/models/company.rb +780 -0
- data/lib/tachain-sdk/models/company_compliance_profile.rb +547 -0
- data/lib/tachain-sdk/models/company_utility_declaration.rb +592 -0
- data/lib/tachain-sdk/models/customer.rb +569 -0
- data/lib/tachain-sdk/models/delivery_note_api_dto.rb +597 -0
- data/lib/tachain-sdk/models/delivery_note_detail_api_dto.rb +682 -0
- data/lib/tachain-sdk/models/document_type_api_dto.rb +480 -0
- data/lib/tachain-sdk/models/factory.rb +545 -0
- data/lib/tachain-sdk/models/get_v1_enum_get_list200_response.rb +201 -0
- data/lib/tachain-sdk/models/microsoft_asp_net_core_mvc_problem_details.rb +188 -0
- data/lib/tachain-sdk/models/model1.rb +157 -0
- data/lib/tachain-sdk/models/model3.rb +202 -0
- data/lib/tachain-sdk/models/model4.rb +202 -0
- data/lib/tachain-sdk/models/order.rb +974 -0
- data/lib/tachain-sdk/models/order_api_dto.rb +918 -0
- data/lib/tachain-sdk/models/order_line.rb +1184 -0
- data/lib/tachain-sdk/models/order_line_api_dto.rb +1277 -0
- data/lib/tachain-sdk/models/order_stage_form_api_dto.rb +270 -0
- data/lib/tachain-sdk/models/order_stage_form_datum_api_dto.rb +260 -0
- data/lib/tachain-sdk/models/order_stage_form_dto.rb +254 -0
- data/lib/tachain-sdk/models/paged_response_delivery_note_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_order_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/paged_response_production_api_dto.rb +296 -0
- data/lib/tachain-sdk/models/product_bom_grouping_dto.rb +280 -0
- data/lib/tachain-sdk/models/production_api_dto.rb +639 -0
- data/lib/tachain-sdk/models/production_raw_material_api_dto.rb +481 -0
- data/lib/tachain-sdk/models/production_raw_material_dto.rb +548 -0
- data/lib/tachain-sdk/models/production_sales_order_api_dto.rb +436 -0
- data/lib/tachain-sdk/models/result_api_enum.rb +270 -0
- data/lib/tachain-sdk/models/result_brand_report_allocated_delivery_kpi_detail.rb +331 -0
- data/lib/tachain-sdk/models/result_brand_report_unlinked_order_detail.rb +229 -0
- data/lib/tachain-sdk/models/result_kpi_archived_data_change_detail.rb +418 -0
- data/lib/tachain-sdk/models/result_mapping_order_select.rb +335 -0
- data/lib/tachain-sdk/models/result_order_trace_report.rb +721 -0
- data/lib/tachain-sdk/models/stage_attachment_api_dto.rb +398 -0
- data/lib/tachain-sdk/models/supplier.rb +585 -0
- data/lib/tachain-sdk/models/supplier_onboarding_ext.rb +383 -0
- data/lib/tachain-sdk/models/template_dto_business_risk_warn_info_dto.rb +456 -0
- data/lib/tachain-sdk/models/template_dto_multi_so_line_complete_status.rb +227 -0
- data/lib/tachain-sdk/models/trader.rb +506 -0
- data/lib/tachain-sdk/signed_api_client.rb +65 -0
- data/lib/tachain-sdk/version.rb +15 -0
- data/lib/tachain-sdk.rb +108 -0
- data/spec/spec_helper.rb +111 -0
- data/tachain-sdk.gemspec +39 -0
- metadata +165 -0
|
@@ -0,0 +1,396 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module TachainSdk
|
|
16
|
+
class ApiDeclarationApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# 申报信息删除接口。
|
|
23
|
+
# 删除只会软删除申报资料记录,不会删除订单、生产单、发货单,也不会触发快速申报。 删除后会按受影响的 `StageId + ExtendId` 重新计算申报完成度。
|
|
24
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @option opts [String] :attachment_id query 方式传入的单个附件申报 ID。
|
|
27
|
+
# @option opts [String] :form_data_id query 方式传入的单个表单申报 ID。
|
|
28
|
+
# @option opts [ApiDeclarationDeleteRequest] :api_declaration_delete_request
|
|
29
|
+
# @return [Model4]
|
|
30
|
+
def delete_v1_declaration_delete(x_credential_type, opts = {})
|
|
31
|
+
data, _status_code, _headers = delete_v1_declaration_delete_with_http_info(x_credential_type, opts)
|
|
32
|
+
data
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# 申报信息删除接口。
|
|
36
|
+
# 删除只会软删除申报资料记录,不会删除订单、生产单、发货单,也不会触发快速申报。 删除后会按受影响的 `StageId + ExtendId` 重新计算申报完成度。
|
|
37
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [String] :attachment_id query 方式传入的单个附件申报 ID。
|
|
40
|
+
# @option opts [String] :form_data_id query 方式传入的单个表单申报 ID。
|
|
41
|
+
# @option opts [ApiDeclarationDeleteRequest] :api_declaration_delete_request
|
|
42
|
+
# @return [Array<(Model4, Integer, Hash)>] Model4 data, response status code and response headers
|
|
43
|
+
def delete_v1_declaration_delete_with_http_info(x_credential_type, opts = {})
|
|
44
|
+
if @api_client.config.debugging
|
|
45
|
+
@api_client.config.logger.debug 'Calling API: ApiDeclarationApi.delete_v1_declaration_delete ...'
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'x_credential_type' is set
|
|
48
|
+
if @api_client.config.client_side_validation && x_credential_type.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'x_credential_type' when calling ApiDeclarationApi.delete_v1_declaration_delete"
|
|
50
|
+
end
|
|
51
|
+
# verify enum value
|
|
52
|
+
allowable_values = ["Token", "API Key"]
|
|
53
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(x_credential_type)
|
|
54
|
+
fail ArgumentError, "invalid value for \"x_credential_type\", must be one of #{allowable_values}"
|
|
55
|
+
end
|
|
56
|
+
# resource path
|
|
57
|
+
local_var_path = '/v1/declaration/Delete'
|
|
58
|
+
|
|
59
|
+
# query parameters
|
|
60
|
+
query_params = opts[:query_params] || {}
|
|
61
|
+
query_params[:'attachmentId'] = opts[:'attachment_id'] if !opts[:'attachment_id'].nil?
|
|
62
|
+
query_params[:'formDataId'] = opts[:'form_data_id'] if !opts[:'form_data_id'].nil?
|
|
63
|
+
|
|
64
|
+
# header parameters
|
|
65
|
+
header_params = opts[:header_params] || {}
|
|
66
|
+
# HTTP header 'Accept' (if needed)
|
|
67
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
68
|
+
# HTTP header 'Content-Type'
|
|
69
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
70
|
+
if !content_type.nil?
|
|
71
|
+
header_params['Content-Type'] = content_type
|
|
72
|
+
end
|
|
73
|
+
header_params[:'X-Credential-Type'] = x_credential_type
|
|
74
|
+
|
|
75
|
+
# form parameters
|
|
76
|
+
form_params = opts[:form_params] || {}
|
|
77
|
+
|
|
78
|
+
# http body (model)
|
|
79
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'api_declaration_delete_request'])
|
|
80
|
+
|
|
81
|
+
# return_type
|
|
82
|
+
return_type = opts[:debug_return_type] || 'Model4'
|
|
83
|
+
|
|
84
|
+
# auth_names
|
|
85
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey', 'Signature', 'BearerToken', 'Timestamp']
|
|
86
|
+
|
|
87
|
+
new_options = opts.merge(
|
|
88
|
+
:operation => :"ApiDeclarationApi.delete_v1_declaration_delete",
|
|
89
|
+
:header_params => header_params,
|
|
90
|
+
:query_params => query_params,
|
|
91
|
+
:form_params => form_params,
|
|
92
|
+
:body => post_body,
|
|
93
|
+
:auth_names => auth_names,
|
|
94
|
+
:return_type => return_type
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug "API called: ApiDeclarationApi#delete_v1_declaration_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
100
|
+
end
|
|
101
|
+
return data, status_code, headers
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# 申报信息查询接口。
|
|
105
|
+
# 附件申报和表单申报分别分页查询后放在同一个响应中返回。 建议调用方尽量传入 `extendId` 和 `stageId`,以便精确查询某个业务单据的申报资料。
|
|
106
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
107
|
+
# @param [Hash] opts the optional parameters
|
|
108
|
+
# @option opts [String] :search_text 关键词搜索:支持阶段编码,如 Order、Production(StageId)。使用完整关键词进行包含匹配,任一字段命中即可,并与其他筛选条件共同生效;不传、空字符串或纯空白时不附加关键词条件。
|
|
109
|
+
# @option opts [Array<String>] :extend_id
|
|
110
|
+
# @option opts [Array<String>] :stage_id
|
|
111
|
+
# @option opts [Array<String>] :document_type_id
|
|
112
|
+
# @option opts [String] :document_type_code
|
|
113
|
+
# @option opts [String] :extend_number
|
|
114
|
+
# @option opts [Time] :extend_date
|
|
115
|
+
# @option opts [String] :extend_line_number
|
|
116
|
+
# @option opts [String] :order_side
|
|
117
|
+
# @option opts [String] :product_code
|
|
118
|
+
# @option opts [Integer] :production_type
|
|
119
|
+
# @option opts [String] :delivery_number
|
|
120
|
+
# @option opts [Integer] :status
|
|
121
|
+
# @option opts [Array<Integer>] :risk_warning
|
|
122
|
+
# @option opts [String] :sort_by
|
|
123
|
+
# @option opts [Integer] :page (default to 1)
|
|
124
|
+
# @option opts [Integer] :page_size (default to 10)
|
|
125
|
+
# @return [ApiResponseApiDeclarationListDto]
|
|
126
|
+
def get_v1_declaration_list_paging(x_credential_type, opts = {})
|
|
127
|
+
data, _status_code, _headers = get_v1_declaration_list_paging_with_http_info(x_credential_type, opts)
|
|
128
|
+
data
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# 申报信息查询接口。
|
|
132
|
+
# 附件申报和表单申报分别分页查询后放在同一个响应中返回。 建议调用方尽量传入 `extendId` 和 `stageId`,以便精确查询某个业务单据的申报资料。
|
|
133
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
134
|
+
# @param [Hash] opts the optional parameters
|
|
135
|
+
# @option opts [String] :search_text 关键词搜索:支持阶段编码,如 Order、Production(StageId)。使用完整关键词进行包含匹配,任一字段命中即可,并与其他筛选条件共同生效;不传、空字符串或纯空白时不附加关键词条件。
|
|
136
|
+
# @option opts [Array<String>] :extend_id
|
|
137
|
+
# @option opts [Array<String>] :stage_id
|
|
138
|
+
# @option opts [Array<String>] :document_type_id
|
|
139
|
+
# @option opts [String] :document_type_code
|
|
140
|
+
# @option opts [String] :extend_number
|
|
141
|
+
# @option opts [Time] :extend_date
|
|
142
|
+
# @option opts [String] :extend_line_number
|
|
143
|
+
# @option opts [String] :order_side
|
|
144
|
+
# @option opts [String] :product_code
|
|
145
|
+
# @option opts [Integer] :production_type
|
|
146
|
+
# @option opts [String] :delivery_number
|
|
147
|
+
# @option opts [Integer] :status
|
|
148
|
+
# @option opts [Array<Integer>] :risk_warning
|
|
149
|
+
# @option opts [String] :sort_by
|
|
150
|
+
# @option opts [Integer] :page (default to 1)
|
|
151
|
+
# @option opts [Integer] :page_size (default to 10)
|
|
152
|
+
# @return [Array<(ApiResponseApiDeclarationListDto, Integer, Hash)>] ApiResponseApiDeclarationListDto data, response status code and response headers
|
|
153
|
+
def get_v1_declaration_list_paging_with_http_info(x_credential_type, opts = {})
|
|
154
|
+
if @api_client.config.debugging
|
|
155
|
+
@api_client.config.logger.debug 'Calling API: ApiDeclarationApi.get_v1_declaration_list_paging ...'
|
|
156
|
+
end
|
|
157
|
+
# verify the required parameter 'x_credential_type' is set
|
|
158
|
+
if @api_client.config.client_side_validation && x_credential_type.nil?
|
|
159
|
+
fail ArgumentError, "Missing the required parameter 'x_credential_type' when calling ApiDeclarationApi.get_v1_declaration_list_paging"
|
|
160
|
+
end
|
|
161
|
+
# verify enum value
|
|
162
|
+
allowable_values = ["Token", "API Key"]
|
|
163
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(x_credential_type)
|
|
164
|
+
fail ArgumentError, "invalid value for \"x_credential_type\", must be one of #{allowable_values}"
|
|
165
|
+
end
|
|
166
|
+
# resource path
|
|
167
|
+
local_var_path = '/v1/declaration/ListPaging'
|
|
168
|
+
|
|
169
|
+
# query parameters
|
|
170
|
+
query_params = opts[:query_params] || {}
|
|
171
|
+
query_params[:'searchText'] = opts[:'search_text'] if !opts[:'search_text'].nil?
|
|
172
|
+
query_params[:'extendId'] = @api_client.build_collection_param(opts[:'extend_id'], :multi) if !opts[:'extend_id'].nil?
|
|
173
|
+
query_params[:'stageId'] = @api_client.build_collection_param(opts[:'stage_id'], :multi) if !opts[:'stage_id'].nil?
|
|
174
|
+
query_params[:'documentTypeId'] = @api_client.build_collection_param(opts[:'document_type_id'], :multi) if !opts[:'document_type_id'].nil?
|
|
175
|
+
query_params[:'documentTypeCode'] = opts[:'document_type_code'] if !opts[:'document_type_code'].nil?
|
|
176
|
+
query_params[:'extendNumber'] = opts[:'extend_number'] if !opts[:'extend_number'].nil?
|
|
177
|
+
query_params[:'extendDate'] = opts[:'extend_date'] if !opts[:'extend_date'].nil?
|
|
178
|
+
query_params[:'extendLineNumber'] = opts[:'extend_line_number'] if !opts[:'extend_line_number'].nil?
|
|
179
|
+
query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
|
|
180
|
+
query_params[:'productCode'] = opts[:'product_code'] if !opts[:'product_code'].nil?
|
|
181
|
+
query_params[:'productionType'] = opts[:'production_type'] if !opts[:'production_type'].nil?
|
|
182
|
+
query_params[:'deliveryNumber'] = opts[:'delivery_number'] if !opts[:'delivery_number'].nil?
|
|
183
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
184
|
+
query_params[:'riskWarning'] = @api_client.build_collection_param(opts[:'risk_warning'], :multi) if !opts[:'risk_warning'].nil?
|
|
185
|
+
query_params[:'sortBy'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
|
|
186
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
187
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
188
|
+
|
|
189
|
+
# header parameters
|
|
190
|
+
header_params = opts[:header_params] || {}
|
|
191
|
+
# HTTP header 'Accept' (if needed)
|
|
192
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
193
|
+
header_params[:'X-Credential-Type'] = x_credential_type
|
|
194
|
+
|
|
195
|
+
# form parameters
|
|
196
|
+
form_params = opts[:form_params] || {}
|
|
197
|
+
|
|
198
|
+
# http body (model)
|
|
199
|
+
post_body = opts[:debug_body]
|
|
200
|
+
|
|
201
|
+
# return_type
|
|
202
|
+
return_type = opts[:debug_return_type] || 'ApiResponseApiDeclarationListDto'
|
|
203
|
+
|
|
204
|
+
# auth_names
|
|
205
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey', 'Signature', 'BearerToken', 'Timestamp']
|
|
206
|
+
|
|
207
|
+
new_options = opts.merge(
|
|
208
|
+
:operation => :"ApiDeclarationApi.get_v1_declaration_list_paging",
|
|
209
|
+
:header_params => header_params,
|
|
210
|
+
:query_params => query_params,
|
|
211
|
+
:form_params => form_params,
|
|
212
|
+
:body => post_body,
|
|
213
|
+
:auth_names => auth_names,
|
|
214
|
+
:return_type => return_type
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
218
|
+
if @api_client.config.debugging
|
|
219
|
+
@api_client.config.logger.debug "API called: ApiDeclarationApi#get_v1_declaration_list_paging\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
220
|
+
end
|
|
221
|
+
return data, status_code, headers
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# 单据所需申报信息查询接口。
|
|
225
|
+
# 该接口只接收能够唯一定位已存在单据的字段。订单、生产、发货等链路参数由接口内部从系统数据反查, 不再要求外部传供应商、客户、产品、国家、订单行、领料明细等规则参数。 调用方应先调用本接口取得 `DocumentTypeId`、是否必填、表单结构等信息,再调用提交接口保存附件或表单数据。
|
|
226
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
227
|
+
# @param [Hash] opts the optional parameters
|
|
228
|
+
# @option opts [String] :stage_code 申报阶段编码,例如 `Order`、`Production`、`Receipt`、`Deliverynote`。
|
|
229
|
+
# @option opts [String] :id 阶段业务单据内部 ID,例如订单 ID、生产单 ID、发货单 ID。
|
|
230
|
+
# @option opts [String] :order_number 订单号;订单阶段未传 id 时,配合 orderDate 定位订单。
|
|
231
|
+
# @option opts [Time] :order_date 订单日期;订单阶段按订单号定位时必传。
|
|
232
|
+
# @option opts [String] :order_side 订单侧别,常用 `PO` 或 `SO`;订单号和日期不唯一时用于区分。
|
|
233
|
+
# @option opts [String] :production_number 生产单号;生产/入库阶段未传 id 时,配合产品编码和类型定位生产单。
|
|
234
|
+
# @option opts [String] :product_code 产品编码;生产/入库阶段按生产单号定位时参与唯一性判断。
|
|
235
|
+
# @option opts [Integer] :production_type 生产类型;生产阶段默认 0,入库阶段默认 1。
|
|
236
|
+
# @option opts [String] :delivery_number 发货单号;发货阶段未传 id 时用于定位发货单。
|
|
237
|
+
# @return [Model3]
|
|
238
|
+
def get_v1_declaration_required_documents(x_credential_type, opts = {})
|
|
239
|
+
data, _status_code, _headers = get_v1_declaration_required_documents_with_http_info(x_credential_type, opts)
|
|
240
|
+
data
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# 单据所需申报信息查询接口。
|
|
244
|
+
# 该接口只接收能够唯一定位已存在单据的字段。订单、生产、发货等链路参数由接口内部从系统数据反查, 不再要求外部传供应商、客户、产品、国家、订单行、领料明细等规则参数。 调用方应先调用本接口取得 `DocumentTypeId`、是否必填、表单结构等信息,再调用提交接口保存附件或表单数据。
|
|
245
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
246
|
+
# @param [Hash] opts the optional parameters
|
|
247
|
+
# @option opts [String] :stage_code 申报阶段编码,例如 `Order`、`Production`、`Receipt`、`Deliverynote`。
|
|
248
|
+
# @option opts [String] :id 阶段业务单据内部 ID,例如订单 ID、生产单 ID、发货单 ID。
|
|
249
|
+
# @option opts [String] :order_number 订单号;订单阶段未传 id 时,配合 orderDate 定位订单。
|
|
250
|
+
# @option opts [Time] :order_date 订单日期;订单阶段按订单号定位时必传。
|
|
251
|
+
# @option opts [String] :order_side 订单侧别,常用 `PO` 或 `SO`;订单号和日期不唯一时用于区分。
|
|
252
|
+
# @option opts [String] :production_number 生产单号;生产/入库阶段未传 id 时,配合产品编码和类型定位生产单。
|
|
253
|
+
# @option opts [String] :product_code 产品编码;生产/入库阶段按生产单号定位时参与唯一性判断。
|
|
254
|
+
# @option opts [Integer] :production_type 生产类型;生产阶段默认 0,入库阶段默认 1。
|
|
255
|
+
# @option opts [String] :delivery_number 发货单号;发货阶段未传 id 时用于定位发货单。
|
|
256
|
+
# @return [Array<(Model3, Integer, Hash)>] Model3 data, response status code and response headers
|
|
257
|
+
def get_v1_declaration_required_documents_with_http_info(x_credential_type, opts = {})
|
|
258
|
+
if @api_client.config.debugging
|
|
259
|
+
@api_client.config.logger.debug 'Calling API: ApiDeclarationApi.get_v1_declaration_required_documents ...'
|
|
260
|
+
end
|
|
261
|
+
# verify the required parameter 'x_credential_type' is set
|
|
262
|
+
if @api_client.config.client_side_validation && x_credential_type.nil?
|
|
263
|
+
fail ArgumentError, "Missing the required parameter 'x_credential_type' when calling ApiDeclarationApi.get_v1_declaration_required_documents"
|
|
264
|
+
end
|
|
265
|
+
# verify enum value
|
|
266
|
+
allowable_values = ["Token", "API Key"]
|
|
267
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(x_credential_type)
|
|
268
|
+
fail ArgumentError, "invalid value for \"x_credential_type\", must be one of #{allowable_values}"
|
|
269
|
+
end
|
|
270
|
+
# resource path
|
|
271
|
+
local_var_path = '/v1/declaration/RequiredDocuments'
|
|
272
|
+
|
|
273
|
+
# query parameters
|
|
274
|
+
query_params = opts[:query_params] || {}
|
|
275
|
+
query_params[:'stageCode'] = opts[:'stage_code'] if !opts[:'stage_code'].nil?
|
|
276
|
+
query_params[:'id'] = opts[:'id'] if !opts[:'id'].nil?
|
|
277
|
+
query_params[:'orderNumber'] = opts[:'order_number'] if !opts[:'order_number'].nil?
|
|
278
|
+
query_params[:'orderDate'] = opts[:'order_date'] if !opts[:'order_date'].nil?
|
|
279
|
+
query_params[:'orderSide'] = opts[:'order_side'] if !opts[:'order_side'].nil?
|
|
280
|
+
query_params[:'productionNumber'] = opts[:'production_number'] if !opts[:'production_number'].nil?
|
|
281
|
+
query_params[:'productCode'] = opts[:'product_code'] if !opts[:'product_code'].nil?
|
|
282
|
+
query_params[:'productionType'] = opts[:'production_type'] if !opts[:'production_type'].nil?
|
|
283
|
+
query_params[:'deliveryNumber'] = opts[:'delivery_number'] if !opts[:'delivery_number'].nil?
|
|
284
|
+
|
|
285
|
+
# header parameters
|
|
286
|
+
header_params = opts[:header_params] || {}
|
|
287
|
+
# HTTP header 'Accept' (if needed)
|
|
288
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
289
|
+
header_params[:'X-Credential-Type'] = x_credential_type
|
|
290
|
+
|
|
291
|
+
# form parameters
|
|
292
|
+
form_params = opts[:form_params] || {}
|
|
293
|
+
|
|
294
|
+
# http body (model)
|
|
295
|
+
post_body = opts[:debug_body]
|
|
296
|
+
|
|
297
|
+
# return_type
|
|
298
|
+
return_type = opts[:debug_return_type] || 'Model3'
|
|
299
|
+
|
|
300
|
+
# auth_names
|
|
301
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey', 'Signature', 'BearerToken', 'Timestamp']
|
|
302
|
+
|
|
303
|
+
new_options = opts.merge(
|
|
304
|
+
:operation => :"ApiDeclarationApi.get_v1_declaration_required_documents",
|
|
305
|
+
:header_params => header_params,
|
|
306
|
+
:query_params => query_params,
|
|
307
|
+
:form_params => form_params,
|
|
308
|
+
:body => post_body,
|
|
309
|
+
:auth_names => auth_names,
|
|
310
|
+
:return_type => return_type
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
314
|
+
if @api_client.config.debugging
|
|
315
|
+
@api_client.config.logger.debug "API called: ApiDeclarationApi#get_v1_declaration_required_documents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
316
|
+
end
|
|
317
|
+
return data, status_code, headers
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# 申报文件/表单提交接口。
|
|
321
|
+
# 入参结构与内部 `BatchCreateStageAttachment` 保持一致: `ExtendId` 表示订单/生产单/发货单等业务 ID,`StageId` 表示申报阶段, `DocumentList` 中每个元素表示一种申报资料类型。 每个 `DocumentList` 元素可以同时包含 `FileList` 和 `FormDataList`。 文件资料和表单资料会分别进入各自服务保存,随后统一重算申报完成度。
|
|
322
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
323
|
+
# @param [Hash] opts the optional parameters
|
|
324
|
+
# @option opts [ApiDeclarationSubmitRequest] :api_declaration_submit_request
|
|
325
|
+
# @return [ApiResponseApiDeclarationSubmitResultDto]
|
|
326
|
+
def post_v1_declaration_submit(x_credential_type, opts = {})
|
|
327
|
+
data, _status_code, _headers = post_v1_declaration_submit_with_http_info(x_credential_type, opts)
|
|
328
|
+
data
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# 申报文件/表单提交接口。
|
|
332
|
+
# 入参结构与内部 `BatchCreateStageAttachment` 保持一致: `ExtendId` 表示订单/生产单/发货单等业务 ID,`StageId` 表示申报阶段, `DocumentList` 中每个元素表示一种申报资料类型。 每个 `DocumentList` 元素可以同时包含 `FileList` 和 `FormDataList`。 文件资料和表单资料会分别进入各自服务保存,随后统一重算申报完成度。
|
|
333
|
+
# @param x_credential_type [String] Use 'Token' with bearer authorization, or 'API Key' with signed API key headers. This header is mandatory in the deployed API.
|
|
334
|
+
# @param [Hash] opts the optional parameters
|
|
335
|
+
# @option opts [ApiDeclarationSubmitRequest] :api_declaration_submit_request
|
|
336
|
+
# @return [Array<(ApiResponseApiDeclarationSubmitResultDto, Integer, Hash)>] ApiResponseApiDeclarationSubmitResultDto data, response status code and response headers
|
|
337
|
+
def post_v1_declaration_submit_with_http_info(x_credential_type, opts = {})
|
|
338
|
+
if @api_client.config.debugging
|
|
339
|
+
@api_client.config.logger.debug 'Calling API: ApiDeclarationApi.post_v1_declaration_submit ...'
|
|
340
|
+
end
|
|
341
|
+
# verify the required parameter 'x_credential_type' is set
|
|
342
|
+
if @api_client.config.client_side_validation && x_credential_type.nil?
|
|
343
|
+
fail ArgumentError, "Missing the required parameter 'x_credential_type' when calling ApiDeclarationApi.post_v1_declaration_submit"
|
|
344
|
+
end
|
|
345
|
+
# verify enum value
|
|
346
|
+
allowable_values = ["Token", "API Key"]
|
|
347
|
+
if @api_client.config.client_side_validation && !allowable_values.include?(x_credential_type)
|
|
348
|
+
fail ArgumentError, "invalid value for \"x_credential_type\", must be one of #{allowable_values}"
|
|
349
|
+
end
|
|
350
|
+
# resource path
|
|
351
|
+
local_var_path = '/v1/declaration/Submit'
|
|
352
|
+
|
|
353
|
+
# query parameters
|
|
354
|
+
query_params = opts[:query_params] || {}
|
|
355
|
+
|
|
356
|
+
# header parameters
|
|
357
|
+
header_params = opts[:header_params] || {}
|
|
358
|
+
# HTTP header 'Accept' (if needed)
|
|
359
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
360
|
+
# HTTP header 'Content-Type'
|
|
361
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
362
|
+
if !content_type.nil?
|
|
363
|
+
header_params['Content-Type'] = content_type
|
|
364
|
+
end
|
|
365
|
+
header_params[:'X-Credential-Type'] = x_credential_type
|
|
366
|
+
|
|
367
|
+
# form parameters
|
|
368
|
+
form_params = opts[:form_params] || {}
|
|
369
|
+
|
|
370
|
+
# http body (model)
|
|
371
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'api_declaration_submit_request'])
|
|
372
|
+
|
|
373
|
+
# return_type
|
|
374
|
+
return_type = opts[:debug_return_type] || 'ApiResponseApiDeclarationSubmitResultDto'
|
|
375
|
+
|
|
376
|
+
# auth_names
|
|
377
|
+
auth_names = opts[:debug_auth_names] || ['ApiKey', 'Signature', 'BearerToken', 'Timestamp']
|
|
378
|
+
|
|
379
|
+
new_options = opts.merge(
|
|
380
|
+
:operation => :"ApiDeclarationApi.post_v1_declaration_submit",
|
|
381
|
+
:header_params => header_params,
|
|
382
|
+
:query_params => query_params,
|
|
383
|
+
:form_params => form_params,
|
|
384
|
+
:body => post_body,
|
|
385
|
+
:auth_names => auth_names,
|
|
386
|
+
:return_type => return_type
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
390
|
+
if @api_client.config.debugging
|
|
391
|
+
@api_client.config.logger.debug "API called: ApiDeclarationApi#post_v1_declaration_submit\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
392
|
+
end
|
|
393
|
+
return data, status_code, headers
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
end
|