@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,133 @@
|
|
|
1
|
+
# barista liberica client-contacts get
|
|
2
|
+
|
|
3
|
+
获取单个客户联系人详情。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica client-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/sales/
|
|
22
|
+
└── EnterpriseClientContactController.java
|
|
23
|
+
└── detail(@GetResource(path = "/detail"))
|
|
24
|
+
└── public ResponseData<MasterClientContactResponse> detail(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
MasterClientContactRequest masterClientContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-sales/sales-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/request/
|
|
35
|
+
└── MasterClientContactRequest.java
|
|
36
|
+
└── clientContactId: Long (@NotNull on detail)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Response DTO位置
|
|
40
|
+
```
|
|
41
|
+
coffee-liberica-end/
|
|
42
|
+
└── business/liberica-business-sales/sales-api/
|
|
43
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
|
|
44
|
+
└── MasterClientContactResponse.java
|
|
45
|
+
├── clientContactId: Long
|
|
46
|
+
├── clientId: Long
|
|
47
|
+
├── clientContactName: String
|
|
48
|
+
├── clientContactPhone: String
|
|
49
|
+
├── clientContactTelephone: String
|
|
50
|
+
├── clientContactEmail: String
|
|
51
|
+
├── clientContactSex: String
|
|
52
|
+
├── clientContactBirthday: Date
|
|
53
|
+
├── clientContactQq: String
|
|
54
|
+
├── clientContactWechat: String
|
|
55
|
+
├── clientContactAddress: 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 client-contacts get <contact-id> [options]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 位置参数
|
|
70
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
71
|
+
|------|------|------|------|
|
|
72
|
+
| contact-id | string | ✅ | 客户联系人ID (clientContactId) |
|
|
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> (位置参数) | clientContactId | string→Long | @NotNull, 必须为正整数 |
|
|
91
|
+
|
|
92
|
+
## 2.5 错误码引用
|
|
93
|
+
|
|
94
|
+
### ExceptionEnum位置
|
|
95
|
+
```
|
|
96
|
+
coffee-liberica-end/
|
|
97
|
+
└── business/liberica-business-sales/sales-api/
|
|
98
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
|
|
99
|
+
└── MasterClientContactResponse.java
|
|
100
|
+
└── MASTER_CLIENT_CONTACT_NOT_EXIST("01001207001", "租户客户联系人不存在")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 已知错误码
|
|
104
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
105
|
+
|--------|----------|----------|
|
|
106
|
+
| 01001207001 | 租户客户联系人不存在 | 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_CLIENT_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 client-contacts get 12345
|
|
126
|
+
|
|
127
|
+
# JSON 输出
|
|
128
|
+
barista liberica client-contacts get 12345 --json
|
|
129
|
+
|
|
130
|
+
# 联系人不存在
|
|
131
|
+
barista liberica client-contacts get 99999
|
|
132
|
+
# 输出: Error: 租户客户联系人不存在 (01001207001)
|
|
133
|
+
```
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# barista liberica client-contacts list
|
|
2
|
+
|
|
3
|
+
查询客户联系人列表。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica client-contacts list` |
|
|
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/sales/
|
|
22
|
+
└── EnterpriseClientContactController.java
|
|
23
|
+
└── list(@GetResource(path = "/list"))
|
|
24
|
+
└── public ResponseData<List<MasterClientContactResponse>> list(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
MasterClientContactRequest masterClientContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-sales/sales-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/request/
|
|
35
|
+
└── MasterClientContactRequest.java
|
|
36
|
+
├── clientId: Long (@NotNull)
|
|
37
|
+
├── clientContactName: String (搜索关键词)
|
|
38
|
+
├── pageNo: Long (分页页码)
|
|
39
|
+
└── pageSize: Long (分页大小)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Response DTO位置
|
|
43
|
+
```
|
|
44
|
+
coffee-liberica-end/
|
|
45
|
+
└── business/liberica-business-sales/sales-api/
|
|
46
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
|
|
47
|
+
└── MasterClientContactResponse.java
|
|
48
|
+
├── clientContactId: Long
|
|
49
|
+
├── clientId: Long
|
|
50
|
+
├── clientContactName: String
|
|
51
|
+
├── clientContactPhone: String
|
|
52
|
+
├── clientContactTelephone: String
|
|
53
|
+
├── clientContactEmail: String
|
|
54
|
+
├── clientContactSex: String
|
|
55
|
+
├── clientContactBirthday: Date
|
|
56
|
+
├── clientContactQq: String
|
|
57
|
+
├── clientContactWechat: String
|
|
58
|
+
├── clientContactAddress: String
|
|
59
|
+
├── defaultFlag: String (Y/N)
|
|
60
|
+
├── remark: String
|
|
61
|
+
├── createTime: String
|
|
62
|
+
└── updateTime: String
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 2.3 CLI参数设计
|
|
66
|
+
|
|
67
|
+
### 命令结构
|
|
68
|
+
```
|
|
69
|
+
barista liberica client-contacts list [options]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 全局选项
|
|
73
|
+
| 选项 | 类型 | 说明 |
|
|
74
|
+
|------|------|------|
|
|
75
|
+
| `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
|
|
76
|
+
| `--tenant` | string | 租户代码 |
|
|
77
|
+
| `--json` | boolean | JSON输出 |
|
|
78
|
+
|
|
79
|
+
### 命令选项
|
|
80
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
|
|
81
|
+
|------|--------|------|------|--------|------|-------------|
|
|
82
|
+
| --client-id | -c | string | ✅ | - | 客户ID | clientId |
|
|
83
|
+
| --page | -p | number | ⬜ | 1 | 页码 | pageNo |
|
|
84
|
+
| --size | -s | number | ⬜ | 20 | 每页条数 | pageSize |
|
|
85
|
+
| --search | -S | string | ⬜ | - | 搜索关键词(姓名) | clientContactName |
|
|
86
|
+
|
|
87
|
+
## 2.4 字段映射表
|
|
88
|
+
|
|
89
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
90
|
+
|---------|---------|----------|----------|
|
|
91
|
+
| --client-id / -c | clientId | string→Long | @NotNull |
|
|
92
|
+
| --page / -p | pageNo | number→Long | >= 1 |
|
|
93
|
+
| --size / -s | pageSize | number→Long | 1-100 |
|
|
94
|
+
| --search / -S | clientContactName | 直接传递 | 模糊查询 |
|
|
95
|
+
|
|
96
|
+
## 2.5 错误码引用
|
|
97
|
+
|
|
98
|
+
### ExceptionEnum位置
|
|
99
|
+
```
|
|
100
|
+
coffee-liberica-end/
|
|
101
|
+
└── business/liberica-business-sales/sales-api/
|
|
102
|
+
└── src/main/java/com/newpeak/liberica/sales/api/exception/enums/
|
|
103
|
+
└── MasterClientContactExceptionEnum.java
|
|
104
|
+
└── MASTER_CLIENT_CONTACT_NOT_EXIST("01001207001", "租户客户联系人不存在")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 已知错误码
|
|
108
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
109
|
+
|--------|----------|----------|
|
|
110
|
+
| 01001207001 | 租户客户联系人不存在 | 客户ID不存在时 |
|
|
111
|
+
|
|
112
|
+
## 2.6 权限检查
|
|
113
|
+
|
|
114
|
+
| 检查项 | 位置 | 说明 |
|
|
115
|
+
|--------|------|------|
|
|
116
|
+
| 注解 | `@GetResource(path = "/list")` | 无 requiredPermission(无需权限码) |
|
|
117
|
+
|
|
118
|
+
**注意**:list 接口在 Controller 层无需权限校验,数据范围通过 tenantId 隔离。
|
|
119
|
+
|
|
120
|
+
## 2.7 实现要点
|
|
121
|
+
|
|
122
|
+
1. **必填参数**:--client-id 必须指定
|
|
123
|
+
2. **分页默认值**:page=1, size=20
|
|
124
|
+
3. **搜索行为**:clientContactName 支持模糊查询
|
|
125
|
+
4. **无结果处理**:返回空列表,不抛出异常
|
|
126
|
+
5. **tenantId来源**:来自 X-TENANT-ID header
|
|
127
|
+
6. **输出格式**:表格形式展示联系人列表
|
|
128
|
+
|
|
129
|
+
## 2.8 示例用法
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# 列出客户的所有联系人
|
|
133
|
+
barista liberica client-contacts list --client-id 12345
|
|
134
|
+
|
|
135
|
+
# 指定页码和每页条数
|
|
136
|
+
barista liberica client-contacts list --client-id 12345 --page 2 --size 50
|
|
137
|
+
|
|
138
|
+
# 搜索联系人
|
|
139
|
+
barista liberica client-contacts list --client-id 12345 --search "张"
|
|
140
|
+
|
|
141
|
+
# JSON 输出(便于脚本处理)
|
|
142
|
+
barista liberica client-contacts list --client-id 12345 --json
|
|
143
|
+
```
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# barista liberica client-contacts update
|
|
2
|
+
|
|
3
|
+
更新客户联系人信息。
|
|
4
|
+
|
|
5
|
+
## 2.1 命令元数据
|
|
6
|
+
|
|
7
|
+
| 字段 | 值 |
|
|
8
|
+
|------|-----|
|
|
9
|
+
| 完整命令 | `barista liberica client-contacts update <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/sales/
|
|
22
|
+
└── EnterpriseClientContactController.java
|
|
23
|
+
└── edit(@PostResource(path = "/edit", requiredPermission = true, requirePermissionCode = "EDIT_MASTER_CLIENT_CONTACT"))
|
|
24
|
+
└── public ResponseData<?> edit(
|
|
25
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
26
|
+
@RequestBody @Validated(BaseRequest.edit.class) MasterClientContactRequest masterClientContactRequest
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Request DTO位置
|
|
31
|
+
```
|
|
32
|
+
coffee-liberica-end/
|
|
33
|
+
└── business/liberica-business-sales/sales-api/
|
|
34
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/request/
|
|
35
|
+
└── MasterClientContactRequest.java
|
|
36
|
+
├── clientContactId: Long (@NotNull on edit)
|
|
37
|
+
├── clientContactName: String (@NotBlank, max=255)
|
|
38
|
+
├── clientContactPhone: String (max=256)
|
|
39
|
+
├── clientContactTelephone: String (max=256)
|
|
40
|
+
├── clientContactEmail: String (max=512)
|
|
41
|
+
├── clientContactSex: String (max=255)
|
|
42
|
+
├── clientContactBirthday: Date
|
|
43
|
+
├── clientContactQq: String (max=512)
|
|
44
|
+
├── clientContactWechat: String (max=512)
|
|
45
|
+
├── clientContactAddress: String (max=512)
|
|
46
|
+
├── defaultFlag: String (max=1)
|
|
47
|
+
└── remark: String (max=255)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Response DTO位置
|
|
51
|
+
```
|
|
52
|
+
coffee-liberica-end/
|
|
53
|
+
└── business/liberica-business-sales/sales-api/
|
|
54
|
+
└── src/main/java/com/newpeak/liberica/sales/api/pojo/response/
|
|
55
|
+
└── MasterClientContactResponse.java
|
|
56
|
+
└── (同 get 接口)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 2.3 CLI参数设计
|
|
60
|
+
|
|
61
|
+
### 命令结构
|
|
62
|
+
```
|
|
63
|
+
barista liberica client-contacts update <contact-id> [options]
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 位置参数
|
|
67
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
68
|
+
|------|------|------|------|
|
|
69
|
+
| contact-id | string | ✅ | 客户联系人ID |
|
|
70
|
+
|
|
71
|
+
### 全局选项
|
|
72
|
+
| 选项 | 类型 | 说明 |
|
|
73
|
+
|------|------|------|
|
|
74
|
+
| `--env` | string | 目标环境(dev\|test\|prod-cn\|prod-jp) |
|
|
75
|
+
| `--tenant` | string | 租户代码 |
|
|
76
|
+
| `--dry-run` | boolean | 预览模式 |
|
|
77
|
+
| `--json` | boolean | JSON输出 |
|
|
78
|
+
|
|
79
|
+
### 命令选项
|
|
80
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
|
|
81
|
+
|------|--------|------|------|--------|------|-------------|
|
|
82
|
+
| --name | -n | string | ⬜ | - | 姓名 | clientContactName |
|
|
83
|
+
| --phone | -p | string | ⬜ | - | 手机号 | clientContactPhone |
|
|
84
|
+
| --telephone | -t | string | ⬜ | - | 座机号 | clientContactTelephone |
|
|
85
|
+
| --email | -e | string | ⬜ | - | 电子邮箱 | clientContactEmail |
|
|
86
|
+
| --sex | -s | string | ⬜ | - | 性别 | clientContactSex |
|
|
87
|
+
| --birthday | -b | string | ⬜ | - | 生日(YYYY-MM-DD) | clientContactBirthday |
|
|
88
|
+
| --qq | -q | string | ⬜ | - | QQ号 | clientContactQq |
|
|
89
|
+
| --wechat | -w | string | ⬜ | - | 微信号 | clientContactWechat |
|
|
90
|
+
| --address | -a | string | ⬜ | - | 详细地址 | clientContactAddress |
|
|
91
|
+
| --default | -d | boolean | ⬜ | - | 是否默认联系人 | defaultFlag |
|
|
92
|
+
| --remark | -r | string | ⬜ | - | 备注 | remark |
|
|
93
|
+
|
|
94
|
+
**注意**:所有字段在 update 时都是可选的,至少需要提供一个要更新的字段。
|
|
95
|
+
|
|
96
|
+
## 2.4 字段映射表
|
|
97
|
+
|
|
98
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
99
|
+
|---------|---------|----------|----------|
|
|
100
|
+
| <contact-id> | clientContactId | string→Long | @NotNull |
|
|
101
|
+
| --name / -n | clientContactName | 直接传递 | max=255 |
|
|
102
|
+
| --phone / -p | clientContactPhone | 直接传递 | max=256 |
|
|
103
|
+
| --telephone / -t | clientContactTelephone | 直接传递 | max=256 |
|
|
104
|
+
| --email / -e | clientContactEmail | 直接传递 | max=512 |
|
|
105
|
+
| --sex / -s | clientContactSex | 直接传递 | max=255 |
|
|
106
|
+
| --birthday / -b | clientContactBirthday | string→Date | yyyy-MM-dd |
|
|
107
|
+
| --qq / -q | clientContactQq | 直接传递 | max=512 |
|
|
108
|
+
| --wechat / -w | clientContactWechat | 直接传递 | max=512 |
|
|
109
|
+
| --address / -a | clientContactAddress | 直接传递 | max=512 |
|
|
110
|
+
| --default / -d | defaultFlag | boolean→Y/N | max=1 |
|
|
111
|
+
| --remark / -r | remark | 直接传递 | max=255 |
|
|
112
|
+
|
|
113
|
+
## 2.5 错误码引用
|
|
114
|
+
|
|
115
|
+
### ExceptionEnum位置
|
|
116
|
+
```
|
|
117
|
+
coffee-liberica-end/
|
|
118
|
+
└── business/liberica-business-sales/sales-api/
|
|
119
|
+
└── src/main/java/com/newpeak/liberica/sales/api/exception/enums/
|
|
120
|
+
└── MasterClientContactExceptionEnum.java
|
|
121
|
+
└── MASTER_CLIENT_CONTACT_NOT_EXIST("01001207001", "租户客户联系人不存在")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### 已知错误码
|
|
125
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
126
|
+
|--------|----------|----------|
|
|
127
|
+
| 01001207001 | 租户客户联系人不存在 | contact-id 不存在或不属于当前租户 |
|
|
128
|
+
|
|
129
|
+
## 2.6 权限检查
|
|
130
|
+
|
|
131
|
+
| 检查项 | 位置 | 说明 |
|
|
132
|
+
|--------|------|------|
|
|
133
|
+
| PermissionConstants | `EDIT_MASTER_CLIENT_CONTACT` | 编辑客户联系人需要此权限 |
|
|
134
|
+
| 注解 | `@PostResource(requirePermissionCode = "EDIT_MASTER_CLIENT_CONTACT")` | Controller方法上 |
|
|
135
|
+
|
|
136
|
+
## 2.7 实现要点
|
|
137
|
+
|
|
138
|
+
1. **位置参数**:contact-id 必须指定
|
|
139
|
+
2. **可选字段**:所有业务字段都是可选的,至少提供一个
|
|
140
|
+
3. **dry-run 模式**:预览模式下只显示将要更新的数据,不实际调用 API
|
|
141
|
+
4. **输出格式**:成功后显示更新后的联系人信息
|
|
142
|
+
5. **错误处理**:联系人不存在时显示友好错误信息
|
|
143
|
+
|
|
144
|
+
## 2.8 示例用法
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# 更新联系人姓名(dry-run 预览)
|
|
148
|
+
barista liberica client-contacts update 12345 --name "新姓名" --dry-run
|
|
149
|
+
|
|
150
|
+
# 实际更新
|
|
151
|
+
barista liberica client-contacts update 12345 --name "新姓名" --phone "13900139000"
|
|
152
|
+
|
|
153
|
+
# 更新多个字段
|
|
154
|
+
barista liberica client-contacts update 12345 --email "new@example.com" --address "新地址"
|
|
155
|
+
|
|
156
|
+
# JSON 输出
|
|
157
|
+
barista liberica client-contacts update 12345 --name "新姓名" --json
|
|
158
|
+
```
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# 命令名称: barista liberica stock ledger
|
|
2
|
+
|
|
3
|
+
## 2.1 命令元数据
|
|
4
|
+
|
|
5
|
+
| 字段 | 值 |
|
|
6
|
+
|------|-----|
|
|
7
|
+
| 完整命令 | `barista liberica stock ledger` |
|
|
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
|
+
├── commonStockJourneyPage(@GetResource(path = "/journey/page"))
|
|
22
|
+
│ └── public ResponseData<PageResult<StockJourneyResponse>> commonStockJourneyPage(
|
|
23
|
+
│ @RequestHeader("X-TENANT-ID") Long tenantId,
|
|
24
|
+
│ @ParameterObject StockJourneyQueryRequest stockJourneyQueryRequest
|
|
25
|
+
│ )
|
|
26
|
+
└── commonStockJourneyPageSummary(@GetResource(path = "/journey/page/summary"))
|
|
27
|
+
└── public ResponseData<StockJourneySummaryResponse> commonStockJourneyPageSummary(
|
|
28
|
+
@RequestHeader("X-TENANT-ID") Long tenantId,
|
|
29
|
+
@ParameterObject StockJourneyQueryRequest stockJourneyQueryRequest
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Request DTO位置
|
|
34
|
+
```
|
|
35
|
+
coffee-liberica-end/
|
|
36
|
+
└── business/liberica-business-stock/stock-api/
|
|
37
|
+
└── src/main/java/com/newpeak/liberica/stock/api/pojo/request/
|
|
38
|
+
└── StockJourneyQueryRequest.java
|
|
39
|
+
├── stockId: Long
|
|
40
|
+
├── stockFormCode: String
|
|
41
|
+
├── stockType: String
|
|
42
|
+
├── stockFlag: String
|
|
43
|
+
├── warehouseCode: String
|
|
44
|
+
├── materialCode: String
|
|
45
|
+
├── materialName: String
|
|
46
|
+
├── materialType: String
|
|
47
|
+
├── color: String
|
|
48
|
+
├── lotNo: String
|
|
49
|
+
├── lotCode: String
|
|
50
|
+
├── sourceType: String
|
|
51
|
+
├── sourceCode: String
|
|
52
|
+
├── stockDate: Date
|
|
53
|
+
├── stockDateCriteria: DateRange
|
|
54
|
+
└── postingMonth: Date
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Response DTO位置
|
|
58
|
+
|
|
59
|
+
**列表项 DTO:**
|
|
60
|
+
```
|
|
61
|
+
coffee-liberica-end/
|
|
62
|
+
└── business/liberica-business-stock/stock-api/
|
|
63
|
+
└── src/main/java/com/newpeak/liberica/stock/api/pojo/response/
|
|
64
|
+
└── StockJourneyResponse.java
|
|
65
|
+
├── stockId: Long
|
|
66
|
+
├── stockFormCode: String
|
|
67
|
+
├── stockType: String
|
|
68
|
+
├── stockFlag: String
|
|
69
|
+
├── warehouseCode: String
|
|
70
|
+
├── materialCode: String
|
|
71
|
+
├── materialNo: String
|
|
72
|
+
├── materialName: String
|
|
73
|
+
├── materialType: String
|
|
74
|
+
├── color: String
|
|
75
|
+
├── longX: BigDecimal
|
|
76
|
+
├── wideY: BigDecimal
|
|
77
|
+
├── highZ: BigDecimal
|
|
78
|
+
├── sourceCode: String
|
|
79
|
+
├── sourceType: String
|
|
80
|
+
├── lotCode: String
|
|
81
|
+
├── lotNo: String
|
|
82
|
+
├── supplierLotNo: String
|
|
83
|
+
├── inboundCount: BigDecimal
|
|
84
|
+
├── outboundCount: BigDecimal
|
|
85
|
+
├── materialUomCode: String
|
|
86
|
+
├── unitPrice: BigDecimal
|
|
87
|
+
├── localCurrency: String
|
|
88
|
+
├── inboundAmount: BigDecimal
|
|
89
|
+
├── outboundAmount: BigDecimal
|
|
90
|
+
├── inboundDate: Date
|
|
91
|
+
├── stockDate: Date
|
|
92
|
+
├── outboundDate: Date
|
|
93
|
+
├── postingMonth: Date
|
|
94
|
+
└── remark: String
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**汇总 DTO:**
|
|
98
|
+
```
|
|
99
|
+
coffee-liberica-end/
|
|
100
|
+
└── business/liberica-business-stock/stock-api/
|
|
101
|
+
└── src/main/java/com/newpeak/liberica/stock/api/pojo/response/
|
|
102
|
+
└── StockJourneySummaryResponse.java
|
|
103
|
+
├── totalInboundCount: BigDecimal
|
|
104
|
+
├── totalOutboundCount: BigDecimal
|
|
105
|
+
├── totalInboundAmount: BigDecimal
|
|
106
|
+
└── totalOutboundAmount: BigDecimal
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 2.3 CLI参数设计
|
|
110
|
+
|
|
111
|
+
### 命令结构
|
|
112
|
+
```bash
|
|
113
|
+
barista liberica stock ledger [options]
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 全局选项
|
|
117
|
+
| 选项 | 类型 | 说明 |
|
|
118
|
+
|------|------|------|
|
|
119
|
+
| `--env` | string | 目标环境(dev/test/prod-cn/prod-jp) |
|
|
120
|
+
| `--tenant` | string | 租户代码(仅Liberica) |
|
|
121
|
+
| `--dry-run` | boolean | 预览模式 |
|
|
122
|
+
| `--json` | boolean | JSON输出 |
|
|
123
|
+
|
|
124
|
+
### 命令选项
|
|
125
|
+
| 选项 | 短选项 | 类型 | 必填 | 默认值 | 说明 | 对应DTO字段 |
|
|
126
|
+
|------|--------|------|------|--------|------|-------------|
|
|
127
|
+
| `--stock-id` | | string | 否 | - | 出入库ID | stockId |
|
|
128
|
+
| `--stock-form-code` | | string | 否 | - | 出入库单编码 | stockFormCode |
|
|
129
|
+
| `--stock-type` | | string | 否 | - | 出入库单类型 | stockType |
|
|
130
|
+
| `--stock-flag` | | string | 否 | - | 出入库标志(inbound/outbound) | stockFlag |
|
|
131
|
+
| `--warehouse-code` | -w | string | 否 | - | 仓库编码 | warehouseCode |
|
|
132
|
+
| `--material-code` | -m | string | 否 | - | 物料编码 | materialCode |
|
|
133
|
+
| `--material-name` | | string | 否 | - | 物料名称(支持模糊查询) | materialName |
|
|
134
|
+
| `--material-type` | -t | string | 否 | - | 物料规格 | materialType |
|
|
135
|
+
| `--color` | -c | string | 否 | - | 颜色 | color |
|
|
136
|
+
| `--lot-no` | -l | string | 否 | - | 批次号 | lotNo |
|
|
137
|
+
| `--lot-code` | | string | 否 | - | 系统批次号 | lotCode |
|
|
138
|
+
| `--source-type` | | string | 否 | - | 源单类型 | sourceType |
|
|
139
|
+
| `--source-code` | | string | 否 | - | 源单编码 | sourceCode |
|
|
140
|
+
| `--start-date` | | string | 否 | - | 出入库开始日期(YYYY-MM-DD) | stockDateCriteria.startDate |
|
|
141
|
+
| `--end-date` | | string | 否 | - | 出入库结束日期(YYYY-MM-DD) | stockDateCriteria.endDate |
|
|
142
|
+
| `--posting-month` | | string | 否 | - | 记账年月(YYYY-MM) | postingMonth |
|
|
143
|
+
| `--summary` | | boolean | 否 | false | 仅显示汇总数据 | 控制输出模式 |
|
|
144
|
+
| `--page` | -p | number | 否 | 1 | 页码 | pageNo |
|
|
145
|
+
| `--size` | -s | number | 否 | 20 | 每页条数 | pageSize |
|
|
146
|
+
|
|
147
|
+
## 2.4 字段映射表
|
|
148
|
+
|
|
149
|
+
| CLI参数 | DTO字段 | 类型转换 | 验证规则 |
|
|
150
|
+
|---------|---------|----------|----------|
|
|
151
|
+
| --stock-id | stockId | string→Long | 后端BigInteger,CLI使用string |
|
|
152
|
+
| --stock-form-code | stockFormCode | 直接传递 | - |
|
|
153
|
+
| --stock-type | stockType | 直接传递 | enum: STOCK_TYPE |
|
|
154
|
+
| --stock-flag | stockFlag | 直接传递 | enum: STOCK_FLAG |
|
|
155
|
+
| --warehouse-code | warehouseCode | 直接传递 | - |
|
|
156
|
+
| --material-code | materialCode | 直接传递 | - |
|
|
157
|
+
| --material-name | materialName | 直接传递 | - |
|
|
158
|
+
| --material-type | materialType | 直接传递 | - |
|
|
159
|
+
| --color | color | 直接传递 | - |
|
|
160
|
+
| --lot-no | lotNo | 直接传递 | - |
|
|
161
|
+
| --lot-code | lotCode | 直接传递 | - |
|
|
162
|
+
| --source-type | sourceType | 直接传递 | enum: source_type |
|
|
163
|
+
| --source-code | sourceCode | 直接传递 | - |
|
|
164
|
+
| --start-date | stockDateCriteria.startDate | string→Date | yyyy-MM-dd |
|
|
165
|
+
| --end-date | stockDateCriteria.endDate | string→Date | yyyy-MM-dd |
|
|
166
|
+
| --posting-month | postingMonth | string→Date | yyyy-MM |
|
|
167
|
+
| --page | pageNo | number-1 | 0-based分页 |
|
|
168
|
+
| --size | pageSize | number | >0 |
|
|
169
|
+
|
|
170
|
+
## 2.5 错误码引用
|
|
171
|
+
|
|
172
|
+
### ExceptionEnum位置
|
|
173
|
+
```
|
|
174
|
+
coffee-liberica-end/
|
|
175
|
+
└── business/liberica-business-stock/stock-api/
|
|
176
|
+
└── src/main/java/com/newpeak/liberica/stock/api/exception/enums/
|
|
177
|
+
├── StockJourneyExceptionEnum.java
|
|
178
|
+
│ ├── STOCK_JOURNEY_NOT_EXIST("...001", "租户出入库台账不存在")
|
|
179
|
+
│ └── CAN_NOT_DELETE_MATERIAL_WITH_USED_IN_STOCK("...002", "物料已在库存中使用,不能删除")
|
|
180
|
+
├── MasterStockExceptionEnum.java
|
|
181
|
+
│ ├── MASTER_STOCK_NOT_EXIST("...001", "租户库存不存在")
|
|
182
|
+
│ └── MASTER_STOCK_OUT_LOT_NOT_ENOUGH("...002", "租户成品出库单{}余量不够")
|
|
183
|
+
└── MasterWarehouseStockExceptionEnum.java
|
|
184
|
+
└── MASTER_WAREHOUSE_STOCK_NOT_EXIST("...001", "租户仓库库存不存在")
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 已知错误码示例
|
|
188
|
+
| 错误码 | 错误消息 | 触发条件 |
|
|
189
|
+
|--------|----------|----------|
|
|
190
|
+
| ...001 | 租户出入库台账不存在 | 查询的台账记录不存在 |
|
|
191
|
+
| ...001 | 租户库存不存在 | 查询的库存记录不存在 |
|
|
192
|
+
| ...002 | 租户成品出库单{}余量不够 | 出库操作余量不足 |
|
|
193
|
+
|
|
194
|
+
## 2.6 权限检查
|
|
195
|
+
|
|
196
|
+
| 检查项 | 位置 | 说明 |
|
|
197
|
+
|--------|------|------|
|
|
198
|
+
| 菜单权限 | `MasterStockController` 类上的 `@Menu` 注解 | `stock_journey` 菜单,要求 `tenantStock` 角色 |
|
|
199
|
+
| 接口访问 | Controller方法无单独 `@GetResource(requiredPermission = true)` | 通过菜单角色控制 |
|
|
200
|
+
|
|
201
|
+
## 2.7 实现要点
|
|
202
|
+
|
|
203
|
+
1. **双接口调用**:默认模式同时调用 `/journey/page/summary` 和 `/journey/page`,先显示汇总再显示列表
|
|
204
|
+
2. **Summary模式**:当传入 `--summary` 时,仅调用 `/journey/page/summary`,不请求列表数据
|
|
205
|
+
3. **分页转换**:CLI page 1 对应 API pageNo 0
|
|
206
|
+
4. **ID类型**:stockId 后端为 Long/BigInteger,CLI 统一使用 string 类型避免精度丢失
|
|
207
|
+
5. **日期格式**:--posting-month 使用 yyyy-MM 格式,转换为 Date 类型
|
|
208
|
+
6. **stockFlag映射**:inbound 对应入库记录,outbound 对应出库记录;后端 StockJourneyResponse 根据 inboundCount 是否为空自动推断 stockFlag
|
|
209
|
+
7. **输出格式**:默认表格输出,--json 返回结构化 JSON;汇总数据和列表数据在 JSON 中分层返回
|