@pksep/zod-shared 0.0.549 → 0.0.550
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/assemble/dto/get-assemble-operation-count.dto.d.ts +14 -0
- package/dist/assemble/interfaces/interfaces.d.ts +1 -0
- package/dist/assemble/schemas/assemble-coming.schema.d.ts +10 -0
- package/dist/assemble/schemas/assemble.schema.d.ts +10 -0
- package/dist/detal/default-values/default-values.d.ts +4 -0
- package/dist/detal/default-values/default-values.js +4 -0
- package/dist/detal/schemas/detal-deficit.schema.d.ts +170 -0
- package/dist/detal/schemas/detal.schema.d.ts +170 -0
- package/dist/material/dto/create-material.dto.d.ts +136 -0
- package/dist/material/dto/create-material.dto.js +16 -0
- package/dist/material/dto/up-create-type-material.dto.d.ts +4 -0
- package/dist/material/dto/up-create-type-material.dto.js +6 -1
- package/dist/material/enum/enum.d.ts +10 -0
- package/dist/material/enum/enum.js +12 -1
- package/dist/material/index.d.ts +1 -0
- package/dist/material/index.js +1 -0
- package/dist/material/interfaces/interface.d.ts +2 -0
- package/dist/material/schemas/material-characteristics.schema.d.ts +56 -0
- package/dist/material/schemas/material-characteristics.schema.js +3 -1
- package/dist/material/schemas/material-shipments-response.schema.d.ts +124 -0
- package/dist/material/schemas/material.schema.d.ts +124 -0
- package/dist/material/schemas/type-material.schema.d.ts +116 -0
- package/dist/material/schemas/type-material.schema.js +9 -2
- package/dist/material/utils/workpiece-mass.d.ts +56 -0
- package/dist/material/utils/workpiece-mass.js +538 -0
- package/dist/material/workpiece-mass.d.ts +45 -0
- package/dist/material/workpiece-mass.js +400 -0
- package/dist/metaloworking/dto/get-metallworking-pagination.dto.d.ts +3 -0
- package/dist/metaloworking/dto/get-metallworking-pagination.dto.js +1 -0
- package/dist/movement-object/schemas/get-one-object-history.schema.d.ts +40 -6
- package/dist/movement-object/schemas/get-one-object-history.schema.js +7 -1
- package/dist/production-tasks/interfaces/online-board.d.ts +1 -0
- package/dist/shipments/dto/format-list-shipment.dto.d.ts +3 -0
- package/dist/shipments/dto/format-list-shipment.dto.js +1 -0
- package/dist/shipments/dto/get-shipment-items-by-entity.dto.d.ts +22 -0
- package/dist/shipments/dto/get-shipment-items-by-entity.dto.js +12 -0
- package/dist/shipments/dto/up-create-shipments.dto.d.ts +342 -4
- package/dist/shipments/dto/up-create-shipments.dto.js +97 -3
- package/dist/shipments/dto/update-ready-to-ship-status.dto.d.ts +9 -0
- package/dist/shipments/dto/update-ready-to-ship-status.dto.js +7 -0
- package/dist/shipments/index.d.ts +2 -0
- package/dist/shipments/index.js +2 -0
- package/dist/shipments/types/types.d.ts +1 -0
- package/dist/specification/schema/attributes.schema.d.ts +386 -0
- package/dist/specification/type/type.d.ts +47 -1
- package/dist/utils/default-value/default-value.js +2 -1
- package/dist/utils/enums.d.ts +4 -2
- package/dist/utils/enums.js +2 -0
- package/dist/utils/types.d.ts +6 -0
- package/dist/waybill/dto/create-waybill-product.dto.d.ts +3 -3
- package/dist/waybill/dto/create-waybill-product.dto.js +1 -1
- package/dist/waybill/dto/create-waybill.dto.d.ts +5 -5
- package/dist/waybill/schemas/waybill.schema.d.ts +6 -0
- package/dist/waybill/schemas/waybill.schema.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateWorkpieceMassPreview = exports.resolveWorkpieceMassVariables = exports.WORKPIECE_MASS_CALCULATORS = exports.WORKPIECE_MASS_VARIABLE_RESOLVERS = exports.WORKPIECE_MASS_FORMULAS = void 0;
|
|
4
|
+
const enum_1 = require("./enum/enum");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
exports.WORKPIECE_MASS_FORMULAS = [
|
|
7
|
+
{
|
|
8
|
+
key: enum_1.WorkpieceMassFormulaKey.boundingBox,
|
|
9
|
+
name: 'Прямоугольная заготовка',
|
|
10
|
+
description: 'm = ρ * L * B * H',
|
|
11
|
+
variables: [
|
|
12
|
+
{
|
|
13
|
+
key: 'density',
|
|
14
|
+
name: 'Плотность',
|
|
15
|
+
source: 'material',
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
key: 'length',
|
|
20
|
+
name: 'Длина',
|
|
21
|
+
source: 'workpiece',
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'width',
|
|
26
|
+
name: 'Ширина',
|
|
27
|
+
source: 'workpiece',
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
key: 'height',
|
|
32
|
+
name: 'Высота',
|
|
33
|
+
source: 'workpiece',
|
|
34
|
+
required: true
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: enum_1.WorkpieceMassFormulaKey.rectangularSection,
|
|
40
|
+
name: 'Прямоугольное сечение',
|
|
41
|
+
description: 'm = ρ * L * B * t',
|
|
42
|
+
variables: [
|
|
43
|
+
{
|
|
44
|
+
key: 'density',
|
|
45
|
+
name: 'Плотность',
|
|
46
|
+
source: 'material',
|
|
47
|
+
required: true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'length',
|
|
51
|
+
name: 'Длина',
|
|
52
|
+
source: 'workpiece',
|
|
53
|
+
required: true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'width',
|
|
57
|
+
name: 'Ширина',
|
|
58
|
+
source: 'workpiece',
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'thickness',
|
|
63
|
+
name: 'Толщина',
|
|
64
|
+
source: 'material',
|
|
65
|
+
required: true
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: enum_1.WorkpieceMassFormulaKey.solidRoundSection,
|
|
71
|
+
name: 'Полнотелое круглое сечение',
|
|
72
|
+
description: 'm = ρ * π * D² / 4 * L',
|
|
73
|
+
variables: [
|
|
74
|
+
{
|
|
75
|
+
key: 'density',
|
|
76
|
+
name: 'Плотность',
|
|
77
|
+
source: 'material',
|
|
78
|
+
required: true
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: 'outsideDiameter',
|
|
82
|
+
name: 'Наружный диаметр',
|
|
83
|
+
source: 'material',
|
|
84
|
+
required: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: 'length',
|
|
88
|
+
name: 'Длина',
|
|
89
|
+
source: 'workpiece',
|
|
90
|
+
required: true
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: enum_1.WorkpieceMassFormulaKey.hollowRoundSection,
|
|
96
|
+
name: 'Полое круглое сечение',
|
|
97
|
+
description: 'm = ρ * π * t * (D - t) * L',
|
|
98
|
+
variables: [
|
|
99
|
+
{
|
|
100
|
+
key: 'density',
|
|
101
|
+
name: 'Плотность',
|
|
102
|
+
source: 'material',
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: 'outsideDiameter',
|
|
107
|
+
name: 'Наружный диаметр',
|
|
108
|
+
source: 'material',
|
|
109
|
+
required: true
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
key: 'wallThickness',
|
|
113
|
+
name: 'Толщина стенки',
|
|
114
|
+
source: 'material',
|
|
115
|
+
required: true
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: 'length',
|
|
119
|
+
name: 'Длина',
|
|
120
|
+
source: 'workpiece',
|
|
121
|
+
required: true
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: enum_1.WorkpieceMassFormulaKey.hollowProfileSection,
|
|
127
|
+
name: 'Полое профильное сечение',
|
|
128
|
+
description: 'm = ρ * (B * H - (B - 2t) * (H - 2t)) * L',
|
|
129
|
+
variables: [
|
|
130
|
+
{
|
|
131
|
+
key: 'density',
|
|
132
|
+
name: 'Плотность',
|
|
133
|
+
source: 'material',
|
|
134
|
+
required: true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: 'width',
|
|
138
|
+
name: 'Ширина профиля',
|
|
139
|
+
source: 'material',
|
|
140
|
+
required: true
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: 'height',
|
|
144
|
+
name: 'Высота профиля',
|
|
145
|
+
source: 'material',
|
|
146
|
+
required: true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: 'wallThickness',
|
|
150
|
+
name: 'Толщина стенки',
|
|
151
|
+
source: 'material',
|
|
152
|
+
required: true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
key: 'length',
|
|
156
|
+
name: 'Длина',
|
|
157
|
+
source: 'workpiece',
|
|
158
|
+
required: true
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
key: enum_1.WorkpieceMassFormulaKey.hexSection,
|
|
164
|
+
name: 'Шестигранное сечение',
|
|
165
|
+
description: 'm = ρ * 0.866025 * S² * L',
|
|
166
|
+
variables: [
|
|
167
|
+
{
|
|
168
|
+
key: 'density',
|
|
169
|
+
name: 'Плотность',
|
|
170
|
+
source: 'material',
|
|
171
|
+
required: true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: 'acrossFlats',
|
|
175
|
+
name: 'Размер под ключ',
|
|
176
|
+
source: 'material',
|
|
177
|
+
required: true
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: 'length',
|
|
181
|
+
name: 'Длина',
|
|
182
|
+
source: 'workpiece',
|
|
183
|
+
required: true
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
key: enum_1.WorkpieceMassFormulaKey.sectionArea,
|
|
189
|
+
name: 'По площади сечения',
|
|
190
|
+
description: 'm = ρ * A * L',
|
|
191
|
+
variables: [
|
|
192
|
+
{
|
|
193
|
+
key: 'density',
|
|
194
|
+
name: 'Плотность',
|
|
195
|
+
source: 'material',
|
|
196
|
+
required: true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
key: 'areaCrossSectional',
|
|
200
|
+
name: 'Площадь поперечного сечения',
|
|
201
|
+
source: 'material',
|
|
202
|
+
required: true
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
key: 'length',
|
|
206
|
+
name: 'Длина',
|
|
207
|
+
source: 'workpiece',
|
|
208
|
+
required: true
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
key: enum_1.WorkpieceMassFormulaKey.linearMass,
|
|
214
|
+
name: 'По массе погонного метра',
|
|
215
|
+
description: 'm = q * L',
|
|
216
|
+
variables: [
|
|
217
|
+
{
|
|
218
|
+
key: 'massPerMeter',
|
|
219
|
+
name: 'Масса погонного метра',
|
|
220
|
+
source: 'material',
|
|
221
|
+
required: true
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
key: 'length',
|
|
225
|
+
name: 'Длина',
|
|
226
|
+
source: 'workpiece',
|
|
227
|
+
required: true
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
const getMaterialCharacteristicValue = (context, key) => {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
const item = (_b = (_a = context.material) === null || _a === void 0 ? void 0 : _a.characteristics) === null || _b === void 0 ? void 0 : _b[key];
|
|
235
|
+
return typeof (item === null || item === void 0 ? void 0 : item.znach) === 'number' && !Number.isNaN(item.znach)
|
|
236
|
+
? item.znach
|
|
237
|
+
: null;
|
|
238
|
+
};
|
|
239
|
+
const getWorkpieceCharacteristicValue = (context, key) => {
|
|
240
|
+
var _a;
|
|
241
|
+
const value = (_a = context.workpieceCharacterization) === null || _a === void 0 ? void 0 : _a[key];
|
|
242
|
+
return typeof value === 'number' && !Number.isNaN(value) ? value : null;
|
|
243
|
+
};
|
|
244
|
+
const getPreparedWorkpieceValues = (context) => {
|
|
245
|
+
var _a, _b, _c, _d;
|
|
246
|
+
const result = {};
|
|
247
|
+
const typeMaterialCharacteristics = ((_a = context.typeMaterial) === null || _a === void 0 ? void 0 : _a.characteristics) || {};
|
|
248
|
+
for (const characteristicKey of Object.keys(typeMaterialCharacteristics)) {
|
|
249
|
+
const characteristicMode = (_b = typeMaterialCharacteristics[characteristicKey]) === null || _b === void 0 ? void 0 : _b.znach;
|
|
250
|
+
if (!characteristicMode)
|
|
251
|
+
continue;
|
|
252
|
+
result[characteristicKey] =
|
|
253
|
+
characteristicMode === utils_1.TypeMaterialCharZnachEnum.permanent
|
|
254
|
+
? ((_c = getMaterialCharacteristicValue(context, characteristicKey)) !== null && _c !== void 0 ? _c : undefined)
|
|
255
|
+
: ((_d = getWorkpieceCharacteristicValue(context, characteristicKey)) !== null && _d !== void 0 ? _d : undefined);
|
|
256
|
+
}
|
|
257
|
+
const density = getMaterialCharacteristicValue(context, 'density');
|
|
258
|
+
if (density !== null)
|
|
259
|
+
result.density = density;
|
|
260
|
+
const mass = getWorkpieceCharacteristicValue(context, 'mass');
|
|
261
|
+
if (mass !== null)
|
|
262
|
+
result.mass = mass;
|
|
263
|
+
const trash = getWorkpieceCharacteristicValue(context, 'trash');
|
|
264
|
+
if (trash !== null)
|
|
265
|
+
result.trash = trash;
|
|
266
|
+
return result;
|
|
267
|
+
};
|
|
268
|
+
const getPreparedValue = (prepared, key) => {
|
|
269
|
+
const value = prepared[key];
|
|
270
|
+
return typeof value === 'number' && !Number.isNaN(value) ? value : null;
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Реестр источников значений переменных.
|
|
274
|
+
* Здесь описано, откуда брать каждую переменную под расчет массы заготовки.
|
|
275
|
+
*/
|
|
276
|
+
exports.WORKPIECE_MASS_VARIABLE_RESOLVERS = {
|
|
277
|
+
density: (context, prepared) => {
|
|
278
|
+
var _a;
|
|
279
|
+
return (_a = getPreparedValue(prepared, 'density')) !== null && _a !== void 0 ? _a : getMaterialCharacteristicValue(context, 'density');
|
|
280
|
+
},
|
|
281
|
+
length: (_context, prepared) => getPreparedValue(prepared, 'length'),
|
|
282
|
+
width: (_context, prepared) => getPreparedValue(prepared, 'width'),
|
|
283
|
+
height: (_context, prepared) => getPreparedValue(prepared, 'height'),
|
|
284
|
+
thickness: (_context, prepared) => getPreparedValue(prepared, 'thickness'),
|
|
285
|
+
wallThickness: (_context, prepared) => getPreparedValue(prepared, 'wallThickness'),
|
|
286
|
+
outsideDiameter: (_context, prepared) => getPreparedValue(prepared, 'outsideDiameter'),
|
|
287
|
+
areaCrossSectional: (_context, prepared) => getPreparedValue(prepared, 'areaCrossSectional'),
|
|
288
|
+
// TODO: добавить поле в model/type_material/material/workpiece_characterization
|
|
289
|
+
acrossFlats: (context, prepared) => {
|
|
290
|
+
var _a;
|
|
291
|
+
return (_a = getPreparedValue(prepared, 'acrossFlats')) !== null && _a !== void 0 ? _a : getMaterialCharacteristicValue(context, 'acrossFlats');
|
|
292
|
+
},
|
|
293
|
+
// TODO: добавить поле в material.characteristics или отдельную модель
|
|
294
|
+
massPerMeter: (context, prepared) => {
|
|
295
|
+
var _a;
|
|
296
|
+
return (_a = getPreparedValue(prepared, 'massPerMeter')) !== null && _a !== void 0 ? _a : getMaterialCharacteristicValue(context, 'massPerMeter');
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const getRequiredVar = (vars, key) => {
|
|
300
|
+
const value = vars[key];
|
|
301
|
+
if (typeof value !== 'number' || Number.isNaN(value)) {
|
|
302
|
+
throw new Error(`Не заполнена переменная "${key}" для расчета массы заготовки`);
|
|
303
|
+
}
|
|
304
|
+
return value;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Реестр математических алгоритмов расчета.
|
|
308
|
+
* Здесь только математика, без поиска значений по моделям.
|
|
309
|
+
*/
|
|
310
|
+
exports.WORKPIECE_MASS_CALCULATORS = {
|
|
311
|
+
[enum_1.WorkpieceMassFormulaKey.boundingBox]: vars => {
|
|
312
|
+
const density = getRequiredVar(vars, 'density');
|
|
313
|
+
const length = getRequiredVar(vars, 'length');
|
|
314
|
+
const width = getRequiredVar(vars, 'width');
|
|
315
|
+
const height = getRequiredVar(vars, 'height');
|
|
316
|
+
return density * length * width * height;
|
|
317
|
+
},
|
|
318
|
+
[enum_1.WorkpieceMassFormulaKey.rectangularSection]: vars => {
|
|
319
|
+
const density = getRequiredVar(vars, 'density');
|
|
320
|
+
const length = getRequiredVar(vars, 'length');
|
|
321
|
+
const width = getRequiredVar(vars, 'width');
|
|
322
|
+
const thickness = getRequiredVar(vars, 'thickness');
|
|
323
|
+
return density * length * width * thickness;
|
|
324
|
+
},
|
|
325
|
+
[enum_1.WorkpieceMassFormulaKey.solidRoundSection]: vars => {
|
|
326
|
+
const density = getRequiredVar(vars, 'density');
|
|
327
|
+
const outsideDiameter = getRequiredVar(vars, 'outsideDiameter');
|
|
328
|
+
const length = getRequiredVar(vars, 'length');
|
|
329
|
+
return (density * Math.PI * Math.pow(outsideDiameter, 2) * length) / 4;
|
|
330
|
+
},
|
|
331
|
+
[enum_1.WorkpieceMassFormulaKey.hollowRoundSection]: vars => {
|
|
332
|
+
const density = getRequiredVar(vars, 'density');
|
|
333
|
+
const outsideDiameter = getRequiredVar(vars, 'outsideDiameter');
|
|
334
|
+
const wallThickness = getRequiredVar(vars, 'wallThickness');
|
|
335
|
+
const length = getRequiredVar(vars, 'length');
|
|
336
|
+
return (density *
|
|
337
|
+
Math.PI *
|
|
338
|
+
wallThickness *
|
|
339
|
+
(outsideDiameter - wallThickness) *
|
|
340
|
+
length);
|
|
341
|
+
},
|
|
342
|
+
[enum_1.WorkpieceMassFormulaKey.hollowProfileSection]: vars => {
|
|
343
|
+
const density = getRequiredVar(vars, 'density');
|
|
344
|
+
const width = getRequiredVar(vars, 'width');
|
|
345
|
+
const height = getRequiredVar(vars, 'height');
|
|
346
|
+
const wallThickness = getRequiredVar(vars, 'wallThickness');
|
|
347
|
+
const length = getRequiredVar(vars, 'length');
|
|
348
|
+
return (density *
|
|
349
|
+
(width * height -
|
|
350
|
+
(width - 2 * wallThickness) * (height - 2 * wallThickness)) *
|
|
351
|
+
length);
|
|
352
|
+
},
|
|
353
|
+
[enum_1.WorkpieceMassFormulaKey.hexSection]: vars => {
|
|
354
|
+
const density = getRequiredVar(vars, 'density');
|
|
355
|
+
const acrossFlats = getRequiredVar(vars, 'acrossFlats');
|
|
356
|
+
const length = getRequiredVar(vars, 'length');
|
|
357
|
+
return density * 0.866025 * Math.pow(acrossFlats, 2) * length;
|
|
358
|
+
},
|
|
359
|
+
[enum_1.WorkpieceMassFormulaKey.sectionArea]: vars => {
|
|
360
|
+
const density = getRequiredVar(vars, 'density');
|
|
361
|
+
const areaCrossSectional = getRequiredVar(vars, 'areaCrossSectional');
|
|
362
|
+
const length = getRequiredVar(vars, 'length');
|
|
363
|
+
return density * areaCrossSectional * length;
|
|
364
|
+
},
|
|
365
|
+
[enum_1.WorkpieceMassFormulaKey.linearMass]: vars => {
|
|
366
|
+
const massPerMeter = getRequiredVar(vars, 'massPerMeter');
|
|
367
|
+
const length = getRequiredVar(vars, 'length');
|
|
368
|
+
return massPerMeter * length;
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
const resolveWorkpieceMassVariables = (context, variableKeys) => {
|
|
372
|
+
var _a;
|
|
373
|
+
const prepared = getPreparedWorkpieceValues(context);
|
|
374
|
+
const result = {};
|
|
375
|
+
for (const key of variableKeys) {
|
|
376
|
+
result[key] =
|
|
377
|
+
(_a = exports.WORKPIECE_MASS_VARIABLE_RESOLVERS[key](context, prepared)) !== null && _a !== void 0 ? _a : undefined;
|
|
378
|
+
}
|
|
379
|
+
return result;
|
|
380
|
+
};
|
|
381
|
+
exports.resolveWorkpieceMassVariables = resolveWorkpieceMassVariables;
|
|
382
|
+
const calculateWorkpieceMassPreview = (context) => {
|
|
383
|
+
var _a;
|
|
384
|
+
const formulaKey = context.workpieceMassFormulaKey ||
|
|
385
|
+
((_a = context.typeMaterial) === null || _a === void 0 ? void 0 : _a.workpieceMassFormulaKey) ||
|
|
386
|
+
null;
|
|
387
|
+
if (!formulaKey)
|
|
388
|
+
return null;
|
|
389
|
+
const formula = exports.WORKPIECE_MASS_FORMULAS.find(currentFormula => currentFormula.key === formulaKey);
|
|
390
|
+
if (!formula) {
|
|
391
|
+
throw new Error(`Формула расчета массы заготовки "${formulaKey}" не найдена`);
|
|
392
|
+
}
|
|
393
|
+
const variables = (0, exports.resolveWorkpieceMassVariables)(context, formula.variables.map(variable => variable.key));
|
|
394
|
+
return {
|
|
395
|
+
formulaKey,
|
|
396
|
+
mass: exports.WORKPIECE_MASS_CALCULATORS[formulaKey](variables),
|
|
397
|
+
variables
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
exports.calculateWorkpieceMassPreview = calculateWorkpieceMassPreview;
|
|
@@ -3,6 +3,7 @@ import { IFiltersByByOrder, IFiltersByParents } from '../../production-tasks';
|
|
|
3
3
|
export declare const GetMetaloworkingPaginationDtoZod: z.ZodObject<{
|
|
4
4
|
page: z.ZodNumber;
|
|
5
5
|
responsibleUserId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6
|
+
metalloworkingID: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
6
7
|
searchString: z.ZodString;
|
|
7
8
|
isBan: z.ZodBoolean;
|
|
8
9
|
byParents: z.ZodOptional<z.ZodNullable<z.ZodType<IFiltersByParents, z.ZodTypeDef, IFiltersByParents>>>;
|
|
@@ -32,6 +33,7 @@ export declare const GetMetaloworkingPaginationDtoZod: z.ZodObject<{
|
|
|
32
33
|
byParents?: IFiltersByParents | null | undefined;
|
|
33
34
|
byOrder?: IFiltersByByOrder | null | undefined;
|
|
34
35
|
childrenByProductionTaskIds?: number[] | null | undefined;
|
|
36
|
+
metalloworkingID?: number | null | undefined;
|
|
35
37
|
}, {
|
|
36
38
|
page: number;
|
|
37
39
|
searchString: string;
|
|
@@ -45,5 +47,6 @@ export declare const GetMetaloworkingPaginationDtoZod: z.ZodObject<{
|
|
|
45
47
|
byParents?: IFiltersByParents | null | undefined;
|
|
46
48
|
byOrder?: IFiltersByByOrder | null | undefined;
|
|
47
49
|
childrenByProductionTaskIds?: number[] | null | undefined;
|
|
50
|
+
metalloworkingID?: number | null | undefined;
|
|
48
51
|
}>;
|
|
49
52
|
export type GetMetaloworkingPaginationDtoZodType = z.infer<typeof GetMetaloworkingPaginationDtoZod>;
|
|
@@ -6,6 +6,7 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
exports.GetMetaloworkingPaginationDtoZod = zod_1.z.object({
|
|
7
7
|
page: zod_1.z.number(),
|
|
8
8
|
responsibleUserId: zod_1.z.number().nullable().optional(),
|
|
9
|
+
metalloworkingID: zod_1.z.number().nullable().optional(),
|
|
9
10
|
searchString: zod_1.z.string(),
|
|
10
11
|
isBan: zod_1.z.boolean(),
|
|
11
12
|
byParents: zod_1.z.custom().nullable().optional(),
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { IFiltersByParents } from '../../production-tasks';
|
|
3
2
|
export declare const GetOneObjectHistorySchema: z.ZodEffects<z.ZodObject<{
|
|
4
3
|
isCheckChildrens: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
5
|
-
byParents: z.ZodOptional<z.ZodNullable<z.
|
|
4
|
+
byParents: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
5
|
+
productIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
6
|
+
cbedIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
7
|
+
detalIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
8
|
+
materialIds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
detalIds: number[];
|
|
11
|
+
cbedIds: number[];
|
|
12
|
+
productIds: number[];
|
|
13
|
+
materialIds: number[];
|
|
14
|
+
}, {
|
|
15
|
+
detalIds?: number[] | undefined;
|
|
16
|
+
cbedIds?: number[] | undefined;
|
|
17
|
+
productIds?: number[] | undefined;
|
|
18
|
+
materialIds?: number[] | undefined;
|
|
19
|
+
}>>>;
|
|
6
20
|
date: z.ZodObject<{
|
|
7
21
|
start: z.ZodDate;
|
|
8
22
|
end: z.ZodDate;
|
|
@@ -21,14 +35,24 @@ export declare const GetOneObjectHistorySchema: z.ZodEffects<z.ZodObject<{
|
|
|
21
35
|
};
|
|
22
36
|
isCheckChildrens: boolean | null;
|
|
23
37
|
page?: number | undefined;
|
|
24
|
-
byParents?:
|
|
38
|
+
byParents?: {
|
|
39
|
+
detalIds: number[];
|
|
40
|
+
cbedIds: number[];
|
|
41
|
+
productIds: number[];
|
|
42
|
+
materialIds: number[];
|
|
43
|
+
} | null | undefined;
|
|
25
44
|
}, {
|
|
26
45
|
date: {
|
|
27
46
|
start: Date;
|
|
28
47
|
end: Date;
|
|
29
48
|
};
|
|
30
49
|
page?: number | undefined;
|
|
31
|
-
byParents?:
|
|
50
|
+
byParents?: {
|
|
51
|
+
detalIds?: number[] | undefined;
|
|
52
|
+
cbedIds?: number[] | undefined;
|
|
53
|
+
productIds?: number[] | undefined;
|
|
54
|
+
materialIds?: number[] | undefined;
|
|
55
|
+
} | null | undefined;
|
|
32
56
|
isCheckChildrens?: boolean | null | undefined;
|
|
33
57
|
}>, {
|
|
34
58
|
date: {
|
|
@@ -37,14 +61,24 @@ export declare const GetOneObjectHistorySchema: z.ZodEffects<z.ZodObject<{
|
|
|
37
61
|
};
|
|
38
62
|
isCheckChildrens: boolean | null;
|
|
39
63
|
page?: number | undefined;
|
|
40
|
-
byParents?:
|
|
64
|
+
byParents?: {
|
|
65
|
+
detalIds: number[];
|
|
66
|
+
cbedIds: number[];
|
|
67
|
+
productIds: number[];
|
|
68
|
+
materialIds: number[];
|
|
69
|
+
} | null | undefined;
|
|
41
70
|
}, {
|
|
42
71
|
date: {
|
|
43
72
|
start: Date;
|
|
44
73
|
end: Date;
|
|
45
74
|
};
|
|
46
75
|
page?: number | undefined;
|
|
47
|
-
byParents?:
|
|
76
|
+
byParents?: {
|
|
77
|
+
detalIds?: number[] | undefined;
|
|
78
|
+
cbedIds?: number[] | undefined;
|
|
79
|
+
productIds?: number[] | undefined;
|
|
80
|
+
materialIds?: number[] | undefined;
|
|
81
|
+
} | null | undefined;
|
|
48
82
|
isCheckChildrens?: boolean | null | undefined;
|
|
49
83
|
}>;
|
|
50
84
|
export type GetOneObjectHistorySchemaType = z.infer<typeof GetOneObjectHistorySchema>;
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetOneObjectHistorySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const MovementObjectParentsSchema = zod_1.z.object({
|
|
6
|
+
productIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
7
|
+
cbedIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
8
|
+
detalIds: zod_1.z.array(zod_1.z.number()).optional().default([]),
|
|
9
|
+
materialIds: zod_1.z.array(zod_1.z.number()).optional().default([])
|
|
10
|
+
});
|
|
5
11
|
exports.GetOneObjectHistorySchema = zod_1.z
|
|
6
12
|
.object({
|
|
7
13
|
isCheckChildrens: zod_1.z.boolean().nullish().default(false),
|
|
8
|
-
byParents:
|
|
14
|
+
byParents: MovementObjectParentsSchema.nullable().optional(),
|
|
9
15
|
date: zod_1.z.object({
|
|
10
16
|
start: zod_1.z.date(),
|
|
11
17
|
end: zod_1.z.date()
|
|
@@ -3,6 +3,7 @@ import { IzdType } from '../../utils';
|
|
|
3
3
|
export declare const formatinglistShipmentSchema: z.ZodObject<{
|
|
4
4
|
entityId: z.ZodNumber;
|
|
5
5
|
type: z.ZodNativeEnum<typeof IzdType>;
|
|
6
|
+
productId: z.ZodOptional<z.ZodNumber>;
|
|
6
7
|
shipmentIdToDelete: z.ZodOptional<z.ZodNumber>;
|
|
7
8
|
shipmentToCheckIds: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
|
|
8
9
|
isReturnFirstDeficit: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -11,6 +12,7 @@ export declare const formatinglistShipmentSchema: z.ZodObject<{
|
|
|
11
12
|
}, "strip", z.ZodTypeAny, {
|
|
12
13
|
type: IzdType;
|
|
13
14
|
entityId: number;
|
|
15
|
+
productId?: number | undefined;
|
|
14
16
|
recursiveSpecificationObject?: any;
|
|
15
17
|
transaction?: any;
|
|
16
18
|
shipmentIdToDelete?: number | undefined;
|
|
@@ -19,6 +21,7 @@ export declare const formatinglistShipmentSchema: z.ZodObject<{
|
|
|
19
21
|
}, {
|
|
20
22
|
type: IzdType;
|
|
21
23
|
entityId: number;
|
|
24
|
+
productId?: number | undefined;
|
|
22
25
|
recursiveSpecificationObject?: any;
|
|
23
26
|
transaction?: any;
|
|
24
27
|
shipmentIdToDelete?: number | undefined;
|
|
@@ -6,6 +6,7 @@ const utils_1 = require("../../utils");
|
|
|
6
6
|
exports.formatinglistShipmentSchema = zod_1.z.object({
|
|
7
7
|
entityId: zod_1.z.number(),
|
|
8
8
|
type: zod_1.z.nativeEnum(utils_1.IzdType),
|
|
9
|
+
productId: zod_1.z.number().optional(),
|
|
9
10
|
shipmentIdToDelete: zod_1.z.number().optional(),
|
|
10
11
|
shipmentToCheckIds: zod_1.z.array(zod_1.z.number()).optional(),
|
|
11
12
|
isReturnFirstDeficit: zod_1.z.boolean().optional(),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IzdType } from '../../utils';
|
|
3
|
+
export declare const getShipmentItemsByEntitySchema: z.ZodObject<{
|
|
4
|
+
entityId: z.ZodNumber;
|
|
5
|
+
entityType: z.ZodNativeEnum<typeof IzdType>;
|
|
6
|
+
shipmentId: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
childId: z.ZodNumber;
|
|
8
|
+
childType: z.ZodNativeEnum<typeof IzdType>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
entityId: number;
|
|
11
|
+
entityType: IzdType;
|
|
12
|
+
childId: number;
|
|
13
|
+
childType: IzdType;
|
|
14
|
+
shipmentId?: number | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
entityId: number;
|
|
17
|
+
entityType: IzdType;
|
|
18
|
+
childId: number;
|
|
19
|
+
childType: IzdType;
|
|
20
|
+
shipmentId?: number | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type GetShipmentItemsByEntityDto = z.infer<typeof getShipmentItemsByEntitySchema>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getShipmentItemsByEntitySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
exports.getShipmentItemsByEntitySchema = zod_1.z.object({
|
|
7
|
+
entityId: zod_1.z.number().int().positive(),
|
|
8
|
+
entityType: zod_1.z.nativeEnum(utils_1.IzdType),
|
|
9
|
+
shipmentId: zod_1.z.number().int().positive().optional(),
|
|
10
|
+
childId: zod_1.z.number().int().positive(),
|
|
11
|
+
childType: zod_1.z.nativeEnum(utils_1.IzdType)
|
|
12
|
+
});
|