cbs-4px-merchant-cli 0.0.12 → 0.0.13

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.
@@ -385,6 +385,9 @@ export interface ProblemListRequest {
385
385
  pageSize?: number;
386
386
  }
387
387
  export interface AbnormalProblem {
388
+ reasonCode: string | null;
389
+ abnId: number | null;
390
+ reasonId: number | null;
388
391
  abnormalTypeName: string | null;
389
392
  abnormalReasonName: string | null;
390
393
  abnormalDescription: string | null;
@@ -503,6 +506,42 @@ export interface ChangeProductResp {
503
506
  success: boolean;
504
507
  message: string | null;
505
508
  }
509
+ /** 下达走货指令参数 */
510
+ export interface ShipmentSubmitParams {
511
+ orderNo: string;
512
+ reasonCode: string;
513
+ solutionChildTypeNo: number;
514
+ newFpxTrackNo?: string;
515
+ remark?: string;
516
+ content?: string;
517
+ }
518
+ /** 下达退件指令参数 */
519
+ export interface ReturnSubmitParams {
520
+ orderNo: string;
521
+ reasonCode: string;
522
+ returnAddressId?: number;
523
+ }
524
+ /** 下达销毁指令参数 */
525
+ export interface DestroySubmitParams {
526
+ orderNo: string;
527
+ reasonCode: string;
528
+ }
529
+ /** 退件地址项 */
530
+ export interface ReturnAddressItem {
531
+ id: number | null;
532
+ consigneeName: string | null;
533
+ consigneeTel: string | null;
534
+ province: string | null;
535
+ city: string | null;
536
+ district: string | null;
537
+ streetAddress: string | null;
538
+ returnType: string | null;
539
+ isDefault: string | null;
540
+ }
541
+ /** 退件地址库列表 */
542
+ export interface ReturnAddressListResp {
543
+ list: ReturnAddressItem[];
544
+ }
506
545
  export interface ServiceRepairOrderListRequest {
507
546
  orderCodeListString?: string;
508
547
  businessLineId?: number;
@@ -1013,6 +1052,31 @@ export interface PlatformOrderDetailResp {
1013
1052
  buyerId: string | null;
1014
1053
  buyerNote: string | null;
1015
1054
  createdTime: string | null;
1055
+ receiverCompany: string | null;
1056
+ addressLine1: string | null;
1057
+ addressLine2: string | null;
1058
+ countryCode: string | null;
1059
+ countryName: string | null;
1060
+ county: string | null;
1061
+ buyerEmail: string | null;
1062
+ sellerNote: string | null;
1063
+ /** 寄件人整组:平台单 sync 回来必为空,push 前须补齐 */
1064
+ senderName: string | null;
1065
+ senderCompany: string | null;
1066
+ senderTelephone: string | null;
1067
+ senderAddress: string | null;
1068
+ senderCity: string | null;
1069
+ senderProvince: string | null;
1070
+ senderPostcode: string | null;
1071
+ senderId: string | null;
1072
+ ioss: string | null;
1073
+ vatNo: string | null;
1074
+ eori: string | null;
1075
+ tariffno: string | null;
1076
+ hasBattery: string | null;
1077
+ returnsign: string | null;
1078
+ transactionId: string | null;
1079
+ fulfillmentOrderId: string | null;
1016
1080
  items: PlatformOrderItemDetail[] | null;
1017
1081
  }
1018
1082
  export interface IndivAuthRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbs-4px-merchant-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Cbs merchant CLI tool",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/skill/SKILL.md CHANGED
@@ -42,7 +42,7 @@ description: >-
42
42
  | 产品推荐 | [`reference/product.md`](reference/product.md) | 参数多(国家/重量/电池/邮编等),必须确认 |
43
43
  | 理赔查询 | [`reference/service.md`](reference/service.md) | 参数多(单号/时间/状态/分页),必须确认 |
44
44
  | 异常件管理 | [`reference/problem.md`](reference/problem.md) | 确认子命令和参数格式 |
45
- | 异常托管(改带电/改产品) | [`reference/custody.md`](reference/custody.md) | 含写操作,必须确认参数和确认机制 |
45
+ | 异常托管(改带电/改产品/走货/退件/销毁) | [`reference/custody.md`](reference/custody.md) | 含写操作(销毁不可逆),必须确认参数和确认机制 |
46
46
  | 服务中心 | [`reference/service.md`](reference/service.md) | 确认子命令和参数格式 |
47
47
  | 财务管理 | [`reference/finance.md`](reference/finance.md) | 确认子命令和参数格式 |
48
48
  | 揽收管理 | [`reference/pickup.md`](reference/pickup.md) | 确认参数格式 |
@@ -70,7 +70,7 @@ description: >-
70
70
  | `product` | 产品推荐:推荐产品、产品列表、产品详情、时效查询、搜索产品 | [`reference/product.md`](reference/product.md) |
71
71
  | `claim` | 理赔查询:按单号/时间/状态查询理赔列表(挂在 `service` 下,即 `fmc service claim ...`) | [`reference/service.md`](reference/service.md) |
72
72
  | `problem` | 异常件管理:问题件列表、AI处理建议、通知件、尾程异常、欠费件、拦截件 | [`reference/problem.md`](reference/problem.md) |
73
- | `custody` | 异常托管:改带电产品查询、AI推荐改产品、批量提交改产品(写操作) | [`reference/custody.md`](reference/custody.md) |
73
+ | `custody` | 异常托管:改带电/改产品查询与提交、查可下达指令、走货/退件/销毁指令下达(写操作,销毁不可逆)、退件地址库查询 | [`reference/custody.md`](reference/custody.md) |
74
74
  | `service` | 服务中心:售后工单、查件、投诉、服务单详情、处理记录、理赔详情 | [`reference/service.md`](reference/service.md) |
75
75
  | `finance` | 财务管理:账户余额、账单、每日费用、未出账汇总及明细、充值记录(在线及线下)、计费明细 | [`reference/finance.md`](reference/finance.md) |
76
76
  | `pickup` | 揽收管理:物料申请单查询 | [`reference/pickup.md`](reference/pickup.md) |
@@ -106,6 +106,10 @@ description: >-
106
106
  用户提到"拦截/拦截件" → `fmc problem intercepted`
107
107
  用户提到"改带电/换带电产品" → `fmc custody electric`
108
108
  用户提到"改产品/换产品/推荐异常产品" → `fmc custody recommend`
109
+ 用户提到"这个异常能下哪些指令/可下达指令" → `fmc custody help`
110
+ 用户提到"走货/确认走货/换单号走货" → `fmc custody ship`(写操作,先确认)
111
+ 用户提到"退件/退回/退货" → `fmc custody return`(写操作,先确认);查退件地址用 `custody address`
112
+ 用户提到"销毁/丢弃/不要了" → `fmc custody destroy`(写操作,不可逆,务必确认)
109
113
  用户提到"批量处理异常/托管处理" → 参考跟单助理角色 SOP
110
114
  用户提到"工单/售后/报修" → `fmc service repair`
111
115
  用户提到"查件/查件进度" → `fmc service check`
@@ -330,7 +334,7 @@ fmc config set baseUrl https://b.4px.com
330
334
  - [`reference/order.md`](reference/order.md) — 订单管理详细参数
331
335
  - [`reference/product.md`](reference/product.md) — 产品推荐与查询详细参数
332
336
  - [`reference/problem.md`](reference/problem.md) — 异常件管理详细参数
333
- - [`reference/custody.md`](reference/custody.md) — 异常托管(改带电/改产品)详细参数
337
+ - [`reference/custody.md`](reference/custody.md) — 异常托管(改带电/改产品/走货/退件/销毁)详细参数
334
338
  - [`reference/service.md`](reference/service.md) — 服务中心与理赔查询详细参数
335
339
  - [`reference/finance.md`](reference/finance.md) — 财务管理详细参数
336
340
  - [`reference/pickup.md`](reference/pickup.md) — 揽收管理详细参数
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbs-4px-merchant-cli",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "BPortal Merchant CLI (fmc) skill — BPortal",
5
5
  "files": [
6
6
  "SKILL.md",
@@ -1,13 +1,19 @@
1
1
  # `fmc custody` command
2
2
 
3
- > 异常托管 — 改带电 / 改产品。配合 `fmc problem list` 使用。
3
+ > 异常托管 — 改带电 / 改产品 / 走货 / 退件 / 销毁。配合 `fmc problem list` 使用。
4
4
 
5
5
  ## 背景
6
6
 
7
7
  当订单在仓库上架时出现异常(如内置电池、磁性物品、无渠道等),商家可通过以下命令将订单
8
- 改换为支持带电的物流产品或替换为有渠道的产品,从而让异常单恢复正常走货。
8
+ 改换为支持带电的物流产品或替换为有渠道的产品,或直接对异常单下达走货/退件/销毁指令,
9
+ 从而让异常单闭环处理。
9
10
 
10
- ### 异常原因编码速查
11
+ ### reasonCode 获取方式
12
+
13
+ `problem list --output json` 返回的 `abnormalProblems[]` 中直接包含 `reasonCode`、`abnId`、
14
+ `reasonId` 三个定位字段——**下达指令时的 `--reason` 直接取 `reasonCode`,无需再做中文名映射**。
15
+
16
+ ### 改带电/改产品异常原因编码速查
11
17
 
12
18
  | abnormalReasonName | reasonCode | 处理流程 |
13
19
  | --- | --- | --- |
@@ -15,7 +21,22 @@
15
21
  | 磁性物品 | CXW | 改带电 → `custody electric` |
16
22
  | 无渠道 | NC | 改产品 → `custody recommend` |
17
23
 
18
- `problem list --output json` 返回的 `abnormalProblems[].abnormalReasonName` 即为上表中文列。
24
+ ### 走货二级指令支持矩阵
25
+
26
+ `custody ship` 仅支持**无附件、无复杂表单**的走货二级指令;其余指令请转页面处理。
27
+
28
+ | 类别 | 二级指令编号 | 命令支持 | 备注 |
29
+ | --- | --- | --- | --- |
30
+ | 直接走货 | 1, 5, 23 | ✅ | 认可重量/认可费用/填充包装走货 |
31
+ | 换单号走货 | 8, 13, 26 | ✅ | **必须** `--new-track-no` |
32
+ | 带说明走货 | 24, 25, 27, 28 | ✅ | **必须** `--remark` |
33
+ | 其他 | 17 | ✅ | **必须** `--content` |
34
+ | 需上传附件 | 2, 9, 11, 12, 16 | ❌ | 转页面处理 |
35
+ | 需填复杂表单 | 3, 6, 7, 15 | ❌ | 转页面处理 |
36
+ | 改带电/改产品 | 32, 33 | ❌ | 改用 `custody change` |
37
+
38
+ > 服务端在提交前会强制调 `get_abnormality_help` 校验该指令是否允许下达;若指令不可下达,
39
+ > 命令会**原样输出服务端返回的可下达指令列表提示**,据此改用正确的二级指令编号重试。
19
40
 
20
41
  ---
21
42
 
@@ -167,6 +188,185 @@ fmc custody change --order-nos FPX12345678 --pk-code ECO-PKG-BAT --reason NZDC -
167
188
 
168
189
  ---
169
190
 
191
+ ### `fmc custody help`
192
+
193
+ | Field | Value |
194
+ | --- | --- |
195
+ | **Name** | `custody help` |
196
+ | **Description** | 查询异常单当前可下达的一级/二级指令列表 |
197
+ | **Usage** | `fmc custody help <orderNo> --reason <code> [flags]` |
198
+
199
+ 需要 API Key 认证。下达走货/退件/销毁指令前,先用它确认可下达的指令编号。
200
+
201
+ #### Arguments
202
+
203
+ | Argument | Type | Required | Description |
204
+ | --- | --- | --- | --- |
205
+ | `<orderNo>` | string | yes | 物流单号 |
206
+
207
+ #### Options
208
+
209
+ | Flag | Type | Required | Description |
210
+ | --- | --- | --- | --- |
211
+ | `--reason <code>` | string | yes | 异常原因编码,取自 problem list 的 `abnormalProblems[].reasonCode` |
212
+
213
+ 支持全局选项: `--output`, `--verbose`, `--dry-run`
214
+
215
+ #### Examples
216
+
217
+ ```bash
218
+ fmc custody help FPX12345678 --reason WD
219
+ fmc custody help FPX12345678 --reason WD --output json
220
+ ```
221
+
222
+ #### Output (text mode)
223
+
224
+ ```
225
+ 可下达指令
226
+ ──────────────────────────────────────────────────
227
+
228
+ 走货(1)
229
+ → 认可重量,确认走货(1)
230
+ → 更换新单号走货(8)
231
+
232
+ 退件(2)
233
+ 无二级指令
234
+
235
+ 销毁(3)
236
+ 无二级指令
237
+ ```
238
+
239
+ ---
240
+
241
+ ### `fmc custody ship`
242
+
243
+ | Field | Value |
244
+ | --- | --- |
245
+ | **Name** | `custody ship` |
246
+ | **Description** | 对异常单下达走货指令(写操作) |
247
+ | **Usage** | `fmc custody ship --order-nos <nos> --reason <code> --child <no> [flags]` |
248
+
249
+ 需要 API Key 认证。**这是写操作**,默认二次确认;非交互环境须加 `-y`。走货支持矩阵见上方「走货二级指令支持矩阵」。
250
+
251
+ #### Options
252
+
253
+ | Flag | Type | Required | Description |
254
+ | --- | --- | --- | --- |
255
+ | `--order-nos <nos>` | string | yes | 物流单号,多个用逗号分隔 |
256
+ | `--reason <code>` | string | yes | 异常原因编码 |
257
+ | `--child <no>` | string | yes | 走货二级指令编号,取自 `custody help` 输出 |
258
+ | `--new-track-no <no>` | string | no | 新物流单号(二级指令 8/13/26 必填) |
259
+ | `--remark <text>` | string | no | 说明(二级指令 24/25/27/28 必填) |
260
+ | `--content <text>` | string | no | 补充说明文本(二级指令 17 必填) |
261
+ | `-y, --yes` | boolean | no | 跳过确认 |
262
+
263
+ 支持全局选项: `--output`, `--verbose`, `--dry-run`
264
+
265
+ #### Examples
266
+
267
+ ```bash
268
+ # 认可重量走货
269
+ fmc custody ship --order-nos FPX12345678 --reason WD --child 1
270
+ # 换新单号走货(必带新单号)
271
+ fmc custody ship --order-nos FPX001,FPX002 --reason WD --child 8 --new-track-no FPXNEW001 -y
272
+ # 其他(必带说明文本)
273
+ fmc custody ship --order-nos FPX12345678 --reason WD --child 17 --content "已与客户确认继续走货"
274
+ ```
275
+
276
+ ---
277
+
278
+ ### `fmc custody return`
279
+
280
+ | Field | Value |
281
+ | --- | --- |
282
+ | **Name** | `custody return` |
283
+ | **Description** | 对异常单下达退件指令(写操作) |
284
+ | **Usage** | `fmc custody return --order-nos <nos> --reason <code> [flags]` |
285
+
286
+ 需要 API Key 认证。**这是写操作**。退件地址取自商家退件地址库;未指定 `--address-id` 时使用默认退件地址(确认文案会提示)。可先用 `custody address` 查看可用地址。
287
+
288
+ #### Options
289
+
290
+ | Flag | Type | Required | Description |
291
+ | --- | --- | --- | --- |
292
+ | `--order-nos <nos>` | string | yes | 物流单号,多个用逗号分隔 |
293
+ | `--reason <code>` | string | yes | 异常原因编码 |
294
+ | `--address-id <id>` | string | no | 退件地址标识(取自 `custody address`,不传则使用默认退件地址) |
295
+ | `-y, --yes` | boolean | no | 跳过确认 |
296
+
297
+ 支持全局选项: `--output`, `--verbose`, `--dry-run`
298
+
299
+ #### Examples
300
+
301
+ ```bash
302
+ # 使用默认退件地址
303
+ fmc custody return --order-nos FPX12345678 --reason WD
304
+ # 指定退件地址
305
+ fmc custody return --order-nos FPX001,FPX002 --reason WD --address-id 3 -y
306
+ ```
307
+
308
+ ---
309
+
310
+ ### `fmc custody destroy`
311
+
312
+ | Field | Value |
313
+ | --- | --- |
314
+ | **Name** | `custody destroy` |
315
+ | **Description** | 对异常单下达销毁指令(写操作,**不可逆**) |
316
+ | **Usage** | `fmc custody destroy --order-nos <nos> --reason <code> [flags]` |
317
+
318
+ 需要 API Key 认证。**这是不可逆写操作**,确认文案含销毁警示,下达前务必与用户确认。
319
+
320
+ #### Options
321
+
322
+ | Flag | Type | Required | Description |
323
+ | --- | --- | --- | --- |
324
+ | `--order-nos <nos>` | string | yes | 物流单号,多个用逗号分隔 |
325
+ | `--reason <code>` | string | yes | 异常原因编码 |
326
+ | `-y, --yes` | boolean | no | 跳过确认 |
327
+
328
+ 支持全局选项: `--output`, `--verbose`, `--dry-run`
329
+
330
+ #### Examples
331
+
332
+ ```bash
333
+ fmc custody destroy --order-nos FPX12345678 --reason WD
334
+ ```
335
+
336
+ ---
337
+
338
+ ### `fmc custody address`
339
+
340
+ | Field | Value |
341
+ | --- | --- |
342
+ | **Name** | `custody address` |
343
+ | **Description** | 查询商家退件地址库列表 |
344
+ | **Usage** | `fmc custody address [flags]` |
345
+
346
+ 需要 API Key 认证。下达退件指令前用它确认 `--address-id`,或核对默认地址。
347
+
348
+ 支持全局选项: `--output`, `--verbose`, `--dry-run`
349
+
350
+ #### Examples
351
+
352
+ ```bash
353
+ fmc custody address
354
+ fmc custody address --output json
355
+ ```
356
+
357
+ #### Output (text mode)
358
+
359
+ ```
360
+ 退件地址库
361
+ ──────────────────────────────────────────────────
362
+
363
+ id=3 [默认] 张三 13800000000
364
+ 广东省深圳市南山区科技园路1号
365
+ 退件方式:快递退件
366
+ ```
367
+
368
+ ---
369
+
170
370
  ## 典型工作流
171
371
 
172
372
  ### A. 内电/磁性物品 → 改带电
@@ -191,3 +391,16 @@ fmc custody change --order-nos FPX12345678 --pk-code ECO-PKG-BAT --reason NZDC -
191
391
  4. 无渠道类 → 逐单 `custody recommend` 查推荐 → 汇总后一次 `custody change`
192
392
  5. 首次执行前向用户确认,确认后加 `-y` 批量执行
193
393
  6. 执行完毕后向用户报告成功/失败/差价
394
+
395
+ ### D. 走货 / 退件 / 销毁(通用异常处理闭环)
396
+
397
+ 1. `fmc problem list --abnormal-status unresolved --output json`
398
+ → 取每条异常问题的 `reasonCode`(直接来自 `abnormalProblems[].reasonCode`,无需中文名映射)
399
+ 2. `fmc custody help <orderNo> --reason <reasonCode>` → 列出可下达的一级/二级指令编号
400
+ 3. 根据用户诉求选择指令下达(写操作,`-y` 前须先向用户确认):
401
+ - 走货:`custody ship --order-nos <no> --reason <code> --child <二级编号> [--new-track-no|--remark|--content]`
402
+ - 退件:先 `custody address` 确认地址 → `custody return --order-nos <no> --reason <code> [--address-id <id>]`
403
+ - 销毁(**不可逆**):`custody destroy --order-nos <no> --reason <code>`(务必向用户强调不可逆)
404
+ 4. 若提交因前置校验未通过失败:命令会原样输出「可下达指令列表」提示,据此改用正确的二级指令编号重试
405
+ 5. 走货指令若命中不支持矩阵(附件类/复杂表单类/改带电改产品),提示用户转页面处理或改用 `custody change`
406
+ 6. 执行完毕后向用户报告成功/失败明细
@@ -41,6 +41,11 @@ Command **details** are in sibling `<group>.md` files in this directory.
41
41
  | `fmc custody electric` | 查询可改带电产品列表 | [custody.md](custody.md) |
42
42
  | `fmc custody recommend` | 获取 AI 推荐改产品方案 | [custody.md](custody.md) |
43
43
  | `fmc custody change` | 批量提交改带电/改产品(写) | [custody.md](custody.md) |
44
+ | `fmc custody help` | 查询异常单可下达的指令列表 | [custody.md](custody.md) |
45
+ | `fmc custody ship` | 下达走货指令(写) | [custody.md](custody.md) |
46
+ | `fmc custody return` | 下达退件指令(写) | [custody.md](custody.md) |
47
+ | `fmc custody destroy` | 下达销毁指令(写,不可逆) | [custody.md](custody.md) |
48
+ | `fmc custody address` | 查询退件地址库 | [custody.md](custody.md) |
44
49
  | `fmc service repair list` | 查询售后工单列表 | [service.md](service.md) |
45
50
  | `fmc service check list` | 查询查件列表 | [service.md](service.md) |
46
51
  | `fmc service complaint list` | 查询投诉列表 | [service.md](service.md) |
@@ -104,7 +109,7 @@ Command **details** are in sibling `<group>.md` files in this directory.
104
109
  | `order` | `get`, `list`, `address-book`, `country`, `create`, `edit`, `forecast`, `cancel`, `intercept` | [order.md](order.md) |
105
110
  | `product` | `recommend`, `list`, `detail`, `eta`, `search` | [product.md](product.md) |
106
111
  | `problem` | `list`, `suggest`, `notify list`, `notify type`, `lastmile list`, `arrear list`, `intercepted list` | [problem.md](problem.md) |
107
- | `custody` | `electric`, `recommend`, `change` | [custody.md](custody.md) |
112
+ | `custody` | `electric`, `recommend`, `change`, `help`, `ship`, `return`, `destroy`, `address` | [custody.md](custody.md) |
108
113
  | `service` | `repair list`, `check list`, `complaint list`, `detail`, `record`, `claim list`, `claim detail`, `claim reason` | [service.md](service.md) |
109
114
  | `finance` | `balance`, `bill list`, `daily-fee list`, `unbilled list`, `recharge list`, `fee detail`, `frozen list` | [finance.md](finance.md) |
110
115
  | `pickup` | `material list`, `material detail`, `material quota`, `address list` | [pickup.md](pickup.md) |