@newpeak/barista-cli 0.1.7 → 0.1.9
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.
- package/README.md +10 -10
- package/dist/commands/liberica/calendar/index.d.ts +3 -0
- package/dist/commands/liberica/calendar/index.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/index.js +11 -0
- package/dist/commands/liberica/calendar/index.js.map +1 -0
- package/dist/commands/liberica/calendar/list.d.ts +3 -0
- package/dist/commands/liberica/calendar/list.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/list.js +181 -0
- package/dist/commands/liberica/calendar/list.js.map +1 -0
- package/dist/commands/liberica/calendar/set.d.ts +3 -0
- package/dist/commands/liberica/calendar/set.d.ts.map +1 -0
- package/dist/commands/liberica/calendar/set.js +120 -0
- package/dist/commands/liberica/calendar/set.js.map +1 -0
- package/dist/commands/liberica/client-contacts/create.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/create.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/create.js +132 -0
- package/dist/commands/liberica/client-contacts/create.js.map +1 -0
- package/dist/commands/liberica/client-contacts/delete.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/delete.js +139 -0
- package/dist/commands/liberica/client-contacts/delete.js.map +1 -0
- package/dist/commands/liberica/client-contacts/get.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/get.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/get.js +92 -0
- package/dist/commands/liberica/client-contacts/get.js.map +1 -0
- package/dist/commands/liberica/client-contacts/index.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/index.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/index.js +17 -0
- package/dist/commands/liberica/client-contacts/index.js.map +1 -0
- package/dist/commands/liberica/client-contacts/list.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/list.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/list.js +92 -0
- package/dist/commands/liberica/client-contacts/list.js.map +1 -0
- package/dist/commands/liberica/client-contacts/update.d.ts +3 -0
- package/dist/commands/liberica/client-contacts/update.d.ts.map +1 -0
- package/dist/commands/liberica/client-contacts/update.js +156 -0
- package/dist/commands/liberica/client-contacts/update.js.map +1 -0
- package/dist/commands/liberica/dict-types/get.d.ts +3 -0
- package/dist/commands/liberica/dict-types/get.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/get.js +62 -0
- package/dist/commands/liberica/dict-types/get.js.map +1 -0
- package/dist/commands/liberica/dict-types/index.d.ts +3 -0
- package/dist/commands/liberica/dict-types/index.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/index.js +13 -0
- package/dist/commands/liberica/dict-types/index.js.map +1 -0
- package/dist/commands/liberica/dict-types/list.d.ts +3 -0
- package/dist/commands/liberica/dict-types/list.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/list.js +91 -0
- package/dist/commands/liberica/dict-types/list.js.map +1 -0
- package/dist/commands/liberica/dict-types/update.d.ts +3 -0
- package/dist/commands/liberica/dict-types/update.d.ts.map +1 -0
- package/dist/commands/liberica/dict-types/update.js +127 -0
- package/dist/commands/liberica/dict-types/update.js.map +1 -0
- package/dist/commands/liberica/dicts/create.d.ts +3 -0
- package/dist/commands/liberica/dicts/create.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/create.js +157 -0
- package/dist/commands/liberica/dicts/create.js.map +1 -0
- package/dist/commands/liberica/dicts/delete.d.ts +3 -0
- package/dist/commands/liberica/dicts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/delete.js +106 -0
- package/dist/commands/liberica/dicts/delete.js.map +1 -0
- package/dist/commands/liberica/dicts/get.d.ts +3 -0
- package/dist/commands/liberica/dicts/get.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/get.js +69 -0
- package/dist/commands/liberica/dicts/get.js.map +1 -0
- package/dist/commands/liberica/dicts/index.d.ts +3 -0
- package/dist/commands/liberica/dicts/index.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/index.js +17 -0
- package/dist/commands/liberica/dicts/index.js.map +1 -0
- package/dist/commands/liberica/dicts/list.d.ts +3 -0
- package/dist/commands/liberica/dicts/list.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/list.js +88 -0
- package/dist/commands/liberica/dicts/list.js.map +1 -0
- package/dist/commands/liberica/dicts/update.d.ts +3 -0
- package/dist/commands/liberica/dicts/update.d.ts.map +1 -0
- package/dist/commands/liberica/dicts/update.js +112 -0
- package/dist/commands/liberica/dicts/update.js.map +1 -0
- package/dist/commands/liberica/index.d.ts.map +1 -1
- package/dist/commands/liberica/index.js +20 -0
- package/dist/commands/liberica/index.js.map +1 -1
- package/dist/commands/liberica/materials/create.d.ts.map +1 -1
- package/dist/commands/liberica/materials/create.js +13 -6
- package/dist/commands/liberica/materials/create.js.map +1 -1
- package/dist/commands/liberica/materials/update.js +1 -1
- package/dist/commands/liberica/materials/update.js.map +1 -1
- package/dist/commands/liberica/mould/get.d.ts +3 -0
- package/dist/commands/liberica/mould/get.d.ts.map +1 -0
- package/dist/commands/liberica/mould/get.js +90 -0
- package/dist/commands/liberica/mould/get.js.map +1 -0
- package/dist/commands/liberica/mould/index.d.ts +3 -0
- package/dist/commands/liberica/mould/index.d.ts.map +1 -0
- package/dist/commands/liberica/mould/index.js +15 -0
- package/dist/commands/liberica/mould/index.js.map +1 -0
- package/dist/commands/liberica/mould/list.d.ts +3 -0
- package/dist/commands/liberica/mould/list.d.ts.map +1 -0
- package/dist/commands/liberica/mould/list.js +114 -0
- package/dist/commands/liberica/mould/list.js.map +1 -0
- package/dist/commands/liberica/mould/set-status.d.ts +3 -0
- package/dist/commands/liberica/mould/set-status.d.ts.map +1 -0
- package/dist/commands/liberica/mould/set-status.js +84 -0
- package/dist/commands/liberica/mould/set-status.js.map +1 -0
- package/dist/commands/liberica/mould/stock-in.d.ts +3 -0
- package/dist/commands/liberica/mould/stock-in.d.ts.map +1 -0
- package/dist/commands/liberica/mould/stock-in.js +160 -0
- package/dist/commands/liberica/mould/stock-in.js.map +1 -0
- package/dist/commands/liberica/operations/active.d.ts +3 -0
- package/dist/commands/liberica/operations/active.d.ts.map +1 -0
- package/dist/commands/liberica/operations/active.js +152 -0
- package/dist/commands/liberica/operations/active.js.map +1 -0
- package/dist/commands/liberica/operations/batch-delete.d.ts +3 -0
- package/dist/commands/liberica/operations/batch-delete.d.ts.map +1 -0
- package/dist/commands/liberica/operations/batch-delete.js +130 -0
- package/dist/commands/liberica/operations/batch-delete.js.map +1 -0
- package/dist/commands/liberica/operations/copy.d.ts +3 -0
- package/dist/commands/liberica/operations/copy.d.ts.map +1 -0
- package/dist/commands/liberica/operations/copy.js +137 -0
- package/dist/commands/liberica/operations/copy.js.map +1 -0
- package/dist/commands/liberica/operations/create.d.ts +3 -0
- package/dist/commands/liberica/operations/create.d.ts.map +1 -0
- package/dist/commands/liberica/operations/create.js +212 -0
- package/dist/commands/liberica/operations/create.js.map +1 -0
- package/dist/commands/liberica/operations/deactive.d.ts +3 -0
- package/dist/commands/liberica/operations/deactive.d.ts.map +1 -0
- package/dist/commands/liberica/operations/deactive.js +152 -0
- package/dist/commands/liberica/operations/deactive.js.map +1 -0
- package/dist/commands/liberica/operations/delete.d.ts +3 -0
- package/dist/commands/liberica/operations/delete.d.ts.map +1 -0
- package/dist/commands/liberica/operations/delete.js +128 -0
- package/dist/commands/liberica/operations/delete.js.map +1 -0
- package/dist/commands/liberica/operations/get.d.ts +3 -0
- package/dist/commands/liberica/operations/get.d.ts.map +1 -0
- package/dist/commands/liberica/operations/get.js +93 -0
- package/dist/commands/liberica/operations/get.js.map +1 -0
- package/dist/commands/liberica/operations/index.d.ts +3 -0
- package/dist/commands/liberica/operations/index.d.ts.map +1 -0
- package/dist/commands/liberica/operations/index.js +25 -0
- package/dist/commands/liberica/operations/index.js.map +1 -0
- package/dist/commands/liberica/operations/list.d.ts +3 -0
- package/dist/commands/liberica/operations/list.d.ts.map +1 -0
- package/dist/commands/liberica/operations/list.js +141 -0
- package/dist/commands/liberica/operations/list.js.map +1 -0
- package/dist/commands/liberica/operations/update.d.ts +3 -0
- package/dist/commands/liberica/operations/update.d.ts.map +1 -0
- package/dist/commands/liberica/operations/update.js +208 -0
- package/dist/commands/liberica/operations/update.js.map +1 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts +2 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.d.ts.map +1 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.js +41 -0
- package/dist/commands/liberica/stock/__tests__/ledger.test.js.map +1 -0
- package/dist/commands/liberica/stock/__tests__/list.test.d.ts +2 -0
- package/dist/commands/liberica/stock/__tests__/list.test.d.ts.map +1 -0
- package/dist/commands/liberica/stock/__tests__/list.test.js +39 -0
- package/dist/commands/liberica/stock/__tests__/list.test.js.map +1 -0
- package/dist/commands/liberica/stock/index.d.ts +3 -0
- package/dist/commands/liberica/stock/index.d.ts.map +1 -0
- package/dist/commands/liberica/stock/index.js +11 -0
- package/dist/commands/liberica/stock/index.js.map +1 -0
- package/dist/commands/liberica/stock/ledger.d.ts +3 -0
- package/dist/commands/liberica/stock/ledger.d.ts.map +1 -0
- package/dist/commands/liberica/stock/ledger.js +154 -0
- package/dist/commands/liberica/stock/ledger.js.map +1 -0
- package/dist/commands/liberica/stock/list.d.ts +3 -0
- package/dist/commands/liberica/stock/list.d.ts.map +1 -0
- package/dist/commands/liberica/stock/list.js +127 -0
- package/dist/commands/liberica/stock/list.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/create.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/create.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/create.js +129 -0
- package/dist/commands/liberica/supplier-contacts/create.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/delete.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/delete.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/delete.js +88 -0
- package/dist/commands/liberica/supplier-contacts/delete.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/get.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/get.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/get.js +84 -0
- package/dist/commands/liberica/supplier-contacts/get.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/index.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/index.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/index.js +17 -0
- package/dist/commands/liberica/supplier-contacts/index.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/list.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/list.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/list.js +98 -0
- package/dist/commands/liberica/supplier-contacts/list.js.map +1 -0
- package/dist/commands/liberica/supplier-contacts/update.d.ts +3 -0
- package/dist/commands/liberica/supplier-contacts/update.d.ts.map +1 -0
- package/dist/commands/liberica/supplier-contacts/update.js +136 -0
- package/dist/commands/liberica/supplier-contacts/update.js.map +1 -0
- package/dist/core/api/client.d.ts +63 -0
- package/dist/core/api/client.d.ts.map +1 -1
- package/dist/core/api/client.js +1050 -65
- package/dist/core/api/client.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/types/calendar.d.ts +28 -0
- package/dist/types/calendar.d.ts.map +1 -0
- package/dist/types/calendar.js +2 -0
- package/dist/types/calendar.js.map +1 -0
- package/dist/types/client-contact.d.ts +65 -0
- package/dist/types/client-contact.d.ts.map +1 -0
- package/dist/types/client-contact.js +4 -0
- package/dist/types/client-contact.js.map +1 -0
- package/dist/types/dict.d.ts +97 -0
- package/dist/types/dict.d.ts.map +1 -0
- package/dist/types/dict.js +2 -0
- package/dist/types/dict.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/material.d.ts +1 -1
- package/dist/types/material.d.ts.map +1 -1
- package/dist/types/mould-stock-in.d.ts +70 -0
- package/dist/types/mould-stock-in.d.ts.map +1 -0
- package/dist/types/mould-stock-in.js +3 -0
- package/dist/types/mould-stock-in.js.map +1 -0
- package/dist/types/mould.d.ts +61 -0
- package/dist/types/mould.d.ts.map +1 -0
- package/dist/types/mould.js +2 -0
- package/dist/types/mould.js.map +1 -0
- package/dist/types/operation.d.ts +66 -0
- package/dist/types/operation.d.ts.map +1 -0
- package/dist/types/operation.js +2 -0
- package/dist/types/operation.js.map +1 -0
- package/dist/types/stock.d.ts +133 -0
- package/dist/types/stock.d.ts.map +1 -0
- package/dist/types/stock.js +3 -0
- package/dist/types/stock.js.map +1 -0
- package/dist/types/supplier-contact.d.ts +65 -0
- package/dist/types/supplier-contact.d.ts.map +1 -0
- package/dist/types/supplier-contact.js +4 -0
- package/dist/types/supplier-contact.js.map +1 -0
- package/docs/commands/REFERENCE.md +24 -4
- package/docs/commands/liberica/calendar/DESIGN.md +333 -0
- package/docs/commands/liberica/client-contacts/create.md +152 -0
- package/docs/commands/liberica/client-contacts/delete.md +123 -0
- package/docs/commands/liberica/client-contacts/get.md +133 -0
- package/docs/commands/liberica/client-contacts/list.md +143 -0
- package/docs/commands/liberica/client-contacts/update.md +158 -0
- package/docs/commands/liberica/stock/ledger.md +209 -0
- package/docs/commands/liberica/stock/list.md +165 -0
- package/docs/commands/liberica/supplier-contacts/create.md +152 -0
- package/docs/commands/liberica/supplier-contacts/delete.md +123 -0
- package/docs/commands/liberica/supplier-contacts/get.md +133 -0
- package/docs/commands/liberica/supplier-contacts/list.md +143 -0
- package/docs/commands/liberica/supplier-contacts/update.md +158 -0
- package/package.json +1 -1
- package/src/commands/liberica/calendar/index.ts +13 -0
- package/src/commands/liberica/calendar/list.ts +214 -0
- package/src/commands/liberica/calendar/set.ts +130 -0
- package/src/commands/liberica/client-contacts/create.ts +115 -0
- package/src/commands/liberica/client-contacts/delete.ts +140 -0
- package/src/commands/liberica/client-contacts/get.ts +103 -0
- package/src/commands/liberica/client-contacts/index.ts +19 -0
- package/src/commands/liberica/client-contacts/list.ts +118 -0
- package/src/commands/liberica/client-contacts/update.ts +137 -0
- package/src/commands/liberica/dict-types/get.ts +74 -0
- package/src/commands/liberica/dict-types/index.ts +15 -0
- package/src/commands/liberica/dict-types/list.ts +118 -0
- package/src/commands/liberica/dict-types/update.ts +134 -0
- package/src/commands/liberica/dicts/create.ts +175 -0
- package/src/commands/liberica/dicts/delete.ts +107 -0
- package/src/commands/liberica/dicts/get.ts +80 -0
- package/src/commands/liberica/dicts/index.ts +19 -0
- package/src/commands/liberica/dicts/list.ts +114 -0
- package/src/commands/liberica/dicts/update.ts +116 -0
- package/src/commands/liberica/index.ts +20 -0
- package/src/commands/liberica/materials/create.ts +13 -5
- package/src/commands/liberica/materials/update.ts +1 -1
- package/src/commands/liberica/mould/get.ts +111 -0
- package/src/commands/liberica/mould/index.ts +17 -0
- package/src/commands/liberica/mould/list.ts +157 -0
- package/src/commands/liberica/mould/set-status.ts +99 -0
- package/src/commands/liberica/mould/stock-in.ts +165 -0
- package/src/commands/liberica/operations/active.ts +153 -0
- package/src/commands/liberica/operations/batch-delete.ts +131 -0
- package/src/commands/liberica/operations/copy.ts +138 -0
- package/src/commands/liberica/operations/create.ts +223 -0
- package/src/commands/liberica/operations/deactive.ts +152 -0
- package/src/commands/liberica/operations/delete.ts +128 -0
- package/src/commands/liberica/operations/design.md +587 -0
- package/src/commands/liberica/operations/get.ts +112 -0
- package/src/commands/liberica/operations/index.ts +27 -0
- package/src/commands/liberica/operations/list.ts +180 -0
- package/src/commands/liberica/operations/update.ts +218 -0
- package/src/commands/liberica/stock/index.ts +13 -0
- package/src/commands/liberica/stock/ledger.ts +159 -0
- package/src/commands/liberica/stock/list.ts +128 -0
- package/src/commands/liberica/supplier-contacts/create.ts +120 -0
- package/src/commands/liberica/supplier-contacts/delete.ts +88 -0
- package/src/commands/liberica/supplier-contacts/get.ts +94 -0
- package/src/commands/liberica/supplier-contacts/index.ts +19 -0
- package/src/commands/liberica/supplier-contacts/list.ts +130 -0
- package/src/commands/liberica/supplier-contacts/update.ts +127 -0
- package/src/core/api/client.ts +1238 -17
- package/src/index.ts +1 -1
- package/src/types/calendar.ts +36 -0
- package/src/types/client-contact.ts +78 -0
- package/src/types/dict.ts +121 -0
- package/src/types/index.ts +7 -0
- package/src/types/material.ts +1 -1
- package/src/types/mould-stock-in.ts +82 -0
- package/src/types/mould.ts +74 -0
- package/src/types/operation.ts +72 -0
- package/src/types/stock.ts +161 -0
- package/src/types/supplier-contact.ts +78 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# 命令名称: barista liberica stock list
|
|
2
|
+
|
|
3
|
+
## 2.1 命令元数据
|
|
4
|
+
|
|
5
|
+
| 字段 | 值 |
|
|
6
|
+
|------|-----|
|
|
7
|
+
| 完整命令 | `barista liberica stock list` |
|
|
8
|
+
| 功能描述 | 查询带仓库的库存列表(分页) |
|
|
9
|
+
| HTTP方法 | GET |
|
|
10
|
+
| 是否需要认证 | 是 |
|
|
11
|
+
| 是否支持dry-run | 否 |
|
|
12
|
+
|
|
13
|
+
## 2.2 后端接口引用
|
|
14
|
+
|
|
15
|
+
### Controller位置
|
|
16
|
+
```
|
|
17
|
+
coffee-liberica-end/
|
|
18
|
+
└── facade/liberica-facade-enterprise/
|
|
19
|
+
└── src/main/java/com/newpeak/liberica/facade/enterprise/controller/master/
|
|
20
|
+
└── MasterStockController.java
|
|
21
|
+
└── commonStockWithWarehousePage(@GetResource(path = "/page/withWarehouse"))
|
|
22
|
+
└── public ResponseData<PageResult<MasterWarehouseStockResponse>> commonStockWithWarehousePage(
|
|
23
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
24
|
+
@ParameterObject MasterStockQueryRequest masterStockQueryRequest
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Request DTO位置
|
|
29
|
+
```
|
|
30
|
+
coffee-liberica-end/
|
|
31
|
+
└── business/liberica-business-stock/stock-api/
|
|
32
|
+
└── src/main/java/com/newpeak/liberica/stock/api/pojo/request/
|
|
33
|
+
└── MasterStockQueryRequest.java
|
|
34
|
+
├── warehouseCode: String
|
|
35
|
+
├── materialCode: String
|
|
36
|
+
├── materialNo: String
|
|
37
|
+
├── materialName: String
|
|
38
|
+
├── materialType: String
|
|
39
|
+
├── lotNo: String
|
|
40
|
+
├── color: String
|
|
41
|
+
├── longX: BigDecimal
|
|
42
|
+
├── wideY: BigDecimal
|
|
43
|
+
├── highZ: BigDecimal
|
|
44
|
+
├── sourceType: String
|
|
45
|
+
├── sourceCode: String
|
|
46
|
+
├── stockId: Long
|
|
47
|
+
├── excludeZeroStock: boolean (default = false)
|
|
48
|
+
└── stockDateCriteria: DateRange
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Response DTO位置
|
|
52
|
+
```
|
|
53
|
+
coffee-liberica-end/
|
|
54
|
+
└── business/liberica-business-stock/stock-api/
|
|
55
|
+
└── src/main/java/com/newpeak/liberica/stock/api/pojo/response/
|
|
56
|
+
└── MasterWarehouseStockResponse.java
|
|
57
|
+
├── warehouseCode: String
|
|
58
|
+
├── materialCode: String
|
|
59
|
+
├── materialName: String
|
|
60
|
+
├── materialType: String
|
|
61
|
+
├── color: String
|
|
62
|
+
├── stockCount: BigDecimal
|
|
63
|
+
├── unitPrice: BigDecimal
|
|
64
|
+
├── stockAmount: BigDecimal
|
|
65
|
+
└── lastStockDate: Date
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## 2.3 CLI参数设计
|
|
69
|
+
|
|
70
|
+
### 命令结构
|
|
71
|
+
```bash
|
|
72
|
+
barista liberica stock list [options]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 全局选项
|
|
76
|
+
| 选项 | 类型 | 说明 |
|
|
77
|
+
|------|------|------|
|
|
78
|
+
| `--env` | string | 目标环境(dev/test/prod-cn/prod-jp) |
|
|
79
|
+
| `--tenant` | string | 租户代码(仅Liberica) |
|
|
80
|
+
| `--dry-run` | boolean | 预览模式 |
|
|
81
|
+
| `--json` | boolean | JSON输出 |
|
|
82
|
+
|
|
83
|
+
### 命令选项
|
|
84
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
|
|
85
|
+
|------|--------|------|------|--------|------|-------------|
|
|
86
|
+
| `--warehouse-code` | -w | string | 否 | - | 仓库编码 | warehouseCode |
|
|
87
|
+
| `--material-code` | -m | string | 否 | - | 物料编码 | materialCode |
|
|
88
|
+
| `--material-no` | -n | string | 否 | - | 物料号码 | materialNo |
|
|
89
|
+
| `--material-name` | | string | 否 | - | 物料名称(支持模糊查询) | materialName |
|
|
90
|
+
| `--material-type` | -t | string | 否 | - | 规格型号 | materialType |
|
|
91
|
+
| `--lot-no` | -l | string | 否 | - | 批次号 | lotNo |
|
|
92
|
+
| `--color` | -c | string | 否 | - | 颜色 | color |
|
|
93
|
+
| `--long-x` | | number | 否 | - | 长 | longX |
|
|
94
|
+
| `--wide-y` | | number | 否 | - | 宽 | wideY |
|
|
95
|
+
| `--high-z` | | number | 否 | - | 高 | highZ |
|
|
96
|
+
| `--source-type` | | string | 否 | - | 源单类型 | sourceType |
|
|
97
|
+
| `--source-code` | | string | 否 | - | 源单编码 | sourceCode |
|
|
98
|
+
| `--stock-id` | | string | 否 | - | 库存ID | stockId |
|
|
99
|
+
| `--exclude-zero-stock` | | boolean | 否 | false | 不包含零库存 | excludeZeroStock |
|
|
100
|
+
| `--start-date` | | string | 否 | - | 出入库开始日期(YYYY-MM-DD) | stockDateCriteria.startDate |
|
|
101
|
+
| `--end-date` | | string | 否 | - | 出入库结束日期(YYYY-MM-DD) | stockDateCriteria.endDate |
|
|
102
|
+
| `--page` | -p | number | 否 | 1 | 页码 | pageNo |
|
|
103
|
+
| `--size` | -s | number | 否 | 20 | 每页条数 | pageSize |
|
|
104
|
+
|
|
105
|
+
## 2.4 字段映射表
|
|
106
|
+
|
|
107
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
108
|
+
|---------|---------|----------|----------|
|
|
109
|
+
| --warehouse-code | warehouseCode | 直接传递 | - |
|
|
110
|
+
| --material-code | materialCode | 直接传递 | - |
|
|
111
|
+
| --material-no | materialNo | 直接传递 | - |
|
|
112
|
+
| --material-name | materialName | 直接传递 | - |
|
|
113
|
+
| --material-type | materialType | 直接传递 | - |
|
|
114
|
+
| --lot-no | lotNo | 直接传递 | - |
|
|
115
|
+
| --color | color | 直接传递 | - |
|
|
116
|
+
| --long-x | longX | string→BigDecimal | - |
|
|
117
|
+
| --wide-y | wideY | string→BigDecimal | - |
|
|
118
|
+
| --high-z | highZ | string→BigDecimal | - |
|
|
119
|
+
| --source-type | sourceType | 直接传递 | - |
|
|
120
|
+
| --source-code | sourceCode | 直接传递 | - |
|
|
121
|
+
| --stock-id | stockId | string→Long | 后端BigInteger,CLI使用string |
|
|
122
|
+
| --exclude-zero-stock | excludeZeroStock | 直接传递 | boolean |
|
|
123
|
+
| --start-date | stockDateCriteria.startDate | string→Date | yyyy-MM-dd |
|
|
124
|
+
| --end-date | stockDateCriteria.endDate | string→Date | yyyy-MM-dd |
|
|
125
|
+
| --page | pageNo | number-1 | 0-based分页 |
|
|
126
|
+
| --size | pageSize | number | >0 |
|
|
127
|
+
|
|
128
|
+
## 2.5 错误码引用
|
|
129
|
+
|
|
130
|
+
### ExceptionEnum位置
|
|
131
|
+
```
|
|
132
|
+
coffee-liberica-end/
|
|
133
|
+
└── business/liberica-business-stock/stock-api/
|
|
134
|
+
└── src/main/java/com/newpeak/liberica/stock/api/exception/enums/
|
|
135
|
+
├── MasterStockExceptionEnum.java
|
|
136
|
+
│ ├── MASTER_STOCK_NOT_EXIST("...001", "租户库存不存在")
|
|
137
|
+
│ └── MASTER_STOCK_OUT_LOT_NOT_ENOUGH("...002", "租户成品出库单{}余量不够")
|
|
138
|
+
├── MasterWarehouseStockExceptionEnum.java
|
|
139
|
+
│ └── MASTER_WAREHOUSE_STOCK_NOT_EXIST("...001", "租户仓库库存不存在")
|
|
140
|
+
└── StockJourneyExceptionEnum.java
|
|
141
|
+
├── STOCK_JOURNEY_NOT_EXIST("...001", "租户出入库台账不存在")
|
|
142
|
+
└── CAN_NOT_DELETE_MATERIAL_WITH_USED_IN_STOCK("...002", "物料已在库存中使用,不能删除")
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 已知错误码示例
|
|
146
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
147
|
+
|--------|----------|----------|
|
|
148
|
+
| ...001 | 租户库存不存在 | 查询的库存记录不存在 |
|
|
149
|
+
| ...001 | 租户仓库库存不存在 | 查询的仓库库存记录不存在 |
|
|
150
|
+
| ...002 | 租户成品出库单{}余量不够 | 出库操作余量不足 |
|
|
151
|
+
|
|
152
|
+
## 2.6 权限检查
|
|
153
|
+
|
|
154
|
+
| 检查项 | 位置 | 说明 |
|
|
155
|
+
|--------|------|------|
|
|
156
|
+
| 菜单权限 | `MasterStockController` 类上的 `@Menu` 注解 | `inventory_query` 菜单,要求 `tenantStock` 角色 |
|
|
157
|
+
| 接口访问 | Controller方法无单独 `@GetResource(requiredPermission = true)` | 通过菜单角色控制 |
|
|
158
|
+
|
|
159
|
+
## 2.7 实现要点
|
|
160
|
+
|
|
161
|
+
1. **分页转换**:CLI page 1 对应 API pageNo 0
|
|
162
|
+
2. **ID类型**:stockId 后端为 Long/BigInteger,CLI 统一使用 string 类型避免精度丢失
|
|
163
|
+
3. **日期范围**:--start-date 和 --end-date 组合为 DateRange 对象传递
|
|
164
|
+
4. **输出格式**:默认表格输出(cli-table3),--json 返回结构化 JSON
|
|
165
|
+
5. **零库存过滤**:excludeZeroStock 默认为 false,传入 true 时过滤掉 stockCount=0 的记录
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# barista liberica supplier-contacts create
|
|
2
|
+
|
|
3
|
+
创建供应商联系人。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica supplier-contacts create` |
|
|
10
|
+
| 功能描述 | 添加新供应商联系人 |
|
|
11
|
+
| HTTP方法 | POST |
|
|
12
|
+
| 是否需要认证 | ✅ 是 |
|
|
13
|
+
| 是否支持dry-run | ✅ 是 |
|
|
14
|
+
|
|
15
|
+
## 2.2 后端接口引用
|
|
16
|
+
|
|
17
|
+
### Controller位置
|
|
18
|
+
```
|
|
19
|
+
coffee-liberica-end/
|
|
20
|
+
└── facade/liberica-facade-enterprise/
|
|
21
|
+
└── src/main/java/com/newpeak/liberica/facade/enterprise/controller/purchases/
|
|
22
|
+
└── EnterpriseSupplierContactController.java
|
|
23
|
+
└── add(@PostResource(path = "/add", requiredPermission = true, requirePermissionCode = "ADD_MASTER_SUPPLIER_CONTACT"))
|
|
24
|
+
└── public ResponseData<MasterSupplierContactResponse> add(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
@RequestBody @Validated(BaseRequest.add.class) MasterSupplierContactRequest masterSupplierContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-master/master-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/request/
|
|
35
|
+
└── MasterSupplierContactRequest.java
|
|
36
|
+
├── supplierId: Long (@NotNull)
|
|
37
|
+
├── supplierContactName: String (@NotBlank, max=255)
|
|
38
|
+
├── supplierContactPhone: String (max=256)
|
|
39
|
+
├── supplierContactTelephone: String (max=256)
|
|
40
|
+
├── supplierContactEmail: String (max=512)
|
|
41
|
+
├── supplierContactSex: String (max=255)
|
|
42
|
+
├── supplierContactBirthday: Date
|
|
43
|
+
├── supplierContactQq: String (max=512)
|
|
44
|
+
├── supplierContactWechat: String (max=512)
|
|
45
|
+
├── supplierContactAddress: String (max=512)
|
|
46
|
+
├── defaultFlag: String (@NotBlank, max=1)
|
|
47
|
+
└── remark: String (max=255)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Response DTO位置
|
|
51
|
+
```
|
|
52
|
+
coffee-liberica-end/
|
|
53
|
+
└── business/liberica-business-master/master-api/
|
|
54
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/response/
|
|
55
|
+
└── MasterSupplierContactResponse.java
|
|
56
|
+
└── (同 get 接口)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 2.3 CLI参数设计
|
|
60
|
+
|
|
61
|
+
### 命令结构
|
|
62
|
+
```
|
|
63
|
+
barista liberica supplier-contacts create [options]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 全局选项
|
|
67
|
+
| 选项 | 类型 | 说明 |
|
|
68
|
+
|------|------|------|
|
|
69
|
+
| `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
|
|
70
|
+
| `--tenant` | string | 租户代码 |
|
|
71
|
+
| `--dry-run` | boolean | 预览模式 |
|
|
72
|
+
| `--json` | boolean | JSON输出 |
|
|
73
|
+
|
|
74
|
+
### 命令选项
|
|
75
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
|
|
76
|
+
|------|--------|------|------|--------|------|-------------|
|
|
77
|
+
| --supplier-id | -s | string | ✅ | - | 供应商ID | supplierId |
|
|
78
|
+
| --name | -n | string | ✅ | - | 姓名 | supplierContactName |
|
|
79
|
+
| --phone | -p | string | ⬜ | - | 手机号 | supplierContactPhone |
|
|
80
|
+
| --telephone | -t | string | ⬜ | - | 座机号 | supplierContactTelephone |
|
|
81
|
+
| --email | -e | string | ⬜ | - | 电子邮箱 | supplierContactEmail |
|
|
82
|
+
| --sex | -x | string | ⬜ | - | 性别 | supplierContactSex |
|
|
83
|
+
| --birthday | -b | string | ⬜ | - | 生日(YYYY-MM-DD) | supplierContactBirthday |
|
|
84
|
+
| --qq | -q | string | ⬜ | - | QQ号 | supplierContactQq |
|
|
85
|
+
| --wechat | -w | string | ⬜ | - | 微信号 | supplierContactWechat |
|
|
86
|
+
| --address | -a | string | ⬜ | - | 详细地址 | supplierContactAddress |
|
|
87
|
+
| --default | -d | boolean | ⬜ | N | 是否默认联系人 | defaultFlag |
|
|
88
|
+
| --remark | -r | string | ⬜ | - | 备注 | remark |
|
|
89
|
+
|
|
90
|
+
## 2.4 字段映射表
|
|
91
|
+
|
|
92
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
93
|
+
|---------|---------|----------|----------|
|
|
94
|
+
| --supplier-id / -s | supplierId | string→Long | @NotNull |
|
|
95
|
+
| --name / -n | supplierContactName | 直接传递 | @NotBlank, max=255 |
|
|
96
|
+
| --phone / -p | supplierContactPhone | 直接传递 | max=256 |
|
|
97
|
+
| --telephone / -t | supplierContactTelephone | 直接传递 | max=256 |
|
|
98
|
+
| --email / -e | supplierContactEmail | 直接传递 | max=512 |
|
|
99
|
+
| --sex / -x | supplierContactSex | 直接传递 | max=255 |
|
|
100
|
+
| --birthday / -b | supplierContactBirthday | string→Date | yyyy-MM-dd |
|
|
101
|
+
| --qq / -q | supplierContactQq | 直接传递 | max=512 |
|
|
102
|
+
| --wechat / -w | supplierContactWechat | 直接传递 | max=512 |
|
|
103
|
+
| --address / -a | supplierContactAddress | 直接传递 | max=512 |
|
|
104
|
+
| --default / -d | defaultFlag | boolean→Y/N | @NotBlank, max=1 |
|
|
105
|
+
| --remark / -r | remark | 直接传递 | max=255 |
|
|
106
|
+
|
|
107
|
+
## 2.5 错误码引用
|
|
108
|
+
|
|
109
|
+
### ExceptionEnum位置
|
|
110
|
+
```
|
|
111
|
+
coffee-liberica-end/
|
|
112
|
+
└── business/liberica-business-master/master-api/
|
|
113
|
+
└── src/main/java/com/newpeak/liberica/master/api/exception/enums/
|
|
114
|
+
└── MasterSupplierContactExceptionEnum.java
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 已知错误码
|
|
118
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
119
|
+
|--------|----------|----------|
|
|
120
|
+
| 01001XXX001 | 租户供应商联系人不存在 | 供应商ID不存在 |
|
|
121
|
+
| 01001XXX... | 相关验证错误 | 字段验证失败 |
|
|
122
|
+
|
|
123
|
+
## 2.6 权限检查
|
|
124
|
+
|
|
125
|
+
| 检查项 | 位置 | 说明 |
|
|
126
|
+
|--------|------|------|
|
|
127
|
+
| PermissionConstants | `ADD_MASTER_SUPPLIER_CONTACT` | 添加供应商联系人需要此权限 |
|
|
128
|
+
| 注解 | `@PostResource(requirePermissionCode = "ADD_MASTER_SUPPLIER_CONTACT")` | Controller方法上 |
|
|
129
|
+
|
|
130
|
+
## 2.7 实现要点
|
|
131
|
+
|
|
132
|
+
1. **必填参数**:--supplier-id 和 --name 必须指定
|
|
133
|
+
2. **defaultFlag**:--default 不指定时默认为 "N",指定时为 "Y"
|
|
134
|
+
3. **dry-run 模式**:预览模式下只显示将要发送的数据,不实际调用 API
|
|
135
|
+
4. **输出格式**:成功后显示创建的联系人信息
|
|
136
|
+
5. **错误处理**:字段验证错误显示友好提示
|
|
137
|
+
|
|
138
|
+
## 2.8 示例用法
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# 创建供应商联系人(dry-run 预览)
|
|
142
|
+
barista liberica supplier-contacts create --supplier-id 123 --name "张三" --phone "13800138000" --dry-run
|
|
143
|
+
|
|
144
|
+
# 实际创建
|
|
145
|
+
barista liberica supplier-contacts create --supplier-id 123 --name "张三" --phone "13800138000" --email "zhang@example.com"
|
|
146
|
+
|
|
147
|
+
# 创建默认联系人
|
|
148
|
+
barista liberica supplier-contacts create --supplier-id 123 --name "李四" --default --address "北京市朝阳区xxx"
|
|
149
|
+
|
|
150
|
+
# JSON 输出
|
|
151
|
+
barista liberica supplier-contacts create --supplier-id 123 --name "张三" --json
|
|
152
|
+
```
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# barista liberica supplier-contacts delete
|
|
2
|
+
|
|
3
|
+
删除供应商联系人。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica supplier-contacts delete <contact-id>` |
|
|
10
|
+
| 功能描述 | 删除供应商联系人 |
|
|
11
|
+
| HTTP方法 | POST |
|
|
12
|
+
| 是否需要认证 | ✅ 是 |
|
|
13
|
+
| 是否支持dry-run | ✅ 是(默认) |
|
|
14
|
+
|
|
15
|
+
## 2.2 后端接口引用
|
|
16
|
+
|
|
17
|
+
### Controller位置
|
|
18
|
+
```
|
|
19
|
+
coffee-liberica-end/
|
|
20
|
+
└── facade/liberica-facade-enterprise/
|
|
21
|
+
└── src/main/java/com/newpeak/liberica/facade/enterprise/controller/purchases/
|
|
22
|
+
└── EnterpriseSupplierContactController.java
|
|
23
|
+
└── delete(@PostResource(path = "/delete", requiredPermission = true, requirePermissionCode = "DEL_MASTER_SUPPLIER_CONTACT"))
|
|
24
|
+
└── public ResponseData<?> delete(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
@RequestBody @Validated(BaseRequest.delete.class) MasterSupplierContactRequest masterSupplierContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-master/master-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/request/
|
|
35
|
+
└── MasterSupplierContactRequest.java
|
|
36
|
+
└── supplierContactId: Long (@NotNull on delete)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Response DTO位置
|
|
40
|
+
```
|
|
41
|
+
coffee-liberica-end/
|
|
42
|
+
└── business/liberica-business-master/master-api/
|
|
43
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/response/
|
|
44
|
+
└── SuccessResponseData<?>
|
|
45
|
+
└── 无具体数据
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 2.3 CLI参数设计
|
|
49
|
+
|
|
50
|
+
### 命令结构
|
|
51
|
+
```
|
|
52
|
+
barista liberica supplier-contacts delete <contact-id> [options]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 位置参数
|
|
56
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
57
|
+
|------|------|------|------|
|
|
58
|
+
| contact-id | string | ✅ | 供应商联系人ID |
|
|
59
|
+
|
|
60
|
+
### 全局选项
|
|
61
|
+
| 选项 | 类型 | 说明 |
|
|
62
|
+
|------|------|------|
|
|
63
|
+
| `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
|
|
64
|
+
| `--tenant` | string | 租户代码 |
|
|
65
|
+
| `--dry-run` | boolean | 预览模式(默认开启) |
|
|
66
|
+
| `--force` | boolean | 跳过确认,直接执行删除 |
|
|
67
|
+
| `--json` | boolean | JSON输出 |
|
|
68
|
+
|
|
69
|
+
## 2.4 字段映射表
|
|
70
|
+
|
|
71
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
72
|
+
|---------|---------|----------|----------|
|
|
73
|
+
| <contact-id> | supplierContactId | string→Long | @NotNull |
|
|
74
|
+
|
|
75
|
+
## 2.5 错误码引用
|
|
76
|
+
|
|
77
|
+
### ExceptionEnum位置
|
|
78
|
+
```
|
|
79
|
+
coffee-liberica-end/
|
|
80
|
+
└── business/liberica-business-master/master-api/
|
|
81
|
+
└── src/main/java/com/newpeak/liberica/master/api/exception/enums/
|
|
82
|
+
└── MasterSupplierContactExceptionEnum.java
|
|
83
|
+
└── MASTER_SUPPLIER_CONTACT_NOT_EXIST("01001XXX001", "租户供应商联系人不存在")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### 已知错误码
|
|
87
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
88
|
+
|--------|----------|----------|
|
|
89
|
+
| 01001XXX001 | 租户供应商联系人不存在 | contact-id 不存在或不属于当前租户 |
|
|
90
|
+
|
|
91
|
+
## 2.6 权限检查
|
|
92
|
+
|
|
93
|
+
| 检查项 | 位置 | 说明 |
|
|
94
|
+
|--------|------|------|
|
|
95
|
+
| PermissionConstants | `DEL_MASTER_SUPPLIER_CONTACT` | 删除供应商联系人需要此权限 |
|
|
96
|
+
| 注解 | `@PostResource(requirePermissionCode = "DEL_MASTER_SUPPLIER_CONTACT")` | Controller方法上 |
|
|
97
|
+
|
|
98
|
+
## 2.7 实现要点
|
|
99
|
+
|
|
100
|
+
1. **位置参数**:contact-id 必须指定
|
|
101
|
+
2. **默认 dry-run**:不带 --force 时默认是 dry-run 模式,只预览不执行
|
|
102
|
+
3. **--force 确认**:实际删除前必须显式指定 --force
|
|
103
|
+
4. **输出格式**:预览模式显示将要删除的联系人信息,确认后显示删除结果
|
|
104
|
+
5. **错误处理**:联系人不存在时显示友好错误信息
|
|
105
|
+
|
|
106
|
+
## 2.8 示例用法
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# 预览删除(默认 dry-run)
|
|
110
|
+
barista liberica supplier-contacts delete 12345
|
|
111
|
+
# 输出: 🔍 Dry-Run 模式:不会实际删除
|
|
112
|
+
# 将删除联系人: 张三 (ID: 12345)
|
|
113
|
+
# 添加 --force 选项以确认删除
|
|
114
|
+
|
|
115
|
+
# 确认删除
|
|
116
|
+
barista liberica supplier-contacts delete 12345 --force
|
|
117
|
+
|
|
118
|
+
# JSON 预览
|
|
119
|
+
barista liberica supplier-contacts delete 12345 --json
|
|
120
|
+
|
|
121
|
+
# JSON 确认删除
|
|
122
|
+
barista liberica supplier-contacts delete 12345 --force --json
|
|
123
|
+
```
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# barista liberica supplier-contacts get
|
|
2
|
+
|
|
3
|
+
获取单个供应商联系人详情。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica supplier-contacts get <contact-id>` |
|
|
10
|
+
| 功能描述 | 获取单个供应商联系人详情 |
|
|
11
|
+
| HTTP方法 | GET |
|
|
12
|
+
| 是否需要认证 | ✅ 是 |
|
|
13
|
+
| 是否支持dry-run | ⬜ 否 |
|
|
14
|
+
|
|
15
|
+
## 2.2 后端接口引用
|
|
16
|
+
|
|
17
|
+
### Controller位置
|
|
18
|
+
```
|
|
19
|
+
coffee-liberica-end/
|
|
20
|
+
└── facade/liberica-facade-enterprise/
|
|
21
|
+
└── src/main/java/com/newpeak/liberica/facade/enterprise/controller/purchases/
|
|
22
|
+
└── EnterpriseSupplierContactController.java
|
|
23
|
+
└── detail(@GetResource(path = "/detail"))
|
|
24
|
+
└── public ResponseData<MasterSupplierContactResponse> detail(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
MasterSupplierContactRequest masterSupplierContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-master/master-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/request/
|
|
35
|
+
└── MasterSupplierContactRequest.java
|
|
36
|
+
└── supplierContactId: Long (@NotNull on detail)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Response DTO位置
|
|
40
|
+
```
|
|
41
|
+
coffee-liberica-end/
|
|
42
|
+
└── business/liberica-business-master/master-api/
|
|
43
|
+
└── src/main/java/com/newpeak/liberica/master/api/pojo/response/
|
|
44
|
+
└── MasterSupplierContactResponse.java
|
|
45
|
+
├── supplierContactId: Long
|
|
46
|
+
├── supplierId: Long
|
|
47
|
+
├── supplierContactName: String
|
|
48
|
+
├── supplierContactPhone: String
|
|
49
|
+
├── supplierContactTelephone: String
|
|
50
|
+
├── supplierContactEmail: String
|
|
51
|
+
├── supplierContactSex: String
|
|
52
|
+
├── supplierContactBirthday: Date
|
|
53
|
+
├── supplierContactQq: String
|
|
54
|
+
├── supplierContactWechat: String
|
|
55
|
+
├── supplierContactAddress: String
|
|
56
|
+
├── defaultFlag: String (Y/N)
|
|
57
|
+
├── remark: String
|
|
58
|
+
├── createTime: String
|
|
59
|
+
└── updateTime: String
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 2.3 CLI参数设计
|
|
63
|
+
|
|
64
|
+
### 命令结构
|
|
65
|
+
```
|
|
66
|
+
barista liberica supplier-contacts get <contact-id> [options]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 位置参数
|
|
70
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
71
|
+
|------|------|------|------|
|
|
72
|
+
| contact-id | string | ✅ | 供应商联系人ID (supplierContactId) |
|
|
73
|
+
|
|
74
|
+
### 全局选项
|
|
75
|
+
| 选项 | 类型 | 说明 |
|
|
76
|
+
|------|------|------|
|
|
77
|
+
| `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
|
|
78
|
+
| `--tenant` | string | 租户代码 |
|
|
79
|
+
| `--json` | boolean | JSON输出 |
|
|
80
|
+
|
|
81
|
+
### 命令选项
|
|
82
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 |
|
|
83
|
+
|------|--------|------|------|--------|------|
|
|
84
|
+
| — | — | — | — | — | 此命令无额外选项,ID 通过位置参数传入 |
|
|
85
|
+
|
|
86
|
+
## 2.4 字段映射表
|
|
87
|
+
|
|
88
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
89
|
+
|---------|---------|----------|----------|
|
|
90
|
+
| <contact-id> (位置参数) | supplierContactId | string→Long | @NotNull, 必须为正整数 |
|
|
91
|
+
|
|
92
|
+
## 2.5 错误码引用
|
|
93
|
+
|
|
94
|
+
### ExceptionEnum位置
|
|
95
|
+
```
|
|
96
|
+
coffee-liberica-end/
|
|
97
|
+
└── business/liberica-business-master/master-api/
|
|
98
|
+
└── src/main/java/com/newpeak/liberica/master/api/exception/enums/
|
|
99
|
+
└── MasterSupplierContactExceptionEnum.java
|
|
100
|
+
└── MASTER_SUPPLIER_CONTACT_NOT_EXIST("01001XXX001", "租户供应商联系人不存在")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 已知错误码
|
|
104
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
105
|
+
|--------|----------|----------|
|
|
106
|
+
| 01001XXX001 | 租户供应商联系人不存在 | contact-id 不存在或不属于当前租户 |
|
|
107
|
+
|
|
108
|
+
## 2.6 权限检查
|
|
109
|
+
|
|
110
|
+
| 检查项 | 位置 | 说明 |
|
|
111
|
+
|--------|------|------|
|
|
112
|
+
| 注解 | `@GetResource(path = "/detail")` | 无 requiredPermission |
|
|
113
|
+
|
|
114
|
+
## 2.7 实现要点
|
|
115
|
+
|
|
116
|
+
1. **位置参数**:`get` 命令使用 `<contact-id>` 位置参数指定联系人ID
|
|
117
|
+
2. **错误处理**:联系人不存在时抛出 `MASTER_SUPPLIER_CONTACT_NOT_EXIST`,CLI 显示友好错误信息
|
|
118
|
+
3. **tenantId来源**:来自 X-TENANT-ID header,后端自动按租户隔离数据
|
|
119
|
+
4. **输出格式**:表格形式展示联系人详情,或 JSON 格式
|
|
120
|
+
|
|
121
|
+
## 2.8 示例用法
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# 获取联系人详情
|
|
125
|
+
barista liberica supplier-contacts get 12345
|
|
126
|
+
|
|
127
|
+
# JSON 输出
|
|
128
|
+
barista liberica supplier-contacts get 12345 --json
|
|
129
|
+
|
|
130
|
+
# 联系人不存在
|
|
131
|
+
barista liberica supplier-contacts get 99999
|
|
132
|
+
# 输出: Error: 租户供应商联系人不存在 (01001XXX001)
|
|
133
|
+
```
|