feat: Implement cutting plan management and work instruction modal

- Introduced a new cutting plan management page for COMPANY_9, allowing users to manage cutting plans effectively.
- Added a Work Instruction Apply Modal to facilitate the application of work instructions linked to cutting plans.
- Enhanced data handling by incorporating additional fields such as condition_unit, condition_base_value, condition_tolerance, condition_auto_collect, and condition_plc_data in relevant controllers and database interactions.
- Updated UI components to support new features, including displaying batch numbers and item sizes in the work instruction page.

These changes aim to improve the efficiency and usability of cutting plan and work instruction management processes.
This commit is contained in:
kjs
2026-04-24 11:12:32 +09:00
parent c01166263b
commit 37ca354af9
8 changed files with 3240 additions and 25 deletions

View File

@@ -463,7 +463,10 @@ export async function getWorkItemDetails(req: AuthenticatedRequest, res: Respons
SELECT id, work_item_id, detail_type, content, is_required, sort_order, remark,
inspection_code, inspection_method, unit, lower_limit, upper_limit,
duration_minutes, input_type, lookup_target, display_fields,
selected_bom_items, process_inspection_apply, equip_inspection_apply, created_date
selected_bom_items, process_inspection_apply, equip_inspection_apply,
condition_unit, condition_base_value, condition_tolerance,
condition_auto_collect, condition_plc_data,
created_date
FROM process_work_item_detail
WHERE work_item_id = $1 AND company_code = $2
ORDER BY sort_order, created_date
@@ -493,6 +496,9 @@ export async function createWorkItemDetail(req: AuthenticatedRequest, res: Respo
inspection_code, inspection_method, unit, lower_limit, upper_limit,
duration_minutes, input_type, lookup_target, display_fields,
selected_bom_items, process_inspection_apply, equip_inspection_apply,
// 설비조건(equip_condition) 전용 5개 필드 — TASK:ERP-015
condition_unit, condition_base_value, condition_tolerance,
condition_auto_collect, condition_plc_data,
} = req.body;
if (!work_item_id || !content) {
@@ -516,8 +522,11 @@ export async function createWorkItemDetail(req: AuthenticatedRequest, res: Respo
(company_code, work_item_id, detail_type, content, is_required, sort_order, remark, writer,
inspection_code, inspection_method, unit, lower_limit, upper_limit,
duration_minutes, input_type, lookup_target, display_fields, selected_bom_items,
process_inspection_apply, equip_inspection_apply)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)
process_inspection_apply, equip_inspection_apply,
condition_unit, condition_base_value, condition_tolerance,
condition_auto_collect, condition_plc_data)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20,
$21, $22, $23, $24, $25)
RETURNING *
`;
@@ -545,6 +554,11 @@ export async function createWorkItemDetail(req: AuthenticatedRequest, res: Respo
bomItemsJson,
process_inspection_apply || null,
equip_inspection_apply || null,
condition_unit || null,
condition_base_value || null,
condition_tolerance || null,
condition_auto_collect || null,
condition_plc_data || null,
]);
logger.info("작업 항목 상세 생성", { companyCode, id: result.rows[0].id });
@@ -571,6 +585,9 @@ export async function updateWorkItemDetail(req: AuthenticatedRequest, res: Respo
inspection_code, inspection_method, unit, lower_limit, upper_limit,
duration_minutes, input_type, lookup_target, display_fields,
selected_bom_items, process_inspection_apply, equip_inspection_apply,
// 설비조건(equip_condition) 전용 5개 필드 — TASK:ERP-015
condition_unit, condition_base_value, condition_tolerance,
condition_auto_collect, condition_plc_data,
} = req.body;
const bomItemsJson = Array.isArray(selected_bom_items) ? JSON.stringify(selected_bom_items) : selected_bom_items ?? null;
@@ -594,6 +611,11 @@ export async function updateWorkItemDetail(req: AuthenticatedRequest, res: Respo
selected_bom_items = $17,
process_inspection_apply = $18,
equip_inspection_apply = $19,
condition_unit = $20,
condition_base_value = $21,
condition_tolerance = $22,
condition_auto_collect = $23,
condition_plc_data = $24,
updated_date = NOW()
WHERE id = $6 AND company_code = $7
RETURNING *
@@ -619,6 +641,11 @@ export async function updateWorkItemDetail(req: AuthenticatedRequest, res: Respo
bomItemsJson,
process_inspection_apply || null,
equip_inspection_apply || null,
condition_unit ?? null,
condition_base_value ?? null,
condition_tolerance ?? null,
condition_auto_collect ?? null,
condition_plc_data ?? null,
]);
if (result.rowCount === 0) {
@@ -733,8 +760,11 @@ export async function saveAll(req: AuthenticatedRequest, res: Response) {
`INSERT INTO process_work_item_detail
(company_code, work_item_id, detail_type, content, is_required, sort_order, remark, writer,
inspection_code, inspection_method, unit, lower_limit, upper_limit,
duration_minutes, input_type, lookup_target, display_fields)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17)`,
duration_minutes, input_type, lookup_target, display_fields,
condition_unit, condition_base_value, condition_tolerance,
condition_auto_collect, condition_plc_data)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17,
$18, $19, $20, $21, $22)`,
[
companyCode,
workItemId,
@@ -753,6 +783,12 @@ export async function saveAll(req: AuthenticatedRequest, res: Response) {
detail.input_type || null,
detail.lookup_target || null,
detail.display_fields || null,
// 설비조건(equip_condition) 전용 5개 — TASK:ERP-015
detail.condition_unit || null,
detail.condition_base_value || null,
detail.condition_tolerance || null,
detail.condition_auto_collect || null,
detail.condition_plc_data || null,
]
);
}