697 lines
18 KiB
TypeScript
697 lines
18 KiB
TypeScript
import request from '@/utils/request'
|
||
|
||
const v = '1.0'
|
||
|
||
export type WaveBatchListParams = {
|
||
pagination?: {
|
||
page?: number
|
||
pageSize?: number
|
||
}
|
||
where?: Record<string, any>
|
||
}
|
||
|
||
export type WaveGroupOrderFetchListParams = {
|
||
pagination?: {
|
||
page?: number
|
||
pageSize?: number
|
||
}
|
||
distinguish_express?: boolean
|
||
store_id?: number
|
||
same_order_quantity?: number
|
||
shop_name?: string
|
||
include_sku?: string
|
||
return_order_ids?: boolean
|
||
}
|
||
|
||
export type WaveStrategyListParams = {
|
||
pagination?: {
|
||
page?: number
|
||
pageSize?: number
|
||
currentPage?: number
|
||
page_size?: number
|
||
size?: number
|
||
}
|
||
}
|
||
|
||
export type WaveStrategyCreateParams = {
|
||
strategy_name: string
|
||
strategy_type: number
|
||
batch_mode: number
|
||
status?: number
|
||
order_min_sku?: number
|
||
order_max_sku?: number
|
||
order_min_qty?: number
|
||
order_max_qty?: number
|
||
min_same_structure?: number
|
||
max_same_structure?: number
|
||
batch_max_orders?: number
|
||
batch_max_skus?: number
|
||
group_batch_max_orders?: number
|
||
require_same_express?: boolean
|
||
allow_cross_owner?: boolean
|
||
description?: string
|
||
allowed_provinces?: Array<string>
|
||
allowed_platforms?: Array<string>
|
||
allowed_owners?: Array<number | string>
|
||
allowed_expresses?: Array<string>
|
||
}
|
||
|
||
export type WaveStrategyUpdateParams = {
|
||
id?: number
|
||
strategy_id?: number
|
||
strategyId?: number
|
||
strategy_name?: string
|
||
strategy_type?: number
|
||
batch_mode?: number
|
||
status?: number
|
||
order_min_sku?: number
|
||
order_max_sku?: number
|
||
order_min_qty?: number
|
||
order_max_qty?: number
|
||
min_same_structure?: number
|
||
max_same_structure?: number
|
||
batch_max_orders?: number
|
||
batch_max_skus?: number
|
||
group_batch_max_orders?: number
|
||
require_same_express?: boolean
|
||
allow_cross_owner?: boolean
|
||
description?: string
|
||
allowed_provinces?: Array<string>
|
||
allowed_platforms?: Array<string>
|
||
allowed_owners?: Array<number | string>
|
||
allowed_expresses?: Array<string>
|
||
}
|
||
|
||
export type WaveStrategyQuickScanParams = {
|
||
}
|
||
|
||
export type WaveStrategyQuickScanResponse = {
|
||
status: string
|
||
task_id: string
|
||
warehouse_id: number
|
||
state: string
|
||
message?: string
|
||
accepted_at: string
|
||
}
|
||
|
||
export type WaveStrategyQuickScanTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveStrategyQuickScanTaskProgressResponse = {
|
||
task_id: string
|
||
state: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
warehouse_id?: number
|
||
total_order_count?: number
|
||
processed_order_count?: number
|
||
matched_order_count?: number
|
||
unmatched_order_count?: number
|
||
progress_percent?: number
|
||
submitted_at?: string
|
||
start_time?: string
|
||
end_time?: string
|
||
error_message?: string
|
||
error_code?: string
|
||
duration_ms?: number
|
||
}
|
||
|
||
export type WaveStrategyFallbackOrderListParams = {
|
||
pagination?: {
|
||
page?: number
|
||
pageSize?: number
|
||
currentPage?: number
|
||
page_size?: number
|
||
size?: number
|
||
}
|
||
where?: Record<string, any>
|
||
sort?: {
|
||
sortField?: string
|
||
sortOrder?: 'ASC' | 'DESC' | string
|
||
}
|
||
}
|
||
|
||
/** 不符合波次策略订单行;含接口新增的 item_snapshot(商品名称*数量|…) */
|
||
export type WaveStrategyFallbackOrderListRow = Record<string, unknown> & {
|
||
item_snapshot?: string
|
||
}
|
||
|
||
export type WaveStrategyFallbackOrderListPagination = {
|
||
page?: number
|
||
pageSize?: number
|
||
total?: number
|
||
totalPages?: number
|
||
hasPrevious?: boolean
|
||
hasNext?: boolean
|
||
}
|
||
|
||
export type WaveStrategyFallbackOrderListResponse = {
|
||
list: WaveStrategyFallbackOrderListRow[]
|
||
pagination: WaveStrategyFallbackOrderListPagination
|
||
}
|
||
|
||
export type WaveFetchParams = {
|
||
structure_list: Array<{
|
||
item_detail_machine: string
|
||
quantity?: number
|
||
}>
|
||
}
|
||
|
||
export type WaveFetchResponse = {
|
||
task_id: string
|
||
warehouse_id: number
|
||
structure_count: number
|
||
default_quantity: number
|
||
auto_fetch_disabled_marker: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveFetchTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveFetchTaskProgressResponse = {
|
||
task_id: string
|
||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found'
|
||
warehouse_id?: number
|
||
structure_count?: number
|
||
finished_structure_count?: number
|
||
progress_percent?: number
|
||
total_fetched_quantity?: number
|
||
duration_ms?: number
|
||
error?: string
|
||
update_time?: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateExpressParams = {
|
||
wave_ids: Array<string | number> | string | number
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateExpressResponse = {
|
||
task_id: string
|
||
status?: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateExpressTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateExpressTaskProgressResponse = {
|
||
task_id: string
|
||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
progress_percent?: number
|
||
total_count?: number
|
||
success_count?: number
|
||
failed_count?: number
|
||
total_order_count?: number
|
||
allocated_order_count?: number
|
||
failed_order_count?: number
|
||
duration_ms?: number
|
||
update_time?: string
|
||
error?: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateStorageParams = {
|
||
wave_ids: Array<string | number> | string | number
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateStorageResponse = {
|
||
task_id: string
|
||
status?: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateStorageTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchAllocateStorageTaskProgressResponse = {
|
||
task_id: string
|
||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
progress_percent?: number
|
||
total_count?: number
|
||
success_count?: number
|
||
failed_count?: number
|
||
total_order_count?: number
|
||
allocated_order_count?: number
|
||
failed_order_count?: number
|
||
duration_ms?: number
|
||
update_time?: string
|
||
error?: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchRemoveExceptionOrdersParams = {
|
||
wave_ids: Array<string | number> | string | number
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchRemoveExceptionOrdersResponse = {
|
||
task_id: string
|
||
status?: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchRemoveExceptionOrdersTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchRemoveExceptionOrdersTaskProgressResponse = {
|
||
task_id: string
|
||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
progress_percent?: number
|
||
total_count?: number
|
||
success_count?: number
|
||
failed_count?: number
|
||
total_order_count?: number
|
||
removed_order_count?: number
|
||
failed_order_count?: number
|
||
duration_ms?: number
|
||
update_time?: string
|
||
error?: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchCancelParams = {
|
||
ids: Array<string | number> | string | number
|
||
}
|
||
|
||
export type WaveBatchCancelTaskProgressParams = {
|
||
task_id?: string
|
||
taskId?: string
|
||
}
|
||
|
||
export type WaveBatchCancelTaskProgressResponse = {
|
||
task_id: string
|
||
status?: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
state?: 'submitted' | 'running' | 'success' | 'failed' | 'not_found' | string
|
||
progress_percent?: number
|
||
total_count?: number
|
||
success_count?: number
|
||
failed_count?: number
|
||
total_wave_count?: number
|
||
processed_wave_count?: number
|
||
total_order_count?: number
|
||
processed_order_count?: number
|
||
duration_ms?: number
|
||
update_time?: string
|
||
error?: string
|
||
message?: string
|
||
}
|
||
|
||
export type WaveBatchAutoGroupingParams = {
|
||
ids: Array<string | number> | string | number
|
||
}
|
||
|
||
export type WaveBatchFinishAutoGroupingParams = {
|
||
ids: Array<string | number> | string | number
|
||
}
|
||
|
||
export type WaveBatchRemoveOrdersParams = {
|
||
ids: Array<string | number> | string | number
|
||
}
|
||
|
||
export function orderWaveBatchList(data: WaveBatchListParams = {}): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchList',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveGroupOrderFetchList(data: WaveGroupOrderFetchListParams = {}): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.groupOrderFetchList',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyList(data: WaveStrategyListParams = {}): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyList',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyCreate(data: WaveStrategyCreateParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyCreate',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyUpdate(data: WaveStrategyUpdateParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyUpdate',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyQuickScan(
|
||
data: WaveStrategyQuickScanParams = {}
|
||
): Promise<WaveStrategyQuickScanResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyQuickScan',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyQuickScanTaskProgress(
|
||
data: WaveStrategyQuickScanTaskProgressParams
|
||
): Promise<WaveStrategyQuickScanTaskProgressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyQuickScanTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveWaveStrategyFallbackOrderList(
|
||
data: WaveStrategyFallbackOrderListParams = {}
|
||
): Promise<WaveStrategyFallbackOrderListResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.waveStrategyFallbackOrderList',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export type WaveSingleFetchByIdsParams = {
|
||
ids?: Array<string | number> | string | number
|
||
order_ids?: Array<string | number> | string | number
|
||
orderIds?: Array<string | number> | string | number
|
||
}
|
||
|
||
export type WaveSingleFetchByIdsResponse = {
|
||
ids: Array<number>
|
||
wave_id: number
|
||
wave_no: string
|
||
fetched_order_ids: Array<number>
|
||
fetched_order_count: number
|
||
excluded_existing_wave_order_ids?: Array<number>
|
||
skipped_order_ids?: Array<number>
|
||
not_found_order_ids?: Array<number>
|
||
}
|
||
|
||
export function orderWaveSingleFetchByIds(
|
||
data: WaveSingleFetchByIdsParams
|
||
): Promise<WaveSingleFetchByIdsResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.singleFetchByIds',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveFetch(data: WaveFetchParams): Promise<WaveFetchResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.fetch',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveGroupFetch(data: WaveFetchParams): Promise<WaveFetchResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.groupFetch',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveFetchTaskProgress(data: WaveFetchTaskProgressParams): Promise<WaveFetchTaskProgressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.fetchTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchAllocateExpress(data: WaveBatchAllocateExpressParams): Promise<WaveBatchAllocateExpressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchAllocateExpress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchAllocateExpressTaskProgress(data: WaveBatchAllocateExpressTaskProgressParams): Promise<WaveBatchAllocateExpressTaskProgressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchAllocateExpressTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchAllocateStorage(data: WaveBatchAllocateStorageParams): Promise<WaveBatchAllocateStorageResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchAllocateStorage',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchAllocateStorageTaskProgress(data: WaveBatchAllocateStorageTaskProgressParams): Promise<WaveBatchAllocateStorageTaskProgressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchAllocateStorageTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchRemoveExceptionOrders(data: WaveBatchRemoveExceptionOrdersParams): Promise<WaveBatchRemoveExceptionOrdersResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchRemoveExceptionOrders',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchRemoveExceptionOrdersTaskProgress(data: WaveBatchRemoveExceptionOrdersTaskProgressParams): Promise<WaveBatchRemoveExceptionOrdersTaskProgressResponse & { code?: number; message?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchRemoveExceptionOrdersTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchCancel(data: WaveBatchCancelParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchCancel',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchCancelTaskProgress(data: WaveBatchCancelTaskProgressParams): Promise<WaveBatchCancelTaskProgressResponse & { code?: number; message?: string; flag?: string }> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchCancelTaskProgress',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchAutoGrouping(data: WaveBatchAutoGroupingParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchAutoGrouping',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchFinishAutoGrouping(data: WaveBatchFinishAutoGroupingParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchFinishAutoGrouping',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export function orderWaveBatchRemoveOrders(data: WaveBatchRemoveOrdersParams): Promise<any> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.wave.batchRemoveOrders',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export const orderWave = {
|
||
batchList: orderWaveBatchList,
|
||
groupOrderFetchList: orderWaveGroupOrderFetchList,
|
||
waveStrategyList: orderWaveWaveStrategyList,
|
||
waveStrategyCreate: orderWaveWaveStrategyCreate,
|
||
waveStrategyUpdate: orderWaveWaveStrategyUpdate,
|
||
waveStrategyQuickScan: orderWaveWaveStrategyQuickScan,
|
||
waveStrategyQuickScanTaskProgress: orderWaveWaveStrategyQuickScanTaskProgress,
|
||
waveStrategyFallbackOrderList: orderWaveWaveStrategyFallbackOrderList,
|
||
singleFetchByIds: orderWaveSingleFetchByIds,
|
||
groupFetch: orderWaveGroupFetch,
|
||
fetch: orderWaveFetch,
|
||
fetchTaskProgress: orderWaveFetchTaskProgress,
|
||
batchAllocateExpress: orderWaveBatchAllocateExpress,
|
||
batchAllocateExpressTaskProgress: orderWaveBatchAllocateExpressTaskProgress,
|
||
batchAllocateStorage: orderWaveBatchAllocateStorage,
|
||
batchAllocateStorageTaskProgress: orderWaveBatchAllocateStorageTaskProgress,
|
||
batchRemoveExceptionOrders: orderWaveBatchRemoveExceptionOrders,
|
||
batchRemoveExceptionOrdersTaskProgress: orderWaveBatchRemoveExceptionOrdersTaskProgress,
|
||
batchCancel: orderWaveBatchCancel,
|
||
batchCancelTaskProgress: orderWaveBatchCancelTaskProgress,
|
||
batchAutoGrouping: orderWaveBatchAutoGrouping,
|
||
batchFinishAutoGrouping: orderWaveBatchFinishAutoGrouping,
|
||
batchRemoveOrders: orderWaveBatchRemoveOrders
|
||
} |