From 78f959c0915b442fc40cdca5ba7e7b62bc439bee Mon Sep 17 00:00:00 2001 From: SeongHyun Kim Date: Mon, 6 Apr 2026 11:47:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A0=91=EC=88=98=EA=B0=80=EB=8A=A5=20?= =?UTF-8?q?=EC=9D=B4=EC=A4=91=20=EC=A7=91=EA=B3=84=20=EB=B2=84=EA=B7=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20+=20=EB=B0=94=ED=85=80=EB=B0=94=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - available-qty: master+SPLIT 이중 합산 → SPLIT만 합산 (5곳) - 원인: master에 합산된 good_qty와 SPLIT의 good_qty가 중복 카운트 - PopShell: 하단 footer(copyright/version/긴급연락) 삭제 --- .../src/controllers/popProductionController.ts | 17 +++++++++++------ frontend/components/pop/hardcoded/PopShell.tsx | 12 +----------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/backend-node/src/controllers/popProductionController.ts b/backend-node/src/controllers/popProductionController.ts index c070c243..251b3113 100644 --- a/backend-node/src/controllers/popProductionController.ts +++ b/backend-node/src/controllers/popProductionController.ts @@ -1051,7 +1051,8 @@ export const saveResult = async ( if (csSeqNum > 1) { const prev = await pool.query( `SELECT COALESCE(SUM(good_qty::int), 0) + COALESCE(SUM(concession_qty::int), 0) as tg - FROM work_order_process WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3`, + FROM work_order_process WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3 + AND parent_process_id IS NOT NULL`, [csWoId, String(csSeqNum - 1), companyCode] ); if (prev.rowCount > 0) csPrevGood = parseInt(prev.rows[0].tg, 10) || 0; @@ -1196,7 +1197,8 @@ const checkAndCompleteWorkInstruction = async ( const totalGoodResult = await pool.query( `SELECT COALESCE(SUM(good_qty::int), 0) + COALESCE(SUM(concession_qty::int), 0) as total_good FROM work_order_process - WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3`, + WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3 + AND parent_process_id IS NOT NULL`, [woId, maxSeq, companyCode] ); @@ -1394,7 +1396,8 @@ export const confirmResult = async ( const prevProcess = await pool.query( `SELECT COALESCE(SUM(good_qty::int), 0) + COALESCE(SUM(concession_qty::int), 0) as total_good FROM work_order_process - WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3`, + WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3 + AND parent_process_id IS NOT NULL`, [wo_id, prevSeq, companyCode] ); if (prevProcess.rowCount > 0) { @@ -1595,14 +1598,15 @@ export const getAvailableQty = async (req: AuthenticatedRequest, res: Response) ); const myInputQty = parseInt(totalAccepted.rows[0].total_input, 10) || 0; - // 앞공정 양품+특채 합산 + // 앞공정 양품+특채 합산 (SPLIT만 — master 이중 집계 방지) let prevGoodQty = instrQty; if (seqNum > 1) { const prevSeq = String(seqNum - 1); const prevProcess = await pool.query( `SELECT COALESCE(SUM(good_qty::int), 0) + COALESCE(SUM(concession_qty::int), 0) as total_good FROM work_order_process - WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3`, + WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3 + AND parent_process_id IS NOT NULL`, [wo_id, prevSeq, companyCode] ); if (prevProcess.rowCount > 0) { @@ -1723,7 +1727,8 @@ export const acceptProcess = async (req: AuthenticatedRequest, res: Response) => const prevProcess = await client.query( `SELECT COALESCE(SUM(good_qty::int), 0) + COALESCE(SUM(concession_qty::int), 0) as total_good FROM work_order_process - WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3`, + WHERE wo_id = $1 AND seq_no = $2 AND company_code = $3 + AND parent_process_id IS NOT NULL`, [row.wo_id, prevSeq, companyCode] ); if (prevProcess.rowCount > 0) { diff --git a/frontend/components/pop/hardcoded/PopShell.tsx b/frontend/components/pop/hardcoded/PopShell.tsx index ef30b2e1..3d4b6ac6 100644 --- a/frontend/components/pop/hardcoded/PopShell.tsx +++ b/frontend/components/pop/hardcoded/PopShell.tsx @@ -318,17 +318,7 @@ export function PopShell({ children, showBanner = true, title, showBack = false, {children} - {/* ===== FOOTER ===== */} - + {/* FOOTER 삭제 — POP 화면에서 불필요 */} {/* Marquee keyframes */}