@be-link/ecommerce-plan-allocation-service-node-sdk 0.0.40 → 0.0.42
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/enum.d.ts +69 -0
- package/enum.js +79 -0
- package/index.d.ts +9 -2
- package/index.js +11 -5
- package/modules/allocationOrder/types.d.ts +2 -0
- package/modules/preAllocationOrder/types.d.ts +3 -0
- package/modules/purchaseOrder/service.d.ts +51 -0
- package/modules/purchaseOrder/service.js +139 -0
- package/modules/purchaseOrder/types.d.ts +289 -0
- package/modules/purchaseOrder/types.js +2 -0
- package/modules/storeProductFulfill/types.d.ts +1 -0
- package/modules/storeReplenishOrder/types.d.ts +3 -0
- package/modules/storeStockIn/types.d.ts +3 -0
- package/modules/warehouseInventory/service.d.ts +14 -0
- package/modules/warehouseInventory/service.js +79 -0
- package/modules/warehouseInventory/types.d.ts +225 -0
- package/modules/warehouseInventory/types.js +2 -0
- package/modules/warehouseLocation/service.d.ts +9 -0
- package/modules/warehouseLocation/service.js +44 -0
- package/modules/warehouseLocation/types.d.ts +64 -0
- package/modules/warehouseLocation/types.js +2 -0
- package/modules/warehouseStockIn/service.d.ts +14 -0
- package/modules/warehouseStockIn/service.js +79 -0
- package/modules/warehouseStockIn/types.d.ts +236 -0
- package/modules/warehouseStockIn/types.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { ENUM } from '../../enum';
|
|
2
|
+
export declare namespace PurchaseOrderTypes {
|
|
3
|
+
/** 实体定义 */
|
|
4
|
+
namespace Entity {
|
|
5
|
+
/** 待采购单(PurchasePreOrder)简化实体 */
|
|
6
|
+
interface PurchasePreOrder {
|
|
7
|
+
id: string;
|
|
8
|
+
createdAt: number;
|
|
9
|
+
updatedAt: number;
|
|
10
|
+
deletedAt: number;
|
|
11
|
+
categoryId: string;
|
|
12
|
+
status: ENUM.PURCHASE_ORDER_ENUM.STATUS;
|
|
13
|
+
deliveryMethod: ENUM.PURCHASE_ORDER_ENUM.DELIVERY_METHOD;
|
|
14
|
+
creator: string;
|
|
15
|
+
}
|
|
16
|
+
/** 采购单主表(PurchaseOrder)简化实体 */
|
|
17
|
+
interface PurchaseOrder {
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
deletedAt: number;
|
|
22
|
+
purchasePreId: string;
|
|
23
|
+
stockInOrderIds: string[];
|
|
24
|
+
supplierId: string;
|
|
25
|
+
categoryId: string;
|
|
26
|
+
status: ENUM.PURCHASE_ORDER_ENUM.STATUS;
|
|
27
|
+
deliveryMethod: ENUM.PURCHASE_ORDER_ENUM.DELIVERY_METHOD;
|
|
28
|
+
creator: string;
|
|
29
|
+
}
|
|
30
|
+
/** 采购单明细(PurchaseOrderDetail)简化实体 */
|
|
31
|
+
interface PurchaseOrderDetail {
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: number;
|
|
34
|
+
updatedAt: number;
|
|
35
|
+
deletedAt: number;
|
|
36
|
+
purchaseOrderId: string;
|
|
37
|
+
purchaseType: ENUM.PURCHASE_ORDER_ENUM.PURCHASE_TYPE;
|
|
38
|
+
productId: string;
|
|
39
|
+
skuId: string;
|
|
40
|
+
skuCode: string;
|
|
41
|
+
purchaseQuantity: number;
|
|
42
|
+
warehouseStock: number;
|
|
43
|
+
supplierId: string;
|
|
44
|
+
deliveryMethod: ENUM.PURCHASE_ORDER_ENUM.DELIVERY_METHOD;
|
|
45
|
+
destinationId: string;
|
|
46
|
+
expectedArrivalDate: number;
|
|
47
|
+
purchaseNote: string;
|
|
48
|
+
}
|
|
49
|
+
/** 采购单明细扩展实体(包含商品与展示信息) */
|
|
50
|
+
interface PurchaseOrderDetailWithProduct extends PurchaseOrderDetail {
|
|
51
|
+
productName: string;
|
|
52
|
+
productImage: string;
|
|
53
|
+
imgList: string[];
|
|
54
|
+
specName: string;
|
|
55
|
+
storageMethod: string;
|
|
56
|
+
classification: string;
|
|
57
|
+
supplierName: string;
|
|
58
|
+
destinationName: string;
|
|
59
|
+
}
|
|
60
|
+
/** 采购单类型(PurchaseCategory) */
|
|
61
|
+
interface PurchaseCategory {
|
|
62
|
+
id: string;
|
|
63
|
+
createdAt: number;
|
|
64
|
+
updatedAt: number;
|
|
65
|
+
deletedAt: number;
|
|
66
|
+
categoryName: string;
|
|
67
|
+
description: string;
|
|
68
|
+
isSystem: number;
|
|
69
|
+
creator: string;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** 请求参数定义(Demo) */
|
|
73
|
+
namespace Request {
|
|
74
|
+
/** 查询采购单类型列表 */
|
|
75
|
+
interface QueryCategoryList {
|
|
76
|
+
categoryName?: string;
|
|
77
|
+
pageIndex: number;
|
|
78
|
+
pageSize: number;
|
|
79
|
+
}
|
|
80
|
+
/** 新增采购单类型 */
|
|
81
|
+
interface AddCategory {
|
|
82
|
+
categoryName: string;
|
|
83
|
+
description?: string;
|
|
84
|
+
operator: string;
|
|
85
|
+
}
|
|
86
|
+
/** 删除待采购单 */
|
|
87
|
+
interface Delete {
|
|
88
|
+
id: string;
|
|
89
|
+
operator: string;
|
|
90
|
+
}
|
|
91
|
+
/** 查询采购单列表(列表页) */
|
|
92
|
+
interface GetList {
|
|
93
|
+
ids?: string[];
|
|
94
|
+
type: string;
|
|
95
|
+
categoryIds?: string[];
|
|
96
|
+
creator?: string;
|
|
97
|
+
createAtStartTime?: string;
|
|
98
|
+
createAtEndTime?: string;
|
|
99
|
+
productIds?: string[];
|
|
100
|
+
skuIds?: string[];
|
|
101
|
+
skuCodes?: string[];
|
|
102
|
+
deliveryMethod?: string;
|
|
103
|
+
pageIndex: number;
|
|
104
|
+
pageSize: number;
|
|
105
|
+
}
|
|
106
|
+
/** 查询采购单详情(含明细列表) */
|
|
107
|
+
interface GetDetail {
|
|
108
|
+
purchaseOrderId: string;
|
|
109
|
+
productIds?: string[];
|
|
110
|
+
skuCodes?: string[];
|
|
111
|
+
skuIds?: string[];
|
|
112
|
+
pageIndex: number;
|
|
113
|
+
pageSize: number;
|
|
114
|
+
}
|
|
115
|
+
/** 导出采购单Excel,请求参数与列表查询保持一致 */
|
|
116
|
+
interface ExportExcel extends GetList {
|
|
117
|
+
}
|
|
118
|
+
/** 导入采购单Excel */
|
|
119
|
+
interface ImportExcel {
|
|
120
|
+
fileUrl: string;
|
|
121
|
+
categoryId: string;
|
|
122
|
+
operator: string;
|
|
123
|
+
}
|
|
124
|
+
/** 批量撤回已采购订单 */
|
|
125
|
+
interface BatchRevoke {
|
|
126
|
+
purchaseOrderIds: string[];
|
|
127
|
+
operator: string;
|
|
128
|
+
}
|
|
129
|
+
/** 批量提交采购单(待采购 -> 已采购) */
|
|
130
|
+
interface BatchSubmit {
|
|
131
|
+
purchaseIds?: string[];
|
|
132
|
+
purchaseDetailInfo?: PurchaseDetailIdInfo[];
|
|
133
|
+
operator: string;
|
|
134
|
+
}
|
|
135
|
+
/** 批量提交时的明细信息(可选覆盖采购数量、预计到仓日期、采购备注) */
|
|
136
|
+
interface PurchaseDetailIdInfo {
|
|
137
|
+
purchaseDetailId?: string;
|
|
138
|
+
purchaseQuantity?: number;
|
|
139
|
+
expectedArrivalDate?: number;
|
|
140
|
+
purchaseNote?: string;
|
|
141
|
+
}
|
|
142
|
+
/** 批量更新采购单明细 */
|
|
143
|
+
interface BatchUpdateDetail {
|
|
144
|
+
purchaseOrderId: string;
|
|
145
|
+
operator: string;
|
|
146
|
+
items: {
|
|
147
|
+
detailId: string;
|
|
148
|
+
updates: {
|
|
149
|
+
purchaseQuantity?: number;
|
|
150
|
+
expectedArrivalDate?: number;
|
|
151
|
+
purchaseNote?: string;
|
|
152
|
+
};
|
|
153
|
+
}[];
|
|
154
|
+
}
|
|
155
|
+
/** 删除采购单明细 */
|
|
156
|
+
interface DeleteDetail {
|
|
157
|
+
detailId: string;
|
|
158
|
+
operator: string;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** 响应结果定义(Demo) */
|
|
162
|
+
namespace Response {
|
|
163
|
+
/** 查询采购单类型列表响应 */
|
|
164
|
+
interface QueryCategoryList {
|
|
165
|
+
list: Entity.PurchaseCategory[];
|
|
166
|
+
total: number;
|
|
167
|
+
}
|
|
168
|
+
/** 新增采购单类型响应 */
|
|
169
|
+
interface AddCategory {
|
|
170
|
+
id: string;
|
|
171
|
+
categoryName: string;
|
|
172
|
+
}
|
|
173
|
+
/** 采购单列表项(列表页) */
|
|
174
|
+
interface ListItem {
|
|
175
|
+
purchasePreId: string;
|
|
176
|
+
purchaseId: string;
|
|
177
|
+
stockInOrderIds?: string[] | null;
|
|
178
|
+
supplierId?: string;
|
|
179
|
+
supplierName?: string;
|
|
180
|
+
categoryId?: string;
|
|
181
|
+
categoryName: string;
|
|
182
|
+
creator: string;
|
|
183
|
+
createdAt: number;
|
|
184
|
+
updatedAt: number;
|
|
185
|
+
status: ENUM.PURCHASE_ORDER_ENUM.STATUS;
|
|
186
|
+
deliveryMethod: ENUM.PURCHASE_ORDER_ENUM.DELIVERY_METHOD;
|
|
187
|
+
}
|
|
188
|
+
/** 查询采购单列表响应(列表页) */
|
|
189
|
+
interface GetList {
|
|
190
|
+
total: number;
|
|
191
|
+
list: ListItem[];
|
|
192
|
+
pendingCount: number;
|
|
193
|
+
purchasedCount: number;
|
|
194
|
+
}
|
|
195
|
+
/** 采购单详情中的主单信息(精简字段) */
|
|
196
|
+
interface DetailOrder {
|
|
197
|
+
id: string;
|
|
198
|
+
createdAt: number;
|
|
199
|
+
status: ENUM.PURCHASE_ORDER_ENUM.STATUS;
|
|
200
|
+
}
|
|
201
|
+
/** 采购单明细列表项 */
|
|
202
|
+
interface DetailItem extends Entity.PurchaseOrderDetailWithProduct {
|
|
203
|
+
}
|
|
204
|
+
/** 查询采购单详情响应(含明细列表) */
|
|
205
|
+
interface GetDetail {
|
|
206
|
+
order: DetailOrder;
|
|
207
|
+
details: DetailItem[];
|
|
208
|
+
total: number;
|
|
209
|
+
}
|
|
210
|
+
/** 导出采购单Excel的每一行字段 */
|
|
211
|
+
interface ExportExcelItem {
|
|
212
|
+
单号?: string;
|
|
213
|
+
类型?: string;
|
|
214
|
+
创建人?: string;
|
|
215
|
+
创建时间: string;
|
|
216
|
+
更新时间?: string;
|
|
217
|
+
状态?: string;
|
|
218
|
+
配送方式?: string;
|
|
219
|
+
productId?: string;
|
|
220
|
+
skuId?: string;
|
|
221
|
+
商品名称?: string;
|
|
222
|
+
规格明细?: string;
|
|
223
|
+
规格编码?: string;
|
|
224
|
+
商品分类?: string;
|
|
225
|
+
储藏方式?: string;
|
|
226
|
+
采购数量?: number;
|
|
227
|
+
供应商?: string;
|
|
228
|
+
目的地?: string;
|
|
229
|
+
联系人电话?: string;
|
|
230
|
+
预计到仓日期?: string;
|
|
231
|
+
采购备注?: string;
|
|
232
|
+
}
|
|
233
|
+
/** 导出采购单Excel响应 */
|
|
234
|
+
interface ExportExcel {
|
|
235
|
+
data: ExportExcelItem[];
|
|
236
|
+
headerMap: string[];
|
|
237
|
+
}
|
|
238
|
+
/** 导入采购单Excel响应 */
|
|
239
|
+
interface ImportExcel {
|
|
240
|
+
errorList: Array<{
|
|
241
|
+
row: number;
|
|
242
|
+
errors: string[];
|
|
243
|
+
}>;
|
|
244
|
+
}
|
|
245
|
+
/** 批量操作通用响应 */
|
|
246
|
+
interface BatchRevoke {
|
|
247
|
+
successCount: number;
|
|
248
|
+
failCount: number;
|
|
249
|
+
failReasons?: string[];
|
|
250
|
+
}
|
|
251
|
+
/** 批量提交采购单失败项 */
|
|
252
|
+
interface FailedOrderInfo {
|
|
253
|
+
sourceOrderId: string;
|
|
254
|
+
failReason: string;
|
|
255
|
+
errorCode: string;
|
|
256
|
+
}
|
|
257
|
+
/** 批量提交采购单响应 */
|
|
258
|
+
interface BatchSubmit {
|
|
259
|
+
successCount: number;
|
|
260
|
+
failCount: number;
|
|
261
|
+
failedOrders?: FailedOrderInfo[];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/** 控制器接口定义(Demo) */
|
|
265
|
+
interface PurchaseOrderController {
|
|
266
|
+
/** 查询采购单类型列表 */
|
|
267
|
+
queryCategoryList(request: Request.QueryCategoryList): Promise<Response.QueryCategoryList>;
|
|
268
|
+
/** 新增采购单类型 */
|
|
269
|
+
addCategory(request: Request.AddCategory): Promise<Response.AddCategory>;
|
|
270
|
+
/** 删除待采购单(仅待采购状态可删) */
|
|
271
|
+
delete(request: Request.Delete): Promise<void>;
|
|
272
|
+
/** 查询采购单列表(Demo) */
|
|
273
|
+
list(request: Request.GetList): Promise<Response.GetList>;
|
|
274
|
+
/** 查询采购单详情(含明细列表) */
|
|
275
|
+
detail(request: Request.GetDetail): Promise<Response.GetDetail>;
|
|
276
|
+
/** 导出采购单Excel */
|
|
277
|
+
exportExcel(request: Request.ExportExcel): Promise<Response.ExportExcel>;
|
|
278
|
+
/** 导入采购单Excel */
|
|
279
|
+
importExcel(request: Request.ImportExcel): Promise<Response.ImportExcel>;
|
|
280
|
+
/** 批量撤回已采购订单 */
|
|
281
|
+
batchRevoke(request: Request.BatchRevoke): Promise<Response.BatchRevoke>;
|
|
282
|
+
/** 批量提交采购单(待采购 -> 已采购) */
|
|
283
|
+
batchSubmit(request: Request.BatchSubmit): Promise<Response.BatchSubmit>;
|
|
284
|
+
/** 批量更新采购单明细 */
|
|
285
|
+
batchUpdateDetail(request: Request.BatchUpdateDetail): Promise<void>;
|
|
286
|
+
/** 删除采购单明细 */
|
|
287
|
+
deleteDetail(request: Request.DeleteDetail): Promise<void>;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
@@ -12,6 +12,7 @@ export declare namespace StoreReplenishOrderTypes {
|
|
|
12
12
|
status: string;
|
|
13
13
|
productId: string;
|
|
14
14
|
productName: string;
|
|
15
|
+
imgList: string[];
|
|
15
16
|
productImage?: string;
|
|
16
17
|
skuId: string;
|
|
17
18
|
skuCode: string;
|
|
@@ -25,6 +26,7 @@ export declare namespace StoreReplenishOrderTypes {
|
|
|
25
26
|
applyType: string;
|
|
26
27
|
storeName: string;
|
|
27
28
|
productImage?: string;
|
|
29
|
+
imgList: string[];
|
|
28
30
|
productName: string;
|
|
29
31
|
productId: string;
|
|
30
32
|
skuId: string;
|
|
@@ -146,6 +148,7 @@ export declare namespace StoreReplenishOrderTypes {
|
|
|
146
148
|
skuId: string;
|
|
147
149
|
skuCode: string;
|
|
148
150
|
productName: string;
|
|
151
|
+
imgList: string[];
|
|
149
152
|
dispatchType: string;
|
|
150
153
|
specName: string;
|
|
151
154
|
productImage?: string;
|
|
@@ -73,6 +73,8 @@ export declare namespace StoreStockInTypes {
|
|
|
73
73
|
productIds?: string[];
|
|
74
74
|
skuIds?: string[];
|
|
75
75
|
skuCodes?: string[];
|
|
76
|
+
minRemainingQuantity?: number;
|
|
77
|
+
maxRemainingQuantity?: number;
|
|
76
78
|
}
|
|
77
79
|
/** 查询入库单列表请求 */
|
|
78
80
|
interface GetList {
|
|
@@ -176,6 +178,7 @@ export declare namespace StoreStockInTypes {
|
|
|
176
178
|
}
|
|
177
179
|
/** 入库单商品项 */
|
|
178
180
|
interface StockInProductItem {
|
|
181
|
+
detailId: string;
|
|
179
182
|
productId: string;
|
|
180
183
|
productName: string;
|
|
181
184
|
skuId: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WarehouseInventoryTypes } from './types';
|
|
2
|
+
import BaseService from '../BaseService';
|
|
3
|
+
declare class WarehouseInventoryService extends BaseService implements WarehouseInventoryTypes.WarehouseInventoryController {
|
|
4
|
+
protected prefixUrl: string;
|
|
5
|
+
inventoryList(request: WarehouseInventoryTypes.Request.GetInventoryList): Promise<WarehouseInventoryTypes.Response.GetInventoryList>;
|
|
6
|
+
inventoryRecordList(request: WarehouseInventoryTypes.Request.GetInventoryRecordList): Promise<WarehouseInventoryTypes.Response.GetInventoryRecordList>;
|
|
7
|
+
importInventory(request: WarehouseInventoryTypes.Request.ImportInventory): Promise<WarehouseInventoryTypes.Response.ImportInventory>;
|
|
8
|
+
exportInventory(request: WarehouseInventoryTypes.Request.ExportInventory): Promise<WarehouseInventoryTypes.Response.ExportInventory>;
|
|
9
|
+
batchStockOperation(request: WarehouseInventoryTypes.Request.BatchStockOperation): Promise<void>;
|
|
10
|
+
setDeductionSwitch(request: WarehouseInventoryTypes.Request.SetDeductionSwitch): Promise<void>;
|
|
11
|
+
getDeductionSwitch(request: WarehouseInventoryTypes.Request.GetDeductionSwitch): Promise<WarehouseInventoryTypes.Response.GetDeductionSwitch>;
|
|
12
|
+
}
|
|
13
|
+
export declare const warehouseInventoryService: WarehouseInventoryService;
|
|
14
|
+
export default warehouseInventoryService;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
9
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.warehouseInventoryService = void 0;
|
|
16
|
+
const tsoa_1 = require("tsoa");
|
|
17
|
+
const http_1 = require("../../utils/http");
|
|
18
|
+
const BaseService_1 = __importDefault(require("../BaseService"));
|
|
19
|
+
let WarehouseInventoryService = class WarehouseInventoryService extends BaseService_1.default {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.prefixUrl = '/warehouse-inventory';
|
|
23
|
+
}
|
|
24
|
+
inventoryList(request) {
|
|
25
|
+
return (0, http_1.callApi)(this.getApiUrl(this.inventoryList), request);
|
|
26
|
+
}
|
|
27
|
+
inventoryRecordList(request) {
|
|
28
|
+
return (0, http_1.callApi)(this.getApiUrl(this.inventoryRecordList), request);
|
|
29
|
+
}
|
|
30
|
+
importInventory(request) {
|
|
31
|
+
return (0, http_1.callApi)(this.getApiUrl(this.importInventory), request);
|
|
32
|
+
}
|
|
33
|
+
exportInventory(request) {
|
|
34
|
+
return (0, http_1.callApi)(this.getApiUrl(this.exportInventory), request);
|
|
35
|
+
}
|
|
36
|
+
batchStockOperation(request) {
|
|
37
|
+
return (0, http_1.callApi)(this.getApiUrl(this.batchStockOperation), request);
|
|
38
|
+
}
|
|
39
|
+
setDeductionSwitch(request) {
|
|
40
|
+
return (0, http_1.callApi)(this.getApiUrl(this.setDeductionSwitch), request);
|
|
41
|
+
}
|
|
42
|
+
getDeductionSwitch(request) {
|
|
43
|
+
return (0, http_1.callApi)(this.getApiUrl(this.getDeductionSwitch), request);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, tsoa_1.Post)('inventory-list'),
|
|
48
|
+
__param(0, (0, tsoa_1.Body)())
|
|
49
|
+
], WarehouseInventoryService.prototype, "inventoryList", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, tsoa_1.Post)('inventory-record-list'),
|
|
52
|
+
__param(0, (0, tsoa_1.Body)())
|
|
53
|
+
], WarehouseInventoryService.prototype, "inventoryRecordList", null);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, tsoa_1.Post)('import-inventory'),
|
|
56
|
+
__param(0, (0, tsoa_1.Body)())
|
|
57
|
+
], WarehouseInventoryService.prototype, "importInventory", null);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, tsoa_1.Post)('export-inventory'),
|
|
60
|
+
__param(0, (0, tsoa_1.Body)())
|
|
61
|
+
], WarehouseInventoryService.prototype, "exportInventory", null);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, tsoa_1.Post)('batch-stock-operation'),
|
|
64
|
+
__param(0, (0, tsoa_1.Body)())
|
|
65
|
+
], WarehouseInventoryService.prototype, "batchStockOperation", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, tsoa_1.Post)('set-deduction-switch'),
|
|
68
|
+
__param(0, (0, tsoa_1.Body)())
|
|
69
|
+
], WarehouseInventoryService.prototype, "setDeductionSwitch", null);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, tsoa_1.Post)('get-deduction-switch'),
|
|
72
|
+
__param(0, (0, tsoa_1.Body)())
|
|
73
|
+
], WarehouseInventoryService.prototype, "getDeductionSwitch", null);
|
|
74
|
+
WarehouseInventoryService = __decorate([
|
|
75
|
+
(0, tsoa_1.Route)('WarehouseInventory'),
|
|
76
|
+
(0, tsoa_1.Tags)('warehouseInventory')
|
|
77
|
+
], WarehouseInventoryService);
|
|
78
|
+
exports.warehouseInventoryService = new WarehouseInventoryService();
|
|
79
|
+
exports.default = exports.warehouseInventoryService;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { ENUM } from '../../enum';
|
|
2
|
+
export declare namespace WarehouseInventoryTypes {
|
|
3
|
+
/** 库位信息 */
|
|
4
|
+
interface LocationInfo {
|
|
5
|
+
/** 库位编码 */
|
|
6
|
+
code: string;
|
|
7
|
+
}
|
|
8
|
+
/** 请求定义 */
|
|
9
|
+
namespace Request {
|
|
10
|
+
/** 仓库库存列表请求 */
|
|
11
|
+
interface GetInventoryList {
|
|
12
|
+
/** 仓库ID列表 */
|
|
13
|
+
warehouseIds?: string[];
|
|
14
|
+
/** 商品ID列表 */
|
|
15
|
+
productIds?: string[];
|
|
16
|
+
/** SKU ID列表 */
|
|
17
|
+
skuIds?: string[];
|
|
18
|
+
/** SKU编码列表 */
|
|
19
|
+
skuCodes?: string[];
|
|
20
|
+
/** 页码(必填) */
|
|
21
|
+
pageIndex: number;
|
|
22
|
+
/** 每页数量(必填) */
|
|
23
|
+
pageSize: number;
|
|
24
|
+
}
|
|
25
|
+
/** 库存流水列表请求 */
|
|
26
|
+
interface GetInventoryRecordList {
|
|
27
|
+
/** 仓库ID列表 */
|
|
28
|
+
warehouseId: string;
|
|
29
|
+
/** SKU ID */
|
|
30
|
+
skuId: string;
|
|
31
|
+
/** 操作类型 */
|
|
32
|
+
operationType?: ENUM.INVENTORY_ENUM.InventoryOperationType;
|
|
33
|
+
/** 创建时间范围起始(时间戳ms) */
|
|
34
|
+
createdAtStart?: number;
|
|
35
|
+
/** 创建时间范围结束(时间戳ms) */
|
|
36
|
+
createdAtEnd?: number;
|
|
37
|
+
/** 页码(必填) */
|
|
38
|
+
pageIndex: number;
|
|
39
|
+
/** 每页数量(必填) */
|
|
40
|
+
pageSize: number;
|
|
41
|
+
}
|
|
42
|
+
/** 导入库存 Excel 请求 */
|
|
43
|
+
interface ImportInventory {
|
|
44
|
+
/** Excel文件地址 */
|
|
45
|
+
fileUrl: string;
|
|
46
|
+
/** 仓库ID */
|
|
47
|
+
warehouseId: string;
|
|
48
|
+
/** 操作人 */
|
|
49
|
+
operator: string;
|
|
50
|
+
}
|
|
51
|
+
/** 导出库存 Excel 请求 */
|
|
52
|
+
interface ExportInventory {
|
|
53
|
+
/** 库存记录ID列表 */
|
|
54
|
+
ids?: string[];
|
|
55
|
+
/** 仓库ID列表 */
|
|
56
|
+
warehouseIds?: string[];
|
|
57
|
+
/** 商品ID列表 */
|
|
58
|
+
productIds?: string[];
|
|
59
|
+
/** SKU ID列表 */
|
|
60
|
+
skuIds?: string[];
|
|
61
|
+
/** SKU编码列表 */
|
|
62
|
+
skuCodes?: string[];
|
|
63
|
+
/** 页码(必填) */
|
|
64
|
+
pageIndex: number;
|
|
65
|
+
/** 每页数量(必填) */
|
|
66
|
+
pageSize: number;
|
|
67
|
+
}
|
|
68
|
+
/** 手动批量出入库请求 */
|
|
69
|
+
interface BatchStockOperation {
|
|
70
|
+
/** 仓库ID */
|
|
71
|
+
warehouseId: string;
|
|
72
|
+
/** 出入库类型:IN-入库, OUT-出库 */
|
|
73
|
+
type: 'IN' | 'OUT';
|
|
74
|
+
/** 商品列表 */
|
|
75
|
+
items: {
|
|
76
|
+
/** SKU ID */
|
|
77
|
+
skuId: string;
|
|
78
|
+
/** 数量 */
|
|
79
|
+
quantity: number;
|
|
80
|
+
}[];
|
|
81
|
+
/** 操作人姓名 */
|
|
82
|
+
operator: string;
|
|
83
|
+
/** 备注 */
|
|
84
|
+
remark?: string;
|
|
85
|
+
}
|
|
86
|
+
/** 控制扣减库存开关请求 */
|
|
87
|
+
interface SetDeductionSwitch {
|
|
88
|
+
/** 仓库ID */
|
|
89
|
+
warehouseId: string;
|
|
90
|
+
/** 是否启用扣减库存:1-启用, 0-禁用 */
|
|
91
|
+
enabled: 0 | 1;
|
|
92
|
+
/** 操作人 */
|
|
93
|
+
operator: string;
|
|
94
|
+
}
|
|
95
|
+
/** 获取扣减库存开关状态请求 */
|
|
96
|
+
interface GetDeductionSwitch {
|
|
97
|
+
/** 仓库ID */
|
|
98
|
+
warehouseId: string;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/** 响应定义 */
|
|
102
|
+
namespace Response {
|
|
103
|
+
/** 仓库库存列表项 */
|
|
104
|
+
interface InventoryListItem {
|
|
105
|
+
/** 库存id */
|
|
106
|
+
id: string;
|
|
107
|
+
/** 商品id */
|
|
108
|
+
productId?: string;
|
|
109
|
+
/** SKU id */
|
|
110
|
+
skuId?: string;
|
|
111
|
+
/** 商品名称 */
|
|
112
|
+
productName: string;
|
|
113
|
+
/** 商品图片 */
|
|
114
|
+
productImage: string;
|
|
115
|
+
/** 商品图片列表 */
|
|
116
|
+
imgList: string[];
|
|
117
|
+
/** SKU编码 */
|
|
118
|
+
skuCode: string;
|
|
119
|
+
/** 门店/仓库名称 */
|
|
120
|
+
warehouseName: string;
|
|
121
|
+
/** 规格详情(使用/分隔的规格值) */
|
|
122
|
+
specName: string;
|
|
123
|
+
/** 库存数量 */
|
|
124
|
+
availableStock: number;
|
|
125
|
+
/** 单价(分) */
|
|
126
|
+
price: number;
|
|
127
|
+
/** 最后更新时间 */
|
|
128
|
+
lastUpdateTime: number;
|
|
129
|
+
/** 仓库id */
|
|
130
|
+
warehouseId: string;
|
|
131
|
+
/** 库位信息数组 */
|
|
132
|
+
locationInfo?: LocationInfo[];
|
|
133
|
+
}
|
|
134
|
+
/** 仓库库存列表响应 */
|
|
135
|
+
interface GetInventoryList {
|
|
136
|
+
total: number;
|
|
137
|
+
list: InventoryListItem[];
|
|
138
|
+
}
|
|
139
|
+
/** 库存流水列表项 */
|
|
140
|
+
interface InventoryRecordListItem {
|
|
141
|
+
/** 流水ID */
|
|
142
|
+
id: string;
|
|
143
|
+
/** 操作类型:INBOUND-入库, OUTBOUND-出库 */
|
|
144
|
+
operationType: ENUM.INVENTORY_ENUM.InventoryOperationType;
|
|
145
|
+
/** 业务类型 */
|
|
146
|
+
bizType: ENUM.INVENTORY_ENUM.InventoryBizType;
|
|
147
|
+
/** 业务ID */
|
|
148
|
+
bizId: string;
|
|
149
|
+
/** SKU编码 */
|
|
150
|
+
skuCode: string;
|
|
151
|
+
/** 商品名称 */
|
|
152
|
+
productName: string;
|
|
153
|
+
/** 商品id */
|
|
154
|
+
productId: string;
|
|
155
|
+
/** skuid */
|
|
156
|
+
skuId: string;
|
|
157
|
+
/** 仓库ID */
|
|
158
|
+
warehouseId: string;
|
|
159
|
+
/** 仓库名称 */
|
|
160
|
+
warehouseName: string;
|
|
161
|
+
/** 数量(正数为入库,负数为出库) */
|
|
162
|
+
quantity: number;
|
|
163
|
+
/** 操作人 */
|
|
164
|
+
operator: string;
|
|
165
|
+
/** 备注 */
|
|
166
|
+
remark: string;
|
|
167
|
+
/** 操作时间 */
|
|
168
|
+
createdAt: number;
|
|
169
|
+
}
|
|
170
|
+
/** 库存流水列表响应 */
|
|
171
|
+
interface GetInventoryRecordList {
|
|
172
|
+
total: number;
|
|
173
|
+
list: InventoryRecordListItem[];
|
|
174
|
+
}
|
|
175
|
+
/** 导入库存 Excel 响应 */
|
|
176
|
+
interface ImportInventory {
|
|
177
|
+
errorList: Array<{
|
|
178
|
+
row: number;
|
|
179
|
+
errors: string[];
|
|
180
|
+
}>;
|
|
181
|
+
}
|
|
182
|
+
/** 导出库存 Excel 行数据 */
|
|
183
|
+
interface ExportInventoryItem {
|
|
184
|
+
productId: string;
|
|
185
|
+
skuId: string;
|
|
186
|
+
商品名称: string;
|
|
187
|
+
规格明细: string;
|
|
188
|
+
规格编码: string;
|
|
189
|
+
仓库: string;
|
|
190
|
+
库存: number;
|
|
191
|
+
单价: number;
|
|
192
|
+
数据更新时间: string;
|
|
193
|
+
库位信息: string;
|
|
194
|
+
}
|
|
195
|
+
/** 导出库存 Excel 响应 */
|
|
196
|
+
interface ExportInventory {
|
|
197
|
+
data: ExportInventoryItem[];
|
|
198
|
+
headerMap: string[];
|
|
199
|
+
}
|
|
200
|
+
/** 扣减库存开关状态响应 */
|
|
201
|
+
interface GetDeductionSwitch {
|
|
202
|
+
/** 仓库ID */
|
|
203
|
+
warehouseId: string;
|
|
204
|
+
/** 是否启用扣减库存:1-启用, 0-禁用 */
|
|
205
|
+
enabled: 0 | 1;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/** WarehouseInventory Controller 接口定义 */
|
|
209
|
+
interface WarehouseInventoryController {
|
|
210
|
+
/** 仓库库存列表 */
|
|
211
|
+
inventoryList(request: Request.GetInventoryList): Promise<Response.GetInventoryList>;
|
|
212
|
+
/** 查看库存流水记录列表 */
|
|
213
|
+
inventoryRecordList(request: Request.GetInventoryRecordList): Promise<Response.GetInventoryRecordList>;
|
|
214
|
+
/** 导入库存 Excel */
|
|
215
|
+
importInventory(request: Request.ImportInventory): Promise<Response.ImportInventory>;
|
|
216
|
+
/** 导出库存 Excel */
|
|
217
|
+
exportInventory(request: Request.ExportInventory): Promise<Response.ExportInventory>;
|
|
218
|
+
/** 手动批量出入库 */
|
|
219
|
+
batchStockOperation(request: Request.BatchStockOperation): Promise<void>;
|
|
220
|
+
/** 设置扣减库存开关 */
|
|
221
|
+
setDeductionSwitch(request: Request.SetDeductionSwitch): Promise<void>;
|
|
222
|
+
/** 获取扣减库存开关状态 */
|
|
223
|
+
getDeductionSwitch(request: Request.GetDeductionSwitch): Promise<Response.GetDeductionSwitch>;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WarehouseLocationTypes } from './types';
|
|
2
|
+
import BaseService from '../BaseService';
|
|
3
|
+
declare class WarehouseLocationService extends BaseService implements WarehouseLocationTypes.WarehouseLocationController {
|
|
4
|
+
protected prefixUrl: string;
|
|
5
|
+
importLocations(request: WarehouseLocationTypes.Request.ImportLocations): Promise<WarehouseLocationTypes.Response.ImportLocations>;
|
|
6
|
+
setLocation(request: WarehouseLocationTypes.Request.SetLocation): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const warehouseLocationService: WarehouseLocationService;
|
|
9
|
+
export default warehouseLocationService;
|