@things-factory/operato-hub 4.3.509 → 4.3.511
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/dist-server/graphql/resolvers/reports/shortage-report.js +2 -0
- package/dist-server/graphql/resolvers/reports/shortage-report.js.map +1 -1
- package/dist-server/graphql/types/reports/shortage-report-type.js +1 -0
- package/dist-server/graphql/types/reports/shortage-report-type.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js +35 -5
- package/dist-server/routers/api/restful-apis/v1/middlewares/logging-middleware.js.map +1 -1
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js +71 -101
- package/dist-server/routers/api/restful-apis/v1/warehouse/get-release-order-details.js.map +1 -1
- package/package.json +15 -14
- package/server/graphql/resolvers/reports/shortage-report.ts +2 -0
- package/server/graphql/types/reports/shortage-report-type.ts +1 -0
- package/server/routers/api/restful-apis/v1/middlewares/logging-middleware.ts +36 -5
- package/server/routers/api/restful-apis/v1/warehouse/get-release-order-details.ts +75 -103
|
@@ -62,6 +62,7 @@ exports.shortageReport = {
|
|
|
62
62
|
drg.ref_no,
|
|
63
63
|
p.sku AS "product_sku",
|
|
64
64
|
p."name" AS "product_name",
|
|
65
|
+
p."description" AS "product_description",
|
|
65
66
|
op.release_qty AS "order_quantity",
|
|
66
67
|
COALESCE(src.av_qty, 0) AS available_qty,
|
|
67
68
|
COALESCE(src.av_qty, 0) - op.release_qty AS "Nett_Stock",
|
|
@@ -139,6 +140,7 @@ exports.shortageReport = {
|
|
|
139
140
|
refNo: itm.ref_no,
|
|
140
141
|
productSku: itm.product_sku,
|
|
141
142
|
productName: itm.product_name,
|
|
143
|
+
productDescription: itm.product_description,
|
|
142
144
|
orderQty: itm.order_quantity,
|
|
143
145
|
avQty: itm.available_qty,
|
|
144
146
|
nettStock: itm.Nett_Stock,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortage-report.js","sourceRoot":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IAAI,gBAAgB,GAAG,OAAO,CAAC,KAAK;qBACjC,WAAW,EAAE;qBACb,KAAK,CAAC,GAAG,CAAC;qBACV,GAAG,CAAC,IAAI,CAAC,EAAE;oBACV,OAAO,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAA;gBACtD,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,CAAC,CAAA;gBAEZ,QAAQ,IAAI;2CACuB,gBAAgB;2CAChB,gBAAgB;2CAChB,gBAAgB;2CAChB,gBAAgB;8CACb,gBAAgB;8CAChB,gBAAgB;8CAChB,gBAAgB;;UAEpD,CAAA;aACH;YAED,IAAI,OAAO,EAAE;gBACX,IAAI,UAAU,GAAG,OAAO,CAAC,KAAK;qBAC3B,WAAW,EAAE;qBACb,KAAK,CAAC,GAAG,CAAC;qBACV,GAAG,CAAC,IAAI,CAAC,EAAE;oBACV,OAAO,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAA;gBACtD,CAAC,CAAC;qBACD,IAAI,CAAC,GAAG,CAAC,CAAA;gBAEZ,QAAQ,IAAI;2CACuB,UAAU;gDACL,UAAU;kDACR,UAAU;kDACV,UAAU;UAClD,CAAA;aACH;YAED,IAAI,QAAQ,EAAE;gBACZ,WAAW,IAAI,2BAA2B,QAAQ,CAAC,KAAK,GAAG,CAAA;aAC5D;YAED,IAAI,CAAC,cAAc,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM;gBAAE,MAAM,eAAe,CAAA;YAElE,MAAM,EAAE,CAAC,KAAK,CACZ
|
|
1
|
+
{"version":3,"file":"shortage-report.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/reports/shortage-report.ts"],"names":[],"mappings":";;;AAIa,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,MAAiB,EAAE,O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;OAEjC,CAAC,CAAA;YAEF,MAAM,MAAM,GAAQ,MAAM,EAAE,CAAC,KAAK,CAChC;;;OAGD,EACC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAClF,CAAA;YAED,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAC3B,OAAO;oBACL,YAAY,EAAE,GAAG,CAAC,OAAO;oBACzB,OAAO,EAAE,GAAG,CAAC,QAAQ;oBACrB,KAAK,EAAE,GAAG,CAAC,MAAM;oBACjB,UAAU,EAAE,GAAG,CAAC,WAAW;oBAC3B,WAAW,EAAE,GAAG,CAAC,YAAY;oBAC7B,kBAAkB,EAAE,GAAG,CAAC,mBAAmB;oBAC3C,QAAQ,EAAE,GAAG,CAAC,cAAc;oBAC5B,KAAK,EAAE,GAAG,CAAC,aAAa;oBACxB,SAAS,EAAE,GAAG,CAAC,UAAU;oBACzB,eAAe,EAAE,GAAG,CAAC,gBAAgB;oBACrC,KAAK,EAAE,GAAG,CAAC,KAAK;oBAChB,IAAI,EAAE,GAAG,CAAC,IAAI;oBACd,OAAO,EAAE,GAAG,CAAC,OAAO;oBACpB,SAAS,EAAE,GAAG,CAAC,UAAU;iBAC1B,CAAA;YACH,CAAC,CAAC,CAAA;YAEF,OAAO;gBACL,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;aACtB,CAAA;SACF;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,KAAK,CAAA;SACZ;IACH,CAAC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortage-report-type.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/shortage-report-type.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA
|
|
1
|
+
{"version":3,"file":"shortage-report-type.js","sourceRoot":"","sources":["../../../../server/graphql/types/reports/shortage-report-type.ts"],"names":[],"mappings":";;;;;;AAAA,8DAA6B;AAEhB,QAAA,cAAc,GAAG,IAAA,qBAAG,EAAA;;;;;;;;;;;;;;;;;CAiBhC,CAAA"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.loggingMiddleware = void 0;
|
|
4
7
|
const integration_base_1 = require("@things-factory/integration-base");
|
|
8
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
const { performance } = require('node:perf_hooks');
|
|
11
|
+
// Requiring module
|
|
12
|
+
var process = require('process');
|
|
5
13
|
// inserts payload log after successful endpoint request
|
|
6
14
|
async function loggingMiddleware(context, next) {
|
|
7
|
-
|
|
8
|
-
|
|
15
|
+
const requestId = (0, uuid_1.v7)();
|
|
16
|
+
let startMemory = node_os_1.default.freemem();
|
|
17
|
+
let metrics = {};
|
|
18
|
+
let response = null;
|
|
9
19
|
// name of requester's domain
|
|
10
20
|
const name = context.state.domain.name;
|
|
11
21
|
// endpoint that was queried
|
|
@@ -15,9 +25,29 @@ async function loggingMiddleware(context, next) {
|
|
|
15
25
|
query: context.query,
|
|
16
26
|
requestBody: context.request.body
|
|
17
27
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
try {
|
|
29
|
+
performance.mark('start');
|
|
30
|
+
// wait for endpoint logic to complete
|
|
31
|
+
await next();
|
|
32
|
+
// response
|
|
33
|
+
response = context.body;
|
|
34
|
+
context.body = Object.assign(Object.assign({}, context.body), { requestId });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
response = error;
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
performance.mark('end');
|
|
42
|
+
metrics["time"] = performance.measure('API', 'start', 'end');
|
|
43
|
+
metrics["memUsed"] = formatMemoryUsage(node_os_1.default.freemem() - startMemory);
|
|
44
|
+
Object.entries(process.memoryUsage()).map(([key, value]) => {
|
|
45
|
+
metrics[key] = formatMemoryUsage(value);
|
|
46
|
+
});
|
|
47
|
+
console.info(metrics);
|
|
48
|
+
await (0, integration_base_1.createPayloadLog)(name, endpoint, request, response, context, integration_base_1.PayloadType.INGESTION, null, JSON.stringify(metrics), requestId);
|
|
49
|
+
}
|
|
21
50
|
}
|
|
22
51
|
exports.loggingMiddleware = loggingMiddleware;
|
|
52
|
+
const formatMemoryUsage = (bytes) => `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
23
53
|
//# sourceMappingURL=logging-middleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging-middleware.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/middlewares/logging-middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logging-middleware.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/middlewares/logging-middleware.ts"],"names":[],"mappings":";;;;;;AAAA,uEAAgF;AAEhF,sDAAyB;AACzB,+BAAmC;AACnC,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD,oBAAoB;AACpB,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAGhC,wDAAwD;AACjD,KAAK,UAAU,iBAAiB,CAAC,OAAO,EAAE,IAAI;IACnD,MAAM,SAAS,GAAG,IAAA,SAAM,GAAE,CAAA;IAC1B,IAAI,WAAW,GAAG,iBAAE,CAAC,OAAO,EAAE,CAAA;IAC9B,IAAI,OAAO,GAAG,EAAE,CAAA;IAChB,IAAI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QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,8BAAW,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAA;KACpI;AACH,CAAC;AA1CD,8CA0CC;AAED,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC"}
|
|
@@ -11,7 +11,6 @@ const sales_base_1 = require("@things-factory/sales-base");
|
|
|
11
11
|
const middlewares_1 = require("../middlewares");
|
|
12
12
|
const error_util_1 = require("../utils/error-util");
|
|
13
13
|
api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middlewares_1.businessMiddleware, middlewares_1.validationMiddleware, middlewares_1.loggingMiddleware, async (context, next) => {
|
|
14
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15
14
|
try {
|
|
16
15
|
// get contact points for that bizplace
|
|
17
16
|
// optional query parameter filter
|
|
@@ -40,14 +39,6 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middleware
|
|
|
40
39
|
const releaseGood = await (0, typeorm_1.getRepository)(sales_base_1.ReleaseGood).findOne({
|
|
41
40
|
where: filter,
|
|
42
41
|
relations: [
|
|
43
|
-
'orderInventories',
|
|
44
|
-
'orderInventories.product',
|
|
45
|
-
'orderInventories.productDetail',
|
|
46
|
-
'orderInventories.orderProduct',
|
|
47
|
-
'orderInventories.orderToteItems',
|
|
48
|
-
'orderInventories.orderToteItems.orderTote',
|
|
49
|
-
'orderInventories.orderToteItems.orderTote.orderToteSeals',
|
|
50
|
-
'orderInventories.orderProduct.productBundle',
|
|
51
42
|
'orderPackages',
|
|
52
43
|
'orderPackages.orderPackageItems',
|
|
53
44
|
'bizplace'
|
|
@@ -55,30 +46,55 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middleware
|
|
|
55
46
|
});
|
|
56
47
|
if (!releaseGood)
|
|
57
48
|
throw new error_util_1.ApiError('E04', `release order: ${filter['name']}`);
|
|
49
|
+
const rgOrderInventories = await (0, typeorm_1.getRepository)(sales_base_1.OrderInventory).createQueryBuilder('oi')
|
|
50
|
+
.leftJoinAndSelect('products', 'p', 'p.id = oi.product_id')
|
|
51
|
+
.leftJoinAndSelect('product_details', 'pd', 'pd.id = oi.product_detail_id')
|
|
52
|
+
.leftJoinAndSelect('order_products', 'op', 'op.id = oi.order_product_id')
|
|
53
|
+
.leftJoinAndSelect('product_bundles', 'pdb', 'pdb.id = op.product_bundle_id')
|
|
54
|
+
.leftJoinAndSelect('delivery_orders', 'do', 'do.id = oi.delivery_order_id')
|
|
55
|
+
.where('oi.release_good_id = :releaseGoodId', { releaseGoodId: releaseGood.id })
|
|
56
|
+
.orderBy('p.sku', 'ASC')
|
|
57
|
+
.orderBy('pd.name', 'ASC')
|
|
58
|
+
.getRawMany();
|
|
59
|
+
const rgOrderToteItems = await (0, typeorm_1.getRepository)(sales_base_1.OrderToteItem).createQueryBuilder('oti')
|
|
60
|
+
.innerJoinAndSelect('oti.orderTote', 'ot')
|
|
61
|
+
.innerJoinAndSelect('ot.orderToteSeals', 'os')
|
|
62
|
+
.where('oti.order_inventory_id In (:...orderInventoryIds)', { orderInventoryIds: rgOrderInventories.map(src => src.oi_id) })
|
|
63
|
+
.getMany();
|
|
58
64
|
// create and format data response
|
|
59
|
-
let orderInventories =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
let orderInventories = rgOrderInventories.map(src => {
|
|
66
|
+
return {
|
|
67
|
+
id: src.oi_id,
|
|
68
|
+
releaseQty: src.oi_release_qty,
|
|
69
|
+
packingType: src.oi_packing_type,
|
|
70
|
+
packingSize: src.oi_packing_size,
|
|
71
|
+
batchId: src.oi_batch_id,
|
|
63
72
|
product: {
|
|
64
|
-
sku:
|
|
73
|
+
sku: src.p_sku,
|
|
65
74
|
productDetail: {
|
|
66
|
-
refCode:
|
|
67
|
-
name:
|
|
75
|
+
refCode: src.pd_ref_code,
|
|
76
|
+
name: src.pd_name
|
|
68
77
|
}
|
|
69
78
|
},
|
|
79
|
+
productDetail: {
|
|
80
|
+
refCode: src.pd_ref_code,
|
|
81
|
+
name: src.pd_name
|
|
82
|
+
},
|
|
70
83
|
orderProduct: {
|
|
84
|
+
product: {
|
|
85
|
+
sku: src.p_sku,
|
|
86
|
+
productDetail: {
|
|
87
|
+
refCode: src.pd_ref_code,
|
|
88
|
+
name: src.pd_name
|
|
89
|
+
}
|
|
90
|
+
},
|
|
71
91
|
productBundle: {
|
|
72
|
-
sku:
|
|
73
|
-
name:
|
|
92
|
+
sku: src.pdb_sku,
|
|
93
|
+
name: src.pdb_name
|
|
74
94
|
},
|
|
75
|
-
releaseQty:
|
|
95
|
+
releaseQty: src.op_releaseQty
|
|
76
96
|
},
|
|
77
|
-
|
|
78
|
-
packingType: orderInventory.packingType,
|
|
79
|
-
packingSize: orderInventory.packingSize,
|
|
80
|
-
releaseQty: orderInventory.releaseQty,
|
|
81
|
-
orderToteItems: orderInventory.orderToteItems.map(oti => {
|
|
97
|
+
orderToteItems: rgOrderToteItems.filter(oti => oti.orderInventoryId === src.oi_id).map(oti => {
|
|
82
98
|
return {
|
|
83
99
|
qty: oti.qty,
|
|
84
100
|
orderTote: {
|
|
@@ -90,10 +106,13 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middleware
|
|
|
90
106
|
})
|
|
91
107
|
}
|
|
92
108
|
};
|
|
93
|
-
})
|
|
109
|
+
}),
|
|
110
|
+
deliveryOrder: {
|
|
111
|
+
id: src.do_id,
|
|
112
|
+
name: src.do_name
|
|
113
|
+
}
|
|
94
114
|
};
|
|
95
|
-
|
|
96
|
-
}
|
|
115
|
+
});
|
|
97
116
|
let orderPackages = [];
|
|
98
117
|
for (const orderPackage of releaseGood.orderPackages) {
|
|
99
118
|
const orderPackagesDataPoint = {
|
|
@@ -113,86 +132,37 @@ api_1.restfulApiRouter.get('/v1/warehouse/get-release-order-details', middleware
|
|
|
113
132
|
deliveryOrders = await (0, typeorm_1.getRepository)(sales_base_1.DeliveryOrder).find({
|
|
114
133
|
where: { releaseGood: releaseGood.id },
|
|
115
134
|
relations: [
|
|
116
|
-
'orderInventories',
|
|
117
|
-
'orderInventories.product',
|
|
118
|
-
'orderInventories.productDetail',
|
|
119
|
-
'orderInventories.orderToteItems',
|
|
120
|
-
'orderInventories.orderToteItems.orderTote',
|
|
121
|
-
'orderInventories.orderToteItems.orderTote.orderToteSeals',
|
|
122
135
|
'transportDriver',
|
|
123
136
|
'transportVehicle',
|
|
124
137
|
'creator',
|
|
125
138
|
'updater'
|
|
126
139
|
]
|
|
127
140
|
});
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
transportDriver: deliveryOrder.transportDriver
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
transportVehicle: deliveryOrder.transportVehicle
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
id: oi.id,
|
|
154
|
-
releaseQty: oi.releaseQty,
|
|
155
|
-
releaseUomValue: oi.releaseUomValue,
|
|
156
|
-
packingType: oi.packingType,
|
|
157
|
-
packingSize: oi.packingSize,
|
|
158
|
-
remark: oi.remark,
|
|
159
|
-
batchId: oi.batchId,
|
|
160
|
-
product: {
|
|
161
|
-
id: oi.product.id,
|
|
162
|
-
name: oi.product.name,
|
|
163
|
-
description: oi.product.description,
|
|
164
|
-
sku: oi.product.sku
|
|
165
|
-
},
|
|
166
|
-
productDetail: { refCode: oi.productDetail.refCode ? oi.productDetail.refCode : null },
|
|
167
|
-
orderToteItems: oi.orderToteItems.map(oti => {
|
|
168
|
-
return {
|
|
169
|
-
qty: oti.qty,
|
|
170
|
-
orderTote: {
|
|
171
|
-
name: oti.orderTote.name,
|
|
172
|
-
orderToteSeals: oti.orderTote.orderToteSeals.map(ots => {
|
|
173
|
-
return {
|
|
174
|
-
name: ots.name
|
|
175
|
-
};
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
})
|
|
180
|
-
};
|
|
181
|
-
})
|
|
182
|
-
// {
|
|
183
|
-
// product: deliveryOrder.orderInventories.map(oi => {
|
|
184
|
-
// return {
|
|
185
|
-
// id: oi.product.id,
|
|
186
|
-
// name: oi.product.name,
|
|
187
|
-
// description: oi.product.description,
|
|
188
|
-
// sku: oi.product.sku,
|
|
189
|
-
// productDetail: { refCode: oi.productDetail.refCode }
|
|
190
|
-
// }
|
|
191
|
-
// }),
|
|
192
|
-
// }
|
|
193
|
-
};
|
|
194
|
-
});
|
|
195
|
-
}
|
|
141
|
+
deliveryOrders = deliveryOrders.map(deliveryOrder => {
|
|
142
|
+
return {
|
|
143
|
+
id: deliveryOrder.id,
|
|
144
|
+
name: deliveryOrder.name,
|
|
145
|
+
to: deliveryOrder.to,
|
|
146
|
+
truckNo: deliveryOrder.truckNo,
|
|
147
|
+
ownCollection: deliveryOrder.ownCollection,
|
|
148
|
+
looseItem: deliveryOrder.looseItem,
|
|
149
|
+
deliveryDate: deliveryOrder.deliveryDate,
|
|
150
|
+
palletQty: deliveryOrder.palletQty,
|
|
151
|
+
remark: deliveryOrder.remark,
|
|
152
|
+
status: deliveryOrder.status,
|
|
153
|
+
creator: deliveryOrder.creator ? { id: deliveryOrder.creator.id, name: deliveryOrder.creator.name } : null,
|
|
154
|
+
createdAt: deliveryOrder.createdAt,
|
|
155
|
+
updater: deliveryOrder.updater ? { id: deliveryOrder.updater.id, name: deliveryOrder.updater.name } : null,
|
|
156
|
+
updatedAt: deliveryOrder.updatedAt,
|
|
157
|
+
transportDriver: deliveryOrder.transportDriver
|
|
158
|
+
? { id: deliveryOrder.transportDriver.id, name: deliveryOrder.transportDriver.name }
|
|
159
|
+
: null,
|
|
160
|
+
transportVehicle: deliveryOrder.transportVehicle
|
|
161
|
+
? { id: deliveryOrder.transportVehicle.id, name: deliveryOrder.transportVehicle.name }
|
|
162
|
+
: null,
|
|
163
|
+
orderInventories: orderInventories.filter(oi => oi.deliveryOrder.id === deliveryOrder.id) || null
|
|
164
|
+
};
|
|
165
|
+
});
|
|
196
166
|
let attachments = [];
|
|
197
167
|
attachments = await (0, typeorm_1.getRepository)(attachment_base_1.Attachment).find({
|
|
198
168
|
where: { refBy: releaseGood.id }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-release-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-release-order-details.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,
|
|
1
|
+
{"version":3,"file":"get-release-order-details.js","sourceRoot":"","sources":["../../../../../../server/routers/api/restful-apis/v1/warehouse/get-release-order-details.ts"],"names":[],"mappings":";;;;;AAAA,oDAAsB;AACtB,qCAAqD;AAErD,6CAAgE;AAChE,qEAA4D;AAC5D,2DAAsG;AAEtG,gDAA4F;AAC5F,oDAAyF;AAEzF,sBAAM,CAAC,GAAG,CACR,yCAAyC,EACzC,gCAAkB,EAClB,kCAAoB,EACpB,+BAAiB,EACjB,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACtB,IAAI;QACF,uCAAuC;QACvC,kCAAkC;QAClC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,IAAI,MAAM,mCAAQ,OAAO,CAAC,KAAK,KAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAE,CAAA;QACpD,IAAI,gBAAC,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE;YAC/B,MAAM,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA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E,CAAC,CAAC,CAAA;;YACjD,IAAA,qCAAwB,EAAC,OAAO,EAAE,CAAC,CAAC,CAAA;KAC1C;AACH,CAAC,CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/operato-hub",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.511",
|
|
4
4
|
"main": "dist-server/index.js",
|
|
5
5
|
"browser": "client/index.js",
|
|
6
6
|
"things-factory": true,
|
|
@@ -77,22 +77,22 @@
|
|
|
77
77
|
"@things-factory/i18n-base": "^4.3.434",
|
|
78
78
|
"@things-factory/import-ui": "^4.3.434",
|
|
79
79
|
"@things-factory/import-ui-excel": "^4.3.434",
|
|
80
|
-
"@things-factory/integration-accounting": "^4.3.
|
|
81
|
-
"@things-factory/integration-fulfillment": "^4.3.
|
|
82
|
-
"@things-factory/integration-lmd": "^4.3.
|
|
83
|
-
"@things-factory/integration-marketplace": "^4.3.
|
|
84
|
-
"@things-factory/integration-pos": "^4.3.
|
|
85
|
-
"@things-factory/integration-powrup": "^4.3.
|
|
86
|
-
"@things-factory/integration-sellercraft": "^4.3.
|
|
87
|
-
"@things-factory/integration-sftp": "^4.3.
|
|
80
|
+
"@things-factory/integration-accounting": "^4.3.511",
|
|
81
|
+
"@things-factory/integration-fulfillment": "^4.3.511",
|
|
82
|
+
"@things-factory/integration-lmd": "^4.3.511",
|
|
83
|
+
"@things-factory/integration-marketplace": "^4.3.511",
|
|
84
|
+
"@things-factory/integration-pos": "^4.3.511",
|
|
85
|
+
"@things-factory/integration-powrup": "^4.3.511",
|
|
86
|
+
"@things-factory/integration-sellercraft": "^4.3.511",
|
|
87
|
+
"@things-factory/integration-sftp": "^4.3.511",
|
|
88
88
|
"@things-factory/lite-menu": "^4.3.452",
|
|
89
|
-
"@things-factory/marketplace-base": "^4.3.
|
|
89
|
+
"@things-factory/marketplace-base": "^4.3.511",
|
|
90
90
|
"@things-factory/more-ui": "^4.3.434",
|
|
91
91
|
"@things-factory/notification": "^4.3.452",
|
|
92
92
|
"@things-factory/pdf": "^4.3.381",
|
|
93
93
|
"@things-factory/product-ui": "^4.3.495",
|
|
94
94
|
"@things-factory/resource-ui": "^4.3.452",
|
|
95
|
-
"@things-factory/sales-base": "^4.3.
|
|
95
|
+
"@things-factory/sales-base": "^4.3.511",
|
|
96
96
|
"@things-factory/scene-data-transform": "^4.3.381",
|
|
97
97
|
"@things-factory/scene-excel": "^4.3.381",
|
|
98
98
|
"@things-factory/scene-firebase": "^4.3.381",
|
|
@@ -108,11 +108,12 @@
|
|
|
108
108
|
"@things-factory/shell": "^4.3.434",
|
|
109
109
|
"@things-factory/system-ui": "^4.3.434",
|
|
110
110
|
"@things-factory/transport-base": "^4.3.452",
|
|
111
|
-
"@things-factory/warehouse-base": "^4.3.
|
|
112
|
-
"@things-factory/worksheet-base": "^4.3.
|
|
111
|
+
"@things-factory/warehouse-base": "^4.3.511",
|
|
112
|
+
"@things-factory/worksheet-base": "^4.3.511",
|
|
113
113
|
"cron-parser": "^4.7.0",
|
|
114
114
|
"koa2-swagger-ui": "^5.0.2",
|
|
115
115
|
"swagger-jsdoc": "^5.0.0",
|
|
116
|
+
"uuid": "10.0.0",
|
|
116
117
|
"yamljs": "^0.3.0"
|
|
117
118
|
},
|
|
118
119
|
"devDependencies": {
|
|
@@ -121,5 +122,5 @@
|
|
|
121
122
|
"resolutions": {
|
|
122
123
|
"core-js": "^3.16.0"
|
|
123
124
|
},
|
|
124
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "b108f8e502be7af81552b9d8d31e585450e18d7e"
|
|
125
126
|
}
|
|
@@ -72,6 +72,7 @@ export const shortageReport = {
|
|
|
72
72
|
drg.ref_no,
|
|
73
73
|
p.sku AS "product_sku",
|
|
74
74
|
p."name" AS "product_name",
|
|
75
|
+
p."description" AS "product_description",
|
|
75
76
|
op.release_qty AS "order_quantity",
|
|
76
77
|
COALESCE(src.av_qty, 0) AS available_qty,
|
|
77
78
|
COALESCE(src.av_qty, 0) - op.release_qty AS "Nett_Stock",
|
|
@@ -157,6 +158,7 @@ export const shortageReport = {
|
|
|
157
158
|
refNo: itm.ref_no,
|
|
158
159
|
productSku: itm.product_sku,
|
|
159
160
|
productName: itm.product_name,
|
|
161
|
+
productDescription: itm.product_description,
|
|
160
162
|
orderQty: itm.order_quantity,
|
|
161
163
|
avQty: itm.available_qty,
|
|
162
164
|
nettStock: itm.Nett_Stock,
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { createPayloadLog, PayloadType } from '@things-factory/integration-base'
|
|
2
2
|
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { v7 as uuidv7 } from 'uuid'
|
|
5
|
+
const { performance } = require('node:perf_hooks');
|
|
6
|
+
// Requiring module
|
|
7
|
+
var process = require('process')
|
|
8
|
+
|
|
9
|
+
|
|
3
10
|
// inserts payload log after successful endpoint request
|
|
4
11
|
export async function loggingMiddleware(context, next) {
|
|
5
|
-
|
|
6
|
-
|
|
12
|
+
const requestId = uuidv7()
|
|
13
|
+
let startMemory = os.freemem()
|
|
14
|
+
let metrics = {}
|
|
15
|
+
let response = null
|
|
7
16
|
|
|
8
17
|
// name of requester's domain
|
|
9
18
|
const name = context.state.domain.name
|
|
@@ -17,8 +26,30 @@ export async function loggingMiddleware(context, next) {
|
|
|
17
26
|
requestBody: context.request.body
|
|
18
27
|
}
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
try {
|
|
30
|
+
performance.mark('start')
|
|
31
|
+
// wait for endpoint logic to complete
|
|
32
|
+
await next()
|
|
33
|
+
|
|
34
|
+
// response
|
|
35
|
+
response = context.body
|
|
36
|
+
context.body = { ...context.body, requestId }
|
|
37
|
+
|
|
38
|
+
} catch (error) {
|
|
39
|
+
response = error
|
|
40
|
+
throw error
|
|
41
|
+
} finally {
|
|
42
|
+
performance.mark('end')
|
|
43
|
+
metrics["time"] = performance.measure('API', 'start', 'end')
|
|
44
|
+
metrics["memUsed"] = formatMemoryUsage(os.freemem() - startMemory)
|
|
22
45
|
|
|
23
|
-
|
|
46
|
+
Object.entries(process.memoryUsage()).map(([key, value]) => {
|
|
47
|
+
metrics[key] = formatMemoryUsage(value as number)
|
|
48
|
+
})
|
|
49
|
+
console.info(metrics)
|
|
50
|
+
|
|
51
|
+
await createPayloadLog(name, endpoint, request, response, context, PayloadType.INGESTION, null, JSON.stringify(metrics), requestId)
|
|
52
|
+
}
|
|
24
53
|
}
|
|
54
|
+
|
|
55
|
+
const formatMemoryUsage = (bytes: number) => `${(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _ from 'lodash'
|
|
2
|
-
import { getRepository } from 'typeorm'
|
|
2
|
+
import { getRepository, QueryBuilder } from 'typeorm'
|
|
3
3
|
|
|
4
4
|
import { restfulApiRouter as router } from '@things-factory/api'
|
|
5
5
|
import { Attachment } from '@things-factory/attachment-base'
|
|
6
|
-
import { DeliveryOrder, ReleaseGood } from '@things-factory/sales-base'
|
|
6
|
+
import { DeliveryOrder, ReleaseGood, OrderInventory, OrderToteItem } from '@things-factory/sales-base'
|
|
7
7
|
|
|
8
8
|
import { businessMiddleware, loggingMiddleware, validationMiddleware } from '../middlewares'
|
|
9
9
|
import { ApiError, ApiErrorHandler, throwInternalServerError } from '../utils/error-util'
|
|
@@ -47,14 +47,6 @@ router.get(
|
|
|
47
47
|
const releaseGood: ReleaseGood = await getRepository(ReleaseGood).findOne({
|
|
48
48
|
where: filter,
|
|
49
49
|
relations: [
|
|
50
|
-
'orderInventories',
|
|
51
|
-
'orderInventories.product',
|
|
52
|
-
'orderInventories.productDetail',
|
|
53
|
-
'orderInventories.orderProduct',
|
|
54
|
-
'orderInventories.orderToteItems',
|
|
55
|
-
'orderInventories.orderToteItems.orderTote',
|
|
56
|
-
'orderInventories.orderToteItems.orderTote.orderToteSeals',
|
|
57
|
-
'orderInventories.orderProduct.productBundle',
|
|
58
50
|
'orderPackages',
|
|
59
51
|
'orderPackages.orderPackageItems',
|
|
60
52
|
'bizplace'
|
|
@@ -63,30 +55,57 @@ router.get(
|
|
|
63
55
|
|
|
64
56
|
if (!releaseGood) throw new ApiError('E04', `release order: ${filter['name']}`)
|
|
65
57
|
|
|
58
|
+
const rgOrderInventories: any[] = await getRepository(OrderInventory).createQueryBuilder('oi')
|
|
59
|
+
.leftJoinAndSelect('products', 'p', 'p.id = oi.product_id')
|
|
60
|
+
.leftJoinAndSelect('product_details', 'pd', 'pd.id = oi.product_detail_id')
|
|
61
|
+
.leftJoinAndSelect('order_products', 'op', 'op.id = oi.order_product_id')
|
|
62
|
+
.leftJoinAndSelect('product_bundles', 'pdb', 'pdb.id = op.product_bundle_id')
|
|
63
|
+
.leftJoinAndSelect('delivery_orders', 'do', 'do.id = oi.delivery_order_id')
|
|
64
|
+
.where('oi.release_good_id = :releaseGoodId', { releaseGoodId: releaseGood.id })
|
|
65
|
+
.orderBy('p.sku', 'ASC')
|
|
66
|
+
.orderBy('pd.name', 'ASC')
|
|
67
|
+
.getRawMany()
|
|
68
|
+
|
|
69
|
+
const rgOrderToteItems: OrderToteItem[] = await getRepository(OrderToteItem).createQueryBuilder('oti')
|
|
70
|
+
.innerJoinAndSelect('oti.orderTote', 'ot')
|
|
71
|
+
.innerJoinAndSelect('ot.orderToteSeals', 'os')
|
|
72
|
+
.where('oti.order_inventory_id In (:...orderInventoryIds)', { orderInventoryIds: rgOrderInventories.map(src => src.oi_id) })
|
|
73
|
+
.getMany()
|
|
74
|
+
|
|
66
75
|
// create and format data response
|
|
67
|
-
let orderInventories =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
let orderInventories: OrderInventory[] = rgOrderInventories.map(src => {
|
|
77
|
+
return {
|
|
78
|
+
id: src.oi_id,
|
|
79
|
+
releaseQty: src.oi_release_qty,
|
|
80
|
+
packingType: src.oi_packing_type,
|
|
81
|
+
packingSize: src.oi_packing_size,
|
|
82
|
+
batchId: src.oi_batch_id,
|
|
71
83
|
product: {
|
|
72
|
-
sku:
|
|
84
|
+
sku: src.p_sku,
|
|
73
85
|
productDetail: {
|
|
74
|
-
refCode:
|
|
75
|
-
name:
|
|
86
|
+
refCode: src.pd_ref_code,
|
|
87
|
+
name: src.pd_name
|
|
76
88
|
}
|
|
77
89
|
},
|
|
90
|
+
productDetail: {
|
|
91
|
+
refCode: src.pd_ref_code,
|
|
92
|
+
name: src.pd_name
|
|
93
|
+
},
|
|
78
94
|
orderProduct: {
|
|
95
|
+
product: {
|
|
96
|
+
sku: src.p_sku,
|
|
97
|
+
productDetail: {
|
|
98
|
+
refCode: src.pd_ref_code,
|
|
99
|
+
name: src.pd_name
|
|
100
|
+
}
|
|
101
|
+
},
|
|
79
102
|
productBundle: {
|
|
80
|
-
sku:
|
|
81
|
-
name:
|
|
103
|
+
sku: src.pdb_sku,
|
|
104
|
+
name: src.pdb_name
|
|
82
105
|
},
|
|
83
|
-
releaseQty:
|
|
106
|
+
releaseQty: src.op_releaseQty
|
|
84
107
|
},
|
|
85
|
-
|
|
86
|
-
packingType: orderInventory.packingType,
|
|
87
|
-
packingSize: orderInventory.packingSize,
|
|
88
|
-
releaseQty: orderInventory.releaseQty,
|
|
89
|
-
orderToteItems: orderInventory.orderToteItems.map(oti => {
|
|
108
|
+
orderToteItems: rgOrderToteItems.filter(oti => oti.orderInventoryId === src.oi_id).map(oti => {
|
|
90
109
|
return {
|
|
91
110
|
qty: oti.qty,
|
|
92
111
|
orderTote: {
|
|
@@ -98,10 +117,13 @@ router.get(
|
|
|
98
117
|
})
|
|
99
118
|
}
|
|
100
119
|
}
|
|
101
|
-
})
|
|
120
|
+
}),
|
|
121
|
+
deliveryOrder: {
|
|
122
|
+
id: src.do_id,
|
|
123
|
+
name: src.do_name
|
|
124
|
+
}
|
|
102
125
|
}
|
|
103
|
-
|
|
104
|
-
}
|
|
126
|
+
})
|
|
105
127
|
|
|
106
128
|
let orderPackages = []
|
|
107
129
|
for (const orderPackage of releaseGood.orderPackages) {
|
|
@@ -123,12 +145,6 @@ router.get(
|
|
|
123
145
|
deliveryOrders = await getRepository(DeliveryOrder).find({
|
|
124
146
|
where: { releaseGood: releaseGood.id },
|
|
125
147
|
relations: [
|
|
126
|
-
'orderInventories',
|
|
127
|
-
'orderInventories.product',
|
|
128
|
-
'orderInventories.productDetail',
|
|
129
|
-
'orderInventories.orderToteItems',
|
|
130
|
-
'orderInventories.orderToteItems.orderTote',
|
|
131
|
-
'orderInventories.orderToteItems.orderTote.orderToteSeals',
|
|
132
148
|
'transportDriver',
|
|
133
149
|
'transportVehicle',
|
|
134
150
|
'creator',
|
|
@@ -136,75 +152,31 @@ router.get(
|
|
|
136
152
|
]
|
|
137
153
|
})
|
|
138
154
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
transportDriver: deliveryOrder.transportDriver
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
transportVehicle: deliveryOrder.transportVehicle
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
id: oi.id,
|
|
165
|
-
releaseQty: oi.releaseQty,
|
|
166
|
-
releaseUomValue: oi.releaseUomValue,
|
|
167
|
-
packingType: oi.packingType,
|
|
168
|
-
packingSize: oi.packingSize,
|
|
169
|
-
remark: oi.remark,
|
|
170
|
-
batchId: oi.batchId,
|
|
171
|
-
product: {
|
|
172
|
-
id: oi.product.id,
|
|
173
|
-
name: oi.product.name,
|
|
174
|
-
description: oi.product.description,
|
|
175
|
-
sku: oi.product.sku
|
|
176
|
-
},
|
|
177
|
-
productDetail: { refCode: oi.productDetail.refCode ? oi.productDetail.refCode : null },
|
|
178
|
-
orderToteItems: oi.orderToteItems.map(oti => {
|
|
179
|
-
return {
|
|
180
|
-
qty: oti.qty,
|
|
181
|
-
orderTote: {
|
|
182
|
-
name: oti.orderTote.name,
|
|
183
|
-
orderToteSeals: oti.orderTote.orderToteSeals.map(ots => {
|
|
184
|
-
return {
|
|
185
|
-
name: ots.name
|
|
186
|
-
}
|
|
187
|
-
})
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
// {
|
|
195
|
-
// product: deliveryOrder.orderInventories.map(oi => {
|
|
196
|
-
// return {
|
|
197
|
-
// id: oi.product.id,
|
|
198
|
-
// name: oi.product.name,
|
|
199
|
-
// description: oi.product.description,
|
|
200
|
-
// sku: oi.product.sku,
|
|
201
|
-
// productDetail: { refCode: oi.productDetail.refCode }
|
|
202
|
-
// }
|
|
203
|
-
// }),
|
|
204
|
-
// }
|
|
205
|
-
}
|
|
206
|
-
})
|
|
207
|
-
}
|
|
155
|
+
deliveryOrders = deliveryOrders.map(deliveryOrder => {
|
|
156
|
+
return {
|
|
157
|
+
id: deliveryOrder.id,
|
|
158
|
+
name: deliveryOrder.name,
|
|
159
|
+
to: deliveryOrder.to,
|
|
160
|
+
truckNo: deliveryOrder.truckNo,
|
|
161
|
+
ownCollection: deliveryOrder.ownCollection,
|
|
162
|
+
looseItem: deliveryOrder.looseItem,
|
|
163
|
+
deliveryDate: deliveryOrder.deliveryDate,
|
|
164
|
+
palletQty: deliveryOrder.palletQty,
|
|
165
|
+
remark: deliveryOrder.remark,
|
|
166
|
+
status: deliveryOrder.status,
|
|
167
|
+
creator: deliveryOrder.creator ? { id: deliveryOrder.creator.id, name: deliveryOrder.creator.name } : null,
|
|
168
|
+
createdAt: deliveryOrder.createdAt,
|
|
169
|
+
updater: deliveryOrder.updater ? { id: deliveryOrder.updater.id, name: deliveryOrder.updater.name } : null,
|
|
170
|
+
updatedAt: deliveryOrder.updatedAt,
|
|
171
|
+
transportDriver: deliveryOrder.transportDriver
|
|
172
|
+
? { id: deliveryOrder.transportDriver.id, name: deliveryOrder.transportDriver.name }
|
|
173
|
+
: null,
|
|
174
|
+
transportVehicle: deliveryOrder.transportVehicle
|
|
175
|
+
? { id: deliveryOrder.transportVehicle.id, name: deliveryOrder.transportVehicle.name }
|
|
176
|
+
: null,
|
|
177
|
+
orderInventories: orderInventories.filter(oi => oi.deliveryOrder.id === deliveryOrder.id) || null
|
|
178
|
+
}
|
|
179
|
+
})
|
|
208
180
|
|
|
209
181
|
let attachments: Attachment[] = []
|
|
210
182
|
attachments = await getRepository(Attachment).find({
|