@pksep/zod-shared 0.0.552 → 0.0.554
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/issue/dto/up-create-issue.dto.d.ts +49 -0
- package/dist/issue/dto/up-create-issue.dto.js +21 -0
- package/dist/issue/index.d.ts +5 -0
- package/dist/issue/index.js +21 -0
- package/dist/issue/interfaces/interface.d.ts +4 -0
- package/dist/issue/schemas/issue-user-controller.schema.d.ts +15 -0
- package/dist/issue/schemas/issue-user-controller.schema.js +9 -0
- package/dist/issue/schemas/issue-user.schema.d.ts +15 -0
- package/dist/issue/schemas/issue-user.schema.js +9 -0
- package/dist/issue/schemas/issue.schema.d.ts +51 -0
- package/dist/issue/schemas/issue.schema.js +21 -0
- package/dist/library/dto/create-chapter.dto.d.ts +12 -0
- package/dist/library/dto/create-chapter.dto.js +8 -0
- package/dist/library/dto/create-link.dto.d.ts +30 -0
- package/dist/library/dto/create-link.dto.js +14 -0
- package/dist/library/index.d.ts +5 -0
- package/dist/library/index.js +21 -0
- package/dist/library/interfaces/interface.d.ts +3 -0
- package/dist/library/interfaces/interface.js +2 -0
- package/dist/library/schemas/links-user.schema.d.ts +15 -0
- package/dist/library/schemas/links-user.schema.js +9 -0
- package/dist/library/schemas/links.schema.d.ts +30 -0
- package/dist/library/schemas/links.schema.js +14 -0
- package/dist/planning/index.d.ts +1 -0
- package/dist/planning/index.js +17 -0
- package/dist/planning/types/planning.d.ts +187 -0
- package/dist/planning/types/planning.js +25 -0
- package/dist/production-tasks/dto/update-marks.dto.d.ts +13 -0
- package/dist/production-tasks/dto/update-marks.dto.js +8 -0
- package/dist/production-tasks/dto/update-responsible.dto.d.ts +12 -0
- package/dist/production-tasks/dto/update-responsible.dto.js +8 -0
- package/dist/production-tasks/dto/update-status.dto.d.ts +13 -0
- package/dist/production-tasks/dto/update-status.dto.js +9 -0
- package/dist/production-tasks/index.d.ts +0 -1
- package/dist/production-tasks/index.js +0 -1
- package/dist/production-tasks/interfaces/production-tasks.d.ts +3 -0
- package/dist/tech-process/schemas/tech-process-with-options.schema.d.ts +306 -0
- package/dist/tech-process/schemas/tech-process-with-options.schema.js +8 -0
- package/dist/utils/interface/mat.interface.d.ts +10 -0
- package/dist/utils/interface/mat.interface.js +2 -0
- package/dist/utils/tables-config/enum.d.ts +2 -1
- package/dist/utils/tables-config/enum.js +2 -0
- package/dist/utils/tables-config/tables-array.js +6 -3
- package/package.json +1 -1
- package/dist/material/workpiece-mass.d.ts +0 -45
- package/dist/material/workpiece-mass.js +0 -400
- package/dist/production-tasks/schemas/orders-summary-by-entity.schema.d.ts +0 -232
- package/dist/production-tasks/schemas/orders-summary-by-entity.schema.js +0 -64
- package/dist/utils/interface/status-flags.interface.d.ts +0 -4
- /package/dist/{utils/interface/status-flags.interface.js → issue/interfaces/interface.js} +0 -0
|
@@ -1,400 +0,0 @@
|
|
|
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;
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const OrdersSummaryProductionTaskZod: z.ZodObject<{
|
|
3
|
-
productionTaskId: z.ZodNumber;
|
|
4
|
-
quantity: z.ZodNumber;
|
|
5
|
-
planReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
6
|
-
requiredReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
quantity: number;
|
|
9
|
-
productionTaskId: number;
|
|
10
|
-
planReadyDate: string | Date | null;
|
|
11
|
-
requiredReadyDate: string | Date | null;
|
|
12
|
-
}, {
|
|
13
|
-
quantity: number;
|
|
14
|
-
productionTaskId: number;
|
|
15
|
-
planReadyDate: string | Date | null;
|
|
16
|
-
requiredReadyDate: string | Date | null;
|
|
17
|
-
}>;
|
|
18
|
-
export declare const OrdersSummaryShipmentZod: z.ZodObject<{
|
|
19
|
-
shipmentId: z.ZodNullable<z.ZodNumber>;
|
|
20
|
-
parentPTNumber: z.ZodNullable<z.ZodNumber>;
|
|
21
|
-
parentPTQuantity: z.ZodNullable<z.ZodNumber>;
|
|
22
|
-
parentPTNeed: z.ZodNullable<z.ZodNumber>;
|
|
23
|
-
shipmentNumber: z.ZodNullable<z.ZodString>;
|
|
24
|
-
quantity: z.ZodNumber;
|
|
25
|
-
requiredReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
26
|
-
}, "strip", z.ZodTypeAny, {
|
|
27
|
-
quantity: number;
|
|
28
|
-
shipmentId: number | null;
|
|
29
|
-
requiredReadyDate: string | Date | null;
|
|
30
|
-
parentPTNumber: number | null;
|
|
31
|
-
parentPTQuantity: number | null;
|
|
32
|
-
parentPTNeed: number | null;
|
|
33
|
-
shipmentNumber: string | null;
|
|
34
|
-
}, {
|
|
35
|
-
quantity: number;
|
|
36
|
-
shipmentId: number | null;
|
|
37
|
-
requiredReadyDate: string | Date | null;
|
|
38
|
-
parentPTNumber: number | null;
|
|
39
|
-
parentPTQuantity: number | null;
|
|
40
|
-
parentPTNeed: number | null;
|
|
41
|
-
shipmentNumber: string | null;
|
|
42
|
-
}>;
|
|
43
|
-
export declare const OrdersSummaryStockOrderZod: z.ZodObject<{
|
|
44
|
-
stockOrderItemId: z.ZodNumber;
|
|
45
|
-
stockOrderId: z.ZodNullable<z.ZodNumber>;
|
|
46
|
-
stockOrderNumber: z.ZodNullable<z.ZodString>;
|
|
47
|
-
quantity: z.ZodNumber;
|
|
48
|
-
warehouseReadinessDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
49
|
-
remainingQuantity: z.ZodNumber;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
quantity: number;
|
|
52
|
-
warehouseReadinessDate: string | Date | null;
|
|
53
|
-
stockOrderNumber: string | null;
|
|
54
|
-
stockOrderItemId: number;
|
|
55
|
-
stockOrderId: number | null;
|
|
56
|
-
remainingQuantity: number;
|
|
57
|
-
}, {
|
|
58
|
-
quantity: number;
|
|
59
|
-
warehouseReadinessDate: string | Date | null;
|
|
60
|
-
stockOrderNumber: string | null;
|
|
61
|
-
stockOrderItemId: number;
|
|
62
|
-
stockOrderId: number | null;
|
|
63
|
-
remainingQuantity: number;
|
|
64
|
-
}>;
|
|
65
|
-
export declare const OrdersSummaryDemandRowZod: z.ZodObject<{
|
|
66
|
-
productionTaskId: z.ZodNullable<z.ZodNumber>;
|
|
67
|
-
quantityByProductionTask: z.ZodNumber;
|
|
68
|
-
planReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
69
|
-
shipmentId: z.ZodNullable<z.ZodNumber>;
|
|
70
|
-
parentPTNumber: z.ZodNullable<z.ZodNumber>;
|
|
71
|
-
parentPTQuantity: z.ZodNullable<z.ZodNumber>;
|
|
72
|
-
parentPTNeed: z.ZodNullable<z.ZodNumber>;
|
|
73
|
-
shipmentNumber: z.ZodNullable<z.ZodString>;
|
|
74
|
-
quantityByShipment: z.ZodNullable<z.ZodNumber>;
|
|
75
|
-
shipmentNeed: z.ZodNullable<z.ZodNumber>;
|
|
76
|
-
demandQuantity: z.ZodNumber;
|
|
77
|
-
requiredReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
shipmentId: number | null;
|
|
80
|
-
productionTaskId: number | null;
|
|
81
|
-
planReadyDate: string | Date | null;
|
|
82
|
-
requiredReadyDate: string | Date | null;
|
|
83
|
-
parentPTNumber: number | null;
|
|
84
|
-
parentPTQuantity: number | null;
|
|
85
|
-
parentPTNeed: number | null;
|
|
86
|
-
shipmentNumber: string | null;
|
|
87
|
-
quantityByProductionTask: number;
|
|
88
|
-
quantityByShipment: number | null;
|
|
89
|
-
shipmentNeed: number | null;
|
|
90
|
-
demandQuantity: number;
|
|
91
|
-
}, {
|
|
92
|
-
shipmentId: number | null;
|
|
93
|
-
productionTaskId: number | null;
|
|
94
|
-
planReadyDate: string | Date | null;
|
|
95
|
-
requiredReadyDate: string | Date | null;
|
|
96
|
-
parentPTNumber: number | null;
|
|
97
|
-
parentPTQuantity: number | null;
|
|
98
|
-
parentPTNeed: number | null;
|
|
99
|
-
shipmentNumber: string | null;
|
|
100
|
-
quantityByProductionTask: number;
|
|
101
|
-
quantityByShipment: number | null;
|
|
102
|
-
shipmentNeed: number | null;
|
|
103
|
-
demandQuantity: number;
|
|
104
|
-
}>;
|
|
105
|
-
export declare const OrdersSummaryByEntityRowZod: z.ZodObject<{
|
|
106
|
-
productionTaskId: z.ZodNullable<z.ZodNumber>;
|
|
107
|
-
quantityByProductionTask: z.ZodNumber;
|
|
108
|
-
planReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
109
|
-
positionNumber: z.ZodNullable<z.ZodNumber>;
|
|
110
|
-
shipmentId: z.ZodNullable<z.ZodNumber>;
|
|
111
|
-
parentPTNumber: z.ZodNullable<z.ZodNumber>;
|
|
112
|
-
parentPTQuantity: z.ZodNullable<z.ZodNumber>;
|
|
113
|
-
parentPTNeed: z.ZodNullable<z.ZodNumber>;
|
|
114
|
-
shipmentNumber: z.ZodNullable<z.ZodString>;
|
|
115
|
-
quantityByShipment: z.ZodNullable<z.ZodNumber>;
|
|
116
|
-
shipmentNeed: z.ZodNullable<z.ZodNumber>;
|
|
117
|
-
stockOrderItemId: z.ZodNullable<z.ZodNumber>;
|
|
118
|
-
stockOrderId: z.ZodNullable<z.ZodNumber>;
|
|
119
|
-
stockOrderNumber: z.ZodNullable<z.ZodString>;
|
|
120
|
-
quantityByStockOrder: z.ZodNumber;
|
|
121
|
-
stockOrderNeed: z.ZodNumber;
|
|
122
|
-
warehouseReadinessDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
123
|
-
deficitWithPlannedIncoming: z.ZodNumber;
|
|
124
|
-
deficit: z.ZodNumber;
|
|
125
|
-
}, "strip", z.ZodTypeAny, {
|
|
126
|
-
deficit: number;
|
|
127
|
-
warehouseReadinessDate: string | Date | null;
|
|
128
|
-
stockOrderNumber: string | null;
|
|
129
|
-
shipmentId: number | null;
|
|
130
|
-
productionTaskId: number | null;
|
|
131
|
-
planReadyDate: string | Date | null;
|
|
132
|
-
parentPTNumber: number | null;
|
|
133
|
-
parentPTQuantity: number | null;
|
|
134
|
-
parentPTNeed: number | null;
|
|
135
|
-
shipmentNumber: string | null;
|
|
136
|
-
stockOrderItemId: number | null;
|
|
137
|
-
stockOrderId: number | null;
|
|
138
|
-
quantityByProductionTask: number;
|
|
139
|
-
quantityByShipment: number | null;
|
|
140
|
-
shipmentNeed: number | null;
|
|
141
|
-
positionNumber: number | null;
|
|
142
|
-
quantityByStockOrder: number;
|
|
143
|
-
stockOrderNeed: number;
|
|
144
|
-
deficitWithPlannedIncoming: number;
|
|
145
|
-
}, {
|
|
146
|
-
deficit: number;
|
|
147
|
-
warehouseReadinessDate: string | Date | null;
|
|
148
|
-
stockOrderNumber: string | null;
|
|
149
|
-
shipmentId: number | null;
|
|
150
|
-
productionTaskId: number | null;
|
|
151
|
-
planReadyDate: string | Date | null;
|
|
152
|
-
parentPTNumber: number | null;
|
|
153
|
-
parentPTQuantity: number | null;
|
|
154
|
-
parentPTNeed: number | null;
|
|
155
|
-
shipmentNumber: string | null;
|
|
156
|
-
stockOrderItemId: number | null;
|
|
157
|
-
stockOrderId: number | null;
|
|
158
|
-
quantityByProductionTask: number;
|
|
159
|
-
quantityByShipment: number | null;
|
|
160
|
-
shipmentNeed: number | null;
|
|
161
|
-
positionNumber: number | null;
|
|
162
|
-
quantityByStockOrder: number;
|
|
163
|
-
stockOrderNeed: number;
|
|
164
|
-
deficitWithPlannedIncoming: number;
|
|
165
|
-
}>;
|
|
166
|
-
export declare const OrdersSummaryByEntityResponseZod: z.ZodArray<z.ZodObject<{
|
|
167
|
-
productionTaskId: z.ZodNullable<z.ZodNumber>;
|
|
168
|
-
quantityByProductionTask: z.ZodNumber;
|
|
169
|
-
planReadyDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
170
|
-
positionNumber: z.ZodNullable<z.ZodNumber>;
|
|
171
|
-
shipmentId: z.ZodNullable<z.ZodNumber>;
|
|
172
|
-
parentPTNumber: z.ZodNullable<z.ZodNumber>;
|
|
173
|
-
parentPTQuantity: z.ZodNullable<z.ZodNumber>;
|
|
174
|
-
parentPTNeed: z.ZodNullable<z.ZodNumber>;
|
|
175
|
-
shipmentNumber: z.ZodNullable<z.ZodString>;
|
|
176
|
-
quantityByShipment: z.ZodNullable<z.ZodNumber>;
|
|
177
|
-
shipmentNeed: z.ZodNullable<z.ZodNumber>;
|
|
178
|
-
stockOrderItemId: z.ZodNullable<z.ZodNumber>;
|
|
179
|
-
stockOrderId: z.ZodNullable<z.ZodNumber>;
|
|
180
|
-
stockOrderNumber: z.ZodNullable<z.ZodString>;
|
|
181
|
-
quantityByStockOrder: z.ZodNumber;
|
|
182
|
-
stockOrderNeed: z.ZodNumber;
|
|
183
|
-
warehouseReadinessDate: z.ZodNullable<z.ZodUnion<[z.ZodDate, z.ZodString]>>;
|
|
184
|
-
deficitWithPlannedIncoming: z.ZodNumber;
|
|
185
|
-
deficit: z.ZodNumber;
|
|
186
|
-
}, "strip", z.ZodTypeAny, {
|
|
187
|
-
deficit: number;
|
|
188
|
-
warehouseReadinessDate: string | Date | null;
|
|
189
|
-
stockOrderNumber: string | null;
|
|
190
|
-
shipmentId: number | null;
|
|
191
|
-
productionTaskId: number | null;
|
|
192
|
-
planReadyDate: string | Date | null;
|
|
193
|
-
parentPTNumber: number | null;
|
|
194
|
-
parentPTQuantity: number | null;
|
|
195
|
-
parentPTNeed: number | null;
|
|
196
|
-
shipmentNumber: string | null;
|
|
197
|
-
stockOrderItemId: number | null;
|
|
198
|
-
stockOrderId: number | null;
|
|
199
|
-
quantityByProductionTask: number;
|
|
200
|
-
quantityByShipment: number | null;
|
|
201
|
-
shipmentNeed: number | null;
|
|
202
|
-
positionNumber: number | null;
|
|
203
|
-
quantityByStockOrder: number;
|
|
204
|
-
stockOrderNeed: number;
|
|
205
|
-
deficitWithPlannedIncoming: number;
|
|
206
|
-
}, {
|
|
207
|
-
deficit: number;
|
|
208
|
-
warehouseReadinessDate: string | Date | null;
|
|
209
|
-
stockOrderNumber: string | null;
|
|
210
|
-
shipmentId: number | null;
|
|
211
|
-
productionTaskId: number | null;
|
|
212
|
-
planReadyDate: string | Date | null;
|
|
213
|
-
parentPTNumber: number | null;
|
|
214
|
-
parentPTQuantity: number | null;
|
|
215
|
-
parentPTNeed: number | null;
|
|
216
|
-
shipmentNumber: string | null;
|
|
217
|
-
stockOrderItemId: number | null;
|
|
218
|
-
stockOrderId: number | null;
|
|
219
|
-
quantityByProductionTask: number;
|
|
220
|
-
quantityByShipment: number | null;
|
|
221
|
-
shipmentNeed: number | null;
|
|
222
|
-
positionNumber: number | null;
|
|
223
|
-
quantityByStockOrder: number;
|
|
224
|
-
stockOrderNeed: number;
|
|
225
|
-
deficitWithPlannedIncoming: number;
|
|
226
|
-
}>, "many">;
|
|
227
|
-
export type OrdersSummaryProductionTaskZodType = z.infer<typeof OrdersSummaryProductionTaskZod>;
|
|
228
|
-
export type OrdersSummaryShipmentZodType = z.infer<typeof OrdersSummaryShipmentZod>;
|
|
229
|
-
export type OrdersSummaryStockOrderZodType = z.infer<typeof OrdersSummaryStockOrderZod>;
|
|
230
|
-
export type OrdersSummaryDemandRowZodType = z.infer<typeof OrdersSummaryDemandRowZod>;
|
|
231
|
-
export type OrdersSummaryByEntityRowZodType = z.infer<typeof OrdersSummaryByEntityRowZod>;
|
|
232
|
-
export type OrdersSummaryByEntityResponseZodType = z.infer<typeof OrdersSummaryByEntityResponseZod>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OrdersSummaryByEntityResponseZod = exports.OrdersSummaryByEntityRowZod = exports.OrdersSummaryDemandRowZod = exports.OrdersSummaryStockOrderZod = exports.OrdersSummaryShipmentZod = exports.OrdersSummaryProductionTaskZod = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const OrdersSummaryDateZod = zod_1.z.union([zod_1.z.date(), zod_1.z.string()]).nullable();
|
|
6
|
-
exports.OrdersSummaryProductionTaskZod = zod_1.z.object({
|
|
7
|
-
productionTaskId: zod_1.z.number(),
|
|
8
|
-
quantity: zod_1.z.number(),
|
|
9
|
-
planReadyDate: OrdersSummaryDateZod,
|
|
10
|
-
requiredReadyDate: OrdersSummaryDateZod
|
|
11
|
-
});
|
|
12
|
-
exports.OrdersSummaryShipmentZod = zod_1.z.object({
|
|
13
|
-
shipmentId: zod_1.z.number().nullable(),
|
|
14
|
-
parentPTNumber: zod_1.z.number().nullable(),
|
|
15
|
-
parentPTQuantity: zod_1.z.number().nullable(),
|
|
16
|
-
parentPTNeed: zod_1.z.number().nullable(),
|
|
17
|
-
shipmentNumber: zod_1.z.string().nullable(),
|
|
18
|
-
quantity: zod_1.z.number(),
|
|
19
|
-
requiredReadyDate: OrdersSummaryDateZod
|
|
20
|
-
});
|
|
21
|
-
exports.OrdersSummaryStockOrderZod = zod_1.z.object({
|
|
22
|
-
stockOrderItemId: zod_1.z.number(),
|
|
23
|
-
stockOrderId: zod_1.z.number().nullable(),
|
|
24
|
-
stockOrderNumber: zod_1.z.string().nullable(),
|
|
25
|
-
quantity: zod_1.z.number(),
|
|
26
|
-
warehouseReadinessDate: OrdersSummaryDateZod,
|
|
27
|
-
remainingQuantity: zod_1.z.number()
|
|
28
|
-
});
|
|
29
|
-
exports.OrdersSummaryDemandRowZod = zod_1.z.object({
|
|
30
|
-
productionTaskId: zod_1.z.number().nullable(),
|
|
31
|
-
quantityByProductionTask: zod_1.z.number(),
|
|
32
|
-
planReadyDate: OrdersSummaryDateZod,
|
|
33
|
-
shipmentId: zod_1.z.number().nullable(),
|
|
34
|
-
parentPTNumber: zod_1.z.number().nullable(),
|
|
35
|
-
parentPTQuantity: zod_1.z.number().nullable(),
|
|
36
|
-
parentPTNeed: zod_1.z.number().nullable(),
|
|
37
|
-
shipmentNumber: zod_1.z.string().nullable(),
|
|
38
|
-
quantityByShipment: zod_1.z.number().nullable(),
|
|
39
|
-
shipmentNeed: zod_1.z.number().nullable(),
|
|
40
|
-
demandQuantity: zod_1.z.number(),
|
|
41
|
-
requiredReadyDate: OrdersSummaryDateZod
|
|
42
|
-
});
|
|
43
|
-
exports.OrdersSummaryByEntityRowZod = zod_1.z.object({
|
|
44
|
-
productionTaskId: zod_1.z.number().nullable(),
|
|
45
|
-
quantityByProductionTask: zod_1.z.number(),
|
|
46
|
-
planReadyDate: OrdersSummaryDateZod,
|
|
47
|
-
positionNumber: zod_1.z.number().nullable(),
|
|
48
|
-
shipmentId: zod_1.z.number().nullable(),
|
|
49
|
-
parentPTNumber: zod_1.z.number().nullable(),
|
|
50
|
-
parentPTQuantity: zod_1.z.number().nullable(),
|
|
51
|
-
parentPTNeed: zod_1.z.number().nullable(),
|
|
52
|
-
shipmentNumber: zod_1.z.string().nullable(),
|
|
53
|
-
quantityByShipment: zod_1.z.number().nullable(),
|
|
54
|
-
shipmentNeed: zod_1.z.number().nullable(),
|
|
55
|
-
stockOrderItemId: zod_1.z.number().nullable(),
|
|
56
|
-
stockOrderId: zod_1.z.number().nullable(),
|
|
57
|
-
stockOrderNumber: zod_1.z.string().nullable(),
|
|
58
|
-
quantityByStockOrder: zod_1.z.number(),
|
|
59
|
-
stockOrderNeed: zod_1.z.number(),
|
|
60
|
-
warehouseReadinessDate: OrdersSummaryDateZod,
|
|
61
|
-
deficitWithPlannedIncoming: zod_1.z.number(),
|
|
62
|
-
deficit: zod_1.z.number()
|
|
63
|
-
});
|
|
64
|
-
exports.OrdersSummaryByEntityResponseZod = zod_1.z.array(exports.OrdersSummaryByEntityRowZod);
|